LSP: added rolling update message

This commit is contained in:
cat 2016-06-13 10:24:44 +02:00 committed by Thulinma
parent 0b5e18db40
commit 9fdb550735
2 changed files with 4 additions and 3 deletions

View file

@ -74,8 +74,8 @@ classes:["red"]}:false}],help:"Repeat your desired password.",classes:["match_pa
b+'".<br>')}d.append("Saving protocol settings..<br>");mist.send(function(){d.append("Protocols enabled. Redirecting..");setTimeout(function(){UI.navto("Overview")},5E3)},{config:{protocols:c}})},{capabilities:true})}}},{label:"Skip",type:"cancel","function":function(){UI.navto("Overview")}}]}]));break;case "Overview":var i=$("<span>").text("Loading.."),m=$("<span>"),f=$("<span>"),p=$("<span>");d.append(UI.buildUI([{type:"help",help:"You can find most basic information about your MistServer here.<br>You can also set the debug level and force a save to the config.json file that MistServer uses to save your settings. "},
{type:"span",label:"Version",pointer:{main:mist.data.config,index:"version"}},{type:"span",label:"Version check",value:i,LTSonly:!0},{type:"span",label:"Server time",value:p},{type:"span",label:"Current streams",value:m},{type:"span",label:"Current connections",value:f},$("<br>"),{type:"str",label:"Human readable name",pointer:{main:mist.data.config,index:"name"},help:"You can name your MistServer here for personal use. You'll still need to set host name within your network yourself."},{type:"debug",
label:"Debug level",pointer:{main:mist.data.config,index:"debug"},help:"You can set the amount of debug information MistServer saves in the log. A full reboot of MistServer is required before some components of MistServer can post debug information."},{type:"checkbox",label:"Force configurations save",pointer:{main:mist.data,index:"save"},help:"Tick the box in order to force an immediate save to the config.json MistServer uses to save your settings. Saving will otherwise happen upon closing MistServer. Don't forget to press save after ticking the box."},
{type:"buttons",buttons:[{type:"save",label:"Save","function":function(){var a={config:mist.data.config};if(mist.data.save)a.save=mist.data.save;mist.send(function(){UI.navto("Overview")},a)}}]}]));if(mist.data.LTS){var n=function(){var a=mist.stored.get().update||{};"uptodate"in a?a.error?i.addClass("red").text(a.error):a.uptodate?i.text("Your version is up to date.").addClass("green"):i.addClass("red").text("Version outdated!").append($("<button>").text("Update").css({"font-size":"1em","margin-left":"1em"}).click(function(){confirm("Are you sure you want to execute a rolling update?")&&
mist.send(function(){mist.stored.del("update");UI.navto("Overview")},{autoupdate:true})})):i.text("Unknown")};if(!mist.stored.get().update||36E5<(new Date).getTime()-mist.stored.get().update.lastchecked){var s=mist.stored.get().update||{};s.lastchecked=(new Date).getTime();mist.send(function(a){mist.stored.set("update",$.extend(true,s,a.update));n()},{checkupdate:!0})}else n()}else i.text("");var l=function(){mist.send(function(){g()},{totals:{fields:["clients"],start:-10},active_streams:true})},
{type:"buttons",buttons:[{type:"save",label:"Save","function":function(){var a={config:mist.data.config};if(mist.data.save)a.save=mist.data.save;mist.send(function(){UI.navto("Overview")},a)}}]}]));if(mist.data.LTS){var n=function(){var a=mist.stored.get().update||{};"uptodate"in a?a.error?i.addClass("red").text(a.error):a.uptodate?i.text("Your version is up to date.").addClass("green"):i.addClass("red").text("Version outdated!").append($("<button>").text("Update").css({"font-size":"1em","margin-left":"1em"}).click(function(){if(confirm("Are you sure you want to execute a rolling update?")){i.addClass("orange").removeClass("red").text("Rolling update command sent..");
mist.stored.del("update");mist.send(function(){UI.navto("Overview")},{autoupdate:true})}})):i.text("Unknown")};if(!mist.stored.get().update||36E5<(new Date).getTime()-mist.stored.get().update.lastchecked){var s=mist.stored.get().update||{};s.lastchecked=(new Date).getTime();mist.send(function(a){mist.stored.set("update",$.extend(true,s,a.update));n()},{checkupdate:!0})}else n()}else i.text("");var l=function(){mist.send(function(){g()},{totals:{fields:["clients"],start:-10},active_streams:true})},
g=function(){m.text(("active_streams"in mist.data?mist.data.active_streams?mist.data.active_streams.length:0:"?")+" active, "+(mist.data.streams?Object.keys(mist.data.streams).length:0)+" configured");if("totals"in mist.data&&"all_streams"in mist.data.totals)var a=mist.data.totals.all_streams.all_protocols.clients,a=a.length?UI.format.number(a[a.length-1][1]):0;else a="Loading..";f.text(a);p.text(UI.format.dateTime(mist.data.config.time,"long"))};l();g();UI.interval.set(l,3E4);break;case "Protocols":if("undefined"==
typeof mist.data.capabilities){mist.send(function(){UI.navto(a)},{capabilities:!0});d.append("Loading..");break}var h=$("<tbody>");d.append(UI.buildUI([{type:"help",help:"You can find an overview of all the protocols and their relevant information here. You can add, edit or delete protocols."}])).append($("<button>").text("New protocol").click(function(){UI.navto("Edit Protocol")})).append($("<table>").html($("<thead>").html($("<tr>").html($("<th>").text("Protocol")).append($("<th>").text("Status")).append($("<th>").text("Settings")).append($("<th>")))).append(h));
var k=function(){function a(c){var b=mist.data.capabilities.connectors[c.connector];if(!b)return"";var d=[],e=["required","optional"],f;for(f in e)for(var g in b[e[f]])c[g]&&c[g]!=""?d.push(g+": "+c[g]):b[e[f]][g]["default"]&&d.push(g+": "+b[e[f]][g]["default"]);return $("<span>").addClass("description").text(d.join(", "))}h.html("");for(var c in mist.data.config.protocols){var b=mist.data.config.protocols[c];h.append($("<tr>").data("index",c).append($("<td>").text(b.connector)).append($("<td>").html(UI.format.status(b))).append($("<td>").html(a(b))).append($("<td>").css("text-align",

View file

@ -1974,8 +1974,9 @@ var UI = {
$versioncheck.addClass('red').text('Version outdated!').append(
$('<button>').text('Update').css({'font-size':'1em','margin-left':'1em'}).click(function(){
if (confirm('Are you sure you want to execute a rolling update?')) {
mist.send(function(d){
$versioncheck.addClass('orange').removeClass('red').text('Rolling update command sent..');
mist.stored.del('update');
mist.send(function(d){
UI.navto('Overview');
},{autoupdate: true});
}