@gregoriusrippenstein/node-red-contrib-introspection 0.9.18 → 0.9.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/nodes/05-seeker.html +1 -1
- package/nodes/10-sink.html +1 -1
- package/package.json +1 -1
- package/plugins/sidebar.html +80 -69
package/nodes/05-seeker.html
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script type="text/javascript">
|
|
2
|
-
RED.nodes.registerType("Seeker",{color:"#e5e4ef",icon:"font-awesome/fa-ship",category:"introspection",paletteLabel:"Seeker",defaults:{name:{value:""}},inputs:0,outputs:1,label:function(){return this.name||this._def.paletteLabel},labelStyle:function(){return this.name?"node_label_italic":""},oneditprepare:function(){var n=this;window._introSpectionSeekerStack=[],window._introWorker=void 0;let i=e=>{var t=RED.nodes.node(e[e.length-1]);let n=[];return e.forEach(function(e){var t,e=RED.nodes.node(e)||RED.nodes.junction(e);void 0!==e&&(t=RED.nodes.workspace(e.z)||RED.nodes.subflow(e.z),n.push({label:"",_label:RED.utils.getNodeLabel(e),node:e,sublabel:t&&RED.utils.getNodeLabel(t)||e.z,icon:RED.utils.createNodeIcon(e,!0),class:"intro-remove-top-left"}))}),{node:t,label:RED.utils.getNodeLabel(t),_label:RED.utils.getNodeLabel(t),_pathlen:e.length,sublabel:"Length: "+e.length,selected:!1,checkbox:!1,children:n}};var o=$("#node-input-seeker-target-filter").searchBox({style:"compact",delay:300,change:function(){let t=$(this).val().trim().toLowerCase();var e,n=$("#node-input-seeker-target-container-div").treeList("data");""===t?($("#node-input-seeker-target-container-div").treeList("filter",null),o.searchBox("count","")):(e=$("#node-input-seeker-target-container-div").treeList("filter",function(e){return-1<e._label.toLowerCase().indexOf(t)||-1<e.node.type.toLowerCase().indexOf(t)||e.sublabel.toLowerCase().indexOf(t)}),o.searchBox("count",e+" / "+n.length))}}),r=((e=>{let n=`#node-input-${e}-target-container-div`,o=`#node-input-${e}-extract-pathway-but`,i=`#node-input-${e}-show-pathway-but`;$(n).css({width:"100%",height:"calc(100%)"}).treeList({multi:!1}).on("treelistitemmouseover",function(e,t){}).on("treelistitemmouseout",function(e,t){}).on("treelistconfirm",function(e,t){t.node&&!t.children&&(RED.view.reveal(t.node.id),RED.view.select(t.node.id),setTimeout(()=>{RED.editor.edit(t.node)},100))}).on("treelistselect",function(e,t){t.node&&!t.children&&(RED.workspaces.show(t.node.z,!1,!1,!0),RED.view.reveal(t.node.id,!0),RED.view.redraw()),1==$(n).treeList("data").filter(e=>e.expanded).length?($(o).prop("disabled",!1),$(i).prop("disabled",!1)):($(o).prop("disabled",!0),$(i).prop("disabled",!0))})})("seeker"),function(t,n){if(n.indexOf(t.id)<0&&!t.d)switch(t.type){case"link call":RED.nodes.getNodeLinks(t).forEach(e=>{r(e.target,[...n,t.id])}),t.links.forEach(e=>{e=RED.nodes.node(e);e&&r(e,[...n,t.id])});break;case"link out":t.links.forEach(e=>{e=RED.nodes.node(e);e&&r(e,[...n,t.id])});break;case"Sink":n.push(t.id),window._introSpectionSeekerStack=[n,...window._introSpectionSeekerStack];break;default:RED.nodes.getNodeLinks(t).forEach(e=>{r(e.target,[...n,t.id])})}});let
|
|
2
|
+
RED.nodes.registerType("Seeker",{color:"#e5e4ef",icon:"font-awesome/fa-ship",category:"introspection",paletteLabel:"Seeker",defaults:{name:{value:""}},inputs:0,outputs:1,label:function(){return this.name||this._def.paletteLabel},labelStyle:function(){return this.name?"node_label_italic":""},oneditprepare:function(){var n=this;window._introSpectionSeekerStack=[],window._introWorker=void 0;let i=e=>{var t=RED.nodes.node(e[e.length-1]);let n=[];return e.forEach(function(e){var t,e=RED.nodes.node(e)||RED.nodes.junction(e);void 0!==e&&(t=RED.nodes.workspace(e.z)||RED.nodes.subflow(e.z),n.push({label:"",_label:RED.utils.getNodeLabel(e),node:e,sublabel:t&&RED.utils.getNodeLabel(t)||e.z,icon:RED.utils.createNodeIcon(e,!0),class:"intro-remove-top-left"}))}),{node:t,label:RED.utils.getNodeLabel(t),_label:RED.utils.getNodeLabel(t),_pathlen:e.length,sublabel:"Length: "+e.length,selected:!1,checkbox:!1,children:n}};var o=$("#node-input-seeker-target-filter").searchBox({style:"compact",delay:300,change:function(){let t=$(this).val().trim().toLowerCase();var e,n=$("#node-input-seeker-target-container-div").treeList("data");""===t?($("#node-input-seeker-target-container-div").treeList("filter",null),o.searchBox("count","")):(e=$("#node-input-seeker-target-container-div").treeList("filter",function(e){return-1<e._label.toLowerCase().indexOf(t)||-1<e.node.type.toLowerCase().indexOf(t)||e.sublabel.toLowerCase().indexOf(t)}),o.searchBox("count",e+" / "+n.length))}}),r=((e=>{let n=`#node-input-${e}-target-container-div`,o=`#node-input-${e}-extract-pathway-but`,i=`#node-input-${e}-show-pathway-but`;$(n).css({width:"100%",height:"calc(100%)"}).treeList({multi:!1}).on("treelistitemmouseover",function(e,t){}).on("treelistitemmouseout",function(e,t){}).on("treelistconfirm",function(e,t){t.node&&!t.children&&(RED.view.reveal(t.node.id),RED.view.select(t.node.id),setTimeout(()=>{RED.editor.edit(t.node)},100))}).on("treelistselect",function(e,t){t.node&&!t.children&&(RED.workspaces.show(t.node.z,!1,!1,!0),RED.view.reveal(t.node.id,!0),RED.view.redraw()),1==$(n).treeList("data").filter(e=>e.expanded).length?($(o).prop("disabled",!1),$(i).prop("disabled",!1)):($(o).prop("disabled",!0),$(i).prop("disabled",!0))})})("seeker"),function(t,n){if(n.indexOf(t.id)<0&&!t.d)switch(t.type){case"link call":RED.nodes.getNodeLinks(t).forEach(e=>{r(e.target,[...n,t.id])}),t.links.forEach(e=>{e=RED.nodes.node(e);e&&r(e,[...n,t.id])});break;case"link out":t.links.forEach(e=>{e=RED.nodes.node(e);e&&r(e,[...n,t.id])});break;case"Sink":n.push(t.id),window._introSpectionSeekerStack=[n,...window._introSpectionSeekerStack];break;default:RED.nodes.getNodeLinks(t).forEach(e=>{r(e.target,[...n,t.id])})}});let d=e=>{e&&e.preventDefault();let t=window._introSpectionSeekerStack.length,n=25,o=("-"!=$("#node-input-seeker-show-percent").val()&&(n=parseInt(t*(parseInt($("#node-input-seeker-show-percent").val())/100))),e=$("#node-input-seeker-show-ordering").val(),{1:(e,t)=>e.length<t.length?-1:1,2:(e,t)=>e.length>t.length?-1:1,3:(e,t)=>RED.utils.getNodeLabel(RED.nodes.node(e[e.length-1]))<RED.utils.getNodeLabel(RED.nodes.node(t[t.length-1]))?-1:1,4:(e,t)=>{e=RED.utils.getNodeLabel(RED.nodes.node(e[e.length-1]));return RED.utils.getNodeLabel(RED.nodes.node(t[t.length-1]))<e?-1:1},5:(e,t)=>.5<Math.random()?-1:1}[parseInt(e)]||((e,t)=>e.length<t.length?-1:1));setTimeout(()=>{setTimeout(()=>{$("#node-input-seeker-totalPaths").html(n>t?""+t:n+" / "+t)},10),setTimeout(()=>{$("#node-input-seeker-target-container-div").treeList("data",window._introSpectionSeekerStack.sort(o).slice(0,n).map(e=>i(e)))},20)},100)},a=()=>{let e=window._introSpectionSeekerStack.length;setTimeout(()=>{$("#node-input-seeker-start-but").prop("disabled",!1),$("#node-input-seeker-totalPaths").html(e),$("#node-input-seeker-spinner").hide()},10);var t="seeker",n=e;$(`#node-input-${t}-show-percent`).show(),$(`#node-input-${t}-show-ordering`).show();var o,i=$(`#node-input-${t}-show-percent`),r=(i.html(""),i.append($("<option></option>").val("-").html("Show..")),[5,10,20,30,40,50,75].forEach(e=>{var t=parseInt(e*n/100);0!=t&&i.append($("<option></option>").val(e).html(t+" paths"))}),i.append($("<option></option>").val(100).html("All")),i.val("-"),(i=$(`#node-input-${t}-show-ordering`)).html(""),{"Count Asc":1,"Count Desc":2,"Name Asc":3,"Name Desc":4,Random:5});for(o in r)i.append($("<option></option>").val(r[o]).html(o));i.val(1),$("#node-input-seeker-show-ordering").on("change",d),$("#node-input-seeker-show-percent").on("change",d),$("#node-input-seeker-show-percent").trigger("change")};$("#node-input-seeker-show-pathway-but").on("click",e=>{e&&e.preventDefault();var e=$("#node-input-seeker-target-container-div").treeList("data").filter(e=>e.expanded);1==(e=e).length?(e=e[0].children.filter(e=>e.node.z==RED.workspaces.active()).map(e=>e.node.id),RED.tray.hide(),RED.view.selectNodes({selected:e,onselect:()=>{RED.tray.show()},oncancel:()=>{RED.tray.show()}})):RED.notify("Only one expanded pathway can be shown.",{type:"warning"})}),$("#node-input-seeker-extract-pathway-but").on("click",e=>{e&&e.preventDefault(),(e=>{if(1==e.length){e=e[0].children.map(e=>e.node).filter(e=>["link in","link out","Seeker","Sink","junction"].indexOf(e.type)<0);let o=RED.nodes.createExportableNodeSet(e).map(e=>(e.id=RED.nodes.id(),e)),i=0;o=o.map((e,t)=>{try{var n;e._def=e._def||RED.nodes.getType(e.type),e._def&&e._def._&&e._?(n=RED.utils.getNodeLabel(e,e.info).split("\\n").length,i+=30*n+30):i+=50}catch(e){i+=50}return delete e.z,e.y=i,e.x=0,e.wires=[[]],t!=o.length-1&&(e.wires=[[o[t+1].id]]),e}),RED.clipboard.copyText(JSON.stringify(o))&&RED.notify("Pathway copied to clipboard",{type:"success"})}else RED.notify("Only one expanded pathway can be extracted.",{type:"warning"})})($("#node-input-seeker-target-container-div").treeList("data").filter(e=>e.expanded))}),$("#node-input-seeker-start-but").on("click",e=>{if(e&&e.preventDefault(),setTimeout(()=>{$("#node-input-seeker-start-but").prop("disabled",!0),$("#node-input-seeker-totalPaths").html(""),$("#node-input-seeker-spinner").show(),$("#node-input-seeker-show-percent").hide(),$("#node-input-seeker-show-ordering").hide()},10),window._introSpectionSeekerStack=[],"undefined"!=typeof Worker){let t=new Worker("data:text/javascript;base64,bGV0IGludHJvU3BlY3Rpb25TdGFjaz1bXSxncmFwaD1bXSxncmFwaEluZGV4PXt9LFJFRD17bm9kZXM6e25vZGU6ZT0+Z3JhcGhbZ3JhcGhJbmRleFtlXV0sZ2V0Tm9kZUxpbmtzOmE9PmEuZmxhdHdpcmVzLm1hcChlPT4oe3RhcmdldDpSRUQubm9kZXMubm9kZShlKSxzb3VyY2U6YX0pKX19LHRyYXZlcnNlPWZ1bmN0aW9uKGEscyl7aWYocy5pbmRleE9mKGEuaWQpPDAmJiFhLmQpc3dpdGNoKGEudHlwZSl7Y2FzZSJsaW5rIGNhbGwiOlJFRC5ub2Rlcy5nZXROb2RlTGlua3MoYSkuZm9yRWFjaChlPT57dHJhdmVyc2UoZS50YXJnZXQsWy4uLnMsYS5pZF0pfSksYS5saW5rcy5mb3JFYWNoKGU9PntlPVJFRC5ub2Rlcy5ub2RlKGUpO2UmJnRyYXZlcnNlKGUsWy4uLnMsYS5pZF0pfSk7YnJlYWs7Y2FzZSJsaW5rIG91dCI6YS5saW5rcy5mb3JFYWNoKGU9PntlPVJFRC5ub2Rlcy5ub2RlKGUpO2UmJnRyYXZlcnNlKGUsWy4uLnMsYS5pZF0pfSk7YnJlYWs7Y2FzZSJTaW5rIjpzLnB1c2goYS5pZCkscG9zdE1lc3NhZ2Uocyk7YnJlYWs7ZGVmYXVsdDpSRUQubm9kZXMuZ2V0Tm9kZUxpbmtzKGEpLmZvckVhY2goZT0+e3RyYXZlcnNlKGUudGFyZ2V0LFsuLi5zLGEuaWRdKX0pfX07b25tZXNzYWdlPWZ1bmN0aW9uKGUpe2xldCBhPWUuZGF0YS5zZWVrZXJJZDsoZ3JhcGg9ZS5kYXRhLm5vZGVzLm1hcChlPT4oe3dpcmVzOmUud2lyZXMsbGlua3M6ZS5saW5rcyxkOmUuZGlzYWJsZWR8fGUuZCxpZDplLmlkLHR5cGU6ZS50eXBlfSkpLmZpbHRlcihlPT4hIWUud2lyZXMpLm1hcChlPT4oZS5mbGF0d2lyZXM9ZS53aXJlcy5mbGF0KCksZSkpKS5mb3JFYWNoKChlLGEpPT5ncmFwaEluZGV4W2UuaWRdPWEpLFJFRC5ub2Rlcy5nZXROb2RlTGlua3MoUkVELm5vZGVzLm5vZGUoYSkpLmZvckVhY2goZT0+e3RyYXZlcnNlKGUudGFyZ2V0LFthXSl9KSxwb3N0TWVzc2FnZSgiZG9uZSIpfTs=");(window._introWorker=t).onmessage=function(e){"done"==e.data?(t.terminate(),delete window._introWorker,a()):(window._introSpectionSeekerStack.push(e.data),$("#node-input-seeker-totalPaths").html(window._introSpectionSeekerStack.length),26==window._introSpectionSeekerStack.length&&$("#node-input-seeker-target-container-div").treeList("data",window._introSpectionSeekerStack.sort((e,t)=>e.length<t.length?-1:1).slice(0,25).map(e=>i(e))))},setTimeout(()=>{t.postMessage({seekerId:n.id,nodes:RED.nodes.createCompleteNodeSet({credentials:!1})})},10)}else setTimeout(()=>{RED.nodes.getNodeLinks(n).forEach(e=>{r(e.target,[n.id])}),a()},300)})},oneditsave:function(){window._introWorker&&(window._introWorker.terminate(),delete window._introWorker),delete window._introSpectionSeekerStack},oneditcancel:function(){window._introWorker&&(window._introWorker.terminate(),delete window._introWorker),delete window._introSpectionSeekerStack},oneditresize:function(e){for(var t=$("#dialog-form>div:not(.node-input-target-list-row)"),n=$("#dialog-form").height(),o=0;o<t.length;o++)n-=$(t[o]).outerHeight(!0);$("#dialog-form>div.node-input-target-list-row").css("height",n+"px")}});
|
|
3
3
|
</script>
|
|
4
4
|
|
|
5
5
|
<script type="text/html" data-template-name="Seeker">
|
package/nodes/10-sink.html
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script type="text/javascript">
|
|
2
|
-
RED.nodes.registerType("Sink",{color:"#e5e4ef",icon:"font-awesome/fa-anchor",category:"introspection",paletteLabel:"Sink",defaults:{name:{value:""}},inputs:1,outputs:0,label:function(){return this.name||this._def.paletteLabel},labelStyle:function(){return this.name?"node_label_italic":""},oneditprepare:function(){var n=this;let o=1,i=(window._introSpectionsinkStack=[],window._introWorker=void 0,e=>{var t=RED.nodes.node(e[e.length-1]);let n=[];return e.forEach(function(e){var t,e=RED.nodes.node(e)||RED.nodes.junction(e);void 0!==e&&(t=RED.nodes.workspace(e.z)||RED.nodes.subflow(e.z),n.push({label:"",_label:RED.utils.getNodeLabel(e),node:e,sublabel:t&&RED.utils.getNodeLabel(t)||e.z,icon:RED.utils.createNodeIcon(e,!0),class:"intro-remove-top-left"}))}),{node:t,label:RED.utils.getNodeLabel(t),_label:RED.utils.getNodeLabel(t),_pathlen:e.length,sublabel:"Length: "+e.length,selected:!1,checkbox:!1,children:n}});var a=$("#node-input-sink-target-filter").searchBox({style:"compact",delay:300,change:function(){let t=$(this).val().trim().toLowerCase();var e,n=$("#node-input-sink-target-container-div").treeList("data");""===t?($("#node-input-sink-target-container-div").treeList("filter",null),a.searchBox("count","")):(e=$("#node-input-sink-target-container-div").treeList("filter",function(e){return-1<e._label.toLowerCase().indexOf(t)||-1<e.node.type.toLowerCase().indexOf(t)||e.sublabel.toLowerCase().indexOf(t)}),a.searchBox("count",e+" / "+n.length))}}),d=((e=>{let n=`#node-input-${e}-target-container-div`,o=`#node-input-${e}-extract-pathway-but`,i=`#node-input-${e}-show-pathway-but`;$(n).css({width:"100%",height:"calc(100%)"}).treeList({multi:!1}).on("treelistitemmouseover",function(e,t){}).on("treelistitemmouseout",function(e,t){}).on("treelistconfirm",function(e,t){t.node&&!t.children&&(RED.view.reveal(t.node.id),RED.view.select(t.node.id),setTimeout(()=>{RED.editor.edit(t.node)},100))}).on("treelistselect",function(e,t){t.node&&!t.children&&(RED.workspaces.show(t.node.z,!1,!1,!0),RED.view.reveal(t.node.id,!0),RED.view.redraw()),1==$(n).treeList("data").filter(e=>e.expanded).length?($(o).prop("disabled",!1),$(i).prop("disabled",!1)):($(o).prop("disabled",!0),$(i).prop("disabled",!0))})})("sink"),function(t,n){if(n.indexOf(t.id)<0&&!t.d)switch(t.type){case"link in":t.links.forEach(e=>{e=RED.nodes.node(e);e&&d(e,[...n,t.id])});break;case"Seeker":n.push(t.id),window._introSpectionsinkStack=[n,...window._introSpectionsinkStack];break;default:RED.nodes.getNodeLinks(t,o).forEach(e=>{d(e.source,[...n,t.id])})}});let l=e=>{e&&e.preventDefault();let t=window._introSpectionsinkStack.length,n=25,o=("-"!=$("#node-input-sink-show-percent").val()&&(n=parseInt(t*(parseInt($("#node-input-sink-show-percent").val())/100))),e=$("#node-input-sink-show-ordering").val(),{1:(e,t)=>e.length<t.length?-1:1,2:(e,t)=>e.length>t.length?-1:1,3:(e,t)=>RED.utils.getNodeLabel(RED.nodes.node(e[e.length-1]))<RED.utils.getNodeLabel(RED.nodes.node(t[t.length-1]))?-1:1,4:(e,t)=>{e=RED.utils.getNodeLabel(RED.nodes.node(e[e.length-1]));return RED.utils.getNodeLabel(RED.nodes.node(t[t.length-1]))<e?-1:1},5:(e,t)=>.5<Math.random()?-1:1}[parseInt(e)]||((e,t)=>e.length<t.length?-1:1));setTimeout(()=>{setTimeout(()=>{$("#node-input-sink-totalPaths").html(n>t?""+t:n+" / "+t)},10),setTimeout(()=>{$("#node-input-sink-target-container-div").treeList("data",window._introSpectionsinkStack.sort(o).slice(0,n).map(e=>i(e)))},20)},100)},s=()=>{let e=window._introSpectionsinkStack.length;setTimeout(()=>{$("#node-input-sink-start-but").prop("disabled",!1),$("#node-input-sink-totalPaths").html(e),$("#node-input-sink-spinner").hide()},10);var t="sink",n=e;$(`#node-input-${t}-show-percent`).show(),$(`#node-input-${t}-show-ordering`).show();var o,i=$(`#node-input-${t}-show-percent`),a=(i.html(""),i.append($("<option></option>").val("-").html("Show..")),[5,10,20,30,40,50,75].forEach(e=>{var t=parseInt(e*n/100);0!=t&&i.append($("<option></option>").val(e).html(t+" paths"))}),i.append($("<option></option>").val(100).html("All")),i.val("-"),(i=$(`#node-input-${t}-show-ordering`)).html(""),{"Count Asc":1,"Count Desc":2,"Name Asc":3,"Name Desc":4,Random:5});for(o in a)i.append($("<option></option>").val(a[o]).html(o));i.val(1),$("#node-input-sink-show-ordering").on("change",l),$("#node-input-sink-show-percent").on("change",l),$("#node-input-sink-show-percent").trigger("change")};$("#node-input-sink-show-pathway-but").on("click",e=>{e&&e.preventDefault();var e=$("#node-input-sink-target-container-div").treeList("data").filter(e=>e.expanded);1==(e=e).length?(e=e[0].children.filter(e=>e.node.z==RED.workspaces.active()).map(e=>e.node.id),RED.tray.hide(),RED.view.selectNodes({selected:e,onselect:()=>{RED.tray.show()},oncancel:()=>{RED.tray.show()}})):RED.notify("Only one expanded pathway can be shown.",{type:"warning"})}),$("#node-input-sink-extract-pathway-but").on("click",e=>{e&&e.preventDefault(),(e=>{if(1==e.length){e=e[0].children.map(e=>e.node).filter(e=>["link in","link out","Seeker","Sink","junction"].indexOf(e.type)<0);let o=RED.nodes.createExportableNodeSet(e).map(e=>(e.id=RED.nodes.id(),e)),i=0;o=o.map((e,t)=>{try{e._def=e._def||RED.nodes.getType(e.type)
|
|
2
|
+
RED.nodes.registerType("Sink",{color:"#e5e4ef",icon:"font-awesome/fa-anchor",category:"introspection",paletteLabel:"Sink",defaults:{name:{value:""}},inputs:1,outputs:0,label:function(){return this.name||this._def.paletteLabel},labelStyle:function(){return this.name?"node_label_italic":""},oneditprepare:function(){var n=this;let o=1,i=(window._introSpectionsinkStack=[],window._introWorker=void 0,e=>{var t=RED.nodes.node(e[e.length-1]);let n=[];return e.forEach(function(e){var t,e=RED.nodes.node(e)||RED.nodes.junction(e);void 0!==e&&(t=RED.nodes.workspace(e.z)||RED.nodes.subflow(e.z),n.push({label:"",_label:RED.utils.getNodeLabel(e),node:e,sublabel:t&&RED.utils.getNodeLabel(t)||e.z,icon:RED.utils.createNodeIcon(e,!0),class:"intro-remove-top-left"}))}),{node:t,label:RED.utils.getNodeLabel(t),_label:RED.utils.getNodeLabel(t),_pathlen:e.length,sublabel:"Length: "+e.length,selected:!1,checkbox:!1,children:n}});var a=$("#node-input-sink-target-filter").searchBox({style:"compact",delay:300,change:function(){let t=$(this).val().trim().toLowerCase();var e,n=$("#node-input-sink-target-container-div").treeList("data");""===t?($("#node-input-sink-target-container-div").treeList("filter",null),a.searchBox("count","")):(e=$("#node-input-sink-target-container-div").treeList("filter",function(e){return-1<e._label.toLowerCase().indexOf(t)||-1<e.node.type.toLowerCase().indexOf(t)||e.sublabel.toLowerCase().indexOf(t)}),a.searchBox("count",e+" / "+n.length))}}),d=((e=>{let n=`#node-input-${e}-target-container-div`,o=`#node-input-${e}-extract-pathway-but`,i=`#node-input-${e}-show-pathway-but`;$(n).css({width:"100%",height:"calc(100%)"}).treeList({multi:!1}).on("treelistitemmouseover",function(e,t){}).on("treelistitemmouseout",function(e,t){}).on("treelistconfirm",function(e,t){t.node&&!t.children&&(RED.view.reveal(t.node.id),RED.view.select(t.node.id),setTimeout(()=>{RED.editor.edit(t.node)},100))}).on("treelistselect",function(e,t){t.node&&!t.children&&(RED.workspaces.show(t.node.z,!1,!1,!0),RED.view.reveal(t.node.id,!0),RED.view.redraw()),1==$(n).treeList("data").filter(e=>e.expanded).length?($(o).prop("disabled",!1),$(i).prop("disabled",!1)):($(o).prop("disabled",!0),$(i).prop("disabled",!0))})})("sink"),function(t,n){if(n.indexOf(t.id)<0&&!t.d)switch(t.type){case"link in":t.links.forEach(e=>{e=RED.nodes.node(e);e&&d(e,[...n,t.id])});break;case"Seeker":n.push(t.id),window._introSpectionsinkStack=[n,...window._introSpectionsinkStack];break;default:RED.nodes.getNodeLinks(t,o).forEach(e=>{d(e.source,[...n,t.id])})}});let l=e=>{e&&e.preventDefault();let t=window._introSpectionsinkStack.length,n=25,o=("-"!=$("#node-input-sink-show-percent").val()&&(n=parseInt(t*(parseInt($("#node-input-sink-show-percent").val())/100))),e=$("#node-input-sink-show-ordering").val(),{1:(e,t)=>e.length<t.length?-1:1,2:(e,t)=>e.length>t.length?-1:1,3:(e,t)=>RED.utils.getNodeLabel(RED.nodes.node(e[e.length-1]))<RED.utils.getNodeLabel(RED.nodes.node(t[t.length-1]))?-1:1,4:(e,t)=>{e=RED.utils.getNodeLabel(RED.nodes.node(e[e.length-1]));return RED.utils.getNodeLabel(RED.nodes.node(t[t.length-1]))<e?-1:1},5:(e,t)=>.5<Math.random()?-1:1}[parseInt(e)]||((e,t)=>e.length<t.length?-1:1));setTimeout(()=>{setTimeout(()=>{$("#node-input-sink-totalPaths").html(n>t?""+t:n+" / "+t)},10),setTimeout(()=>{$("#node-input-sink-target-container-div").treeList("data",window._introSpectionsinkStack.sort(o).slice(0,n).map(e=>i(e)))},20)},100)},s=()=>{let e=window._introSpectionsinkStack.length;setTimeout(()=>{$("#node-input-sink-start-but").prop("disabled",!1),$("#node-input-sink-totalPaths").html(e),$("#node-input-sink-spinner").hide()},10);var t="sink",n=e;$(`#node-input-${t}-show-percent`).show(),$(`#node-input-${t}-show-ordering`).show();var o,i=$(`#node-input-${t}-show-percent`),a=(i.html(""),i.append($("<option></option>").val("-").html("Show..")),[5,10,20,30,40,50,75].forEach(e=>{var t=parseInt(e*n/100);0!=t&&i.append($("<option></option>").val(e).html(t+" paths"))}),i.append($("<option></option>").val(100).html("All")),i.val("-"),(i=$(`#node-input-${t}-show-ordering`)).html(""),{"Count Asc":1,"Count Desc":2,"Name Asc":3,"Name Desc":4,Random:5});for(o in a)i.append($("<option></option>").val(a[o]).html(o));i.val(1),$("#node-input-sink-show-ordering").on("change",l),$("#node-input-sink-show-percent").on("change",l),$("#node-input-sink-show-percent").trigger("change")};$("#node-input-sink-show-pathway-but").on("click",e=>{e&&e.preventDefault();var e=$("#node-input-sink-target-container-div").treeList("data").filter(e=>e.expanded);1==(e=e).length?(e=e[0].children.filter(e=>e.node.z==RED.workspaces.active()).map(e=>e.node.id),RED.tray.hide(),RED.view.selectNodes({selected:e,onselect:()=>{RED.tray.show()},oncancel:()=>{RED.tray.show()}})):RED.notify("Only one expanded pathway can be shown.",{type:"warning"})}),$("#node-input-sink-extract-pathway-but").on("click",e=>{e&&e.preventDefault(),(e=>{if(1==e.length){e=e[0].children.map(e=>e.node).filter(e=>["link in","link out","Seeker","Sink","junction"].indexOf(e.type)<0);let o=RED.nodes.createExportableNodeSet(e).map(e=>(e.id=RED.nodes.id(),e)),i=0;o=o.map((e,t)=>{try{var n;e._def=e._def||RED.nodes.getType(e.type),e._def&&e._def._&&e._?(n=RED.utils.getNodeLabel(e,e.info).split("\\n").length,i+=30*n+30):i+=50}catch(e){i+=50}return delete e.z,e.y=i,e.x=0,e.wires=[[]],t!=o.length-1&&(e.wires=[[o[t+1].id]]),e}),RED.clipboard.copyText(JSON.stringify(o))&&RED.notify("Pathway copied to clipboard",{type:"success"})}else RED.notify("Only one expanded pathway can be extracted.",{type:"warning"})})($("#node-input-sink-target-container-div").treeList("data").filter(e=>e.expanded))}),$("#node-input-sink-start-but").on("click",e=>{if(e&&e.preventDefault(),setTimeout(()=>{$("#node-input-sink-start-but").prop("disabled",!0),$("#node-input-sink-totalPaths").html(""),$("#node-input-sink-spinner").show(),$("#node-input-sink-show-percent").hide(),$("#node-input-sink-show-ordering").hide()},10),window._introSpectionsinkStack=[],"undefined"!=typeof Worker){let t=new Worker("data:text/javascript;base64,bGV0IGludHJvU3BlY3Rpb25TdGFjaz1bXSxncmFwaD1bXSxncmFwaEluZGV4PXt9LFJFRD17bm9kZXM6e25vZGU6ZT0+Z3JhcGhbZ3JhcGhJbmRleFtlXV0sZ2V0Tm9kZUxpbmtzOnM9PnMuaW53aXJlcy5tYXAoZT0+KHt0YXJnZXQ6cyxzb3VyY2U6UkVELm5vZGVzLm5vZGUoZSl9KSl9fTt2YXIgdHJhdmVyc2U9ZnVuY3Rpb24ocyxhKXtpZihhLmluZGV4T2Yocy5pZCk8MCYmIXMuZClzd2l0Y2gocy50eXBlKXtjYXNlImxpbmsgaW4iOnMubGlua3MuZm9yRWFjaChlPT57ZT1SRUQubm9kZXMubm9kZShlKTtlJiZ0cmF2ZXJzZShlLFsuLi5hLHMuaWRdKX0pO2JyZWFrO2Nhc2UiU2Vla2VyIjphLnB1c2gocy5pZCkscG9zdE1lc3NhZ2UoYSk7YnJlYWs7ZGVmYXVsdDpSRUQubm9kZXMuZ2V0Tm9kZUxpbmtzKHMpLmZvckVhY2goZT0+e3RyYXZlcnNlKGUuc291cmNlLFsuLi5hLHMuaWRdKX0pfX07b25tZXNzYWdlPWZ1bmN0aW9uKGUpe2xldCBzPWUuZGF0YS5zaW5rSWQ7KGdyYXBoPShncmFwaD1lLmRhdGEubm9kZXMubWFwKGU9Pih7d2lyZXM6ZS53aXJlcyxsaW5rczplLmxpbmtzLGQ6ZS5kaXNhYmxlZHx8ZS5kLGlkOmUuaWQsdHlwZTplLnR5cGV9KSkuZmlsdGVyKGU9PiEhZS53aXJlcykubWFwKGU9PihlLmZsYXR3aXJlcz1lLndpcmVzLmZsYXQoKSxlKSkpLm1hcChzPT4ocy5pbndpcmVzPWdyYXBoLmZpbHRlcihlPT4tMTxlLmZsYXR3aXJlcy5pbmRleE9mKHMuaWQpKS5tYXAoZT0+ZS5pZCkscykpKS5mb3JFYWNoKChlLHMpPT5ncmFwaEluZGV4W2UuaWRdPXMpLFJFRC5ub2Rlcy5nZXROb2RlTGlua3MoUkVELm5vZGVzLm5vZGUocykpLmZvckVhY2goZT0+e3RyYXZlcnNlKGUuc291cmNlLFtzXSl9KSxwb3N0TWVzc2FnZSgiZG9uZSIpfTs=");(window._introWorker=t).onmessage=function(e){"done"==e.data?(t.terminate(),delete window._introWorker,s()):(window._introSpectionsinkStack.push(e.data),$("#node-input-sink-totalPaths").html(window._introSpectionsinkStack.length),26==window._introSpectionsinkStack.length&&$("#node-input-sink-target-container-div").treeList("data",window._introSpectionsinkStack.sort((e,t)=>e.length<t.length?-1:1).slice(0,25).map(e=>i(e))))},setTimeout(()=>{t.postMessage({sinkId:n.id,nodes:RED.nodes.createCompleteNodeSet({credentials:!1})})},10)}else setTimeout(()=>{RED.nodes.getNodeLinks(n,o).forEach(e=>{d(e.source,[n.id])}),s()},300)})},oneditsave:function(){window._introWorker&&(window._introWorker.terminate(),delete window._introWorker),delete window._introSpectionsinkStack},oneditcancel:function(){window._introWorker&&(window._introWorker.terminate(),delete window._introWorker),delete window._introSpectionsinkStack},oneditresize:function(e){for(var t=$("#dialog-form>div:not(.node-input-target-list-row)"),n=$("#dialog-form").height(),o=0;o<t.length;o++)n-=$(t[o]).outerHeight(!0);$("#dialog-form>div.node-input-target-list-row").css("height",n+"px")}});
|
|
3
3
|
</script>
|
|
4
4
|
|
|
5
5
|
<script type="text/html" data-template-name="Sink">
|
package/package.json
CHANGED
package/plugins/sidebar.html
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
function setupTreelist(){var e=collectOrphans();if(0==e.length){RED.notify("No Orphans Found",{type:"success",timeout:2e3});try{$("#node-input-orphan-target-container-div").treeList("empty")}catch(e){}}else{try{$("#node-input-orphan-target-container-div").treeList("empty")}catch(e){$("#node-input-orphan-target-container-div").css({width:"100%",height:"calc(100%)"}).treeList({multi:!1}).on("treelistitemmouseover",function(e,t){}).on("treelistitemmouseout",function(e,t){}).on("treelistselect",function(e,t){t.node&&(RED.workspaces.show(t.node.z,!1,!1,!0),RED.view.reveal(t.node.id,!0),RED.view.redraw())}).on("treelistconfirm",function(e,t){var n;t.node&&(n=t.node.id,setTimeout(()=>{var e=RED.nodes.node(n);e&&(RED.view.reveal(e.id),RED.view.select(e.id),RED.editor.edit(e)),n==RED.workspaces.active()&&RED.workspaces.edit()},50))}),$("#node-input-orphan-target-filter").show();var n=$("#node-input-orphan-target-filter").searchBox({style:"compact",delay:300,change:function(){var e,t=$(this).val().trim().toLowerCase();""===t?($("#node-input-orphan-target-container-div").treeList("filter",null),n.searchBox("count","")):(e=$("#node-input-orphan-target-container-div").treeList("filter",function(e){return-1<e.label.toLowerCase().indexOf(t)||-1<e.node.type.toLowerCase().indexOf(t)}),n.searchBox("count",e+" / "+$("#node-input-orphan-target-container-div").treeList("data").length))}})}$("#node-input-orphan-target-container-div").treeList("data",e.sort((e,t)=>e.node.z>t.node.z))}}function collectOrphans(){let t=new Set;var n=[],i=(RED.nodes.eachLink(e=>{t.add(e.source),t.add(e.target)}),RED.nodes.eachNode(e=>{(!t.has(e)||"link out"==e.type&&"link"==e.mode&&0==e.links.reduce((e,t)=>e||!!RED.nodes.node(t),!1))&&n.push(e)}),[]),r={};return n.forEach(function(e){var t=RED.nodes.getType(e.type);if(t){var n=t.label,n=("function"==typeof n?n.call(e):n)||"",o=e.type;if(0===o.indexOf("subflow:"))return}t&&n||(n=e.type),r[e.id]={node:e,label:n,sublabel:o,selected:!1,checkbox:!1},i.push(r[e.id])}),i}
|
|
8
8
|
|
|
9
|
-
function nr_intro_generate_svg_4_0(r,t){return e=>{try{handleSvgObject($($("#red-ui-workspace-chart").find("svg")[0]),e,t)}catch(t){var n="Error Generating SVG: "+JSON.stringify(t);r.notify(n,{type:"error"}),e('<?xml version="1.0" encoding="UTF-8" standalone="no"?><svg width="1000" height="1000" viewBox="0 0 1000 1000" pointer-events="all" style="cursor: crosshair; touch-action: none;" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><style>.small { font: bold 20px sans-serif; fill: red;}</style><text x="10" y="30" class="small">'+n+"</text></svg>")}}}function nr_intro_generate_svg_3_1(r,t){return e=>{try{handleSvgObject($($("#red-ui-workspace-chart").find("svg")[0]),e,t)}catch(t){var n="Error Generating SVG: "+JSON.stringify(t);r.notify(n,{type:"error"}),e('<?xml version="1.0" encoding="UTF-8" standalone="no"?><svg width="1000" height="1000" viewBox="0 0 1000 1000" pointer-events="all" style="cursor: crosshair; touch-action: none;" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><style>.small { font: bold 20px sans-serif; fill: red;}</style><text x="10" y="30" class="small">'+n+"</text></svg>")}}}function nr_intro_generate_svg_3_0(r,t){return e=>{try{handleSvgObject($($("svg")[0]),e,t)}catch(t){var n="Error Generating SVG: "+JSON.stringify(t);r.notify(n,{type:"error"}),e('<?xml version="1.0" encoding="UTF-8" standalone="no"?><svg width="1000" height="1000" viewBox="0 0 1000 1000" pointer-events="all" style="cursor: crosshair; touch-action: none;" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><style>.small { font: bold 20px sans-serif; fill: red;}</style><text x="10" y="30" class="small">'+n+"</text></svg>")}}}function handleSvgObject(a,e
|
|
9
|
+
function nr_intro_generate_svg_4_0(r,t){return e=>{try{handleSvgObject($($("#red-ui-workspace-chart").find("svg")[0]),e,t)}catch(t){var n="Error Generating SVG: "+JSON.stringify(t);r.notify(n,{type:"error"}),e('<?xml version="1.0" encoding="UTF-8" standalone="no"?><svg width="1000" height="1000" viewBox="0 0 1000 1000" pointer-events="all" style="cursor: crosshair; touch-action: none;" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><style>.small { font: bold 20px sans-serif; fill: red;}</style><text x="10" y="30" class="small">'+n+"</text></svg>")}}}function nr_intro_generate_svg_3_1(r,t){return e=>{try{handleSvgObject($($("#red-ui-workspace-chart").find("svg")[0]),e,t)}catch(t){var n="Error Generating SVG: "+JSON.stringify(t);r.notify(n,{type:"error"}),e('<?xml version="1.0" encoding="UTF-8" standalone="no"?><svg width="1000" height="1000" viewBox="0 0 1000 1000" pointer-events="all" style="cursor: crosshair; touch-action: none;" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><style>.small { font: bold 20px sans-serif; fill: red;}</style><text x="10" y="30" class="small">'+n+"</text></svg>")}}}function nr_intro_generate_svg_3_0(r,t){return e=>{try{handleSvgObject($($("svg")[0]),e,t)}catch(t){var n="Error Generating SVG: "+JSON.stringify(t);r.notify(n,{type:"error"}),e('<?xml version="1.0" encoding="UTF-8" standalone="no"?><svg width="1000" height="1000" viewBox="0 0 1000 1000" pointer-events="all" style="cursor: crosshair; touch-action: none;" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><style>.small { font: bold 20px sans-serif; fill: red;}</style><text x="10" y="30" class="small">'+n+"</text></svg>")}}}function handleSvgObject(a,t,e){var n=a.clone(),r=(n.find("foreignObject").remove(),n.find("svg.__screenshot").remove(),'width="'+a.attr("width")+'" height="'+a.attr("height")+'"'),s=RED.settings.version.split("."),i=parseInt(s[0]),s=parseInt(s[1]);if(3<=i&&1<=s||4<=i){var o=$($($(a).children("g")[0]).children("g")[0]).children("g"),l={x:8e3,y:8e3,w:-1,h:-1};for(let t=1;t<o.length;t++){var g=o[t].getBBox();0==g.width&&0==g.height||(l.x=Math.min(g.x,l.x),l.y=Math.min(g.y,l.y),l.w=Math.max(g.width,l.w),l.h=Math.max(g.height,l.h))}r+=` viewBox='${l.x} ${l.y} ${l.w} ${l.h}'`}function c(t,e){for(var n=0;n<t.length;n++){var s=t.item(n),i=e[n];["stroke-width","fill-opacity","stroke-opacity","opacity","stroke-dasharray"].forEach(function(t){s.setAttribute(t,$(i).attr(t)||$(i).css(t))}),["fill","stroke"].forEach(function(t){var e,n,r=(e=$(i).attr(t)||$(i).css(t))&&null!==e&&"none"!=e?(n=e.match(/^#(.)(.)(.)$/))?"#"+n[1]+n[1]+n[2]+n[2]+n[3]+n[3]:(n=e.match(/^#......$/))?e:null===(n=e.match(/^rgb\(([0-9]+),\s+([0-9]+),\s+([0-9]+)/))?(r=e.match(/^rgba\(([0-9]+),\s+([0-9]+),\s+([0-9]+),\s+([0-9]+)/))?{clr:"#"+("0"+parseInt(r[1],10).toString(16)).slice(-2)+("0"+parseInt(r[2],10).toString(16)).slice(-2)+("0"+parseInt(r[3],10).toString(16)).slice(-2),opa:r[4]}:(console.log("Screenshot node: returned unknown color: "+e),e):"#"+("0"+parseInt(n[1],10).toString(16)).slice(-2)+("0"+parseInt(n[2],10).toString(16)).slice(-2)+("0"+parseInt(n[3],10).toString(16)).slice(-2):"none";"object"==typeof r?(s.setAttribute(t+"-opacity",r.opa),s.setAttribute(t,r.clr)):s.setAttribute(t,r)}),$(i).hasClass("hide")&&("g"==s.tagName&&s.setAttribute("opacity","0"),s.setAttribute("visibility","hidden"))}}var s='<?xml version="1.0" standalone="no"?>\r\n<svg '+r+' pointer-events="all" style="cursor: crosshair; touch-action: none;" xmlns="http://www.w3.org/2000/svg" class="__screenshot" xmlns:xlink="http://www.w3.org/1999/xlink">\r\n',i=n.html(),h=(new DOMParser).parseFromString(s+i+"\r\n</svg>","image/svg+xml"),v=t=>t,f=(e.rmidsandclasses&&(v=e=>(["g","rect","line","path","circle","image","text"].forEach(t=>{$(e.getElementsByTagName(t)).each((t,e)=>{e.setAttribute("class",""),e.setAttribute("id","")})}),e)),["g","rect","line","path","circle","image"].forEach(function(t){c(h.getElementsByTagName(t),a.find(t))}),["text"].forEach(function(t){c(h.getElementsByTagName(t),a.find(t));for(var e=h.getElementsByTagName(t),n=a.find(t),r=0;r<e.length;r++){var s=e.item(r),i=n[r];["font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","text-anchor","dominant-baseline"].forEach(function(t){s.setAttribute(t,$(i).attr(t)||$(i).css(t))})}}),h.getElementsByTagName("image")),w={},m=(n,r,s)=>{var i=n.getAttribute("xlink:href")||n.getAttribute("href"),a=i.substr(-4,4).toLowerCase(),o={".jpg":"jpeg",jpeg:"jpeg",".png":"png",".svg":"svg+xml"};if(w[i])return n.setAttribute("xlink:href","data:image/"+o[a]+";base64,"+w[i]),s(r-1);switch(a){case".jpg":case"jpeg":case".png":var l=new XMLHttpRequest;l.open("GET",i,!0),l.responseType="arraybuffer";l.onerror=function(t){s(r-1)},l.onload=function(t){var e=l.response;e&&(e=(t=>{for(var e="",n=new Uint8Array(t),r=n.byteLength,s=0;s<r;s++)e+=String.fromCharCode(n[s]);return window.btoa(e)})(e),w[i]=e,n.setAttribute("xlink:href","data:image/"+o[a]+";base64,"+e)),s(r-1)},l.send(null);break;case".svg":$.get(i,function(t){var e=new XMLSerializer,e=btoa(e.serializeToString(t));w[i]=e,n.setAttribute("xlink:href","data:image/svg+xml;base64,"+e),s(r-1)})}},d=e=>{if(e<0)t((new XMLSerializer).serializeToString(v(h)));else try{m(f.item(e),e,d)}catch(t){d(e-1)}};0<f.length?m(f.item(f.length-1),f.length-1,d):t((new XMLSerializer).serializeToString(v(h)))}function generatorFunctionForVersion(t,e){var n,r=t.settings.version.split("."),s=r[0],r=r[1];if("3"==s){if("0"==r)return nr_intro_generate_svg_3_0(t,e);if("1"==r)return nr_intro_generate_svg_3_1(t,e)}return"4"==s&&"0"==r?nr_intro_generate_svg_4_0(t,e):(n=t,t=>{var e="Node-RED version ("+n.settings.version+") not supported";n.notify(e,{type:"error"}),t&&t('<?xml version="1.0" encoding="UTF-8" standalone="no"?><svg width="1000" height="1000" viewBox="0 0 1000 1000" pointer-events="all" style="cursor: crosshair; touch-action: none;" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><style>.small { font: bold 20px sans-serif; fill: red;}</style><text x="10" y="30" class="small">'+e+"</text></svg>")})}function addPanZoom(){var t=d3.select("#node-input-screenshot-svgcontainer svg"),e=(t.html("<g>"+t.html()+"</g>"),setTimeout(()=>{var t=$("#node-input-screenshot-svgcontainer svg"),e=$(t).attr("viewBox").split(" ");t.animate({height:parseInt(e[3]),width:parseInt(e[2])},800,"swing")},100),t.select("g")),n=d3.behavior.zoom().scaleExtent([.1,200]).on("zoom",function(t){e.attr({transform:"translate("+n.translate()+") scale("+n.scale()+")"})});t.call(n)}
|
|
10
10
|
|
|
11
11
|
function setupTreelistInfoness(){var e=collectUndocumentedNodes();if(0==e.length){RED.notify("All nodes documented",{type:"success",timeout:2e3});try{$("#node-input-orphan-target-container-div").treeList("empty")}catch(e){}}else{try{$("#node-input-orphan-target-container-div").treeList("empty")}catch(e){$("#node-input-orphan-target-container-div").css({width:"100%",height:"calc(100%)"}).treeList({multi:!1}).on("treelistitemmouseover",function(e,t){}).on("treelistitemmouseout",function(e,t){}).on("treelistselect",function(e,t){t.node&&(RED.workspaces.show(t.node.z,!1,!1,!0),RED.view.reveal(t.node.id,!0),RED.view.redraw())}).on("treelistconfirm",function(e,t){var i;t.node&&(i=t.node.id,setTimeout(()=>{var e=RED.nodes.node(i);e&&(RED.view.reveal(e.id),RED.view.select(e.id),RED.editor.edit(e,"editor-tab-description")),i==RED.workspaces.active()&&RED.workspaces.edit()},50))}),$("#node-input-orphan-target-filter").show();var i=$("#node-input-orphan-target-filter").searchBox({style:"compact",delay:300,change:function(){var e,t=$(this).val().trim().toLowerCase();""===t?($("#node-input-orphan-target-container-div").treeList("filter",null),i.searchBox("count","")):(e=$("#node-input-orphan-target-container-div").treeList("filter",function(e){return-1<e.label.toLowerCase().indexOf(t)||-1<e.node.type.toLowerCase().indexOf(t)}),i.searchBox("count",e+" / "+$("#node-input-orphan-target-container-div").treeList("data").length))}})}$("#node-input-orphan-target-container-div").treeList("data",e.sort((e,t)=>e.node.z>t.node.z))}}function collectUndocumentedNodes(){let t=[];RED.nodes.eachNode(e=>{if($("#"+e.id).find(".red-ui-info-available-indicator").remove(),e.info&&e.info.trim()&&$("#"+e.id)[0]){var i=document.createElementNS("http://www.w3.org/2000/svg","g"),n=(i.setAttribute("class","red-ui-info-available-indicator"),i.setAttribute("transform","translate(20,10)"),i.setAttribute("id","infoclk-"+e.id),document.createElementNS("http://www.w3.org/2000/svg","g")),o=(n.setAttribute("class","tip"),n.setAttribute("fill","lightyellow"),document.createElementNS("http://www.w3.org/2000/svg","rect")),o=(o.setAttribute("width","30"),o.setAttribute("height","20"),o.setAttribute("x",$("#"+e.id)[0].getBBox().width-60),o.setAttribute("y","-15"),o.setAttribute("rx","2"),o.setAttribute("style","cursor: pointer;"),n.append(o),document.createElementNS("http://www.w3.org/2000/svg","text"));o.setAttribute("x",$("#"+e.id)[0].getBBox().width-55),o.setAttribute("y","-6"),o.appendChild(document.createTextNode("docs")),n.append(o),i.append(n),$(i).insertBefore($("#"+e.id).find(".red-ui-flow-node"));let t=e.id;$("#infoclk-"+e.id).on("click",e=>{e&&e.preventDefault();e=RED.nodes.node(t);RED.editor.edit(e,"editor-tab-description"),RED.sidebar.show("info")})}else e.z==RED.workspaces.active()&&["link in","link out","link call"].indexOf(e.type)<0&&t.push(e)});var o=[],r={};return t.forEach(function(e){var t=RED.nodes.getType(e.type);if(t){var i,n=t.label,n=("function"==typeof n?n.call(e):n)||"";if(0===(i=e.type).indexOf("subflow:"))return}t&&n||(n=e.type),r[e.id]={node:e,label:n,sublabel:i,selected:!1,checkbox:!1},o.push(r[e.id])}),o}
|
|
12
12
|
|
|
@@ -281,6 +281,14 @@
|
|
|
281
281
|
if ( e ) { e.preventDefault() }
|
|
282
282
|
setupTreeListForNodeStats()
|
|
283
283
|
})
|
|
284
|
+
|
|
285
|
+
RED.panels.create({
|
|
286
|
+
id: 'func-introspection-tab-lint',
|
|
287
|
+
resize: (topSze,botSze) => {
|
|
288
|
+
$('#node-input-msgtracer-trace-treelist').parent().css("height", `calc(${botSze}px - 13vh)`)
|
|
289
|
+
$('#node-input-orphan-target-container-div').parent().css('height', `calc(${topSze}px - 15vh)`)
|
|
290
|
+
}
|
|
291
|
+
})
|
|
284
292
|
};
|
|
285
293
|
RED.events.on('runtime-state', initialiseConfigNodeOnce);
|
|
286
294
|
})();
|
|
@@ -402,80 +410,83 @@
|
|
|
402
410
|
<!-- Lint Tab in Sidebar -->
|
|
403
411
|
|
|
404
412
|
<div id="func-introspection-tab-lint" style="display:none; min-height: calc(100%);">
|
|
405
|
-
<div
|
|
406
|
-
<
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
<div class="form-row"
|
|
423
|
-
style="margin-left: 10px; position: relative; min-height: 200px; height: 430px; margin-right: 15px;">
|
|
424
|
-
<div style="margin-bottom: 5px; width: 35%; padding-left: 60%;">
|
|
425
|
-
<input type="text" id="node-input-orphan-target-filter" style="display: none;">
|
|
413
|
+
<div>
|
|
414
|
+
<div class="form-row" style="margin-left: 10px; margin-top: 30px">
|
|
415
|
+
<button id="node-input-orphan-find-btn"
|
|
416
|
+
class="red-ui-button"><i class="fa fa-life-ring"></i> Unconnected</button>
|
|
417
|
+
<button id="node-input-documentation-find-btn"
|
|
418
|
+
class="red-ui-button"><i class="fa fa-cc"></i> Undocumented</button>
|
|
419
|
+
<button id="node-input-linkin-nodes-find-btn"
|
|
420
|
+
class="red-ui-button"><i class="fa fa-link"></i> Link Ins</button>
|
|
421
|
+
<button id="node-input-linkcalls-find-btn"
|
|
422
|
+
class="red-ui-button"><i class="fa fa-link"></i> Link Calls</button>
|
|
423
|
+
<button id="node-input-orphan-clear-workspace-btn"
|
|
424
|
+
class="red-ui-button">Clear dots</button>
|
|
425
|
+
<button id="node-input-transform-inject-to-change-btn"
|
|
426
|
+
class="red-ui-button"><i class='icon-button' style="background-image: url('icons/@gregoriusrippenstein/node-red-contrib-introspection/swap-inject-to-change.svg');"></i><span class='icon-button-text'>Inj->Chg</span></button>
|
|
427
|
+
<button id="node-input-statistics-btn"
|
|
428
|
+
class="red-ui-button"><i class="fa fa-pie-chart"></i> Stats</button>
|
|
426
429
|
</div>
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
<i class="fa fa-stethoscope"></i>
|
|
435
|
-
<span>Trace selected nodes?</span>
|
|
436
|
-
</label>
|
|
437
|
-
<input type="checkbox" id="node-input-msgtracer-toggle"
|
|
438
|
-
style="display:inline-block; width:15px; vertical-align:baseline;">
|
|
439
|
-
|
|
440
|
-
<label for="node-input-msgtracer-toggle-all" class="w-25">
|
|
441
|
-
<i class="fa fa-warning"></i>
|
|
442
|
-
<span>All nodes?</span>
|
|
443
|
-
</label>
|
|
444
|
-
<input type="checkbox" id="node-input-msgtracer-toggle-all"
|
|
445
|
-
style="display:inline-block; width:15px; vertical-align:baseline;">
|
|
446
|
-
|
|
447
|
-
<button id="node-input-msgtrace-clear-trace-btn" style="margin-left: 10px;"
|
|
448
|
-
class="red-ui-button">Clear Trace</button>
|
|
449
|
-
</div>
|
|
450
|
-
|
|
451
|
-
<div class="form-row"
|
|
452
|
-
style="margin-left: 10px; position: relative; min-height: 200px; height: 430px; margin-right: 15px;">
|
|
453
|
-
<div style="margin-bottom: 5px; width: 35%; padding-left: 60%;">
|
|
454
|
-
<input type="text" id="node-input-msgtracer-trace-treelist-filter" style="display: none;">
|
|
430
|
+
|
|
431
|
+
<div class="form-row"
|
|
432
|
+
style="margin-left: 10px; position: relative; min-height: 5vh; height: 20vh; margin-right: 15px;">
|
|
433
|
+
<div style="margin-bottom: 5px; width: 35%; padding-left: 60%;">
|
|
434
|
+
<input type="text" id="node-input-orphan-target-filter" style="display: none;">
|
|
435
|
+
</div>
|
|
436
|
+
<div id="node-input-orphan-target-container-div"></div>
|
|
455
437
|
</div>
|
|
456
|
-
<div id="node-input-msgtracer-trace-treelist"></div>
|
|
457
438
|
</div>
|
|
458
|
-
|
|
459
|
-
<div class="form-row" style="margin-left: 10px; margin-top: 40px;">
|
|
460
|
-
<label for="node-input-msgtracer-msgtodebug" class="w-25">
|
|
461
|
-
<i class="fa fa-bug"></i>
|
|
462
|
-
<span>Msgs from selected nodes to Debug?</span>
|
|
463
|
-
</label>
|
|
464
|
-
<input type="checkbox" id="node-input-msgtracer-msgtodebug"
|
|
465
|
-
style="display:inline-block; width:15px; vertical-align:baseline;">
|
|
466
439
|
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
440
|
+
<div>
|
|
441
|
+
<!-- message tracing stuff -->
|
|
442
|
+
|
|
443
|
+
<div class="form-row" style="margin-left: 10px; margin-top: 40px">
|
|
444
|
+
<label for="node-input-msgtracer-toggle" class="w-25">
|
|
445
|
+
<i class="fa fa-stethoscope"></i>
|
|
446
|
+
<span>Trace selected nodes?</span>
|
|
447
|
+
</label>
|
|
448
|
+
<input type="checkbox" id="node-input-msgtracer-toggle"
|
|
449
|
+
style="display:inline-block; width:15px; vertical-align:baseline;">
|
|
450
|
+
|
|
451
|
+
<label for="node-input-msgtracer-toggle-all" class="w-25">
|
|
452
|
+
<i class="fa fa-warning"></i>
|
|
453
|
+
<span>All nodes?</span>
|
|
454
|
+
</label>
|
|
455
|
+
<input type="checkbox" id="node-input-msgtracer-toggle-all"
|
|
456
|
+
style="display:inline-block; width:15px; vertical-align:baseline;">
|
|
457
|
+
|
|
458
|
+
<button id="node-input-msgtrace-clear-trace-btn" style="margin-left: 10px;"
|
|
459
|
+
class="red-ui-button">Clear Trace</button>
|
|
460
|
+
</div>
|
|
461
|
+
|
|
462
|
+
<div class="form-row"
|
|
463
|
+
style="margin-left: 10px; position: relative; min-height: 5vh; height: 20vh; margin-right: 15px;">
|
|
464
|
+
<div style="margin-bottom: 5px; width: 35%; padding-left: 60%;">
|
|
465
|
+
<input type="text" id="node-input-msgtracer-trace-treelist-filter" style="display: none;">
|
|
466
|
+
</div>
|
|
467
|
+
<div id="node-input-msgtracer-trace-treelist"></div>
|
|
468
|
+
</div>
|
|
469
|
+
|
|
470
|
+
<div class="form-row" style="margin-left: 10px; margin-top: 40px;">
|
|
471
|
+
<label for="node-input-msgtracer-msgtodebug" class="w-25">
|
|
472
|
+
<i class="fa fa-bug"></i>
|
|
473
|
+
<span>Msgs from selected nodes to Debug?</span>
|
|
474
|
+
</label>
|
|
475
|
+
<input type="checkbox" id="node-input-msgtracer-msgtodebug"
|
|
476
|
+
style="display:inline-block; width:15px; vertical-align:baseline;">
|
|
477
|
+
|
|
478
|
+
<label for="node-input-msgtracer-msgtodebug-all" class="w-25">
|
|
479
|
+
<i class="fa fa-warning"></i>
|
|
480
|
+
<span>All nodes?</span>
|
|
481
|
+
</label>
|
|
482
|
+
<input type="checkbox" id="node-input-msgtracer-msgtodebug-all"
|
|
483
|
+
style="display:inline-block; width:15px; vertical-align:baseline;">
|
|
484
|
+
|
|
485
|
+
<button id="node-input-msgtrace-clear-debug-btn" style="margin-left: 10px;"
|
|
486
|
+
class="red-ui-button">Clear Debug</button>
|
|
487
|
+
</div>
|
|
476
488
|
</div>
|
|
477
489
|
</div>
|
|
478
|
-
|
|
479
490
|
<!-- Obfuscation Tab in Sidebar -->
|
|
480
491
|
|
|
481
492
|
<div id="func-introspection-tab-obfuscation" style="display:none; min-height: calc(100%);">
|