@gregoriusrippenstein/node-red-contrib-introspection 0.9.9 → 0.9.10
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 +8 -1
- package/nodes/10-sink.html +8 -3
- package/package.json +1 -1
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,o=(window._introSpectionSeekerStack=[],$("#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))}}));$("#node-input-seeker-target-container-div").css({width:"100%",height:"95%"}).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){var n;t.node&&(t.children?(n=t.children.filter(e=>e.node.z==RED.workspaces.active()).map(e=>e.node.id),RED.tray.hide(),RED.view.selectNodes({selected:n,onselect:()=>{RED.tray.show()},oncancel:()=>{RED.tray.show()}})):(RED.workspaces.show(t.node.z,!1,!1,!0),RED.view.reveal(t.node.id,!0),RED.view.redraw()))});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);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)}))}),{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 r=function(t,n){if(n.indexOf(t.id)<0)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])})}};$("#node-input-seeker-start-but").on("click",e=>{e&&e.preventDefault(),$("#node-input-seeker-start-but").prop("disabled",!0),$("#node-input-seeker-totalPaths").html(""),$("#node-input-seeker-spinner").show(),window._introSpectionSeekerStack=[],setTimeout(()=>{RED.nodes.getNodeLinks(n).forEach(e=>{r(e.target,[n.id])});var t,e=window._introSpectionSeekerStack.length;$("#node-input-seeker-start-but").prop("disabled",!1),$("#node-input-seeker-totalPaths").html(e),$("#node-input-seeker-spinner").hide(),50<e?($("#node-input-seeker-show-percent").show(),(t=$("#node-input-seeker-show-percent")).html(""),["-",5,10,20,30,40,50,75,100].forEach(function(e){t.append($("<option></option>").val(e).html(100==e?"All":"-"==e?"Select..":e+"%"))}),t.val("-"),$("#node-input-seeker-show-percent").on("change",e=>{e&&e.preventDefault();e=window._introSpectionSeekerStack.length;let t=25;"-"!=$("#node-input-seeker-show-percent").val()&&(t=parseInt(e*(parseInt($("#node-input-seeker-show-percent").val())/100))),$("#node-input-seeker-totalPaths").html(t+" / "+e),setTimeout(()=>{$("#node-input-seeker-target-container-div").treeList("data",window._introSpectionSeekerStack.sort((e,t)=>e.length<t.length?-1:1).slice(0,t).map(e=>i(e)))},300)}),$("#node-input-seeker-show-percent").trigger("change")):setTimeout(()=>{$("#node-input-seeker-target-container-div").treeList("data",window._introSpectionSeekerStack.sort((e,t)=>e.length<t.length?-1:1).map(e=>i(e)))},300)},300)})},oneditsave:function(){delete window._introSpectionSeekerStack},oneditcancel:function(){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")}});
|
|
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,o=(window._introSpectionSeekerStack=[],$("#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))}}));$("#node-input-seeker-target-container-div").css({width:"100%",height:"95%"}).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){var n;t.node&&(t.children?(n=t.children.filter(e=>e.node.z==RED.workspaces.active()).map(e=>e.node.id),RED.tray.hide(),RED.view.selectNodes({selected:n,onselect:()=>{RED.tray.show()},oncancel:()=>{RED.tray.show()}})):(RED.workspaces.show(t.node.z,!1,!1,!0),RED.view.reveal(t.node.id,!0),RED.view.redraw()))});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 r=function(t,n){if(n.indexOf(t.id)<0)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])})}};$("#node-input-seeker-start-but").on("click",e=>{e&&e.preventDefault(),$("#node-input-seeker-start-but").prop("disabled",!0),$("#node-input-seeker-totalPaths").html(""),$("#node-input-seeker-spinner").show(),window._introSpectionSeekerStack=[],setTimeout(()=>{RED.nodes.getNodeLinks(n).forEach(e=>{r(e.target,[n.id])});var t,e=window._introSpectionSeekerStack.length;$("#node-input-seeker-start-but").prop("disabled",!1),$("#node-input-seeker-totalPaths").html(e),$("#node-input-seeker-spinner").hide(),50<e?($("#node-input-seeker-show-percent").show(),(t=$("#node-input-seeker-show-percent")).html(""),["-",5,10,20,30,40,50,75,100].forEach(function(e){t.append($("<option></option>").val(e).html(100==e?"All":"-"==e?"Select..":e+"%"))}),t.val("-"),$("#node-input-seeker-show-percent").on("change",e=>{e&&e.preventDefault();e=window._introSpectionSeekerStack.length;let t=25;"-"!=$("#node-input-seeker-show-percent").val()&&(t=parseInt(e*(parseInt($("#node-input-seeker-show-percent").val())/100))),$("#node-input-seeker-totalPaths").html(t+" / "+e),setTimeout(()=>{$("#node-input-seeker-target-container-div").treeList("data",window._introSpectionSeekerStack.sort((e,t)=>e.length<t.length?-1:1).slice(0,t).map(e=>i(e)))},300)}),$("#node-input-seeker-show-percent").trigger("change")):setTimeout(()=>{$("#node-input-seeker-target-container-div").treeList("data",window._introSpectionSeekerStack.sort((e,t)=>e.length<t.length?-1:1).map(e=>i(e)))},300)},300)})},oneditsave:function(){delete window._introSpectionSeekerStack},oneditcancel:function(){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">
|
|
@@ -28,6 +28,13 @@ RED.nodes.registerType("Seeker",{color:"#e5e4ef",icon:"font-awesome/fa-ship",cat
|
|
|
28
28
|
|
|
29
29
|
</script>
|
|
30
30
|
|
|
31
|
+
<style>
|
|
32
|
+
.intro-remove-top-left i.red-ui-palette-icon-fa {
|
|
33
|
+
top: -2px !important;
|
|
34
|
+
left: 0px !important;
|
|
35
|
+
}
|
|
36
|
+
</style>
|
|
37
|
+
|
|
31
38
|
<script type="text/html" data-help-name="Seeker">
|
|
32
39
|
<p>The Seeker seeks in the sink and presents all (max 25) paths that lead to the sink.</p>
|
|
33
40
|
</script>
|
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 i=1;window._introSpectionsinkStack=[];var o=$("#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),o.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)}),o.searchBox("count",e+" / "+n.length))}});$("#node-input-sink-target-container-div").css({width:"100%",height:"95%"}).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){var n;t.node&&(t.children?(n=t.children.filter(e=>e.node.z==RED.workspaces.active()).map(e=>e.node.id),RED.tray.hide(),RED.view.selectNodes({selected:n,onselect:()=>{RED.tray.show()},oncancel:()=>{RED.tray.show()}})):(RED.workspaces.show(t.node.z,!1,!1,!0),RED.view.reveal(t.node.id,!0),RED.view.redraw()))});let s=e=>{var t=RED.nodes.node(e[e.length-1]);let n=[];return e.forEach(function(e){var t,e=RED.nodes.node(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)}))}),{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=function(t,n){if(n.indexOf(t.id)<0)switch(t.type){case"link in":t.links.forEach(e=>{e=RED.nodes.node(e);e&&a(e,[...n,t.id])});break;case"Seeker":n.push(t.id),window._introSpectionsinkStack=[n,...window._introSpectionsinkStack];break;default:RED.nodes.getNodeLinks(t,i).forEach(e=>{a(e.source,[...n,t.id])})}};$("#node-input-sink-start-but").on("click",e=>{e&&e.preventDefault(),$("#node-input-sink-start-but").prop("disabled",!0),$("#node-input-sink-totalPaths").html(""),$("#node-input-sink-spinner").show(),window._introSpectionsinkStack=[],setTimeout(()=>{RED.nodes.getNodeLinks(n,i).forEach(e=>{a(e.source,[n.id])});var t,e=window._introSpectionsinkStack.length;$("#node-input-sink-start-but").prop("disabled",!1),$("#node-input-sink-totalPaths").html(e),$("#node-input-sink-spinner").hide(),50<e?($("#node-input-sink-show-percent").show(),(t=$("#node-input-sink-show-percent")).html(""),["-",5,10,20,30,40,50,75,100].forEach(function(e){t.append($("<option></option>").val(e).html(100==e?"All":"-"==e?"Select..":e+"%"))}),t.val("-"),$("#node-input-sink-show-percent").on("change",e=>{e&&e.preventDefault();e=window._introSpectionsinkStack.length;let t=25;"-"!=$("#node-input-sink-show-percent").val()&&(t=parseInt(e*(parseInt($("#node-input-sink-show-percent").val())/100))),$("#node-input-sink-totalPaths").html(t+" / "+e),setTimeout(()=>{$("#node-input-sink-target-container-div").treeList("data",window._introSpectionsinkStack.sort((e,t)=>e.length<t.length?-1:1).slice(0,t).map(e=>s(e)))},300)}),$("#node-input-sink-show-percent").trigger("change")):setTimeout(()=>{$("#node-input-sink-target-container-div").treeList("data",window._introSpectionsinkStack.sort((e,t)=>e.length<t.length?-1:1).map(e=>s(e)))},300)},300)})},oneditsave:function(){delete window._introSpectionsinkStack},oneditcancel:function(){delete window._introSpectionsinkStack},oneditresize:function(e){for(var t=$("#dialog-form>div:not(.node-input-target-list-row)"),n=$("#dialog-form").height(),i=0;i<t.length;i++)n-=$(t[i]).outerHeight(!0);$("#dialog-form>div.node-input-target-list-row").css("height",n+"px")}});
|
|
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 i=1;window._introSpectionsinkStack=[];var o=$("#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),o.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)}),o.searchBox("count",e+" / "+n.length))}});$("#node-input-sink-target-container-div").css({width:"100%",height:"95%"}).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){var n;t.node&&(t.children?(n=t.children.filter(e=>e.node.z==RED.workspaces.active()).map(e=>e.node.id),RED.tray.hide(),RED.view.selectNodes({selected:n,onselect:()=>{RED.tray.show()},oncancel:()=>{RED.tray.show()}})):(RED.workspaces.show(t.node.z,!1,!1,!0),RED.view.reveal(t.node.id,!0),RED.view.redraw()))});let s=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=function(t,n){if(n.indexOf(t.id)<0)switch(t.type){case"link in":t.links.forEach(e=>{e=RED.nodes.node(e);e&&a(e,[...n,t.id])});break;case"Seeker":n.push(t.id),window._introSpectionsinkStack=[n,...window._introSpectionsinkStack];break;default:RED.nodes.getNodeLinks(t,i).forEach(e=>{a(e.source,[...n,t.id])})}};$("#node-input-sink-start-but").on("click",e=>{e&&e.preventDefault(),$("#node-input-sink-start-but").prop("disabled",!0),$("#node-input-sink-totalPaths").html(""),$("#node-input-sink-spinner").show(),window._introSpectionsinkStack=[],setTimeout(()=>{RED.nodes.getNodeLinks(n,i).forEach(e=>{a(e.source,[n.id])});var t,e=window._introSpectionsinkStack.length;$("#node-input-sink-start-but").prop("disabled",!1),$("#node-input-sink-totalPaths").html(e),$("#node-input-sink-spinner").hide(),50<e?($("#node-input-sink-show-percent").show(),(t=$("#node-input-sink-show-percent")).html(""),["-",5,10,20,30,40,50,75,100].forEach(function(e){t.append($("<option></option>").val(e).html(100==e?"All":"-"==e?"Select..":e+"%"))}),t.val("-"),$("#node-input-sink-show-percent").on("change",e=>{e&&e.preventDefault();e=window._introSpectionsinkStack.length;let t=25;"-"!=$("#node-input-sink-show-percent").val()&&(t=parseInt(e*(parseInt($("#node-input-sink-show-percent").val())/100))),$("#node-input-sink-totalPaths").html(t+" / "+e),setTimeout(()=>{$("#node-input-sink-target-container-div").treeList("data",window._introSpectionsinkStack.sort((e,t)=>e.length<t.length?-1:1).slice(0,t).map(e=>s(e)))},300)}),$("#node-input-sink-show-percent").trigger("change")):setTimeout(()=>{$("#node-input-sink-target-container-div").treeList("data",window._introSpectionsinkStack.sort((e,t)=>e.length<t.length?-1:1).map(e=>s(e)))},300)},300)})},oneditsave:function(){delete window._introSpectionsinkStack},oneditcancel:function(){delete window._introSpectionsinkStack},oneditresize:function(e){for(var t=$("#dialog-form>div:not(.node-input-target-list-row)"),n=$("#dialog-form").height(),i=0;i<t.length;i++)n-=$(t[i]).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">
|
|
@@ -24,10 +24,15 @@ RED.nodes.registerType("Sink",{color:"#e5e4ef",icon:"font-awesome/fa-anchor",cat
|
|
|
24
24
|
<span id="node-input-sink-totalPaths"></span><img id="node-input-sink-spinner" class="hide" src='red/images/spin.svg'/>
|
|
25
25
|
</label>
|
|
26
26
|
</div>
|
|
27
|
-
|
|
28
|
-
|
|
29
27
|
</script>
|
|
30
28
|
|
|
29
|
+
<style>
|
|
30
|
+
.intro-remove-top-left i.red-ui-palette-icon-fa {
|
|
31
|
+
top: -2px !important;
|
|
32
|
+
left: 0px !important;
|
|
33
|
+
}
|
|
34
|
+
</style>
|
|
35
|
+
|
|
31
36
|
<script type="text/html" data-help-name="Sink">
|
|
32
37
|
<p>Sink is the end of a chain of nodes to complete a full text.</p>
|
|
33
38
|
</script>
|