diff --git a/lsp/minified.js b/lsp/minified.js index 028fe982..492a1e05 100644 --- a/lsp/minified.js +++ b/lsp/minified.js @@ -199,9 +199,9 @@ value:mist.user.name},{type:"email",label:"Your email address",validate:["requir return a==""||a==null?true:false}).each(function(){var a=[];$(this).is("input, select, textarea")?a.push($(this)):a=$(this).find("input, select, textarea");if(a.length){$(a[0]).focus();return false}});!navigator.doNotTrack&&mist.user.loggedin&&d.append($("").attr("src","https://www.google-analytics.com/collect?v=1&tid=UA-32426932-1&cid="+mist.data.config.iid+"&t=pageview&dp="+encodeURIComponent("/MI/"+a)+"&dh=MI."+(mist.data.LTS?"Pro":"OS")).css({width:"1px",height:"1px","min-width":"1px",opacity:0.1, position:"absolute",left:"-1000px"}))}}};"origin"in location||(location.origin=location.protocol+"//");var host;host="file://"==location.origin?"http://localhost:4242/api":location.origin+location.pathname.replace(/\/+$/,"")+"/api"; var mist={data:{},user:{name:"",password:"",host:host},send:function(a,c,d){var c=c||{},d=d||{},d=$.extend(true,{timeOut:3E4,sendData:c},d),b={authorize:{password:mist.user.authstring?MD5(mist.user.password+mist.user.authstring):"",username:mist.user.name}};$.extend(true,b,c);log("Send",$.extend(true,{},c));b={url:mist.user.host,type:"POST",data:{command:JSON.stringify(b)},dataType:"jsonp",crossDomain:true,timeout:d.timeout*1E3,async:true,error:function(b,e){delete mist.user.loggedin;if(!d.hide){switch(e){case "timeout":e= -$("").text("The connection timed out. ");break;case "abort":e=$("").text("The connection was aborted. ");break;default:e=$("").text(e+". ").css("text-transform","capitalize")}$("#message").addClass("red").text("An error occurred while attempting to communicate with MistServer:").append($("
")).append(e).append($("").text("Send server request again").click(function(){mist.send(a,c,d)}))}UI.navto("Login")},success:function(b){log("Receive",$.extend(true,{},b),"as reply to",d.sendData); -delete mist.user.loggedin;switch(b.authorize.status){case "OK":if("streams"in b)if(b.streams)if("incomplete list"in b.streams){delete b.streams["incomplete list"];$.extend(mist.data.streams,b.streams)}else mist.data.streams=b.streams;else mist.data.streams={};var e=$.extend({},b),h=["config","capabilities","ui_settings","LTS","active_streams","browse","log","totals"],q;for(q in e)h.indexOf(q)==-1&&delete e[q];$.extend(mist.data,e);mist.user.loggedin=true;UI.elements.connection.status.text("Connected").removeClass("red").addClass("green"); -UI.elements.connection.user_and_host.text(mist.user.name+" @ "+mist.user.host);UI.elements.connection.msg.removeClass("red").text("Last communication with the server at "+UI.format.time((new Date).getTime()/1E3));b.LTS&&UI.elements.menu.find(".LTSonly").removeClass("LTSonly");if(b.log){e=b.log[b.log.length-1];UI.elements.connection.msg.append($("
")).append("Last log entry: "+UI.format.time(e[0])+" ["+e[1]+"] "+e[2])}if("totals"in b){e=function(a,b,c){var d;d=function(){for(var a in c.fields)e[c.fields[a]].push([m, +$("").text("The connection timed out. ");break;case "abort":e=$("").text("The connection was aborted. ");break;default:e=$("").text(e+". ").css("text-transform","capitalize")}$("#message").addClass("red").text("An error occurred while attempting to communicate with MistServer:").append($("
")).append($("").text(e)).append($("
").text("Send server request again").click(function(){mist.send(a,c,d)}))}UI.navto("Login")},success:function(b){log("Receive",$.extend(true,{},b),"as reply to", +d.sendData);delete mist.user.loggedin;switch(b.authorize.status){case "OK":if("streams"in b)if(b.streams)if("incomplete list"in b.streams){delete b.streams["incomplete list"];$.extend(mist.data.streams,b.streams)}else mist.data.streams=b.streams;else mist.data.streams={};var e=$.extend({},b),h=["config","capabilities","ui_settings","LTS","active_streams","browse","log","totals"],q;for(q in e)h.indexOf(q)==-1&&delete e[q];$.extend(mist.data,e);mist.user.loggedin=true;UI.elements.connection.status.text("Connected").removeClass("red").addClass("green"); +UI.elements.connection.user_and_host.text(mist.user.name+" @ "+mist.user.host);UI.elements.connection.msg.removeClass("red").text("Last communication with the server at "+UI.format.time((new Date).getTime()/1E3));b.LTS&&UI.elements.menu.find(".LTSonly").removeClass("LTSonly");if(b.log){e=b.log[b.log.length-1];UI.elements.connection.msg.append($("
")).append($("").text("Last log entry: "+UI.format.time(e[0])+" ["+e[1]+"] "+e[2]))}if("totals"in b){e=function(a,b,c){var d;d=function(){for(var a in c.fields)e[c.fields[a]].push([m, 0])};var e={},f;for(f in c.fields)e[c.fields[f]]=[];var h=0,m;if(c.data){if(c.start>mist.data.config.time-600){m=(mist.data.config.time-600)*1E3;d();m=c.start*1E3;d()}else m=c.start*1E3;for(f in c.data){if(f==0){m=c.start*1E3;var q=0}else{m=m+c.interval[q][1]*1E3;c.interval[q][0]--;if(c.interval[q][0]<=0){q++;q20){d();m=(mist.data.config.time- 15)*1E3;d()}}else{m=(mist.data.config.time-600)*1E3;d();m=(mist.data.config.time-15)*1E3;d()}d=e;stream=a?a.join(" "):"all_streams";protocol=b?b.join("_"):"all_protocols";stream in mist.data.totals||(mist.data.totals[stream]={});protocol in mist.data.totals[stream]||(mist.data.totals[stream][protocol]={});$.extend(mist.data.totals[stream][protocol],d)};mist.data.totals={};if("fields"in b.totals)e(c.totals.streams,c.totals.protocols,b.totals);else for(q in b.totals)e(c.totals[q].streams,c.totals[q].protocols, b.totals[q])}a&&a(b,d);break;case "CHALL":if(b.authorize.challenge==mist.user.authstring){mist.user.password!=""&&UI.elements.connection.msg.text("The credentials you provided are incorrect.").addClass("red");UI.navto("Login")}else if(mist.user.password=="")UI.navto("Login");else{mist.user.authstring=b.authorize.challenge;mist.send(a,c,d);sessionStorage.setItem("mistLogin",JSON.stringify({host:mist.user.host,name:mist.user.name,password:mist.user.password}))}break;case "NOACC":UI.navto("Create a new account"); diff --git a/lsp/mist.js b/lsp/mist.js index 4367ae1d..1bc7f35e 100644 --- a/lsp/mist.js +++ b/lsp/mist.js @@ -5661,7 +5661,7 @@ var mist = { $('#message').addClass('red').text('An error occurred while attempting to communicate with MistServer:').append( $('
') ).append( - textStatus + $("").text(textStatus) ).append( $('
').text('Send server request again').click(function(){ mist.send(callback,sendData,opts); @@ -5716,7 +5716,9 @@ var mist = { if (d.log) { var lastlog = d.log[d.log.length-1]; UI.elements.connection.msg.append($('
')).append( - 'Last log entry: '+UI.format.time(lastlog[0])+' ['+lastlog[1]+'] '+lastlog[2] + $("").text( + 'Last log entry: '+UI.format.time(lastlog[0])+' ['+lastlog[1]+'] '+lastlog[2] + ) ); } if ('totals' in d) {