From 5ee53f9ccad9bc4d11f699a657c0b80ae17b098e Mon Sep 17 00:00:00 2001 From: Cat Date: Thu, 28 Mar 2019 10:57:08 +0100 Subject: [PATCH] LSP: bugfix embed page --- lsp/generateLSP.sh | 4 ++-- lsp/minified.js | 20 ++++++++++---------- lsp/mist.js | 12 ++++++------ 3 files changed, 18 insertions(+), 18 deletions(-) diff --git a/lsp/generateLSP.sh b/lsp/generateLSP.sh index c05b848e..7981c878 100755 --- a/lsp/generateLSP.sh +++ b/lsp/generateLSP.sh @@ -12,9 +12,9 @@ elementIn () { echo "Minimizing LSP.."; -if elementIn "lsp/plugins/md5.js" "${CHANGES[@]}" || elementIn "lsp/plugins/cattablesort.js" "${CHANGES[@]}" || elementIn "lsp/mist.js" "${CHANGES[@]}" ; then +#if elementIn "lsp/plugins/md5.js" "${CHANGES[@]}" || elementIn "lsp/plugins/cattablesort.js" "${CHANGES[@]}" || elementIn "lsp/mist.js" "${CHANGES[@]}" ; then echo " Generating minified.js.." java -jar closure-compiler.jar --warning_level QUIET plugins/md5.js plugins/cattablesort.js mist.js > minified.js -fi +#fi echo "Done."; diff --git a/lsp/minified.js b/lsp/minified.js index 989bd371..ed8e5a2e 100644 --- a/lsp/minified.js +++ b/lsp/minified.js @@ -80,12 +80,12 @@ a.substring(1)},addUnit:function(a,c){var d=$("").html(a);d.append($("").text(a));switch(a){case "Login":if(mist.user.loggedin){UI.navto("Overview");return}document.title="MistServer MI";UI.elements.menu.addClass("hide");UI.elements.connection.status.text("Disconnected").removeClass("green").addClass("red");d.append(UI.buildUI([{type:"help",help:"Please provide your account details.
You were asked to set these when MistController was started for the first time. If you did not yet set any account details, log in with your desired credentials to create a new account."}, {label:"Host",help:"Url location of the MistServer API. Generally located at http://MistServerIP:4242/api","default":"http://localhost:4242/api",pointer:{main:mist.user,index:"host"}},{label:"Username",help:"Please enter your username here.",validate:["required"],pointer:{main:mist.user,index:"name"}},{label:"Password",type:"password",help:"Please enter your password here.",validate:["required"],pointer:{main:mist.user,index:"rawpassword"}},{type:"buttons",buttons:[{label:"Login",type:"save","function":function(){mist.user.password= MD5(mist.user.rawpassword);delete mist.user.rawpassword;mist.send(function(){UI.navto("Overview")})}}]}]));break;case "Create a new account":UI.elements.menu.addClass("hide");d.append($("

").text("No account has been created yet in the MistServer at ").append($("").text(mist.user.host)).append("."));d.append(UI.buildUI([{type:"buttons",buttons:[{label:"Select other host",type:"cancel",css:{"float":"left"},"function":function(){UI.navto("Login")}}]},{type:"custom",custom:$("
")},{label:"Desired username", -type:"str",validate:["required"],help:"Enter your desired username. In the future, you will need this to access the Management Interface.",pointer:{main:mist.user,index:"name"}},{label:"Desired password",type:"password",validate:["required",function(a,b){$(".match_password").not($(b)).trigger("change");return false}],help:"Enter your desired password. In the future, you will need this to access the Management Interface.",pointer:{main:mist.user,index:"rawpassword"},classes:["match_password"]},{label:"Repeat password", -type:"password",validate:["required",function(a,b){return a!=$(".match_password").not($(b)).val()?{msg:'The fields "Desired password" and "Repeat password" do not match.',classes:["red"]}:false}],help:"Repeat your desired password.",classes:["match_password"]},{type:"buttons",buttons:[{type:"save",label:"Create new account","function":function(){mist.send(function(){UI.navto("Account created")},{authorize:{new_username:mist.user.name,new_password:mist.user.rawpassword}});mist.user.password=MD5(mist.user.rawpassword); -delete mist.user.rawpassword}}]}]));break;case "Account created":UI.elements.menu.addClass("hide");d.append($("

").text("Your account has been created succesfully.")).append(UI.buildUI([{type:"text",text:"Would you like to enable all (currently) available protocols with their default settings?"},{type:"buttons",buttons:[{label:"Enable protocols",type:"save","function":function(){if(mist.data.config.protocols)d.append("Unable to enable all protocols as protocol settings already exist.
");else{d.append("Retrieving available protocols..
"); -mist.send(function(a){var b=[],c;for(c in a.capabilities.connectors)if(a.capabilities.connectors[c].required)d.append('Could not enable protocol "'+c+'" because it has required settings.
');else{b.push({connector:c});d.append('Enabled protocol "'+c+'".
')}d.append("Saving protocol settings..
");mist.send(function(){d.append("Protocols enabled. Redirecting..");setTimeout(function(){UI.navto("Overview")},5E3)},{config:{protocols:b}})},{capabilities:true})}}},{label:"Skip",type:"cancel","function":function(){UI.navto("Overview")}}]}])); -break;case "Overview":if("undefined"==typeof mist.data.bandwidth){mist.send(function(){UI.navto(a)},{bandwidth:!0});d.append("Loading..");return}var i=$("").text("Loading.."),m=$(""),h=$("").addClass("logs"),f=$(""),r=$(""),j=$("").text("Unknown"),l=$(""),u=$(""),g={serverid:mist.data.config.serverid,debug:mist.data.config.debug,accesslog:mist.data.config.accesslog,prometheus:mist.data.config.prometheus},e={};"bandwidth"in mist.data&&(e=mist.data.bandwidth, -null==e&&(e={}),e.limit||(e.limit=""));var k=$("").html($("

").text("Protocol stream urls"),ba]));$.ajax({type:"GET",url:H+"json_"+C+".js",success:function(a){var b= -[],c=O.find(".forceType"),d=O.find(".prioritize_type"),g;for(g in a.source){var e=a.source[g],f=UI.humanMime(e.type);b.push({label:f?f+" ("+e.type+")":UI.format.capital(e.type),type:"str",value:e.url,readonly:true,qrcode:true,clipboard:true});f=UI.humanMime(e.type);if(c.children('option[value="'+e.type+'"]').length==0){c.append($("