From 0d5a4f3bced23fe62c833bc7820e57349bae4b52 Mon Sep 17 00:00:00 2001 From: Dave Conway-Jones Date: Tue, 6 Oct 2020 00:27:22 +0100 Subject: [PATCH] fix wrinkle with flowfile name --- electronflow.json | 615 +------------------------------------- example/electronflow.json | 2 +- main.js | 1 + 3 files changed, 3 insertions(+), 615 deletions(-) diff --git a/electronflow.json b/electronflow.json index 5df9341..4e8f2fa 100644 --- a/electronflow.json +++ b/electronflow.json @@ -1,614 +1 @@ -[ - { - "id": "41f61d2.fbe09e4", - "type": "tab", - "label": "Flow 1" - }, - { - "id": "52a903f3.ad56fc", - "type": "ui_tab", - "z": "41f61d2.fbe09e4", - "name": "My Simple Dashboard", - "icon": "dashboard", - "disabled": false, - "hidden": false - }, - { - "id": "30e652f.d9de3ae", - "type": "ui_group", - "z": "41f61d2.fbe09e4", - "name": "Panel 2", - "tab": "52a903f3.ad56fc", - "order": 4, - "disp": true, - "width": "6" - }, - { - "id": "a8ecb9.c60f4348", - "type": "ui_group", - "z": "41f61d2.fbe09e4", - "name": "Introduction", - "tab": "52a903f3.ad56fc", - "order": 1, - "disp": false, - "width": "3" - }, - { - "id": "bbdf3e02.e8fee", - "type": "ui_group", - "z": "41f61d2.fbe09e4", - "name": "Panel 1", - "tab": "52a903f3.ad56fc", - "order": 2, - "disp": true, - "width": "6" - }, - { - "id": "d9ba26fa.6d2b18", - "type": "ui_base", - "theme": { - "name": "theme-light", - "lightTheme": { - "default": "#0094CE", - "baseColor": "#8e0d17", - "baseFont": "Copperplate,Copperplate Gothic Light,fantasy", - "edited": true, - "reset": false - }, - "darkTheme": { - "default": "#097479", - "baseColor": "#097479", - "baseFont": "Helvetica Neue", - "edited": false - }, - "customTheme": { - "name": "Untitled Theme 1", - "default": "#4B7930", - "baseColor": "#4B7930", - "baseFont": "Helvetica Neue" - }, - "themeState": { - "base-color": { - "default": "#0094CE", - "value": "#d80005", - "edited": true - }, - "page-titlebar-backgroundColor": { - "value": "#8e0d17", - "edited": false - }, - "page-backgroundColor": { - "value": "#fafafa", - "edited": false - }, - "page-sidebar-backgroundColor": { - "value": "#333333", - "edited": false - }, - "group-textColor": { - "value": "#d41322", - "edited": false - }, - "group-borderColor": { - "value": "#ffffff", - "edited": false - }, - "group-backgroundColor": { - "value": "#ffffff", - "edited": false - }, - "widget-textColor": { - "value": "#111111", - "edited": false - }, - "widget-backgroundColor": { - "value": "#8e0d17", - "edited": false - }, - "widget-borderColor": { - "value": "#ffffff", - "edited": false - }, - "base-font": { - "value": "Copperplate,Copperplate Gothic Light,fantasy" - } - }, - "angularTheme": { - "primary": "indigo", - "accents": "blue", - "warn": "red", - "background": "grey" - } - }, - "site": { - "name": "Node-RED Dashboard", - "hideToolbar": "false", - "allowSwipe": "false", - "dateFormat": "DD/MM/YYYY", - "sizes": { - "sx": 48, - "sy": 48, - "gx": 6, - "gy": 6, - "cx": 6, - "cy": 6, - "px": 0, - "py": 0 - } - } - }, - { - "id": "87356b62.92e3d8", - "type": "ui_group", - "z": "", - "name": "Text to Speech", - "tab": "52a903f3.ad56fc", - "order": 5, - "disp": true, - "width": "6", - "collapse": false - }, - { - "id": "c75ad4f0.0cede8", - "type": "ui_group", - "z": "", - "name": "Map", - "tab": "52a903f3.ad56fc", - "order": 3, - "disp": true, - "width": "6", - "collapse": true - }, - { - "id": "189cf871.681118", - "type": "ui_template", - "z": "41f61d2.fbe09e4", - "group": "a8ecb9.c60f4348", - "name": "Welcome", - "order": 1, - "width": "3", - "height": "9", - "format": "

Welcome to the Node-RED Dashboard

\n

On the right you will see a graph and a chart logging data from the sliders underneath.

", - "storeOutMessages": false, - "fwdInMessages": false, - "resendOnRefresh": false, - "templateScope": "local", - "x": 93, - "y": 45, - "wires": [ - [] - ] - }, - { - "id": "9f19ee5c.beaef", - "type": "ui_chart", - "z": "41f61d2.fbe09e4", - "name": "", - "group": "bbdf3e02.e8fee", - "order": 1, - "width": "0", - "height": "0", - "label": "", - "chartType": "line", - "xformat": "HH:mm:ss", - "interpolate": "basis", - "nodata": "No Data", - "dot": false, - "ymin": "0", - "ymax": "100", - "removeOlder": 1, - "removeOlderPoints": "", - "removeOlderUnit": "60", - "cutout": "", - "colors": [ - "#1f77b4", - "#aec7e8", - "#ff7f0e", - "#2ca02c", - "#98df8a", - "#d62728", - "#ff9896", - "#9467bd", - "#c5b0d5" - ], - "outputs": 2, - "x": 270, - "y": 200, - "wires": [ - [], - [] - ] - }, - { - "id": "799d9318.fd385c", - "type": "ui_gauge", - "z": "41f61d2.fbe09e4", - "name": "", - "group": "30e652f.d9de3ae", - "order": 2, - "width": "", - "height": "", - "gtype": "gage", - "title": "Title", - "label": "gauge", - "format": "{{value}}", - "min": 0, - "max": "100", - "colors": [ - "#00b500", - "#e6e600", - "#ca3838" - ], - "x": 270, - "y": 140, - "wires": [] - }, - { - "id": "6f18b200.666a4", - "type": "ui_button", - "z": "41f61d2.fbe09e4", - "name": "", - "group": "87356b62.92e3d8", - "order": 2, - "width": 0, - "height": 0, - "passthru": false, - "label": "press to talk", - "tooltip": "", - "color": "", - "bgcolor": "", - "icon": "fa-volume-up", - "payload": "Hello to Jason Isaacs", - "payloadType": "str", - "topic": "", - "x": 110, - "y": 300, - "wires": [ - [ - "f897d7c2.467a58" - ] - ] - }, - { - "id": "f897d7c2.467a58", - "type": "ui_audio", - "z": "41f61d2.fbe09e4", - "name": "", - "group": "30e652f.d9de3ae", - "voice": "0", - "x": 300, - "y": 300, - "wires": [] - }, - { - "id": "da0f7e67.0d38a", - "type": "ui_slider", - "z": "41f61d2.fbe09e4", - "name": "", - "label": "slider", - "group": "30e652f.d9de3ae", - "order": 4, - "width": 0, - "height": 0, - "passthru": true, - "topic": "", - "min": 0, - "max": "100", - "step": 1, - "x": 90, - "y": 140, - "wires": [ - [ - "799d9318.fd385c" - ] - ] - }, - { - "id": "eabf2bd7.f4e0c8", - "type": "ui_slider", - "z": "41f61d2.fbe09e4", - "name": "", - "label": "slider", - "group": "bbdf3e02.e8fee", - "order": 4, - "width": 0, - "height": 0, - "passthru": true, - "topic": "", - "min": 0, - "max": "100", - "step": 1, - "x": 90, - "y": 200, - "wires": [ - [ - "9f19ee5c.beaef" - ] - ] - }, - { - "id": "45508d88.744a54", - "type": "function", - "z": "41f61d2.fbe09e4", - "name": "", - "func": "// create random position\nvar lat = 51 + Math.random() * 0.2;\nvar lon = -1.45 + Math.random() * 0.2;\nmsg.payload={lat:lat, lon:lon, name:\"Jason\", icon:\"male\", url:\"IBM link\"};\nreturn msg;", - "outputs": 1, - "noerr": 0, - "x": 270, - "y": 480, - "wires": [ - [ - "576d953b.3e57dc", - "f9ae061e.76b048" - ] - ] - }, - { - "id": "6ca8cfc2.e0bce", - "type": "ui_button", - "z": "41f61d2.fbe09e4", - "name": "", - "group": "c75ad4f0.0cede8", - "order": 2, - "width": 0, - "height": 0, - "passthru": false, - "label": "Where's Jason", - "color": "", - "bgcolor": "#910000", - "icon": "fa-male", - "payload": "", - "payloadType": "str", - "topic": "", - "x": 120, - "y": 480, - "wires": [ - [ - "45508d88.744a54" - ] - ] - }, - { - "id": "576d953b.3e57dc", - "type": "worldmap-tracks", - "z": "41f61d2.fbe09e4", - "name": "", - "depth": 20, - "layer": "combined", - "x": 450, - "y": 420, - "wires": [ - [ - "f9ae061e.76b048" - ] - ] - }, - { - "id": "814a9c85.e6fb8", - "type": "ui_button", - "z": "41f61d2.fbe09e4", - "name": "", - "group": "c75ad4f0.0cede8", - "order": 3, - "width": 0, - "height": 0, - "passthru": false, - "label": "Delete Jason", - "tooltip": "", - "color": "", - "bgcolor": "#910000", - "icon": "fa-male", - "payload": "", - "payloadType": "str", - "topic": "", - "x": 110, - "y": 420, - "wires": [ - [ - "b9d3d78b.360d38" - ] - ] - }, - { - "id": "b9d3d78b.360d38", - "type": "function", - "z": "41f61d2.fbe09e4", - "name": "", - "func": "// create random position\nmsg.payload={name:\"Jason\", deleted:true};\nreturn msg;", - "outputs": 1, - "noerr": 0, - "x": 270, - "y": 420, - "wires": [ - [ - "576d953b.3e57dc" - ] - ] - }, - { - "id": "36c05d33.b783b2", - "type": "ui_button", - "z": "41f61d2.fbe09e4", - "name": "", - "group": "c75ad4f0.0cede8", - "order": 4, - "width": 0, - "height": 0, - "passthru": false, - "label": "Delete Track", - "tooltip": "", - "color": "", - "bgcolor": "#910000", - "icon": "fa-male", - "payload": "", - "payloadType": "str", - "topic": "", - "x": 110, - "y": 360, - "wires": [ - [ - "108b8604.f5bb8a" - ] - ] - }, - { - "id": "108b8604.f5bb8a", - "type": "function", - "z": "41f61d2.fbe09e4", - "name": "", - "func": "// create random position\nmsg.payload={name:\"Jason_\", deleted:true};\nreturn msg;", - "outputs": 1, - "noerr": 0, - "x": 270, - "y": 360, - "wires": [ - [ - "f9ae061e.76b048" - ] - ] - }, - { - "id": "e90f82d8.46a78", - "type": "ui_ui_control", - "z": "41f61d2.fbe09e4", - "name": "", - "events": "all", - "x": 360, - "y": 560, - "wires": [ - [] - ] - }, - { - "id": "c920e625.e95578", - "type": "ui_button", - "z": "41f61d2.fbe09e4", - "name": "", - "group": "a8ecb9.c60f4348", - "order": 2, - "width": 0, - "height": 0, - "passthru": false, - "label": "Close Map", - "tooltip": "", - "color": "", - "bgcolor": "", - "icon": "", - "payload": "{\"group\":{\"close\":[\"My_Simple_Dashboard_Map\"]}}", - "payloadType": "json", - "topic": "", - "x": 150, - "y": 560, - "wires": [ - [ - "e90f82d8.46a78" - ] - ] - }, - { - "id": "48892dbf.1d3e64", - "type": "ui_button", - "z": "41f61d2.fbe09e4", - "name": "", - "group": "a8ecb9.c60f4348", - "order": 5, - "width": 0, - "height": 0, - "passthru": false, - "label": "Show Map", - "tooltip": "", - "color": "", - "bgcolor": "", - "icon": "", - "payload": "{\"group\":{\"show\":[\"My_Simple_Dashboard_Map\"]}}", - "payloadType": "json", - "topic": "", - "x": 150, - "y": 680, - "wires": [ - [ - "e90f82d8.46a78" - ] - ] - }, - { - "id": "e44dda45.d85038", - "type": "ui_button", - "z": "41f61d2.fbe09e4", - "name": "", - "group": "a8ecb9.c60f4348", - "order": 4, - "width": 0, - "height": 0, - "passthru": false, - "label": "Hide Map", - "tooltip": "", - "color": "", - "bgcolor": "", - "icon": "", - "payload": "{\"group\":{\"hide\":[\"My_Simple_Dashboard_Map\"]}}", - "payloadType": "json", - "topic": "", - "x": 140, - "y": 640, - "wires": [ - [ - "e90f82d8.46a78" - ] - ] - }, - { - "id": "1ffc9864.56de48", - "type": "ui_button", - "z": "41f61d2.fbe09e4", - "name": "", - "group": "a8ecb9.c60f4348", - "order": 3, - "width": 0, - "height": 0, - "passthru": false, - "label": "Open Map", - "tooltip": "", - "color": "", - "bgcolor": "", - "icon": "", - "payload": "{\"group\":{\"open\":[\"My_Simple_Dashboard_Map\"]}}", - "payloadType": "json", - "topic": "", - "x": 150, - "y": 600, - "wires": [ - [ - "e90f82d8.46a78" - ] - ] - }, - { - "id": "f9ae061e.76b048", - "type": "ui_worldmap", - "z": "41f61d2.fbe09e4", - "group": "c75ad4f0.0cede8", - "order": 1, - "width": 0, - "height": 0, - "name": "", - "lat": "", - "lon": "", - "zoom": "", - "layer": "", - "cluster": "", - "maxage": "", - "usermenu": "hide", - "layers": "hide", - "panit": "false", - "panlock": "false", - "zoomlock": "false", - "hiderightclick": "true", - "coords": "none", - "showgrid": "false", - "path": "/worldmap", - "x": 480, - "y": 480, - "wires": [] - } -] \ No newline at end of file +[{"id":"41f61d2.fbe09e4","type":"tab","label":"Flow 1"},{"id":"52a903f3.ad56fc","type":"ui_tab","z":"41f61d2.fbe09e4","name":"My Simple Dashboard","icon":"dashboard","disabled":false,"hidden":false},{"id":"30e652f.d9de3ae","type":"ui_group","z":"41f61d2.fbe09e4","name":"Panel 2","tab":"52a903f3.ad56fc","order":4,"disp":true,"width":"6"},{"id":"a8ecb9.c60f4348","type":"ui_group","z":"41f61d2.fbe09e4","name":"Introduction","tab":"52a903f3.ad56fc","order":1,"disp":false,"width":"3"},{"id":"bbdf3e02.e8fee","type":"ui_group","z":"41f61d2.fbe09e4","name":"Panel 1","tab":"52a903f3.ad56fc","order":2,"disp":true,"width":"6"},{"id":"d9ba26fa.6d2b18","type":"ui_base","theme":{"name":"theme-light","lightTheme":{"default":"#0094CE","baseColor":"#8e0d17","baseFont":"Copperplate,Copperplate Gothic Light,fantasy","edited":true,"reset":false},"darkTheme":{"default":"#097479","baseColor":"#097479","baseFont":"Helvetica Neue","edited":false},"customTheme":{"name":"Untitled Theme 1","default":"#4B7930","baseColor":"#4B7930","baseFont":"Helvetica Neue"},"themeState":{"base-color":{"default":"#0094CE","value":"#d80005","edited":true},"page-titlebar-backgroundColor":{"value":"#8e0d17","edited":false},"page-backgroundColor":{"value":"#fafafa","edited":false},"page-sidebar-backgroundColor":{"value":"#333333","edited":false},"group-textColor":{"value":"#d41322","edited":false},"group-borderColor":{"value":"#ffffff","edited":false},"group-backgroundColor":{"value":"#ffffff","edited":false},"widget-textColor":{"value":"#111111","edited":false},"widget-backgroundColor":{"value":"#8e0d17","edited":false},"widget-borderColor":{"value":"#ffffff","edited":false},"base-font":{"value":"Copperplate,Copperplate Gothic Light,fantasy"}},"angularTheme":{"primary":"indigo","accents":"blue","warn":"red","background":"grey"}},"site":{"name":"Node-RED Dashboard","hideToolbar":"false","allowSwipe":"false","dateFormat":"DD/MM/YYYY","sizes":{"sx":48,"sy":48,"gx":6,"gy":6,"cx":6,"cy":6,"px":0,"py":0}}},{"id":"87356b62.92e3d8","type":"ui_group","z":"","name":"Text to Speech","tab":"52a903f3.ad56fc","order":5,"disp":true,"width":"6","collapse":false},{"id":"c75ad4f0.0cede8","type":"ui_group","z":"","name":"Map","tab":"52a903f3.ad56fc","order":3,"disp":true,"width":"6","collapse":true},{"id":"189cf871.681118","type":"ui_template","z":"41f61d2.fbe09e4","group":"a8ecb9.c60f4348","name":"Welcome","order":1,"width":"3","height":"9","format":"

Welcome to the Node-RED Dashboard

\n

On the right you will see a graph and a chart logging data from the sliders underneath.

","storeOutMessages":false,"fwdInMessages":false,"x":93,"y":45,"wires":[[]]},{"id":"9f19ee5c.beaef","type":"ui_chart","z":"41f61d2.fbe09e4","name":"","group":"bbdf3e02.e8fee","order":1,"width":"0","height":"0","label":"","chartType":"line","xformat":"HH:mm:ss","interpolate":"basis","nodata":"No Data","dot":false,"ymin":"0","ymax":"100","removeOlder":1,"removeOlderPoints":"","removeOlderUnit":"60","cutout":"","colors":["#1f77b4","#aec7e8","#ff7f0e","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"outputs":2,"x":270,"y":200,"wires":[[],[]]},{"id":"799d9318.fd385c","type":"ui_gauge","z":"41f61d2.fbe09e4","name":"","group":"30e652f.d9de3ae","order":2,"width":"","height":"","gtype":"gage","title":"Title","label":"gauge","format":"{{value}}","min":0,"max":"100","colors":["#00b500","#e6e600","#ca3838"],"x":270,"y":140,"wires":[]},{"id":"6f18b200.666a4","type":"ui_button","z":"41f61d2.fbe09e4","name":"","group":"87356b62.92e3d8","order":2,"width":0,"height":0,"passthru":false,"label":"press to talk","tooltip":"","color":"","bgcolor":"","icon":"fa-volume-up","payload":"Hello to Jason Isaacs","payloadType":"str","topic":"","x":110,"y":300,"wires":[["f897d7c2.467a58"]]},{"id":"f897d7c2.467a58","type":"ui_audio","z":"41f61d2.fbe09e4","name":"","group":"30e652f.d9de3ae","voice":"0","x":300,"y":300,"wires":[]},{"id":"da0f7e67.0d38a","type":"ui_slider","z":"41f61d2.fbe09e4","name":"","label":"slider","group":"30e652f.d9de3ae","order":4,"width":0,"height":0,"passthru":true,"topic":"","min":0,"max":"100","step":1,"x":90,"y":140,"wires":[["799d9318.fd385c"]]},{"id":"eabf2bd7.f4e0c8","type":"ui_slider","z":"41f61d2.fbe09e4","name":"","label":"slider","group":"bbdf3e02.e8fee","order":4,"width":0,"height":0,"passthru":true,"topic":"","min":0,"max":"100","step":1,"x":90,"y":200,"wires":[["9f19ee5c.beaef"]]},{"id":"45508d88.744a54","type":"function","z":"41f61d2.fbe09e4","name":"","func":"// create random position\nvar lat = 51 + Math.random() * 0.2;\nvar lon = -1.45 + Math.random() * 0.2;\nmsg.payload={lat:lat, lon:lon, name:\"Jason\", icon:\"male\", url:\"IBM link\"};\nreturn msg;","outputs":1,"noerr":0,"x":270,"y":480,"wires":[["576d953b.3e57dc","1bc50b6.cfc1cf5"]]},{"id":"6ca8cfc2.e0bce","type":"ui_button","z":"41f61d2.fbe09e4","name":"","group":"c75ad4f0.0cede8","order":2,"width":0,"height":0,"passthru":false,"label":"Where's Jason","color":"","bgcolor":"#910000","icon":"fa-male","payload":"","payloadType":"str","topic":"","x":120,"y":480,"wires":[["45508d88.744a54"]]},{"id":"576d953b.3e57dc","type":"worldmap-tracks","z":"41f61d2.fbe09e4","name":"","depth":20,"layer":"combined","x":450,"y":420,"wires":[["1bc50b6.cfc1cf5"]]},{"id":"814a9c85.e6fb8","type":"ui_button","z":"41f61d2.fbe09e4","name":"","group":"c75ad4f0.0cede8","order":3,"width":0,"height":0,"passthru":false,"label":"Remove Jason","tooltip":"","color":"","bgcolor":"#910000","icon":"fa-male","payload":"","payloadType":"str","topic":"","x":110,"y":420,"wires":[["b9d3d78b.360d38"]]},{"id":"b9d3d78b.360d38","type":"function","z":"41f61d2.fbe09e4","name":"","func":"// create random position\nmsg.payload={name:\"Jason\", deleted:true};\nreturn msg;","outputs":1,"noerr":0,"x":270,"y":420,"wires":[["576d953b.3e57dc"]]},{"id":"36c05d33.b783b2","type":"ui_button","z":"41f61d2.fbe09e4","name":"","group":"c75ad4f0.0cede8","order":4,"width":0,"height":0,"passthru":false,"label":"Delete Track","tooltip":"","color":"","bgcolor":"#910000","icon":"fa-male","payload":"","payloadType":"str","topic":"","x":110,"y":360,"wires":[["108b8604.f5bb8a"]]},{"id":"108b8604.f5bb8a","type":"function","z":"41f61d2.fbe09e4","name":"","func":"// create random position\nmsg.payload={name:\"Jason_\", deleted:true};\nreturn msg;","outputs":1,"noerr":0,"x":270,"y":360,"wires":[["1bc50b6.cfc1cf5"]]},{"id":"e90f82d8.46a78","type":"ui_ui_control","z":"41f61d2.fbe09e4","name":"","events":"all","x":320,"y":560,"wires":[[]]},{"id":"c920e625.e95578","type":"ui_button","z":"41f61d2.fbe09e4","name":"","group":"a8ecb9.c60f4348","order":2,"width":0,"height":0,"passthru":false,"label":"Close Map","tooltip":"","color":"","bgcolor":"","icon":"","payload":"{\"group\":{\"close\":[\"My_Simple_Dashboard_Map\"]}}","payloadType":"json","topic":"","x":130,"y":560,"wires":[["e90f82d8.46a78"]]},{"id":"48892dbf.1d3e64","type":"ui_button","z":"41f61d2.fbe09e4","name":"","group":"a8ecb9.c60f4348","order":5,"width":0,"height":0,"passthru":false,"label":"Show Map","tooltip":"","color":"","bgcolor":"","icon":"","payload":"{\"group\":{\"show\":[\"My_Simple_Dashboard_Map\"]}}","payloadType":"json","topic":"","x":130,"y":640,"wires":[["e90f82d8.46a78"]]},{"id":"e44dda45.d85038","type":"ui_button","z":"41f61d2.fbe09e4","name":"","group":"a8ecb9.c60f4348","order":4,"width":0,"height":0,"passthru":false,"label":"Hide Map","tooltip":"","color":"","bgcolor":"","icon":"","payload":"{\"group\":{\"hide\":[\"My_Simple_Dashboard_Map\"]}}","payloadType":"json","topic":"","x":120,"y":680,"wires":[["e90f82d8.46a78"]]},{"id":"1ffc9864.56de48","type":"ui_button","z":"41f61d2.fbe09e4","name":"","group":"a8ecb9.c60f4348","order":3,"width":0,"height":0,"passthru":false,"label":"Open Map","tooltip":"","color":"","bgcolor":"","icon":"","payload":"{\"group\":{\"open\":[\"My_Simple_Dashboard_Map\"]}}","payloadType":"json","topic":"","x":130,"y":600,"wires":[["e90f82d8.46a78"]]},{"id":"1bc50b6.cfc1cf5","type":"ui_worldmap","z":"41f61d2.fbe09e4","group":"c75ad4f0.0cede8","order":1,"width":0,"height":0,"name":"","lat":"","lon":"","zoom":"","layer":"","cluster":"","maxage":"","usermenu":"hide","layers":"hide","panit":"false","panlock":"false","zoomlock":"false","hiderightclick":"true","coords":"none","showgrid":"false","path":"/worldmap","x":500,"y":480,"wires":[]}] \ No newline at end of file diff --git a/example/electronflow.json b/example/electronflow.json index d8fbe3c..4e8f2fa 100644 --- a/example/electronflow.json +++ b/example/electronflow.json @@ -1 +1 @@ -[{"id":"41f61d2.fbe09e4","type":"tab","label":"Flow 1"},{"id":"52a903f3.ad56fc","type":"ui_tab","z":"41f61d2.fbe09e4","name":"Home","icon":"dashboard"},{"id":"30e652f.d9de3ae","type":"ui_group","z":"41f61d2.fbe09e4","name":"Panel 2","tab":"52a903f3.ad56fc","order":5,"disp":true,"width":"6"},{"id":"a8ecb9.c60f4348","type":"ui_group","z":"41f61d2.fbe09e4","name":"Introduction","tab":"52a903f3.ad56fc","order":1,"disp":false,"width":"4","collapse":false},{"id":"bbdf3e02.e8fee","type":"ui_group","z":"41f61d2.fbe09e4","name":"Panel 1","tab":"52a903f3.ad56fc","order":2,"disp":true,"width":"6"},{"id":"d9ba26fa.6d2b18","type":"ui_base","theme":{"name":"theme-light","lightTheme":{"default":"#0094CE","baseColor":"#8e0d17","baseFont":"Gill Sans,Geneva,sans-serif","edited":true,"reset":false},"darkTheme":{"default":"#097479","baseColor":"#097479","baseFont":"Helvetica Neue","edited":false},"customTheme":{"name":"Untitled Theme 1","default":"#4B7930","baseColor":"#4B7930","baseFont":"Helvetica Neue"},"themeState":{"base-color":{"default":"#0094CE","value":"#d80005","edited":true},"page-titlebar-backgroundColor":{"value":"#8e0d17","edited":false},"page-backgroundColor":{"value":"#fafafa","edited":false},"page-sidebar-backgroundColor":{"value":"#000000","edited":false},"group-textColor":{"value":"#d41322","edited":false},"group-borderColor":{"value":"#ffffff","edited":false},"group-backgroundColor":{"value":"#ffffff","edited":false},"widget-textColor":{"value":"#111111","edited":false},"widget-backgroundColor":{"value":"#8e0d17","edited":false},"widget-borderColor":{"value":"#ffffff","edited":false},"base-font":{"value":"Gill Sans,Geneva,sans-serif"}}},"site":{"name":"Node-RED Dashboard","hideToolbar":"false","allowSwipe":"false","dateFormat":"DD/MM/YYYY","sizes":{"sx":48,"sy":48,"gx":6,"gy":6,"cx":6,"cy":6,"px":0,"py":0}}},{"id":"87356b62.92e3d8","type":"ui_group","z":"","name":"Text to Speech","tab":"52a903f3.ad56fc","order":3,"disp":true,"width":"6"},{"id":"c75ad4f0.0cede8","type":"ui_group","z":"","name":"Map","tab":"52a903f3.ad56fc","order":4,"disp":true,"width":"6"},{"id":"189cf871.681118","type":"ui_template","z":"41f61d2.fbe09e4","group":"a8ecb9.c60f4348","name":"Welcome","order":1,"width":"4","height":"9","format":"

Welcome to the Node-RED Dashboard

\n

On the right you will see a graph and a gauge logging data from the sliders underneath.

\n

There is also an example of embedding a small map.

","storeOutMessages":false,"fwdInMessages":false,"templateScope":"local","x":100,"y":60,"wires":[[]]},{"id":"9f19ee5c.beaef","type":"ui_chart","z":"41f61d2.fbe09e4","name":"","group":"bbdf3e02.e8fee","order":1,"width":"0","height":"0","label":"","chartType":"line","xformat":"HH:mm:ss","interpolate":"basis","nodata":"No Data","dot":false,"ymin":"0","ymax":"100","removeOlder":1,"removeOlderPoints":"","removeOlderUnit":"60","cutout":"","colors":["#1f77b4","#aec7e8","#ff7f0e","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"outputs":2,"x":270,"y":200,"wires":[[],[]]},{"id":"799d9318.fd385c","type":"ui_gauge","z":"41f61d2.fbe09e4","name":"","group":"30e652f.d9de3ae","order":2,"width":"","height":"","gtype":"gage","title":"Title","label":"gauge","format":"{{value}}","min":0,"max":"100","colors":["#00b500","#e6e600","#ca3838"],"x":270,"y":140,"wires":[]},{"id":"6f18b200.666a4","type":"ui_button","z":"41f61d2.fbe09e4","name":"","group":"87356b62.92e3d8","order":2,"width":0,"height":0,"label":"press to talk","color":"","bgcolor":"","icon":"fa-volume-up","payload":"Hello to Jason Isaacs","payloadType":"str","topic":"","x":110,"y":320,"wires":[["f897d7c2.467a58"]]},{"id":"f897d7c2.467a58","type":"ui_audio","z":"41f61d2.fbe09e4","name":"","group":"30e652f.d9de3ae","voice":"0","x":300,"y":320,"wires":[]},{"id":"da0f7e67.0d38a","type":"ui_slider","z":"41f61d2.fbe09e4","name":"","label":"slider","group":"30e652f.d9de3ae","order":4,"width":0,"height":0,"passthru":true,"topic":"","min":0,"max":"100","step":1,"x":90,"y":140,"wires":[["799d9318.fd385c","219da65f.e0b0da"]]},{"id":"eabf2bd7.f4e0c8","type":"ui_slider","z":"41f61d2.fbe09e4","name":"","label":"slider","group":"bbdf3e02.e8fee","order":4,"width":0,"height":0,"passthru":true,"topic":"","min":0,"max":"100","step":1,"x":130,"y":200,"wires":[["9f19ee5c.beaef","ccee40e3.c1618"]]},{"id":"45508d88.744a54","type":"function","z":"41f61d2.fbe09e4","name":"","func":"// create random position\nvar lat = 51 + Math.random() * 0.2;\nvar lon = -1.45 + Math.random() * 0.2;\nmsg.payload={lat:lat, lon:lon, name:\"Jason\", icon:\"male\", url:\"IBM link\"};\nreturn msg;","outputs":1,"noerr":0,"x":290,"y":400,"wires":[["f76b15b1.dd27a8"]]},{"id":"6ca8cfc2.e0bce","type":"ui_button","z":"41f61d2.fbe09e4","name":"","group":"c75ad4f0.0cede8","order":1,"width":0,"height":0,"passthru":false,"label":"Where's Jason ?","color":"","bgcolor":"#910000","icon":"fa-male","payload":"","payloadType":"str","topic":"","x":110,"y":400,"wires":[["45508d88.744a54"]]},{"id":"219da65f.e0b0da","type":"debug","z":"41f61d2.fbe09e4","name":"","active":true,"tosidebar":true,"console":true,"tostatus":false,"complete":"payload","x":300,"y":100,"wires":[]},{"id":"ccee40e3.c1618","type":"debug","z":"41f61d2.fbe09e4","name":"","active":true,"tosidebar":true,"console":true,"tostatus":false,"complete":"payload","targetType":"msg","x":300,"y":260,"wires":[]},{"id":"1c597308.3cfc0d","type":"worldmap in","z":"41f61d2.fbe09e4","name":"worldmap in","path":"","events":"","x":110,"y":480,"wires":[["7d6cb82c.3f3ea8"]]},{"id":"7d6cb82c.3f3ea8","type":"debug","z":"41f61d2.fbe09e4","name":"","active":true,"tosidebar":false,"console":true,"tostatus":false,"complete":"payload","x":350,"y":480,"wires":[]},{"id":"762cecef.af00d4","type":"inject","z":"41f61d2.fbe09e4","name":"","topic":"","payload":"26","payloadType":"num","repeat":"","crontab":"","once":true,"onceDelay":"2","x":90,"y":260,"wires":[["eabf2bd7.f4e0c8"]]},{"id":"f76b15b1.dd27a8","type":"ui_worldmap","z":"41f61d2.fbe09e4","group":"c75ad4f0.0cede8","order":1,"width":"6","height":"7","name":"","lat":"51.17","lon":"-1.4","zoom":"","layer":"","cluster":"","maxage":"","usermenu":"hide","layers":"hide","panit":"false","panlock":"false","zoomlock":"false","hiderightclick":"true","coords":"none","showgrid":"false","path":"/worldmap","x":440,"y":400,"wires":[]}] \ No newline at end of file +[{"id":"41f61d2.fbe09e4","type":"tab","label":"Flow 1"},{"id":"52a903f3.ad56fc","type":"ui_tab","z":"41f61d2.fbe09e4","name":"My Simple Dashboard","icon":"dashboard","disabled":false,"hidden":false},{"id":"30e652f.d9de3ae","type":"ui_group","z":"41f61d2.fbe09e4","name":"Panel 2","tab":"52a903f3.ad56fc","order":4,"disp":true,"width":"6"},{"id":"a8ecb9.c60f4348","type":"ui_group","z":"41f61d2.fbe09e4","name":"Introduction","tab":"52a903f3.ad56fc","order":1,"disp":false,"width":"3"},{"id":"bbdf3e02.e8fee","type":"ui_group","z":"41f61d2.fbe09e4","name":"Panel 1","tab":"52a903f3.ad56fc","order":2,"disp":true,"width":"6"},{"id":"d9ba26fa.6d2b18","type":"ui_base","theme":{"name":"theme-light","lightTheme":{"default":"#0094CE","baseColor":"#8e0d17","baseFont":"Copperplate,Copperplate Gothic Light,fantasy","edited":true,"reset":false},"darkTheme":{"default":"#097479","baseColor":"#097479","baseFont":"Helvetica Neue","edited":false},"customTheme":{"name":"Untitled Theme 1","default":"#4B7930","baseColor":"#4B7930","baseFont":"Helvetica Neue"},"themeState":{"base-color":{"default":"#0094CE","value":"#d80005","edited":true},"page-titlebar-backgroundColor":{"value":"#8e0d17","edited":false},"page-backgroundColor":{"value":"#fafafa","edited":false},"page-sidebar-backgroundColor":{"value":"#333333","edited":false},"group-textColor":{"value":"#d41322","edited":false},"group-borderColor":{"value":"#ffffff","edited":false},"group-backgroundColor":{"value":"#ffffff","edited":false},"widget-textColor":{"value":"#111111","edited":false},"widget-backgroundColor":{"value":"#8e0d17","edited":false},"widget-borderColor":{"value":"#ffffff","edited":false},"base-font":{"value":"Copperplate,Copperplate Gothic Light,fantasy"}},"angularTheme":{"primary":"indigo","accents":"blue","warn":"red","background":"grey"}},"site":{"name":"Node-RED Dashboard","hideToolbar":"false","allowSwipe":"false","dateFormat":"DD/MM/YYYY","sizes":{"sx":48,"sy":48,"gx":6,"gy":6,"cx":6,"cy":6,"px":0,"py":0}}},{"id":"87356b62.92e3d8","type":"ui_group","z":"","name":"Text to Speech","tab":"52a903f3.ad56fc","order":5,"disp":true,"width":"6","collapse":false},{"id":"c75ad4f0.0cede8","type":"ui_group","z":"","name":"Map","tab":"52a903f3.ad56fc","order":3,"disp":true,"width":"6","collapse":true},{"id":"189cf871.681118","type":"ui_template","z":"41f61d2.fbe09e4","group":"a8ecb9.c60f4348","name":"Welcome","order":1,"width":"3","height":"9","format":"

Welcome to the Node-RED Dashboard

\n

On the right you will see a graph and a chart logging data from the sliders underneath.

","storeOutMessages":false,"fwdInMessages":false,"x":93,"y":45,"wires":[[]]},{"id":"9f19ee5c.beaef","type":"ui_chart","z":"41f61d2.fbe09e4","name":"","group":"bbdf3e02.e8fee","order":1,"width":"0","height":"0","label":"","chartType":"line","xformat":"HH:mm:ss","interpolate":"basis","nodata":"No Data","dot":false,"ymin":"0","ymax":"100","removeOlder":1,"removeOlderPoints":"","removeOlderUnit":"60","cutout":"","colors":["#1f77b4","#aec7e8","#ff7f0e","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"outputs":2,"x":270,"y":200,"wires":[[],[]]},{"id":"799d9318.fd385c","type":"ui_gauge","z":"41f61d2.fbe09e4","name":"","group":"30e652f.d9de3ae","order":2,"width":"","height":"","gtype":"gage","title":"Title","label":"gauge","format":"{{value}}","min":0,"max":"100","colors":["#00b500","#e6e600","#ca3838"],"x":270,"y":140,"wires":[]},{"id":"6f18b200.666a4","type":"ui_button","z":"41f61d2.fbe09e4","name":"","group":"87356b62.92e3d8","order":2,"width":0,"height":0,"passthru":false,"label":"press to talk","tooltip":"","color":"","bgcolor":"","icon":"fa-volume-up","payload":"Hello to Jason Isaacs","payloadType":"str","topic":"","x":110,"y":300,"wires":[["f897d7c2.467a58"]]},{"id":"f897d7c2.467a58","type":"ui_audio","z":"41f61d2.fbe09e4","name":"","group":"30e652f.d9de3ae","voice":"0","x":300,"y":300,"wires":[]},{"id":"da0f7e67.0d38a","type":"ui_slider","z":"41f61d2.fbe09e4","name":"","label":"slider","group":"30e652f.d9de3ae","order":4,"width":0,"height":0,"passthru":true,"topic":"","min":0,"max":"100","step":1,"x":90,"y":140,"wires":[["799d9318.fd385c"]]},{"id":"eabf2bd7.f4e0c8","type":"ui_slider","z":"41f61d2.fbe09e4","name":"","label":"slider","group":"bbdf3e02.e8fee","order":4,"width":0,"height":0,"passthru":true,"topic":"","min":0,"max":"100","step":1,"x":90,"y":200,"wires":[["9f19ee5c.beaef"]]},{"id":"45508d88.744a54","type":"function","z":"41f61d2.fbe09e4","name":"","func":"// create random position\nvar lat = 51 + Math.random() * 0.2;\nvar lon = -1.45 + Math.random() * 0.2;\nmsg.payload={lat:lat, lon:lon, name:\"Jason\", icon:\"male\", url:\"IBM link\"};\nreturn msg;","outputs":1,"noerr":0,"x":270,"y":480,"wires":[["576d953b.3e57dc","1bc50b6.cfc1cf5"]]},{"id":"6ca8cfc2.e0bce","type":"ui_button","z":"41f61d2.fbe09e4","name":"","group":"c75ad4f0.0cede8","order":2,"width":0,"height":0,"passthru":false,"label":"Where's Jason","color":"","bgcolor":"#910000","icon":"fa-male","payload":"","payloadType":"str","topic":"","x":120,"y":480,"wires":[["45508d88.744a54"]]},{"id":"576d953b.3e57dc","type":"worldmap-tracks","z":"41f61d2.fbe09e4","name":"","depth":20,"layer":"combined","x":450,"y":420,"wires":[["1bc50b6.cfc1cf5"]]},{"id":"814a9c85.e6fb8","type":"ui_button","z":"41f61d2.fbe09e4","name":"","group":"c75ad4f0.0cede8","order":3,"width":0,"height":0,"passthru":false,"label":"Remove Jason","tooltip":"","color":"","bgcolor":"#910000","icon":"fa-male","payload":"","payloadType":"str","topic":"","x":110,"y":420,"wires":[["b9d3d78b.360d38"]]},{"id":"b9d3d78b.360d38","type":"function","z":"41f61d2.fbe09e4","name":"","func":"// create random position\nmsg.payload={name:\"Jason\", deleted:true};\nreturn msg;","outputs":1,"noerr":0,"x":270,"y":420,"wires":[["576d953b.3e57dc"]]},{"id":"36c05d33.b783b2","type":"ui_button","z":"41f61d2.fbe09e4","name":"","group":"c75ad4f0.0cede8","order":4,"width":0,"height":0,"passthru":false,"label":"Delete Track","tooltip":"","color":"","bgcolor":"#910000","icon":"fa-male","payload":"","payloadType":"str","topic":"","x":110,"y":360,"wires":[["108b8604.f5bb8a"]]},{"id":"108b8604.f5bb8a","type":"function","z":"41f61d2.fbe09e4","name":"","func":"// create random position\nmsg.payload={name:\"Jason_\", deleted:true};\nreturn msg;","outputs":1,"noerr":0,"x":270,"y":360,"wires":[["1bc50b6.cfc1cf5"]]},{"id":"e90f82d8.46a78","type":"ui_ui_control","z":"41f61d2.fbe09e4","name":"","events":"all","x":320,"y":560,"wires":[[]]},{"id":"c920e625.e95578","type":"ui_button","z":"41f61d2.fbe09e4","name":"","group":"a8ecb9.c60f4348","order":2,"width":0,"height":0,"passthru":false,"label":"Close Map","tooltip":"","color":"","bgcolor":"","icon":"","payload":"{\"group\":{\"close\":[\"My_Simple_Dashboard_Map\"]}}","payloadType":"json","topic":"","x":130,"y":560,"wires":[["e90f82d8.46a78"]]},{"id":"48892dbf.1d3e64","type":"ui_button","z":"41f61d2.fbe09e4","name":"","group":"a8ecb9.c60f4348","order":5,"width":0,"height":0,"passthru":false,"label":"Show Map","tooltip":"","color":"","bgcolor":"","icon":"","payload":"{\"group\":{\"show\":[\"My_Simple_Dashboard_Map\"]}}","payloadType":"json","topic":"","x":130,"y":640,"wires":[["e90f82d8.46a78"]]},{"id":"e44dda45.d85038","type":"ui_button","z":"41f61d2.fbe09e4","name":"","group":"a8ecb9.c60f4348","order":4,"width":0,"height":0,"passthru":false,"label":"Hide Map","tooltip":"","color":"","bgcolor":"","icon":"","payload":"{\"group\":{\"hide\":[\"My_Simple_Dashboard_Map\"]}}","payloadType":"json","topic":"","x":120,"y":680,"wires":[["e90f82d8.46a78"]]},{"id":"1ffc9864.56de48","type":"ui_button","z":"41f61d2.fbe09e4","name":"","group":"a8ecb9.c60f4348","order":3,"width":0,"height":0,"passthru":false,"label":"Open Map","tooltip":"","color":"","bgcolor":"","icon":"","payload":"{\"group\":{\"open\":[\"My_Simple_Dashboard_Map\"]}}","payloadType":"json","topic":"","x":130,"y":600,"wires":[["e90f82d8.46a78"]]},{"id":"1bc50b6.cfc1cf5","type":"ui_worldmap","z":"41f61d2.fbe09e4","group":"c75ad4f0.0cede8","order":1,"width":0,"height":0,"name":"","lat":"","lon":"","zoom":"","layer":"","cluster":"","maxage":"","usermenu":"hide","layers":"hide","panit":"false","panlock":"false","zoomlock":"false","hiderightclick":"true","coords":"none","showgrid":"false","path":"/worldmap","x":500,"y":480,"wires":[]}] \ No newline at end of file diff --git a/main.js b/main.js index a5cb980..345a32e 100755 --- a/main.js +++ b/main.js @@ -70,6 +70,7 @@ if (editable === true) { } store.set("electronFlow",flowfile) } + else { flowfile = path.join(userdir,flowfile); } } else { // We set the user directory to be in the users home directory... userdir = os.homedir() + '/.node-red';