LSP: show license msg in overview
This commit is contained in:
parent
c1373fba17
commit
df2eaf4f01
2 changed files with 8 additions and 5 deletions
|
@ -82,10 +82,10 @@ value:m},{type:"span",label:"Enabled protocols",value:i},{type:"span",label:"Dis
|
||||||
function(a){function c(a){if(a.update){var b="";"progress"in a.update&&(b=" ("+a.update.progress+"%)");h.text("Updating.."+b);setTimeout(function(){mist.send(function(a){c(a)},{update:true})},5E3)}else UI.showTab("Overview")}if(!a.update||!("uptodate"in a.update)){h.text("Unknown, checking..");setTimeout(function(){mist.send(function(a){"update"in a&&k(a)},{checkupdate:true})},5E3)}else if(a.update.error)h.addClass("red").text(a.update.error);else if(a.update.uptodate)h.text("Your version is up to date.").addClass("green");
|
function(a){function c(a){if(a.update){var b="";"progress"in a.update&&(b=" ("+a.update.progress+"%)");h.text("Updating.."+b);setTimeout(function(){mist.send(function(a){c(a)},{update:true})},5E3)}else UI.showTab("Overview")}if(!a.update||!("uptodate"in a.update)){h.text("Unknown, checking..");setTimeout(function(){mist.send(function(a){"update"in a&&k(a)},{checkupdate:true})},5E3)}else if(a.update.error)h.addClass("red").text(a.update.error);else if(a.update.uptodate)h.text("Your version is up to date.").addClass("green");
|
||||||
else if(a.update.progress){h.addClass("orange").removeClass("red").text("Updating..");c(a)}else h.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?")){h.addClass("orange").removeClass("red").text("Rolling update command sent..");mist.send(function(a){c(a)},{autoupdate:true})}}))};k(mist.data);if("license"in mist.data.config){if("active_products"in
|
else if(a.update.progress){h.addClass("orange").removeClass("red").text("Updating..");c(a)}else h.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?")){h.addClass("orange").removeClass("red").text("Rolling update command sent..");mist.send(function(a){c(a)},{autoupdate:true})}}))};k(mist.data);if("license"in mist.data.config){if("active_products"in
|
||||||
mist.data.config.license&&Object.keys(mist.data.config.license.active_products).length){var z=$("<table>").css("text-indent","0");f.html(z);z.append($("<tr>").append($("<th>").append("Product")).append($("<th>").append("Updates until")).append($("<th>").append("Use until")).append($("<th>").append("Max. simul. instances")));for(g in mist.data.config.license.active_products)b=mist.data.config.license.active_products[g],z.append($("<tr>").append($("<td>").append(b.name)).append($("<td>").append(b.updates_final?
|
mist.data.config.license&&Object.keys(mist.data.config.license.active_products).length){var z=$("<table>").css("text-indent","0");f.html(z);z.append($("<tr>").append($("<th>").append("Product")).append($("<th>").append("Updates until")).append($("<th>").append("Use until")).append($("<th>").append("Max. simul. instances")));for(g in mist.data.config.license.active_products)b=mist.data.config.license.active_products[g],z.append($("<tr>").append($("<td>").append(b.name)).append($("<td>").append(b.updates_final?
|
||||||
b.updates_final:"∞")).append($("<td>").append(b.use_final?b.use_final:"∞")).append($("<td>").append(b.amount?b.amount:"∞")))}else f.text("None.");f.append($("<a>").text("More details").attr("href","https://shop.mistserver.org/myinvoices").attr("target","_blank"))}}else h.text("");g=function(){var a={totals:{fields:["clients"],start:-10},active_streams:true};if(!("cabailities"in mist.data))a.capabilities=true;mist.send(function(){ga()},a)};var ga=function(){q.text("active_streams"in
|
b.updates_final:"∞")).append($("<td>").append(b.use_final?b.use_final:"∞")).append($("<td>").append(b.amount?b.amount:"∞")))}else f.text("None. ");f.append($("<a>").text("More details").attr("href","https://shop.mistserver.org/myinvoices").attr("target","_blank"))}}else h.text("");g=function(){var a={totals:{fields:["clients"],start:-10},active_streams:true};if(!("cabailities"in mist.data))a.capabilities=true;mist.send(function(){ga()},a)};var ga=function(){q.text("active_streams"in
|
||||||
mist.data?mist.data.active_streams?mist.data.active_streams.length:0:"?");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..";m.text(a);u.text(UI.format.dateTime(mist.data.config.time,"long"));p.html("");var a=0,c;for(c in mist.data.log){var b=mist.data.log[c];if(["FAIL","ERROR"].indexOf(b[1])>-1){a++;var d=$("<span>").addClass("content").addClass("red"),g=b[2].split("|");
|
mist.data?mist.data.active_streams?mist.data.active_streams.length:0:"?");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..";m.text(a);u.text(UI.format.dateTime(mist.data.config.time,"long"));p.html("");a=0;"license"in mist.data.config&&"user_msg"in mist.data.config.license&&mist.data.log.unshift([mist.data.config.license.time,"ERROR",mist.data.config.license.user_msg]);
|
||||||
for(c in g)d.append($("<span>").text(g[c]));p.append($("<div>").append($("<span>").append(UI.format.time(b[0]))).append(d));if(a==5)break}}a==0&&p.html("None.");a=[];b=[];for(c in mist.data.config.protocols){d=mist.data.config.protocols[c];a.indexOf(d.connector)>-1||a.push(d.connector)}i.text(a.length?a.join(", "):"None.");if("capabilities"in mist.data){for(c in mist.data.capabilities.connectors)a.indexOf(c)==-1&&b.push(c);j.text(b.length?b.join(", "):"None.")}else j.text("Loading..")};g();ga();UI.interval.set(g,
|
for(var c in mist.data.log){var b=mist.data.log[c];if(["FAIL","ERROR"].indexOf(b[1])>-1){a++;var d=$("<span>").addClass("content").addClass("red"),g=b[2].split("|");for(c in g)d.append($("<span>").text(g[c]));p.append($("<div>").append($("<span>").append(UI.format.time(b[0]))).append(d));if(a==5)break}}a==0&&p.html("None.");a=[];b=[];for(c in mist.data.config.protocols){d=mist.data.config.protocols[c];a.indexOf(d.connector)>-1||a.push(d.connector)}i.text(a.length?a.join(", "):"None.");if("capabilities"in
|
||||||
3E4);break;case "Protocols":if("undefined"==typeof mist.data.capabilities){mist.send(function(){UI.navto(a)},{capabilities:!0});d.append("Loading..");return}var x=$("<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("Delete all protocols").click(function(){if(confirm("Are you sure you want to delete all currently configured protocols?")){mist.data.config.protocols=
|
mist.data){for(c in mist.data.capabilities.connectors)a.indexOf(c)==-1&&b.push(c);j.text(b.length?b.join(", "):"None.")}else j.text("Loading..")};g();ga();UI.interval.set(g,3E4);break;case "Protocols":if("undefined"==typeof mist.data.capabilities){mist.send(function(){UI.navto(a)},{capabilities:!0});d.append("Loading..");return}var x=$("<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("Delete all protocols").click(function(){if(confirm("Are you sure you want to delete all currently configured protocols?")){mist.data.config.protocols=
|
||||||
[];mist.send(function(){UI.navto("Protocols")},{config:mist.data.config})}})).append($("<button>").text("Enable default protocols").click(function(){var a=Object.keys(mist.data.capabilities.connectors),c;for(c in mist.data.config.protocols){var b=a.indexOf(mist.data.config.protocols[c].connector);b>-1&&a.splice(b,1)}var d=[];for(c in a)(!("required"in mist.data.capabilities.connectors[a[c]])||Object.keys(mist.data.capabilities.connectors[a[c]].required).length==0)&&d.push(a[c]);b="Click OK to enable disabled protocols with their default settings:\n ";
|
[];mist.send(function(){UI.navto("Protocols")},{config:mist.data.config})}})).append($("<button>").text("Enable default protocols").click(function(){var a=Object.keys(mist.data.capabilities.connectors),c;for(c in mist.data.config.protocols){var b=a.indexOf(mist.data.config.protocols[c].connector);b>-1&&a.splice(b,1)}var d=[];for(c in a)(!("required"in mist.data.capabilities.connectors[a[c]])||Object.keys(mist.data.capabilities.connectors[a[c]].required).length==0)&&d.push(a[c]);b="Click OK to enable disabled protocols with their default settings:\n ";
|
||||||
b=d.length?b+d.join(", "):b+"None.";if(d.length!=a.length){a=a.filter(function(a){return d.indexOf(a)<0});b=b+("\n\nThe following protocols can only be set manually:\n "+a.join(", "))}if(confirm(b)&&d.length){for(c in d)mist.data.config.protocols.push({connector:d[c]});mist.send(function(){UI.navto("Protocols")},{config:mist.data.config})}})).append("<br>").append($("<button>").text("New protocol").click(function(){UI.navto("Edit Protocol")}).css("clear","both")).append($("<table>").html($("<thead>").html($("<tr>").html($("<th>").text("Protocol")).append($("<th>").text("Status")).append($("<th>").text("Settings")).append($("<th>")))).append(x));
|
b=d.length?b+d.join(", "):b+"None.";if(d.length!=a.length){a=a.filter(function(a){return d.indexOf(a)<0});b=b+("\n\nThe following protocols can only be set manually:\n "+a.join(", "))}if(confirm(b)&&d.length){for(c in d)mist.data.config.protocols.push({connector:d[c]});mist.send(function(){UI.navto("Protocols")},{config:mist.data.config})}})).append("<br>").append($("<button>").text("New protocol").click(function(){UI.navto("Edit Protocol")}).css("clear","both")).append($("<table>").html($("<thead>").html($("<tr>").html($("<th>").text("Protocol")).append($("<th>").text("Status")).append($("<th>").text("Settings")).append($("<th>")))).append(x));
|
||||||
var ha=function(){function a(c){var b=mist.data.capabilities.connectors[c.connector];if(!b)return"";var d=[],g=["required","optional"],F;for(F in g)for(var f in b[g[F]])c[f]&&c[f]!=""?d.push(f+": "+c[f]):b[g[F]][f]["default"]&&d.push(f+": "+b[g[F]][f]["default"]);return $("<span>").addClass("description").text(d.join(", "))}x.html("");for(var c in mist.data.config.protocols){var b=mist.data.config.protocols[c];x.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",
|
var ha=function(){function a(c){var b=mist.data.capabilities.connectors[c.connector];if(!b)return"";var d=[],g=["required","optional"],F;for(F in g)for(var f in b[g[F]])c[f]&&c[f]!=""?d.push(f+": "+c[f]):b[g[F]][f]["default"]&&d.push(f+": "+b[g[F]][f]["default"]);return $("<span>").addClass("description").text(d.join(", "))}x.html("");for(var c in mist.data.config.protocols){var b=mist.data.config.protocols[c];x.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",
|
||||||
|
|
|
@ -2245,7 +2245,7 @@ var UI = {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$activeproducts.text("None.");
|
$activeproducts.text("None. ");
|
||||||
}
|
}
|
||||||
$activeproducts.append(
|
$activeproducts.append(
|
||||||
$("<a>").text("More details").attr("href","https://shop.mistserver.org/myinvoices").attr("target","_blank")
|
$("<a>").text("More details").attr("href","https://shop.mistserver.org/myinvoices").attr("target","_blank")
|
||||||
|
@ -2290,6 +2290,9 @@ var UI = {
|
||||||
|
|
||||||
$errors.html('');
|
$errors.html('');
|
||||||
var n = 0;
|
var n = 0;
|
||||||
|
if (("license" in mist.data.config) && ("user_msg" in mist.data.config.license)) {
|
||||||
|
mist.data.log.unshift([mist.data.config.license.time,"ERROR",mist.data.config.license.user_msg]);
|
||||||
|
}
|
||||||
for (var i in mist.data.log) {
|
for (var i in mist.data.log) {
|
||||||
var l = mist.data.log[i];
|
var l = mist.data.log[i];
|
||||||
if (['FAIL','ERROR'].indexOf(l[1]) > -1) {
|
if (['FAIL','ERROR'].indexOf(l[1]) > -1) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue