Hi,
I am trying to load editor resources following Loading extra resources in the editor : Node-RED (nodered.org)
step 1
make the resources directory /app/nod_red/lower_case/resources
, like this
-rw-r--r-- 1 root root 3.1K Jan 9 13:48 1704778565817.png
-rw-r--r-- 1 root root 2.9K Jan 9 13:48 17047786206814.png
-rw-r--r-- 1 root root 3.7K Jan 9 13:48 17047786723943.png
-rw-r--r-- 1 root root 50 Jan 9 13:31 add.js
add.js has a function defined.
function add(num1, num2)
{
return num1 + num2;
}
and lower-case node is defined like this
drwxr-xr-x 4 root root 288 Jan 9 10:06 locales/
-rw-r--r-- 1 root root 3.0K Jan 9 14:28 lower-case.html
-rw-r--r-- 1 root root 1.5K Jan 9 10:17 lower-case.js
-rw-r--r-- 1 root root 152 Jan 8 14:13 package.json
drwxr-xr-x 2 root root 464 Jan 9 13:48 resources/
step 2
add a img tag in lower-case.html, like this
<script type="text/html" data-help-name="lower-case">
<p data-i18n="lower-case.help-text">
<img src="resources/lower-case/17047786723943.png" />
<span id = "span_id"/>
</p>
</script>
and the picture is shown correctly in browser console,
step 3,
add <script src="resources/lower-case/add.js">
to the begin of lower-case.html, restart node red, refresh browser, and the load page gets stucked
<script src="resources/lower-case/add.js">
<script type="text/javascript">
RED.nodes.registerType('lower-case',{
category: 'function',
color: '#a6bbcf',
defaults: {
name: {value:""},
username:{value:""},
server: {value:"localhost", type:"remote-server"}
},
inputs: 1,
outputs: 1,
icon: "file.svg",
label: function() {
return this.name||"lower-case";
}
})