kopia lustrzana https://github.com/dceejay/electron-node-red
add flag to disable palette manager, add quit confirmation dialog
rodzic
d88c9ecaca
commit
218a9daf75
|
@ -72,7 +72,7 @@ Runtimes are created in the `dist` directory under the `electron-node-red` proje
|
||||||
Generally you can just add the required parameter to the command
|
Generally you can just add the required parameter to the command
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
yarn && yarn dist -w // for windows
|
yarn && yarn dist -w // for windows (see below for building on Mac Catalina)
|
||||||
yarn && yarn dist -l // for linux
|
yarn && yarn dist -l // for linux
|
||||||
yarn && yarn dist -m // for mac
|
yarn && yarn dist -m // for mac
|
||||||
```
|
```
|
||||||
|
|
16
main.js
16
main.js
|
@ -10,6 +10,7 @@ const editable = options.editable || true; // set this to false to create
|
||||||
const allowLoadSave = options.allowLoadSave || false; // set to true to allow import and export of flow file
|
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
|
const showMap = options.showMap || false; // set to true to add Worldmap to the menu
|
||||||
const kioskMode = options.kioskMode || false; // set to true to start in kiosk mode
|
const kioskMode = options.kioskMode || false; // set to true to start in kiosk mode
|
||||||
|
const addNodes = options.addNodes || true; // set to false to block installing extra nodes
|
||||||
let flowfile = options.flowFile || 'electronflow.json'; // default Flows file name - loaded at start
|
let flowfile = options.flowFile || 'electronflow.json'; // default Flows file name - loaded at start
|
||||||
|
|
||||||
const urldash = "/ui/#/0"; // url for the dashboard page
|
const urldash = "/ui/#/0"; // url for the dashboard page
|
||||||
|
@ -112,7 +113,7 @@ var settings = {
|
||||||
httpNodeRoot: "/",
|
httpNodeRoot: "/",
|
||||||
userDir: userdir,
|
userDir: userdir,
|
||||||
flowFile: flowfile,
|
flowFile: flowfile,
|
||||||
editorTheme: { projects:{ enabled:false } }, // enable projects feature
|
editorTheme: { projects:{ enabled:false }, palette: { editable:addNodes } }, // enable projects feature
|
||||||
functionGlobalContext: { }, // enables global context - add extras ehre if you need them
|
functionGlobalContext: { }, // enables global context - add extras ehre if you need them
|
||||||
logging: {
|
logging: {
|
||||||
websock: {
|
websock: {
|
||||||
|
@ -354,6 +355,19 @@ function createWindow() {
|
||||||
option.height = w.height;
|
option.height = w.height;
|
||||||
})
|
})
|
||||||
|
|
||||||
|
mainWindow.on('close', function(e) {
|
||||||
|
const choice = require('electron').dialog.showMessageBoxSync(this, {
|
||||||
|
type: 'question',
|
||||||
|
icon: nrIcon,
|
||||||
|
buttons: ['Yes', 'No'],
|
||||||
|
title: 'Confirm',
|
||||||
|
message: 'Are you sure you want to quit?'
|
||||||
|
});
|
||||||
|
if (choice === 1) {
|
||||||
|
e.preventDefault();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
mainWindow.on('closed', () => {
|
mainWindow.on('closed', () => {
|
||||||
mainWindow = null;
|
mainWindow = null;
|
||||||
});
|
});
|
||||||
|
|
|
@ -9,6 +9,7 @@
|
||||||
"allowLoadSave": false,
|
"allowLoadSave": false,
|
||||||
"showMap": false,
|
"showMap": false,
|
||||||
"kioskMode": false,
|
"kioskMode": false,
|
||||||
|
"addNodes": true,
|
||||||
"flowFile": "electronflow.json",
|
"flowFile": "electronflow.json",
|
||||||
"start": "editor"
|
"start": "editor"
|
||||||
},
|
},
|
||||||
|
|
Ładowanie…
Reference in New Issue