").text("No pushes are active.").addClass("text").css("margin-top","0.5em")):y.append($("
").text("Stop all pushes").click(function(){var b=[],c;for(c in a.push_list)b.push(a.push_list[c][0]);
+if(b.length!=0&&confirm("Are you sure you want to stop all pushes?")){mist.send(function(){function a(){setTimeout(function(){mist.send(function(c){var d=false;if("push_list"in c&&c.push_list&&c.push_list.length){var d=true,f;for(f in c.push_list)if(b.indexOf(c.push_list[f][0])==-1){d=false;break}}else d=true;d?UI.navto("Push"):a()},{push_list:1})},1E3)}a()},{push_stop:b});d.find("tr:not(:first-child)").html($("").append($("").addClass("red").text("Stopping..")));$(this).remove()}})).append(d)},
+{push_settings:1,push_list:1,push_auto_list:1});break;case "Start Push":if(!("capabilities"in mist.data)){b.append("Loading Mist capabilities..");mist.send(function(){UI.navto("Start Push")},{capabilities:1});break}var t,O=function(){var a=[],d;for(d in mist.data.capabilities.connectors){var f=mist.data.capabilities.connectors[d];"push_urls"in f&&(a=a.concat(f.push_urls))}c=="auto"&&b.find("h2").text("Add automatic push");var e={};b.append(UI.buildUI([{label:"Stream name",type:"str",help:"This may either be a full stream name, a partial wildcard stream name, or a full wildcard stream name. For example, given the stream a you can use:a : the stream configured as a a+ : all streams configured as a with a wildcard behind it, but not a itselfa+b : only the version of stream a that has wildcard b ",
pointer:{main:e,index:"stream"},validate:["required",function(a){a=a.split("+");a=a[0];return a in mist.data.streams?false:{msg:"'"+a+"' is not a stream name.",classes:["red"]}}],datalist:t},{label:"Target",type:"str",help:"Where the stream will be pushed to. Valid formats:",pointer:{main:e,index:"target"},validate:["required",function(b){for(var c in a)if(mist.inputMatch(a[c],b))return false;return{msg:"Does not match a valid target. Valid formats:",classes:["red"]}}]},{type:"buttons",buttons:[{type:"cancel",label:"Cancel","function":function(){UI.navto("Push")}},{type:"save",label:"Save","function":function(){var a={};a[c=="auto"?"push_auto_add":"push_start"]=e;mist.send(function(){UI.navto("Push")},a)}}]}]))};mist.data.LTS?mist.send(function(a){(t=a.active_streams)||(t=[]);var a=[],b;for(b in t)t[b].indexOf("+")!=-1&&a.push(t[b].replace(/\+.*/,"")+"+");t=t.concat(a);var c=0,d=0;for(b in mist.data.streams){t.push(b);
if(mist.inputMatch(mist.data.capabilities.inputs.Folder.source_match,mist.data.streams[b].source)){t.push(b+"+");mist.send(function(a,b){var f=b.stream,e;for(e in a.browse.files)for(var g in mist.data.capabilities.inputs)g.indexOf("Buffer")>=0||g.indexOf("Folder")>=0||mist.inputMatch(mist.data.capabilities.inputs[g].source_match,"/"+a.browse.files[e])&&t.push(f+"+"+a.browse.files[e]);d++;if(c==d){t=t.filter(function(a,b,c){return c.lastIndexOf(a)===b}).sort();O()}},{browse:mist.data.streams[b].source},
@@ -142,7 +143,7 @@ false);b.closest("label").hide()}a.children('option[value="'+a.val()+'"]:disable
"function":function(){$s=A.find(".graph_datatype");switch($(this).getval()){case "coords":$s.children("option").prop("disabled",true).filter('[value="coords"]').prop("disabled",false);break;case "time":$s.children("option").prop("disabled",false).filter('[value="coords"]').prop("disabled",true)}if(!$s.val()||$s.children('option[value="'+$s.val()+'"]:disabled').length){$s.val($s.children("option:enabled").first().val());$s.trigger("change")}}},{label:"Data type",type:"select",select:[["clients","Connections"],
["upbps","Bandwidth (up)"],["downbps","Bandwidth (down)"],["cpuload","CPU use"],["memload","Memory load"],["coords","Client location"]],pointer:{main:o,index:"datatype"},classes:["graph_datatype"],"function":function(){$s=A.find(".graph_origin");switch($(this).getval()){case "cpuload":case "memload":$s.find("input[type=radio]").not('[value="total"]').prop("disabled",true);$s.find('input[type=radio][value="total"]').prop("checked",true);break;default:$s.find("input[type=radio]").prop("disabled",false)}}},
{label:"Data origin",type:"radioselect",radioselect:[["total","All"],["stream","The stream:",H],["protocol","The protocol:",Q]],pointer:{main:o,index:"origin"},value:["total"],classes:["graph_origin"]},{type:"buttons",buttons:[{label:"Add data set",type:"save","function":function(){var a;if(o.graph=="new"){a=UI.plot.addGraph(o,c);u[a.id]=a;A.find("select.graph_ids").append($("").text(a.id)).val(a.id).trigger("change")}else a=u[o.graph];var b=UI.plot.datatype.getOptions({datatype:o.datatype,
-origin:o.origin});a.datasets.push(b);UI.plot.save(a);UI.plot.go(u)}}]}]));var c=$("").addClass("graph_container");b.append(c);var d=A.find("select.graph_ids");for(a in u){var e=UI.plot.addGraph(u[a],c);d.append($("
").text(e.id)).val(e.id);var f=[],g;for(g in u[a].datasets){var h=UI.plot.datatype.getOptions({datatype:u[a].datasets[g].datatype,origin:u[a].datasets[g].origin});f.push(h)}e.datasets=f;u[e.id]=e}d.trigger("change");UI.plot.go(u);UI.interval.set(function(){UI.plot.go(u)},1E4)},
+origin:o.origin});a.datasets.push(b);UI.plot.save(a);UI.plot.go(u)}}]}]));var c=$("").addClass("graph_container");b.append(c);var d=A.find("select.graph_ids");for(a in u){var f=UI.plot.addGraph(u[a],c);d.append($("
").text(f.id)).val(f.id);var e=[],g;for(g in u[a].datasets){var h=UI.plot.datatype.getOptions({datatype:u[a].datasets[g].datatype,origin:u[a].datasets[g].origin});e.push(h)}f.datasets=e;u[f.id]=f}d.trigger("change");UI.plot.go(u);UI.interval.set(function(){UI.plot.go(u)},1E4)},
{active_streams:!0,capabilities:!0});break;case "Server Stats":if("undefined"==typeof mist.data.capabilities){mist.send(function(){UI.navto(a)},{capabilities:!0});b.append("Loading..");break}var R=$(""),S=$(""),h={vheader:"CPUs",labels:["Model","Processor speed","Amount of cores","Amount of threads"],content:[]};for(q in mist.data.capabilities.cpu)r=mist.data.capabilities.cpu[q],h.content.push({header:"CPU #"+(Number(q)+1),body:[r.model,UI.format.addUnit(UI.format.number(r.mhz),"MHz"),
r.cores,r.threads]});var h=UI.buildVheaderTable(h),aa=function(){var a=mist.data.capabilities.mem,b=mist.data.capabilities.load,a={vheader:"Memory",labels:["Used","Cached","Available","Total"],content:[{header:"Physical memory",body:[UI.format.bytes(a.used*1048576)+" ("+UI.format.addUnit(b.memory,"%")+")",UI.format.bytes(a.cached*1048576),UI.format.bytes(a.free*1048576),UI.format.bytes(a.total*1048576)]},{header:"Swap memory",body:[UI.format.bytes((a.swaptotal-a.swapfree)*1048576),UI.format.addUnit("",
"N/A"),UI.format.bytes(a.swapfree*1048576),UI.format.bytes(a.swaptotal*1048576)]}]},a=UI.buildVheaderTable(a);R.replaceWith(a);R=a;b={vheader:"Load average",labels:["CPU use","1 minute","5 minutes","15 minutes"],content:[{header:" ",body:[UI.format.addUnit(UI.format.number(mist.data.capabilities.cpu_use/10),"%"),UI.format.number(b.one/100),UI.format.number(b.five/100),UI.format.number(b.fifteen/100)]}]};b=UI.buildVheaderTable(b);S.replaceWith(b);S=b};aa();b.append(UI.buildUI([{type:"help",help:"You can find general server statistics here. Note that memory and CPU usage is for your entire machine, not just MistServer."}])).append($("").css("width",
diff --git a/lsp/mist.js b/lsp/mist.js
index 3d6fa054..29233b25 100644
--- a/lsp/mist.js
+++ b/lsp/mist.js
@@ -3363,7 +3363,52 @@ var UI = {
);
}
else {
- $c.append($push);
+ $c.append(
+ $('').text('Stop all pushes').click(function(){
+ var push_list = [];
+ for (var i in d.push_list) {
+ push_list.push(d.push_list[i][0]);
+ }
+ if (push_list.length == 0) { return; }
+ if (confirm('Are you sure you want to stop all pushes?')) {
+ mist.send(function(d){
+ function checkgone() {
+ setTimeout(function(){
+ mist.send(function(d){
+ var gone = false;
+ if (('push_list' in d) && (d.push_list) && (d.push_list.length)) {
+ gone = true;
+ for (var i in d.push_list) {
+ if (push_list.indexOf(d.push_list[i][0]) == -1) {
+ gone = false;
+ break;
+ }
+ }
+ }
+ else {
+ gone = true;
+ }
+ if (gone) {
+ UI.navto('Push');
+ }
+ else {
+ checkgone();
+ }
+ },{push_list:1});
+ },1e3);
+ }
+ checkgone();
+ },{push_stop:push_list});
+ $push.find('tr:not(:first-child)').html(
+ $('').append(
+ $('').addClass('red').text('Stopping..')
+ )
+ );
+ $(this).remove();
+ }
+
+ })
+ ).append($push);
}
},{push_settings:1,push_list:1,push_auto_list:1});