kopia lustrzana https://github.com/dceejay/electron-node-red
Several enhancements thanks to dceejay !
rodzic
7c33bbefd9
commit
10f77ce158
|
@ -25,13 +25,13 @@ If you want to distribute executables of this project, the easiest way is to use
|
|||
sudo npm install -g electron-packager
|
||||
|
||||
# build for OS X 64 bits
|
||||
electron-packager electron-node-red MyAppName --icon=nodered.icns --platform=darwin --arch=x64
|
||||
electron-packager electron-node-red Node-RED --icon=nodered.icns --platform=darwin --arch=x64
|
||||
|
||||
# build for Windows 64 bits
|
||||
electron-packager electron-node-red MyAppName --icon=nodered.icns --platform=win32 --arch=x64
|
||||
electron-packager electron-node-red Node-RED --icon=nodered.icns --platform=win32 --arch=x64
|
||||
|
||||
# build for Linux 64 bits
|
||||
electron-packager electron-node-red MyAppName --icon=nodered.icns --platform=linux --arch=x64
|
||||
electron-packager electron-node-red Node-RED --icon=nodered.icns --platform=linux --arch=x64
|
||||
```
|
||||
|
||||
Learn more about Electron and its API in the [documentation](http://electron.atom.io/docs/latest).
|
||||
|
|
|
@ -1 +1 @@
|
|||
[{"type":"tab","id":"41f61d2.fbe09e4","label":"Flow 1"},{"id":"52a903f3.ad56fc","type":"ui_tab","z":"41f61d2.fbe09e4","name":"Home","icon":"dashboard","order":"1"},{"id":"d3a0fd6d.2c5f","type":"ui_slider","z":"41f61d2.fbe09e4","tab":"52a903f3.ad56fc","name":"Slider","topic":"","group":"","order":1,"min":0,"max":10,"x":425.5,"y":116,"wires":[["42ddca5b.bd2234"]]},{"id":"42ddca5b.bd2234","type":"ui_gauge","z":"41f61d2.fbe09e4","tab":"52a903f3.ad56fc","name":"Gauge","group":"","order":1,"format":"{{value}}","min":0,"max":10,"x":578.5,"y":116,"wires":[]},{"id":"852d9c04.7ad26","type":"ui_link","z":"41f61d2.fbe09e4","name":"Admin","link":"http://localhost:8000/admin","icon":"open_in_browser","order":1,"x":405.5,"y":195,"wires":[]},{"id":"fce4a072.031b6","type":"ui_button","z":"41f61d2.fbe09e4","tab":"52a903f3.ad56fc","name":"Button","payload":"","topic":"","group":"","order":1,"x":397.5,"y":251,"wires":[[]]}]
|
||||
[{"type":"tab","id":"41f61d2.fbe09e4","label":"Flow 1"},{"id":"52a903f3.ad56fc","type":"ui_tab","z":"41f61d2.fbe09e4","name":"Home","icon":"dashboard","order":"1"},{"id":"d3a0fd6d.2c5f","type":"ui_slider","z":"41f61d2.fbe09e4","tab":"52a903f3.ad56fc","name":"Slider","topic":"","group":"","order":"3","min":0,"max":10,"x":147.5,"y":87,"wires":[["42ddca5b.bd2234"]]},{"id":"42ddca5b.bd2234","type":"ui_gauge","z":"41f61d2.fbe09e4","tab":"52a903f3.ad56fc","name":"Gauge","group":"","order":"2","format":"{{value}}","min":0,"max":10,"x":300.5,"y":87,"wires":[]},{"id":"852d9c04.7ad26","type":"ui_link","z":"41f61d2.fbe09e4","name":"Admin","link":"http://localhost:8000/admin","icon":"open_in_browser","order":1,"x":72.5,"y":273,"wires":[]},{"id":"fce4a072.031b6","type":"ui_button","z":"41f61d2.fbe09e4","tab":"52a903f3.ad56fc","name":"Button","payload":"Hello !","topic":"","group":"","order":"4","x":124.5,"y":145,"wires":[["a09bb056.68216"]]},{"id":"a09bb056.68216","type":"ui_toast","z":"41f61d2.fbe09e4","name":"","x":328,"y":144,"wires":[]},{"id":"189cf871.681118","type":"ui_template","z":"41f61d2.fbe09e4","tab":"52a903f3.ad56fc","name":"Welcome","group":"Introduction","order":1,"format":"<h3>Welcome to Node-RED</h3>\nOn the right you will see some simple widgets to play with.\nTo get started making something a bit more useful click the menu icon at the top-left, and select <b>Admin</b>.","storeOutMessages":false,"fwdInMessages":false,"x":81,"y":45,"wires":[[]]}]
|
|
@ -6,6 +6,7 @@ const app = electron.app;
|
|||
// Module to create native browser window.
|
||||
const BrowserWindow = electron.BrowserWindow;
|
||||
|
||||
var Menu = require("menu");
|
||||
var http = require('http');
|
||||
var express = require("express");
|
||||
var RED = require("node-red");
|
||||
|
@ -54,14 +55,16 @@ function createWindow () {
|
|||
nodeIntegration: false
|
||||
},
|
||||
width: 1024,
|
||||
height: 768
|
||||
height: 768,
|
||||
icon: __dirname + "/nodered.png"
|
||||
});
|
||||
|
||||
mainWindow.loadURL("http://localhost:8000/ui");
|
||||
var webContents = mainWindow.webContents;
|
||||
webContents.on('did-get-response-details', function(event, status, newURL, originalURL, httpResponseCode) {
|
||||
if (httpResponseCode == 404)
|
||||
if (httpResponseCode == 404) {
|
||||
setTimeout(webContents.reload, 200);
|
||||
}
|
||||
});
|
||||
|
||||
// Open the DevTools.
|
||||
|
@ -95,4 +98,27 @@ app.on('activate', function () {
|
|||
if (mainWindow === null) {
|
||||
createWindow();
|
||||
}
|
||||
|
||||
// Create the Application's main menu
|
||||
var template = [{
|
||||
label: "Application",
|
||||
submenu: [
|
||||
{ label: "About Application", selector: "orderFrontStandardAboutPanel:" },
|
||||
{ type: "separator" },
|
||||
{ label: "Quit", accelerator: "Command+Q", click: function() { app.quit(); }}
|
||||
]}, {
|
||||
label: "Edit",
|
||||
submenu: [
|
||||
{ label: "Undo", accelerator: "CmdOrCtrl+Z", selector: "undo:" },
|
||||
{ label: "Redo", accelerator: "Shift+CmdOrCtrl+Z", selector: "redo:" },
|
||||
{ type: "separator" },
|
||||
{ label: "Cut", accelerator: "CmdOrCtrl+X", selector: "cut:" },
|
||||
{ label: "Copy", accelerator: "CmdOrCtrl+C", selector: "copy:" },
|
||||
{ label: "Paste", accelerator: "CmdOrCtrl+V", selector: "paste:" },
|
||||
{ label: "Select All", accelerator: "CmdOrCtrl+A", selector: "selectAll:" }
|
||||
]}
|
||||
];
|
||||
|
||||
Menu.setApplicationMenu(Menu.buildFromTemplate(template));
|
||||
|
||||
});
|
||||
|
|
BIN
nodered.icns
BIN
nodered.icns
Plik binarny nie jest wyświetlany.
Plik binarny nie jest wyświetlany.
Po Szerokość: | Wysokość: | Rozmiar: 1.3 KiB |
Ładowanie…
Reference in New Issue