diff --git a/main.js b/main.js index 66b0b36..0624ce3 100755 --- a/main.js +++ b/main.js @@ -426,43 +426,44 @@ function createWindow() { // If on a Mac add some touchbar buttons... if (process.platform === 'darwin') { - const touchButton1 = new TouchBarButton({ - label: 'Editor', - backgroundColor: '#910000', - click: () => { mainWindow.loadURL("http://localhost:"+listenPort+urledit); } - }); - const touchButton2 = new TouchBarButton({ + const touchButton1 = new TouchBarButton({ label: 'Dashboard', backgroundColor: '#910000', click: () => { mainWindow.loadURL("http://localhost:"+listenPort+urldash); } }); + const touchButton2 = new TouchBarButton({ + label: 'Editor', + backgroundColor: '#910000', + click: () => { mainWindow.loadURL("http://localhost:"+listenPort+urledit); } + }); + const touchButton3 = new TouchBarButton({ label: 'Map', backgroundColor: '#910000', click: () => { mainWindow.loadURL("http://localhost:"+listenPort+urlmap); } }); - const spacer = new TouchBarSpacer({ size: 'flexible' }); - const touchButton4 = new TouchBarButton({ label: 'Console', backgroundColor: '#910000', click: () => { createConsole(); } }); - var items = [ touchButton2 ]; - if (editable) { items.push(touchButton1) } + var items = [ touchButton1 ]; + if (editable) { items.push(touchButton2) } if (showMap) { items.push(touchButton3) } if (editable) { - items.push(spacer); + items.push(new TouchBarSpacer({ size: 'flexible' })); items.push(touchButton4); } - const mainTouchBar = new TouchBar({ items: items }); - - mainWindow.setTouchBar(mainTouchBar); + // Only bother to add buttons if more than one + if (items.length != 1) { + const mainTouchBar = new TouchBar({ items: items }); + mainWindow.setTouchBar(mainTouchBar); + } } // Start the app full screen diff --git a/merger.js b/merger.js index 9ff06b9..62ca180 100755 --- a/merger.js +++ b/merger.js @@ -22,8 +22,8 @@ if (process.argv.length === 3 ) { app = require(arg); } } - else { - app = require(path.join(arg, "package.json")); + else { + app = require(path.join(arg, "package.json")); dn = arg; } } @@ -40,12 +40,12 @@ const merge = { pkg.dependencies = merge; // Try to get flow file name from package.json setiings if (app.hasOwnProperty("node-red") && app["node-red"].hasOwnProperty("settings") && app["node-red"].settings.hasOwnProperty("flowFile") ) { - pkg.NRelectron.flowFile = app["node-red"].settings.flowFile; + pkg.NRelectron.flowFile = app["node-red"].settings.flowFile; } // or the npm scripts if there is a run command else if (app.hasOwnProperty("scripts") && app.scripts.hasOwnProperty("start")) { pkg.NRelectron.flowFile = app.scripts.start.split(' ').pop(); } // or the command line if the user gave us a name - or just guess flow.json. -else { +else { pkg.NRelectron.flowFile = flowfile || "flow.json"; } @@ -73,7 +73,7 @@ fs.copyFile(path.join(arg, creds), path.join("./", creds), (err) => { else { console.log('Copied creds file - '+creds); } }); -// Finally re-write th new package.json +// Finally re-write the new package.json fs.writeFile("./package.json", JSON.stringify(pkg, null, 4), 'utf8', function (err) { if (err) { console.log("Failed to re-write package.json file."); } else { diff --git a/package-template.json b/package-template.json index a58b001..13ad2b8 100644 --- a/package-template.json +++ b/package-template.json @@ -11,7 +11,7 @@ "kioskMode": false, "addNodes": true, "flowFile": "electronflow.json", - "start": "editor" + "start": "dashboard" }, "scripts": { "pack": "electron-builder --dir",