@gregoriusrippenstein/node-red-contrib-introspection 0.9.10 → 0.9.11
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.
|
@@ -54,6 +54,7 @@ function handleClientCodeFrontend(event,data){var doSend,doStatus,doError,nodeid
|
|
|
54
54
|
msg:true,
|
|
55
55
|
RED: true,
|
|
56
56
|
node: true,
|
|
57
|
+
alert: true,
|
|
57
58
|
console: true,
|
|
58
59
|
Buffer: true,
|
|
59
60
|
setTimeout: true,
|
|
@@ -186,4 +187,8 @@ Functionality:
|
|
|
186
187
|
<p>
|
|
187
188
|
An example flow with some use cases is included and can be accessed either via
|
|
188
189
|
the Import Flow dialog or accessed online <a style="color: blue" href="https://flowhub.org/f/e02ba6e534f7a0f4" target="_blank">at here <i class="fa fa-external-link"></i></a>.
|
|
190
|
+
<p>
|
|
191
|
+
The code to be executed by the client can also be passed in via the `msg` object using the
|
|
192
|
+
`clientcode` attribute on the `msg` object. If this attribute is set, it will take precendence
|
|
193
|
+
over the code defined in the node itself.
|
|
189
194
|
</script>
|
package/nodes/60-client-code.js
CHANGED
|
@@ -77,13 +77,14 @@ module.exports = function (RED) {
|
|
|
77
77
|
msg: "execfunc",
|
|
78
78
|
payload: msg.payload,
|
|
79
79
|
topic: msg.topic,
|
|
80
|
-
func: cfg.clientcode,
|
|
80
|
+
func: msg.clientcode || cfg.clientcode,
|
|
81
81
|
nodeid: node.id,
|
|
82
82
|
_msg: msg
|
|
83
83
|
})
|
|
84
84
|
);
|
|
85
85
|
});
|
|
86
86
|
}
|
|
87
|
+
|
|
87
88
|
RED.nodes.registerType("ClientCode", ClientCodeFunctionality);
|
|
88
89
|
|
|
89
90
|
/**
|