From b2f5676ca7a06058b4809b09e4c499747dec95b2 Mon Sep 17 00:00:00 2001 From: Cat Date: Mon, 26 Jun 2017 15:12:25 +0200 Subject: [PATCH 1/3] LSP: bugfix adding triggers when no triggers set --- lsp/minified.js | 40 ++++++++++++++++++++-------------------- lsp/mist.js | 3 +++ 2 files changed, 23 insertions(+), 20 deletions(-) diff --git a/lsp/minified.js b/lsp/minified.js index 8eb95a91..d89f32a0 100644 --- a/lsp/minified.js +++ b/lsp/minified.js @@ -173,26 +173,26 @@ if(confirm("Are you sure you want to delete this "+a[0]+" trigger?")){mist.data. $("[name=params]").closest(".UIelement").show();break;default:$("[name=appliesto]").closest(".UIelement").show();$("[name=params]").setval("").closest(".UIelement").hide()}}},{label:"Applies to",pointer:{main:n,index:"appliesto"},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:!0},$("
"),{label:"Handler (URL or executable)",help:"This can be either an HTTP URL or a full path to an executable.", pointer:{main:n,index:"url"},validate:["required"],type:"str",LTSonly:!0},{label:"Blocking",type:"checkbox",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:n,index:"async"},LTSonly:!0},{label:"Parameters",type:"str",help:"The extra data you want this trigger to use.",pointer:{main:n,index:"params"}, LTSonly:!0},{label:"Default response",type:"str",help:"For blocking requests, the default response in case the handler cannot be executed for any reason.",pointer:{main:n,index:"default"},LTSonly:!0},{type:"buttons",buttons:[{type:"cancel",label:"Cancel","function":function(){UI.navto("Triggers")}},{type:"save",label:"Save","function":function(){c&&mist.data.config.triggers[c[0]].splice(c[1],1);var a={handler:n.url,sync:n.async?true:false,streams:typeof n.appliesto=="undefined"?[]:n.appliesto,params:n.params, -"default":n["default"]};n.triggeron in mist.data.config.triggers||(mist.data.config.triggers[n.triggeron]=[]);mist.data.config.triggers[n.triggeron].push(a);mist.send(function(){UI.navto("Triggers")},{config:mist.data.config})}}]}]));$("[name=triggeron]").trigger("change");break;case "Logs":var pa=$("