LSP: added help messages to new auto push settings
This commit is contained in:
parent
7da2327e44
commit
405bf0f054
2 changed files with 9 additions and 9 deletions
|
@ -162,12 +162,12 @@ var e={},g;for(g in a.push_list)if((c==""||a.push_list[g][1]==c)&&(d==""||a.push
|
|||
e&&(f=f.concat(e.push_urls))}c=="auto"&&d.find("h2").text("Add automatic push");var h={};if(c=="auto"&&typeof a!="undefined"){h={stream:a[0],target:a[1]};if(a.length>=3)h.scheduletime=a[2];if(a.length>=4)h.completetime=a[3];if(h.target.indexOf("recstartunix=")>-1){g=h.target.split("recstartunix=")[1];h.recstartunix=g.split("&")[0];h.target=h.target.replace("recstartunix="+h.recstartunix,"").replace("?&","?").replace("&&","&");if(h.target[h.target.length-1]=="?")h.target=h.target.slice(0,-1)}}g=[{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.<br>For example, given the stream <i>a</i> you can use:<ul><li><i>a</i>: the stream configured as <i>a</i></li><li><i>a+</i>: all streams configured as <i>a</i> with a wildcard behind it, but not <i>a</i> itself</li><li><i>a+b</i>: only the version of stream <i>a</i> that has wildcard <i>b</i></li></ul>",pointer:{main:h,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:["orange"],"break":false}}],datalist:t,LTSonly:1},{label:"Target",type:"str",help:"Where the stream will be pushed to.<br>Valid formats:<ul><li>"+f.join("</li><li>")+"</li></ul> Valid text replacements:<ul><li>$stream - inserts the stream name used to push to MistServer</li><li>$day - inserts the current day number</li><li>$month - inserts the current month number</li><li>$year - inserts the current year number</li><li>$hour - inserts the hour timestamp when stream was received</li><li>$minute - inserts the minute timestamp the stream was received</li><li>$seconds - inserts the seconds timestamp when the stream was received</li><li>$datetime - inserts $year.$month.$day.$hour.$minute.$seconds timestamp when the stream was received</li>",
|
||||
pointer:{main:h,index:"target"},validate:["required",function(a){for(var b in f)if(mist.inputMatch(f[b],a))return false;return{msg:"Does not match a valid target.<br>Valid formats:<ul><li>"+f.join("</li><li>")+"</li></ul>",classes:["red"]}}],LTSonly:1}];c=="auto"&&g.push($("<h4>").text("Optional parameters"),{type:"unix",label:"Schedule time",min:0,help:"TODO",pointer:{main:h,index:"scheduletime"}},{type:"unix",label:"Recording start time",min:0,help:"TODO",pointer:{main:h,index:"recstartunix"}},
|
||||
{type:"unix",label:"Complete time",min:0,help:"TODO",pointer:{main:h,index:"completetime"}});g.push({type:"buttons",buttons:[{type:"cancel",label:"Cancel","function":function(){UI.navto("Push")}},{type:"save",label:"Save","function":function(){var b={};h.recstartunix?b.recstartunix="recstartunix="+h.recstartunix:h.scheduletime&&(b.recstartunix="recstartunix="+h.scheduletime);delete h.recstartunix;if(Object.keys(b).length){var d="?",e=h.target.split("?");if(e.length>1){var d="&",e=e[e.length-1],e=
|
||||
e.split("&"),f;for(f in e){var g=e[f].split("=")[0];g in b&&delete b[g]}}if(Object.keys(b).length){d=d+Object.values(b).join("&");h.target=h.target+d}}b={};b[c=="auto"?"push_auto_add":"push_start"]=h;if(typeof a!="undefined"&&(a[0]!=h.stream||a[1]!=h.target))b.push_auto_remove=[a];mist.send(function(){UI.navto("Push")},b)}}]});d.append(UI.buildUI(g))}};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(UI.findInput("Folder").source_match,mist.data.streams[b].source)){t.push(b+"+");mist.send(function(a,b){var e=b.stream,f;for(f in a.browse.files)for(var g in mist.data.capabilities.inputs)g.indexOf("Buffer")>=0||(g.indexOf("Folder")>=0||g.indexOf("Buffer.exe")>=0||g.indexOf("Folder.exe")>=0)||mist.inputMatch(mist.data.capabilities.inputs[g].source_match,"/"+a.browse.files[f])&&t.push(e+"+"+a.browse.files[f]);d++;if(c==
|
||||
d){t=t.filter(function(a,b,c){return c.lastIndexOf(a)===b}).sort();V()}},{browse:mist.data.streams[b].source},{stream:b});c++}}if(c==d){t=t.filter(function(a,b,c){return c.lastIndexOf(a)===b}).sort();V()}},{active_streams:1}):(t=Object.keys(mist.data.streams),V());break;case "Triggers":"triggers"in mist.data.config||(mist.data.config.triggers={});x=$("<tbody>");b=$("<table>").html($("<thead>").html($("<tr>").html($("<th>").text("Trigger on").attr("data-sort-type","string").addClass("sorting-asc")).append($("<th>").text("Applies to").attr("data-sort-type",
|
||||
"string")).append($("<th>").text("Handler").attr("data-sort-type","string")).append($("<th>")))).append(x);d.append(UI.buildUI([{type:"help",help:"Triggers are a way to react to events that occur inside MistServer. These allow you to block specific users, redirect streams, keep tabs on what is being pushed where, etcetera. For full documentation, please refer to the developer documentation section on the MistServer website."}])).append($("<button>").text("New trigger").click(function(){UI.navto("Edit Trigger")})).append(b);
|
||||
pointer:{main:h,index:"target"},validate:["required",function(a){for(var b in f)if(mist.inputMatch(f[b],a))return false;return{msg:"Does not match a valid target.<br>Valid formats:<ul><li>"+f.join("</li><li>")+"</li></ul>",classes:["red"]}}],LTSonly:1}];c=="auto"&&g.push($("<h4>").text("Optional parameters"),{type:"unix",label:"Schedule time",min:0,help:"The time where the push will become active. The default is to start immediately.",pointer:{main:h,index:"scheduletime"}},{type:"unix",label:"Recording start time",
|
||||
min:0,help:"Where in the media buffer the recording will start. Defaults to the most recently received keyframe.<br>Only makes sense for live streams.",pointer:{main:h,index:"recstartunix"}},{type:"unix",label:"Complete time",min:0,help:"The time where the push will stop. Defaults to never stop automatically.<br>Only makes sense for live streams.",pointer:{main:h,index:"completetime"}});g.push({type:"buttons",buttons:[{type:"cancel",label:"Cancel","function":function(){UI.navto("Push")}},{type:"save",
|
||||
label:"Save","function":function(){var b={};h.recstartunix?b.recstartunix="recstartunix="+h.recstartunix:h.scheduletime&&(b.recstartunix="recstartunix="+h.scheduletime);delete h.recstartunix;if(Object.keys(b).length){var d="?",e=h.target.split("?");if(e.length>1){var d="&",e=e[e.length-1],e=e.split("&"),f;for(f in e){var g=e[f].split("=")[0];g in b&&delete b[g]}}if(Object.keys(b).length){d=d+Object.values(b).join("&");h.target=h.target+d}}b={};b[c=="auto"?"push_auto_add":"push_start"]=h;if(typeof a!=
|
||||
"undefined"&&(a[0]!=h.stream||a[1]!=h.target))b.push_auto_remove=[a];mist.send(function(){UI.navto("Push")},b)}}]});d.append(UI.buildUI(g))}};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(UI.findInput("Folder").source_match,mist.data.streams[b].source)){t.push(b+"+");mist.send(function(a,b){var e=b.stream,f;for(f in a.browse.files)for(var g in mist.data.capabilities.inputs)g.indexOf("Buffer")>=
|
||||
0||(g.indexOf("Folder")>=0||g.indexOf("Buffer.exe")>=0||g.indexOf("Folder.exe")>=0)||mist.inputMatch(mist.data.capabilities.inputs[g].source_match,"/"+a.browse.files[f])&&t.push(e+"+"+a.browse.files[f]);d++;if(c==d){t=t.filter(function(a,b,c){return c.lastIndexOf(a)===b}).sort();V()}},{browse:mist.data.streams[b].source},{stream:b});c++}}if(c==d){t=t.filter(function(a,b,c){return c.lastIndexOf(a)===b}).sort();V()}},{active_streams:1}):(t=Object.keys(mist.data.streams),V());break;case "Triggers":"triggers"in
|
||||
mist.data.config||(mist.data.config.triggers={});x=$("<tbody>");b=$("<table>").html($("<thead>").html($("<tr>").html($("<th>").text("Trigger on").attr("data-sort-type","string").addClass("sorting-asc")).append($("<th>").text("Applies to").attr("data-sort-type","string")).append($("<th>").text("Handler").attr("data-sort-type","string")).append($("<th>")))).append(x);d.append(UI.buildUI([{type:"help",help:"Triggers are a way to react to events that occur inside MistServer. These allow you to block specific users, redirect streams, keep tabs on what is being pushed where, etcetera. For full documentation, please refer to the developer documentation section on the MistServer website."}])).append($("<button>").text("New trigger").click(function(){UI.navto("Edit Trigger")})).append(b);
|
||||
b.stupidtable();b=mist.data.config.triggers;for(f in b)for(g in b[f])r=triggerRewrite(b[f][g]),x.append($("<tr>").attr("data-index",f+","+g).append($("<td>").text(f)).append($("<td>").text("streams"in r?r.streams.join(", "):"")).append($("<td>").text(r.handler)).append($("<td>").html($("<button>").text("Edit").click(function(){UI.navto("Edit Trigger",$(this).closest("tr").attr("data-index"))})).append($("<button>").text("Delete").click(function(){var a=$(this).closest("tr").attr("data-index").split(",");
|
||||
if(confirm("Are you sure you want to delete this "+a[0]+" trigger?")){mist.data.config.triggers[a[0]].splice(a[1],1);mist.data.config.triggers[a[0]].length==0&&delete mist.data.config.triggers[a[0]];mist.send(function(){UI.navto("Triggers")},{config:mist.data.config})}}))));break;case "Edit Trigger":"triggers"in mist.data.config||(mist.data.config.triggers={});c?(c=c.split(","),f=triggerRewrite(mist.data.config.triggers[c[0]][c[1]]),n={triggeron:c[0],appliesto:f.streams,url:f.handler,async:f.sync,
|
||||
"default":f["default"],params:f.params}):(d.html($("<h2>").text("New Trigger")),n={});d.append(UI.buildUI([{label:"Trigger on",pointer:{main:n,index:"triggeron"},help:"For what event this trigger should activate.",type:"select",select:[["SYSTEM_START","SYSTEM_START: after MistServer boot"],["SYSTEM_STOP","SYSTEM_STOP: right before MistServer shutdown"],["SYSTEM_CONFIG","SYSTEM_CONFIG: after MistServer configurations have changed"],["OUTPUT_START","OUTPUT_START: right after the start command has been send to a protocol"],
|
||||
|
|
|
@ -4667,7 +4667,7 @@ var UI = {
|
|||
type: "unix",
|
||||
label: "Schedule time",
|
||||
min: 0,
|
||||
help: "TODO",
|
||||
help: "The time where the push will become active. The default is to start immediately.",
|
||||
pointer: {
|
||||
main: saveas,
|
||||
index: "scheduletime"
|
||||
|
@ -4676,7 +4676,7 @@ var UI = {
|
|||
type: "unix",
|
||||
label: "Recording start time",
|
||||
min: 0,
|
||||
help: "TODO",
|
||||
help: "Where in the media buffer the recording will start. Defaults to the most recently received keyframe.<br>Only makes sense for live streams.",
|
||||
pointer: {
|
||||
main: saveas,
|
||||
index: "recstartunix"
|
||||
|
@ -4685,7 +4685,7 @@ var UI = {
|
|||
type: "unix",
|
||||
label: "Complete time",
|
||||
min: 0,
|
||||
help: "TODO",
|
||||
help: "The time where the push will stop. Defaults to never stop automatically.<br>Only makes sense for live streams.",
|
||||
pointer: {
|
||||
main: saveas,
|
||||
index: "completetime"
|
||||
|
|
Loading…
Add table
Reference in a new issue