forked from phoddie/node-red-mcu
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.js
30 lines (28 loc) · 857 Bytes
/
main.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import "nodered"; // import for global side effects
import Modules from "modules";
import Timer from "timer";
if (!Modules.has("flows"))
trace("no flows installed\n");
else {
Timer.set(function() { // run on an empty stack
const flows = Modules.importNow("flows");
RED.build(flows);
if (globalThis.REDTheme) {
if (!Modules.has("ui_nodes") || !Modules.has("ui_templates"))
trace("flow neeeds UI nodes; not build into host \n");
else {
const buildModel = Modules.importNow("ui_nodes");
const templates = Modules.importNow("ui_templates");
const REDApplication = templates.REDApplication;
if (REDApplication) {
try {
const model = buildModel();
new REDApplication(model, { commandListLength:4096, displayListLength:8192, touchCount:1, pixels: 240 * 48 });
}
catch {
}
}
}
}
});
}