Trigger documentation in browser interface.

This commit is contained in:
Thulinma 2015-10-01 13:53:33 +02:00
parent 1e9ee73bfe
commit 51e6a5d1e9
2 changed files with 125 additions and 122 deletions

View file

@ -527,6 +527,7 @@ var UI = {
$field = $('<input>').attr('type','text');
}
$field.addClass('field').data('opts',e);
if ('pointer' in e) { $field.attr('name',e.pointer.index); }
$fc.append($field);
if ('classes' in e) {
for (var j in e.classes) {
@ -845,7 +846,7 @@ var UI = {
};
}
//check for duplicate stream names
if (val in mist.data.streams) {
if (('streams' in mist.data) && (val in mist.data.streams)) {
//check that we're not simply editing the stream
if ($(me).data('pointer').main.name != val) {
return {
@ -1657,7 +1658,7 @@ var UI = {
case -1: $s.text('Enabling'); break;
case 0: $s.text('Unavailable').addClass('red'); break;
case 1: $s.text('Active').addClass('green'); break;
case 2: $s.text('Inactive').addClass('orange'); break;
case 2: $s.text('Standby').addClass('orange'); break;
default: $s.text(item.online);
}
if (typeof item.error != 'undefined') {
@ -2417,7 +2418,7 @@ var UI = {
totals.push({
streams: [mist.data.active_streams[i]],
fields: ['clients'],
start: -10
start: -2
});
}
mist.send(function(){
@ -2498,7 +2499,7 @@ var UI = {
UI.interval.set(function(){
updateStreams();
},30e3);
},10e3);
}
break;
@ -2556,6 +2557,7 @@ var UI = {
help: 'Set the stream source.<table><tr><td>VoD:</td><td>You can browse to the file or folder as a source or simply enter the path to the file.</td></tr><tr><td>Live:</td><td>You\'ll need to enter "push://IP" with the IP of the machine pushing towards MistServer.<br>You can use "push://" to accept any source.</td></tr><tr><td>(Pro only)</td><td>Use "push://(IP)@password" to set a password protection for pushes.</td></tr></table>If you\'re unsure how to set the source properly, please view our Live pushing guide at the tools section.',
'function': function(){
var source = $(this).val();
if (source == '') { return; }
var type = null;
for (var i in mist.data.capabilities.inputs) {
if (typeof mist.data.capabilities.inputs[i].source_match == 'undefined') { continue; }
@ -3433,7 +3435,7 @@ var UI = {
).append(
$('<th>').text('Applies to').attr('data-sort-type','string')
).append(
$('<th>').text('Execute URL').attr('data-sort-type','string')
$('<th>').text('Handler').attr('data-sort-type','string')
).append(
$('<th>')
)
@ -3443,7 +3445,7 @@ var UI = {
$main.append(
UI.buildUI([{
type: 'help',
help: 'Balder verzin iets leuks'
help: 'Triggers are the system you can use 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(){
@ -3500,34 +3502,34 @@ var UI = {
$main.append(UI.buildUI([{
type: 'help',
help: 'Balder verzin iets leuks'
help: ''
},{
label: 'Trigger on',
pointer: {
main: saveas,
index: 'triggeron'
},
help: 'Balder verzin iets leuks',
help: 'For what event this trigger should activate.',
type: 'select',
select: [
['SYSTEM_START', 'server boot'],
['SYSTEM_STOP', 'server exit'],
['SYSTEM_CONFIG', 'config changed'],
['SYSTEM_LOG', 'log line logged'],
['OUTPUT_ADD', 'new output configured'],
['OUTPUT_CONFIG', 'output config changed'],
['OUTPUT_REMOVE', 'deleted output in config'],
['STREAM_ADD', 'new stream configured'],
['STREAM_CONFIG', 'stream config changed'],
['STREAM_REMOVE', 'stream config deleted'],
['STREAM_LOAD', 'stream input loaded in memory'],
['STREAM_UNLOAD', 'stream input unloaded from memory'],
['STREAM_TRACK_ADD', 'added track to stream; ie: push/multi'],
['STREAM_TRACK_REMOVE', 'removed track from stream'],
['CONN_OPEN', 'new connection'],
['CONN_CLOSE', 'connection closed'],
['CONN_PLAY', 'before play start, includes limits status'],
['CONN_STOP', 'play end, but no disconnect yet']
['SYSTEM_START', 'SYSTEM_START: server boot'],
['SYSTEM_STOP', 'SYSTEM_STOP: server exit'],
['SYSTEM_CONFIG', 'SYSTEM_CONFIG: config changed'],
['OUTPUT_ADD', 'OUTPUT_ADD: new output configured'],
['OUTPUT_CONFIG', 'OUTPUT_CONFIG: output config changed'],
['OUTPUT_REMOVE', 'OUTPUT_REMOVE: deleted output in config'],
['STREAM_ADD', 'STREAM_ADD: new stream configured'],
['STREAM_CONFIG', 'STREAM_CONFIG: stream config changed'],
['STREAM_REMOVE', 'STREAM_REMOVE: stream config deleted'],
['STREAM_SOURCE', 'STREAM_SOURCE: right before stream source is loaded'],
['STREAM_PRELOAD', 'STREAM_PRELOAD: right before stream input is loaded in memory'],
['STREAM_LOAD', 'STREAM_LOAD: stream input loaded in memory'],
['STREAM_UNLOAD', 'STREAM_UNLOAD: stream input unloaded from memory'],
['STREAM_TRACK_ADD', 'STREAM_TRACK_ADD: added track to stream; e.g.: push received'],
['STREAM_TRACK_REMOVE', 'STREAM_TRACK_REMOVE: removed track from stream; e.g.: push timeout'],
['CONN_OPEN', 'CONN_OPEN: new incoming connection'],
['CONN_CLOSE', 'CONN_CLOSE: connection closed'],
['CONN_PLAY', 'CONN_PLAY: right before play of a new connection']
],
LTSonly: true
},{
@ -3536,13 +3538,13 @@ var UI = {
main: saveas,
index: 'appliesto'
},
help: 'Balder verzin iets leuks (none checked = all are checked)',
help: 'For triggers that can apply to specific streams, this value decides what streams they are triggered for. (none checked = always triggered)',
type: 'checklist',
checklist: Object.keys(mist.data.streams),
LTSonly: true
},$('<br>'),{
label: 'Excecute URL',
help: 'Balder verzin iets leuks',
label: 'Handler (URL or executable)',
help: 'This can be either an HTTP URL or a full path to an executable.',
pointer: {
main: saveas,
index: 'url'
@ -3551,18 +3553,18 @@ var UI = {
type: 'str',
LTSonly: true
},{
label: 'Asynchronous',
label: 'Blocking',
type: 'checkbox',
help: 'Balder verzin iets leuks',
help: 'If checked, pauses processing and uses the response of the handler. If the response does not start with 1, true, yes or cont, further processing is aborted. If unchecked, processing is never paused and the response is not checked.',
pointer: {
main: saveas,
index: 'async'
},
LTSonly: true
},{
label: 'Default return on error',
label: 'Default response',
type: 'str',
help: 'Balder verzin iets leuks (synchronous only)',
help: 'For blocking requests, the default response in case the handler cannot be executed for any reason.',
pointer: {
main: saveas,
index: 'default'
@ -4476,9 +4478,9 @@ $.fn.getval = function(){
$(this).find('.checklist input[type=checkbox]:checked').each(function(){
val.push($(this).attr('name'));
});
if (val.length == opts.checklist.length) {
/*if (val.length == opts.checklist.length) {
val = [];
}
}*/
break;
}
}