mirror of
https://github.com/sle118/squeezelite-esp32.git
synced 2025-12-10 13:37:03 +03:00
UI change of the update mechanism
This commit is contained in:
Binary file not shown.
|
Before Width: | Height: | Size: 634 B After Width: | Height: | Size: 578 B |
File diff suppressed because one or more lines are too long
Binary file not shown.
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
Binary file not shown.
@@ -1 +0,0 @@
|
||||
!function(e){function r(r){for(var n,l,f=r[0],i=r[1],a=r[2],c=0,s=[];c<f.length;c++)l=f[c],Object.prototype.hasOwnProperty.call(o,l)&&o[l]&&s.push(o[l][0]),o[l]=0;for(n in i)Object.prototype.hasOwnProperty.call(i,n)&&(e[n]=i[n]);for(p&&p(r);s.length;)s.shift()();return u.push.apply(u,a||[]),t()}function t(){for(var e,r=0;r<u.length;r++){for(var t=u[r],n=!0,f=1;f<t.length;f++){var i=t[f];0!==o[i]&&(n=!1)}n&&(u.splice(r--,1),e=l(l.s=t[0]))}return e}var n={},o={2:0},u=[];function l(r){if(n[r])return n[r].exports;var t=n[r]={i:r,l:!1,exports:{}};return e[r].call(t.exports,t,t.exports,l),t.l=!0,t.exports}l.m=e,l.c=n,l.d=function(e,r,t){l.o(e,r)||Object.defineProperty(e,r,{enumerable:!0,get:t})},l.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},l.t=function(e,r){if(1&r&&(e=l(e)),8&r)return e;if(4&r&&"object"==typeof e&&e&&e.__esModule)return e;var t=Object.create(null);if(l.r(t),Object.defineProperty(t,"default",{enumerable:!0,value:e}),2&r&&"string"!=typeof e)for(var n in e)l.d(t,n,function(r){return e[r]}.bind(null,n));return t},l.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return l.d(r,"a",r),r},l.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},l.p="";var f=window.webpackJsonp=window.webpackJsonp||[],i=f.push.bind(f);f.push=r,f=f.slice();for(var a=0;a<f.length;a++)r(f[a]);var p=i;t()}([]);
|
||||
Binary file not shown.
Binary file not shown.
@@ -15,6 +15,7 @@ const data = {
|
||||
messages: require("../mock/messages.json"),
|
||||
messagequeue: require("../mock/messages.json"),
|
||||
message_queue_sequence: [],
|
||||
message_queue_sequence_post_empty: null,
|
||||
commands: require("../mock/commands.json"),
|
||||
scan: require("../mock/scan.json"),
|
||||
ap: require("../mock/ap.json"),
|
||||
@@ -124,10 +125,20 @@ module.exports = merge(common, {
|
||||
app.get('/scan.json', function(req, res) { res.json( data.scan ); });
|
||||
app.get('/config.json', function(req, res) { res.json( data.config ); });
|
||||
app.get('/status.json', function(req, res) { res.json( data.status ); });
|
||||
app.get('/plugins/SqueezeESP32/firmware/-99', function(req, res) {
|
||||
let has_proxy= data.status.mock_plugin_has_proxy ?? 'n';
|
||||
const statusCode='xy'.includes((has_proxy).toLowerCase())?200:500;
|
||||
console.log(`Checking if plugin has proxy enabled with option mock_plugin_has_proxy = ${data.status.mock_plugin_has_proxy}. Returning status ${statusCode} `);
|
||||
res.status(statusCode ).json();
|
||||
});
|
||||
app.get('/messages.json', function(req, res) {
|
||||
if(data.message_queue_sequence.length>0){
|
||||
data.messagequeue.push(data.message_queue_sequence.shift());
|
||||
}
|
||||
else if (data.message_queue_sequence_post_empty){
|
||||
data.message_queue_sequence_post_empty();
|
||||
data.message_queue_sequence_post_empty = null;
|
||||
}
|
||||
res.json( data.messagequeue ) ;
|
||||
data.messagequeue=[];
|
||||
});
|
||||
@@ -157,7 +168,7 @@ module.exports = merge(common, {
|
||||
});
|
||||
app.post('/config.json', function(req, res) {
|
||||
var fwurl='';
|
||||
console.log(req.body);
|
||||
console.log(`Processing config.json with request body: ${req.body}`);
|
||||
console.log(data.config);
|
||||
for (const property in req.body.config) {
|
||||
console.log(`${property}: ${req.body.config[property].value}`);
|
||||
@@ -177,16 +188,24 @@ module.exports = merge(common, {
|
||||
|
||||
}
|
||||
res.json( {} );
|
||||
if(fwurl!==''){
|
||||
data.status.recovery=1;
|
||||
requeueMessages();
|
||||
if(fwurl!=='' ){
|
||||
if(data.status.recovery!=1) {
|
||||
// we're not yet in recovery. Simulate reboot to recovery
|
||||
data.status.recovery=1;
|
||||
requeueMessages();
|
||||
}
|
||||
if(fwurl.toLowerCase().includes('fail')){
|
||||
console.log(`queuing ${data.messages_ota_fail.length} ota messages `);
|
||||
data.message_queue_sequence.push(...data.messages_ota_fail);
|
||||
|
||||
}
|
||||
else {
|
||||
console.log(`queuing ${data.messages_ota.length} ota messages `);
|
||||
data.message_queue_sequence.push(...data.messages_ota);
|
||||
data.message_queue_sequence_post_empty = function(){
|
||||
data.status.recovery=0;
|
||||
requeueMessages();
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user