mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-08 16:59:50 +03:00
enable download of beta releases via webui
This commit is contained in:
@@ -62,9 +62,9 @@ deploy:
|
|||||||
file: "*.bin"
|
file: "*.bin"
|
||||||
name: latest development build
|
name: latest development build
|
||||||
release_notes:
|
release_notes:
|
||||||
Automatic firmware builds of the current EMS-ESP branch for version $FIRMWARE_VERSION.
|
Version $FIRMWARE_VERSION.
|
||||||
This is work in progress and not fully tested. Use at your own risk.
|
Automatic firmware builds of the current EMS-ESP branch built on $(date +'%F %T %Z') from commit $TRAVIS_COMMIT.
|
||||||
Built by Travis CI on $(date +'%F %T %Z') from commit $TRAVIS_COMMIT.
|
Warning, this is a development build and not fully tested. Use at your own risk.
|
||||||
cleanup: false
|
cleanup: false
|
||||||
prerelease: true
|
prerelease: true
|
||||||
overwrite: true
|
overwrite: true
|
||||||
|
|||||||
@@ -194,7 +194,10 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="modal-body">
|
<div class="modal-body">
|
||||||
<div>
|
<div>
|
||||||
<h4>Latest Stable Release</h4>
|
<div>
|
||||||
|
<button id="updateb" onclick="switchfirmware()" type="submit" class="btn btn-success btn-sm pull-right">Official Release</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div id="onlineupdate">
|
<div id="onlineupdate">
|
||||||
<h5 id=releasehead></h5>
|
<h5 id=releasehead></h5>
|
||||||
<div style="clear:both;">
|
<div style="clear:both;">
|
||||||
|
|||||||
@@ -8,6 +8,24 @@ var ajaxobj;
|
|||||||
|
|
||||||
var custom_config = {};
|
var custom_config = {};
|
||||||
|
|
||||||
|
var xDown = null;
|
||||||
|
var yDown = null;
|
||||||
|
|
||||||
|
var page = 1;
|
||||||
|
var haspages;
|
||||||
|
var file = {};
|
||||||
|
var backupstarted = false;
|
||||||
|
var updateurl = "";
|
||||||
|
var updateurl_dev = "";
|
||||||
|
|
||||||
|
var use_beta_firmware = false;
|
||||||
|
|
||||||
|
var myespcontent;
|
||||||
|
|
||||||
|
var formData = new FormData();
|
||||||
|
|
||||||
|
var nextIsNotJson = false;
|
||||||
|
|
||||||
var config = {
|
var config = {
|
||||||
"command": "configfile",
|
"command": "configfile",
|
||||||
"network": {
|
"network": {
|
||||||
@@ -40,14 +58,6 @@ var config = {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
var page = 1;
|
|
||||||
var haspages;
|
|
||||||
var file = {};
|
|
||||||
var backupstarted = false;
|
|
||||||
var updateurl = "";
|
|
||||||
|
|
||||||
var myespcontent;
|
|
||||||
|
|
||||||
function browserTime() {
|
function browserTime() {
|
||||||
var d = new Date(0);
|
var d = new Date(0);
|
||||||
var c = new Date();
|
var c = new Date();
|
||||||
@@ -209,8 +219,6 @@ function savenetwork() {
|
|||||||
saveconfig();
|
saveconfig();
|
||||||
}
|
}
|
||||||
|
|
||||||
var formData = new FormData();
|
|
||||||
|
|
||||||
function inProgress(callback) {
|
function inProgress(callback) {
|
||||||
$("body").load("myesp.html #progresscontent", function (responseTxt, statusTxt, xhr) {
|
$("body").load("myesp.html #progresscontent", function (responseTxt, statusTxt, xhr) {
|
||||||
if (statusTxt === "success") {
|
if (statusTxt === "success") {
|
||||||
@@ -510,6 +518,7 @@ function getContent(contentname) {
|
|||||||
$("#appurl2").text(ajaxobj.appurl);
|
$("#appurl2").text(ajaxobj.appurl);
|
||||||
|
|
||||||
updateurl = ajaxobj.updateurl;
|
updateurl = ajaxobj.updateurl;
|
||||||
|
updateurl_dev = ajaxobj.updateurl_dev;
|
||||||
listCustomStats();
|
listCustomStats();
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
@@ -734,8 +743,6 @@ function initMQTTLogTable() {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
var nextIsNotJson = false;
|
|
||||||
|
|
||||||
function socketMessageListener(evt) {
|
function socketMessageListener(evt) {
|
||||||
var obj = JSON.parse(evt.data);
|
var obj = JSON.parse(evt.data);
|
||||||
if (obj.hasOwnProperty("command")) {
|
if (obj.hasOwnProperty("command")) {
|
||||||
@@ -814,46 +821,6 @@ function restart() {
|
|||||||
inProgress("restart");
|
inProgress("restart");
|
||||||
}
|
}
|
||||||
|
|
||||||
$("#dismiss, .overlay").on("click", function () {
|
|
||||||
$("#sidebar").removeClass("active");
|
|
||||||
$(".overlay").fadeOut();
|
|
||||||
});
|
|
||||||
|
|
||||||
$("#sidebarCollapse").on("click", function () {
|
|
||||||
$("#sidebar").addClass("active");
|
|
||||||
$(".overlay").fadeIn();
|
|
||||||
$(".collapse.in").toggleClass("in");
|
|
||||||
$("a[aria-expanded=true]").attr("aria-expanded", "false");
|
|
||||||
});
|
|
||||||
|
|
||||||
$("#custom_status").click(function () {
|
|
||||||
websock.send("{\"command\":\"custom_status\"}");
|
|
||||||
return false;
|
|
||||||
});
|
|
||||||
|
|
||||||
$("#status").click(function () {
|
|
||||||
websock.send("{\"command\":\"status\"}");
|
|
||||||
return false;
|
|
||||||
});
|
|
||||||
|
|
||||||
$("#custom").click(function () { getContent("#customcontent"); return false; });
|
|
||||||
|
|
||||||
$("#network").on("click", (function () { getContent("#networkcontent"); return false; }));
|
|
||||||
$("#general").click(function () { getContent("#generalcontent"); return false; });
|
|
||||||
$("#mqtt").click(function () { getContent("#mqttcontent"); return false; });
|
|
||||||
$("#ntp").click(function () { getContent("#ntpcontent"); return false; });
|
|
||||||
$("#backup").click(function () { getContent("#backupcontent"); return false; });
|
|
||||||
$("#reset").click(function () { $("#destroy").modal("show"); return false; });
|
|
||||||
$("#restart").click(function () { $("#reboot").modal("show"); return false; });
|
|
||||||
$("#eventlog").click(function () { getContent("#eventcontent"); return false; });
|
|
||||||
|
|
||||||
$(".noimp").on("click", function () {
|
|
||||||
$("#noimp").modal("show");
|
|
||||||
});
|
|
||||||
|
|
||||||
var xDown = null;
|
|
||||||
var yDown = null;
|
|
||||||
|
|
||||||
function handleTouchStart(evt) {
|
function handleTouchStart(evt) {
|
||||||
xDown = evt.touches[0].clientX;
|
xDown = evt.touches[0].clientX;
|
||||||
yDown = evt.touches[0].clientY;
|
yDown = evt.touches[0].clientY;
|
||||||
@@ -953,8 +920,26 @@ function login() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function switchfirmware() {
|
||||||
|
if (use_beta_firmware) {
|
||||||
|
use_beta_firmware = false;
|
||||||
|
document.getElementById("updateb").innerHTML = "Official Release";
|
||||||
|
} else {
|
||||||
|
use_beta_firmware = true;
|
||||||
|
document.getElementById("updateb").innerHTML = "Beta Build";
|
||||||
|
}
|
||||||
|
getLatestReleaseInfo();
|
||||||
|
}
|
||||||
|
|
||||||
function getLatestReleaseInfo() {
|
function getLatestReleaseInfo() {
|
||||||
$.getJSON(updateurl).done(function (release) {
|
|
||||||
|
if (use_beta_firmware) {
|
||||||
|
var url = updateurl_dev;
|
||||||
|
} else {
|
||||||
|
var url = updateurl;
|
||||||
|
}
|
||||||
|
|
||||||
|
$.getJSON(url).done(function (release) {
|
||||||
var asset = release.assets[0];
|
var asset = release.assets[0];
|
||||||
var downloadCount = 0;
|
var downloadCount = 0;
|
||||||
for (var i = 0; i < release.assets.length; i++) {
|
for (var i = 0; i < release.assets.length; i++) {
|
||||||
@@ -978,10 +963,6 @@ function getLatestReleaseInfo() {
|
|||||||
}).error(function () { $("#onlineupdate").html("<h5>Couldn't get release details. Make sure there is an Internet connection.</h5>"); });
|
}).error(function () { $("#onlineupdate").html("<h5>Couldn't get release details. Make sure there is an Internet connection.</h5>"); });
|
||||||
}
|
}
|
||||||
|
|
||||||
$("#update").on("shown.bs.modal", function (e) {
|
|
||||||
getLatestReleaseInfo();
|
|
||||||
});
|
|
||||||
|
|
||||||
function allowUpload() {
|
function allowUpload() {
|
||||||
$("#upbtn").prop("disabled", false);
|
$("#upbtn").prop("disabled", false);
|
||||||
}
|
}
|
||||||
@@ -1014,5 +995,31 @@ function refreshStatus() {
|
|||||||
websock.send("{\"command\":\"status\"}");
|
websock.send("{\"command\":\"status\"}");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$("#dismiss, .overlay").on("click", function () {
|
||||||
|
$("#sidebar").removeClass("active");
|
||||||
|
$(".overlay").fadeOut();
|
||||||
|
});
|
||||||
|
|
||||||
|
$("#sidebarCollapse").on("click", function () {
|
||||||
|
$("#sidebar").addClass("active");
|
||||||
|
$(".overlay").fadeIn();
|
||||||
|
$(".collapse.in").toggleClass("in");
|
||||||
|
$("a[aria-expanded=true]").attr("aria-expanded", "false");
|
||||||
|
});
|
||||||
|
|
||||||
|
$("#custom_status").click(function () { websock.send("{\"command\":\"custom_status\"}"); return false; });
|
||||||
|
$("#status").click(function () { websock.send("{\"command\":\"status\"}"); return false; });
|
||||||
|
$("#custom").click(function () { getContent("#customcontent"); return false; });
|
||||||
|
$("#network").on("click", (function () { getContent("#networkcontent"); return false; }));
|
||||||
|
$("#general").click(function () { getContent("#generalcontent"); return false; });
|
||||||
|
$("#mqtt").click(function () { getContent("#mqttcontent"); return false; });
|
||||||
|
$("#ntp").click(function () { getContent("#ntpcontent"); return false; });
|
||||||
|
$("#backup").click(function () { getContent("#backupcontent"); return false; });
|
||||||
|
$("#reset").click(function () { $("#destroy").modal("show"); return false; });
|
||||||
|
$("#restart").click(function () { $("#reboot").modal("show"); return false; });
|
||||||
|
$("#eventlog").click(function () { getContent("#eventcontent"); return false; });
|
||||||
|
$(".noimp").on("click", function () { $("#noimp").modal("show"); });
|
||||||
|
$("#update").on("shown.bs.modal", function (e) { getLatestReleaseInfo(); });
|
||||||
|
|
||||||
document.addEventListener("touchstart", handleTouchStart, false);
|
document.addEventListener("touchstart", handleTouchStart, false);
|
||||||
document.addEventListener("touchmove", handleTouchMove, false);
|
document.addEventListener("touchmove", handleTouchMove, false);
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
node $PWD/../webfilesbuilder/node_modules/gulp/bin/gulp.js --silent --cwd $PWD/../webfilesbuilder
|
node $PWD/../webfilesbuilder/node_modules/gulp/bin/gulp.js --cwd $PWD/../webfilesbuilder
|
||||||
|
|
||||||
open -na Google\ Chrome --args --disable-web-security --remote-debugging-port=9222 --user-data-dir="/tmp/chrome_dev" $PWD/../../src/websrc/temp/index.html
|
open -na Google\ Chrome --args --disable-web-security --remote-debugging-port=9222 --user-data-dir="/tmp/chrome_dev" $PWD/../../src/websrc/temp/index.html
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user