kopia lustrzana https://github.com/OpenBuilds/OpenBuilds-CONTROL
v1.0.177 test
rodzic
668b9aad60
commit
31c329aeac
|
@ -24,7 +24,7 @@
|
||||||
|
|
||||||
|
|
||||||
<div class="window" style="height: 100vh;">
|
<div class="window" style="height: 100vh;">
|
||||||
<div class="window-caption bg-openbuilds" style="-webkit-app-region: drag;">
|
<div id="windowtitlebar" class="window-caption bg-openbuilds" style="-webkit-app-region: drag;">
|
||||||
<!-- <span class="icon mif-cog"></span> -->
|
<!-- <span class="icon mif-cog"></span> -->
|
||||||
<span class="icon"><img src="icon-transparent.png"/></span>
|
<span class="icon"><img src="icon-transparent.png"/></span>
|
||||||
<span class="title" id="windowtitle">OpenBuilds CONTROL</span>
|
<span class="title" id="windowtitle">OpenBuilds CONTROL</span>
|
||||||
|
|
|
@ -262,6 +262,9 @@ function initSocket() {
|
||||||
|
|
||||||
if (nostatusyet) {
|
if (nostatusyet) {
|
||||||
$('#windowtitle').html("OpenBuilds CONTROL v" + status.driver.version)
|
$('#windowtitle').html("OpenBuilds CONTROL v" + status.driver.version)
|
||||||
|
if (status.driver.operatingsystem == "rpi") {
|
||||||
|
$('#windowtitlebar').hide();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
nostatusyet = false;
|
nostatusyet = false;
|
||||||
|
|
||||||
|
|
24
index.js
24
index.js
|
@ -215,6 +215,7 @@ var status = {
|
||||||
driver: {
|
driver: {
|
||||||
version: require('./package').version,
|
version: require('./package').version,
|
||||||
ipaddress: ip.address(),
|
ipaddress: ip.address(),
|
||||||
|
operatingsystem: false
|
||||||
},
|
},
|
||||||
machine: {
|
machine: {
|
||||||
name: '',
|
name: '',
|
||||||
|
@ -2179,8 +2180,9 @@ if (isElectron()) {
|
||||||
function createApp() {
|
function createApp() {
|
||||||
createTrayIcon();
|
createTrayIcon();
|
||||||
if (process.platform == 'darwin') {
|
if (process.platform == 'darwin') {
|
||||||
console.log("Creating MacOS Menu")
|
console.log("Creating MacOS Menu");
|
||||||
createMenu()
|
createMenu();
|
||||||
|
status.driver.operatingsystem = 'macos';
|
||||||
}
|
}
|
||||||
if (process.platform == 'win32' && process.argv.length >= 2) {
|
if (process.platform == 'win32' && process.argv.length >= 2) {
|
||||||
var openFilePath = process.argv[1];
|
var openFilePath = process.argv[1];
|
||||||
|
@ -2437,6 +2439,8 @@ if (isElectron()) {
|
||||||
var isPi = require('detect-rpi');
|
var isPi = require('detect-rpi');
|
||||||
if (isPi()) {
|
if (isPi()) {
|
||||||
console.log('Running on Raspberry Pi!');
|
console.log('Running on Raspberry Pi!');
|
||||||
|
status.driver.operatingsystem = 'rpi'
|
||||||
|
startChrome();
|
||||||
} else {
|
} else {
|
||||||
console.log("Running under NodeJS...");
|
console.log("Running under NodeJS...");
|
||||||
}
|
}
|
||||||
|
@ -2563,4 +2567,20 @@ function isJson(item) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function startChrome(callback) {
|
||||||
|
if (status.driver.operatingsystem == 'rpi') {
|
||||||
|
var terminal = cp.spawn('bash');
|
||||||
|
var chrome = {};
|
||||||
|
|
||||||
|
terminal.on('exit', function(code) {
|
||||||
|
console.log('child process exited with code ' + code);
|
||||||
|
console.log('Starting chrome');
|
||||||
|
chrome = cp.spawn('`which chromium-browser`', [
|
||||||
|
'--app=http://127.0.0.1:3000'
|
||||||
|
]);
|
||||||
|
callback(chrome);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
process.on('exit', () => console.log('exit'))
|
process.on('exit', () => console.log('exit'))
|
Ładowanie…
Reference in New Issue