@gregoriusrippenstein/node-red-contrib-introspection 0.11.3 → 0.11.5

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.
@@ -10,6 +10,9 @@
10
10
  flowVersion: {
11
11
  value: "v1"
12
12
  },
13
+ useHttps: {
14
+ value: false
15
+ },
13
16
  useAuthentication: {
14
17
  value:false
15
18
  },
@@ -82,9 +85,18 @@
82
85
  </select>
83
86
  </div>
84
87
 
88
+ <div class="form-row">
89
+ <label for="node-input-useHttps">
90
+ <i class="fa fa-clown"></i>
91
+ <span>Use HTTPS?</span>
92
+ </label>
93
+ <input type="checkbox" id="node-input-useHttps"
94
+ style="display:inline-block; width:15px; vertical-align:baseline;">
95
+ </div>
96
+
85
97
  <div class="form-row">
86
98
  <label for="node-input-useAuthentication">
87
- <i class="fa "></i>
99
+ <i class="fa fa-key"></i>
88
100
  <span>Use Authentication?</span>
89
101
  </label>
90
102
 
@@ -12,7 +12,7 @@ module.exports = function(RED) {
12
12
  node.on("input", function(msg, send, done) {
13
13
  var os = require('os');
14
14
 
15
- var baseUrl = "http://" + os.hostname() + ":" + RED.settings.get("uiPort");
15
+ var baseUrl = `${cfg.useHttps ? "https" : "http"}://` + os.hostname() + ":" + RED.settings.get("uiPort");
16
16
  if ( RED.settings.get("httpAdminRoot") != "/" ) {
17
17
  baseUrl += RED.settings.get("httpAdminRoot");
18
18
  }
@@ -22,6 +22,9 @@ module.exports = function(RED) {
22
22
  headers: {
23
23
  "Node-RED-API-Version": cfg.flowVersion,
24
24
  ...hdrs
25
+ },
26
+ https: {
27
+ rejectUnauthorized: false
25
28
  }
26
29
  }).then( res => {
27
30
  var bodySize = res.body.length;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gregoriusrippenstein/node-red-contrib-introspection",
3
- "version": "0.11.3",
3
+ "version": "0.11.5",
4
4
  "dependencies": {
5
5
  "got": "^13",
6
6
  "uglify-js": "^3.17.4",
@@ -10,7 +10,7 @@
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
 
13
- function highlightAllLinkCalls(){let e=[];RED.nodes.eachNode(t=>{t.z==RED.workspaces.active()&&"link call"==t.type&&e.push(t)}),e.forEach(t=>{$("#grplnkcallclk-"+t.id).remove();var e=document.createElementNS("http://www.w3.org/2000/svg","g"),l=(e.setAttribute("class","red-ui-linkcall-link-indicator"),e.setAttribute("transform","translate(12,0)"),e.setAttribute("id","grplnkcallclk-"+t.id),document.createElementNS("http://www.w3.org/2000/svg","circle")),i=(l.setAttribute("cx","5"),l.setAttribute("cy","5"),l.setAttribute("r","5"),l.setAttribute("id","lnkcallclk-"+t.id),l.setAttribute("style","cursor: pointer;"),t.links[0]);i?RED.nodes.node(i)?l.setAttribute("fill","green"):l.setAttribute("fill","red"):l.setAttribute("fill","orange"),e.append(l),$(e).insertBefore($("#"+t.id).find(".red-ui-flow-node-changed"));let r=t.id;$("#lnkcallclk-"+t.id).on("click",t=>{t&&t.preventDefault();t=RED.nodes.node(r);if(t){let l=t.links[0];1<t.links.length&&RED.notify("Multiple links, showing first","warning"),RED.nodes.node(l)?(RED.view.reveal(l),RED.view.select(l),setTimeout(()=>{$("#lnkcallclk-"+l).remove();var t=document.createElementNS("http://www.w3.org/2000/svg","g"),e=(t.setAttribute("class","red-ui-linkcall-link-indicator"),t.setAttribute("transform","translate(12,0)"),t.setAttribute("id","lnkcallclk-"+l),document.createElementNS("http://www.w3.org/2000/svg","circle"));e.setAttribute("cx","5"),e.setAttribute("cy","5"),e.setAttribute("r","5"),e.setAttribute("id","lnkcallclk-"+l),e.setAttribute("style","cursor: pointer;"),e.setAttribute("fill","green"),t.append(e),$(t).insertBefore($("#"+l).find(".red-ui-flow-node-changed")),$("#lnkcallclk-"+l).on("click",t=>{t&&t.preventDefault(),RED.view.reveal(r),RED.view.select(r),setTimeout(highlightAllLinkCalls,500)})},500)):RED.notify("Link in node not found","error")}else RED.notify("Node not found","error")})})}
13
+ function highlightDebugNodesInPanel(e){e&&e.preventDefault(),$(".red-ui-debug-msg").css("background-color",""),RED.view.selection().nodes.forEach(e=>{$(".red-ui-debug-msg-node-"+e.id).css("background-color","red")})}function highlightAllLinkCalls(){let t=[];RED.nodes.eachNode(e=>{e.z==RED.workspaces.active()&&"link call"==e.type&&t.push(e)}),t.forEach(e=>{$("#grplnkcallclk-"+e.id).remove();var t=document.createElementNS("http://www.w3.org/2000/svg","g"),l=(t.setAttribute("class","red-ui-linkcall-link-indicator"),t.setAttribute("transform","translate(12,0)"),t.setAttribute("id","grplnkcallclk-"+e.id),document.createElementNS("http://www.w3.org/2000/svg","circle")),i=(l.setAttribute("cx","5"),l.setAttribute("cy","5"),l.setAttribute("r","5"),l.setAttribute("id","lnkcallclk-"+e.id),l.setAttribute("style","cursor: pointer;"),e.links[0]);i?RED.nodes.node(i)?l.setAttribute("fill","green"):l.setAttribute("fill","red"):l.setAttribute("fill","orange"),t.append(l),$(t).insertBefore($("#"+e.id).find(".red-ui-flow-node-changed"));let r=e.id;$("#lnkcallclk-"+e.id).on("click",e=>{e&&e.preventDefault();e=RED.nodes.node(r);if(e){let l=e.links[0];1<e.links.length&&RED.notify("Multiple links, showing first","warning"),RED.nodes.node(l)?(RED.view.reveal(l),RED.view.select(l),setTimeout(()=>{$("#lnkcallclk-"+l).remove();var e=document.createElementNS("http://www.w3.org/2000/svg","g"),t=(e.setAttribute("class","red-ui-linkcall-link-indicator"),e.setAttribute("transform","translate(12,0)"),e.setAttribute("id","lnkcallclk-"+l),document.createElementNS("http://www.w3.org/2000/svg","circle"));t.setAttribute("cx","5"),t.setAttribute("cy","5"),t.setAttribute("r","5"),t.setAttribute("id","lnkcallclk-"+l),t.setAttribute("style","cursor: pointer;"),t.setAttribute("fill","green"),e.append(t),$(e).insertBefore($("#"+l).find(".red-ui-flow-node-changed")),$("#lnkcallclk-"+l).on("click",e=>{e&&e.preventDefault(),RED.view.reveal(r),RED.view.select(r),setTimeout(highlightAllLinkCalls,500)})},500)):RED.notify("Link in node not found","error")}else RED.notify("Node not found","error")})})}
14
14
 
15
15
  function setupTreelistAllLinksForLinkIn(e){e=collectAllLinksNodes(e);if(0==e.length){RED.notify("No links found",{type:"error",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,"editor-tab-description")),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 collectAllLinksNodes(t){let n=[];RED.nodes.eachNode(e=>{"link call"!=e.type&&"link out"!=e.type||-1<e.links.indexOf(t)&&n.push(e)});var i=[],r={};return n.forEach(function(e){var t=RED.nodes.getType(e.type);if(t){var n,o=t.label,o=("function"==typeof o?o.call(e):o)||"";if(0===(n=e.type).indexOf("subflow:"))return}t&&o||(o=e.type),r[e.id]={node:e,label:o,sublabel:n,selected:!1,checkbox:!1},i.push(r[e.id])}),i}function collectNodeStats(){let t={},n=[],o={workspaces:0,junctions:0,subflows:0,configs:0,groups:0,wires:0,nodes:0},i=(RED.nodes.eachConfig(e=>{o.configs+=1}),RED.nodes.eachLink(e=>{o.wires+=1}),RED.nodes.eachJunction(e=>{o.junctions+=1}),RED.nodes.eachGroup(e=>{o.groups+=1}),RED.nodes.eachWorkspace(e=>{o.workspaces+=1}),RED.nodes.eachSubflow(e=>{o.subflows+=1}),RED.nodes.eachNode(e=>{o.nodes+=1,t[e.type]=(t[e.type]||0)+1}),Object.keys(t).forEach(e=>{n.push({label:e,sublabel:t[e],selected:!1,checkbox:!1})}),[]),r=0;return Object.keys(o).forEach(e=>{r+=o[e],i.push({label:e,sublabel:o[e],selected:!1,checkbox:!1})}),[{label:"__ TOTALS",sublabel:r,selected:!1,checkbox:!1,children:i}].concat(n.sort((e,t)=>e.label>t.label))}function setupTreeListForNodeStats(){var e=collectNodeStats();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){}).on("treelistconfirm",function(e,t){}),$("#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)}),n.searchBox("count",e+" / "+$("#node-input-orphan-target-container-div").treeList("data").length))}})}$("#node-input-orphan-target-container-div").treeList("data",e)}
16
16
 
@@ -301,6 +301,7 @@
301
301
  */
302
302
  })
303
303
 
304
+ $('#node-input-highlight-debug-nodes-btn').on( 'click', highlightDebugNodesInPanel)
304
305
  $('#node-input-transform-inject-to-change-btn').on( 'click', transformInjectToChangeNode)
305
306
  $('#node-input-statistics-btn').on('click', (e) => {
306
307
  if ( e ) { e.preventDefault() }
@@ -448,6 +449,8 @@
448
449
  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-&gt;Chg</span></button>
449
450
  <button id="node-input-statistics-btn"
450
451
  class="red-ui-button"><i class="fa fa-pie-chart"></i> Stats</button>
452
+ <button id="node-input-highlight-debug-nodes-btn"
453
+ class="red-ui-button"><i class="fa fa-bug"></i> Hilight Debug</button>
451
454
  </div>
452
455
 
453
456
  <div class="form-row"