kopia lustrzana https://github.com/dceejay/electron-node-red
add kiosk mode (dangerous)
rodzic
457537b15d
commit
28f7c6fbff
|
@ -0,0 +1,15 @@
|
|||
{
|
||||
// Use IntelliSense to learn about possible attributes.
|
||||
// Hover to view descriptions of existing attributes.
|
||||
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
|
||||
"version": "0.2.0",
|
||||
"configurations": [
|
||||
{
|
||||
"type": "node",
|
||||
"request": "launch",
|
||||
"name": "Electron Main",
|
||||
"runtimeExecutable": "${workspaceFolder}/node_modules/.bin/electron",
|
||||
"program": "${workspaceFolder}/main.js"
|
||||
}
|
||||
]
|
||||
}
|
|
@ -51,7 +51,7 @@ yarn && yarn dist -m // for mac
|
|||
These will generally fail the first time through and you will need to install some extra library in order to make it
|
||||
complete successfully.
|
||||
|
||||
The defaults are to build a `.msi` for Windows, a `.dmg` for Mac and both a `.deb` and `.rpm` for Linux.
|
||||
The defaults are to build a `.msi` for Windows, a `.dmg` for Mac, and both a `.deb` and `.rpm` for Linux.
|
||||
These can be changed by editing the build section of the `package.json` file, see the
|
||||
[electron-builder config docs](https://www.electron.build/configuration/configuration) for more info.
|
||||
|
||||
|
|
File diff suppressed because one or more lines are too long
16
main.js
16
main.js
|
@ -6,6 +6,7 @@
|
|||
const editable = true; // Set this to false to create a run only application - no editor/no console
|
||||
const allowLoadSave = false; // set to true to allow import and export of flow file
|
||||
const showMap = false; // set to true to add Worldmap to the menu
|
||||
const kioskMode = false; // set to true to start in kiosk mode
|
||||
|
||||
let flowfile = 'electronflow.json'; // default Flows file name - loaded at start
|
||||
const urldash = "/ui/#/0"; // Start on the dashboard page
|
||||
|
@ -215,9 +216,11 @@ if (process.platform !== 'darwin') {
|
|||
template[tempNum].submenu.push({ type: "separator" });
|
||||
template[tempNum].submenu.push({ role: 'togglefullscreen' });
|
||||
template[tempNum].submenu.push({ role: 'quit' });
|
||||
if (!showMap) { template[tempNum].submenu.splice(8,1); }
|
||||
}
|
||||
else {
|
||||
if (!showMap) { template[tempNum].submenu.splice(6,1); }
|
||||
}
|
||||
|
||||
if (!showMap) { template[tempNum].submenu.splice(8,1); }
|
||||
|
||||
if (!editable) {
|
||||
template[tempNum].submenu.splice(3,1);
|
||||
|
@ -251,8 +254,7 @@ function saveFlow() {
|
|||
function openFlow() {
|
||||
dialog.showOpenDialog({ filters:[{ name:'JSON', extensions:['json']} ]},
|
||||
function (fileNames) {
|
||||
if (fileNames) {
|
||||
//console.log(fileNames[0]);
|
||||
if (fileNames && fileNames.length > 0) {
|
||||
fs.readFile(fileNames[0], 'utf-8', function (err, data) {
|
||||
try {
|
||||
var flo = JSON.parse(data);
|
||||
|
@ -305,11 +307,11 @@ function createConsole() {
|
|||
function createWindow() {
|
||||
mainWindow = new BrowserWindow({
|
||||
title: "Node-RED",
|
||||
//titleBarStyle: "hidden",
|
||||
width: 1024,
|
||||
height: 768,
|
||||
icon: path.join(__dirname, nrIcon),
|
||||
fullscreenable: true,
|
||||
kiosk: kioskMode,
|
||||
autoHideMenuBar: true,
|
||||
webPreferences: {
|
||||
nodeIntegration: false
|
||||
|
@ -327,8 +329,8 @@ function createWindow() {
|
|||
}
|
||||
});
|
||||
|
||||
// mainWindow.webContents.on('did-finish-load', () => {
|
||||
// console.log("LOADED DASHBOARD");
|
||||
// mainWindow.webContents.on('did-finish-load', (a) => {
|
||||
// console.log("FINISHED LOAD",a);
|
||||
// });
|
||||
|
||||
mainWindow.webContents.on("new-window", function(e, url, frameName, disposition, options) {
|
||||
|
|
Ładowanie…
Reference in New Issue