diff --git a/.gitignore b/.gitignore index efdc8c3..2c41b3f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,18 +1,15 @@ dist/* lib/* -package-lock.json node_modules +logs .config.json -.flows.json.backup +.electronflow* .sessions.json *darwin-x64* *linux-x64* *win32-x64* -*.back -.config.json.backup -.electronflow* -*.backup -logs +*.back* *.log -yarn.lock +*lock* +*error* diff --git a/dockbuild b/dockerbuilder similarity index 91% rename from dockbuild rename to dockerbuilder index 8cd9c3e..5a961be 100755 --- a/dockbuild +++ b/dockerbuilder @@ -1 +1 @@ -docker run --rm -ti --env-file <(env | grep -iE 'DEBUG|NODE_|ELECTRON_|YARN_|NPM_|CI|CIRCLE|TRAVIS_TAG|TRAVIS|TRAVIS_REPO_|TRAVIS_BUILD_|TRAVIS_BRANCH|TRAVIS_PULL_REQUEST_|APPVEYOR_|CSC_|GH_|GITHUB_|BT_|AWS_|STRIP|BUILD_') --env ELECTRON_CACHE="/root/.cache/electron" --env ELECTRON_BUILDER_CACHE="/root/.cache/electron-builder" -v ${PWD}:/project -v ${PWD##*/}-node-modules:/project/node_modules -v ~/.cache/electron:/root/.cache/electron -v ~/.cache/electron-builder:/root/.cache/electron-builder electronuserland/builder:wine && yarn && yarn dist +docker run --rm -ti --env-file <(env | grep -iE 'DEBUG|NODE_|ELECTRON_|YARN_|NPM_|CI|CIRCLE|TRAVIS_TAG|TRAVIS|TRAVIS_REPO_|TRAVIS_BUILD_|TRAVIS_BRANCH|TRAVIS_PULL_REQUEST_|APPVEYOR_|CSC_|GH_|GITHUB_|BT_|AWS_|STRIP|BUILD_') --env ELECTRON_CACHE="/root/.cache/electron" --env ELECTRON_BUILDER_CACHE="/root/.cache/electron-builder" -v ${PWD}:/project -v ${PWD##*/}-node-modules:/project/node_modules -v ~/.cache/electron:/root/.cache/electron -v ~/.cache/electron-builder:/root/.cache/electron-builder electronuserland/builder:wine diff --git a/electronflow.json b/electronflow.json index 7e2201c..d8fbe3c 100644 --- a/electronflow.json +++ b/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":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,"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":"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 diff --git a/main.js b/main.js index ad4da67..b4e73a3 100755 --- a/main.js +++ b/main.js @@ -5,7 +5,7 @@ let options; if (pkg.hasOwnProperty("NRelectron")) { options = pkg["NRelectron"] } // Some settings you can edit if you don't set them in package.json -console.log(options) +//console.log(options) const editable = options.editable || true; // set this to false to create a run only application - no editor/no console const allowLoadSave = options.allowLoadSave || false; // set to true to allow import and export of flow file const showMap = options.showMap || false; // set to true to add Worldmap to the menu @@ -157,7 +157,7 @@ red_app.use(settings.httpNodeRoot,RED.httpNode); // Create the Application's main menu var template = [{ - label: 'Node-RED', + label: "View", submenu: [ { label: 'Import Flow', accelerator: "Shift+CmdOrCtrl+O", @@ -320,17 +320,18 @@ function createWindow() { height: 768, icon: path.join(__dirname, nrIcon), fullscreenable: true, + autoHideMenuBar: false, kiosk: kioskMode, - autoHideMenuBar: true, webPreferences: { nodeIntegration: false } }); + const menu = Menu.buildFromTemplate(template); Menu.setApplicationMenu(menu); + if (process.platform !== 'darwin') { mainWindow.autoHideMenuBar(true); } mainWindow.loadURL(`file://${__dirname}/load.html`); - //if (process.platform !== 'darwin') { mainWindow.setAutoHideMenuBar(true); } mainWindow.webContents.on('did-get-response-details', function(event, status, newURL, originalURL, httpResponseCode) { if ((httpResponseCode == 404) && (newURL == ("http://localhost:"+listenPort+urlStart))) {