kopia lustrzana https://github.com/OpenBuilds/OpenBuilds-CONTROL
update
rodzic
2d85c9878f
commit
0ea9f68c13
|
@ -3,7 +3,7 @@
|
||||||
#electron dist
|
#electron dist
|
||||||
dist
|
dist
|
||||||
upload
|
upload
|
||||||
ssl
|
electron-builder.yml
|
||||||
|
|
||||||
# Compiled source #
|
# Compiled source #
|
||||||
###################
|
###################
|
||||||
|
|
|
@ -0,0 +1,3 @@
|
||||||
|
owner: OpenBuilds
|
||||||
|
repo: SW-Machine-Drivers
|
||||||
|
provider: github
|
79
index.js
79
index.js
|
@ -19,16 +19,18 @@ var io = new ioServer();
|
||||||
// var anotherIo = io.listen(https);
|
// var anotherIo = io.listen(https);
|
||||||
|
|
||||||
var fs = require('fs');
|
var fs = require('fs');
|
||||||
|
var path = require("path");
|
||||||
|
const join = require('path').join;
|
||||||
|
|
||||||
var httpsOptions = {
|
var httpsOptions = {
|
||||||
key: fs.readFileSync('ssl/localhost.key'),
|
key: fs.readFileSync(path.join(__dirname, 'ssl/localhost.key')),
|
||||||
cert: fs.readFileSync('ssl/localhost.cer')
|
cert: fs.readFileSync(path.join(__dirname, 'ssl/localhost.cer'))
|
||||||
};
|
};
|
||||||
|
|
||||||
const httpsserver = https.createServer(httpsOptions, app).listen(3001, function() {
|
const httpsserver = https.createServer(httpsOptions, app).listen(3001, function() {
|
||||||
console.log('https: listening on:' + ip.address() + ":3001");
|
console.log('https: listening on:' + ip.address() + ":3001");
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
const httpserver = http.listen(config.webPort, '0.0.0.0', function() {
|
const httpserver = http.listen(config.webPort, '0.0.0.0', function() {
|
||||||
console.log('http: listening on:' + ip.address() + ":" + config.webPort);
|
console.log('http: listening on:' + ip.address() + ":" + config.webPort);
|
||||||
// Now refresh library
|
// Now refresh library
|
||||||
|
@ -41,8 +43,6 @@ io.attach(httpsserver);
|
||||||
|
|
||||||
|
|
||||||
const grblStrings = require("./grblStrings.js");
|
const grblStrings = require("./grblStrings.js");
|
||||||
var path = require("path");
|
|
||||||
const join = require('path').join;
|
|
||||||
const serialport = require('serialport');
|
const serialport = require('serialport');
|
||||||
var SerialPort = serialport;
|
var SerialPort = serialport;
|
||||||
var md5 = require('md5');
|
var md5 = require('md5');
|
||||||
|
@ -79,6 +79,71 @@ var appIcon = null,
|
||||||
jogWindow = null,
|
jogWindow = null,
|
||||||
mainWindow = null
|
mainWindow = null
|
||||||
|
|
||||||
|
const {
|
||||||
|
autoUpdater
|
||||||
|
} = require("electron-updater");
|
||||||
|
|
||||||
|
electronApp.on('ready', function() {
|
||||||
|
autoUpdater.checkForUpdates();
|
||||||
|
});
|
||||||
|
|
||||||
|
autoUpdater.on('checking-for-update', () => {
|
||||||
|
var string = 'Checking for update...';
|
||||||
|
io.sockets.emit('data', string);
|
||||||
|
appIcon.displayBalloon({
|
||||||
|
icon: nativeImage.createFromPath(iconPath),
|
||||||
|
title: "OpenBuilds Machine Driver",
|
||||||
|
content: string
|
||||||
|
})
|
||||||
|
})
|
||||||
|
autoUpdater.on('update-available', (ev, info) => {
|
||||||
|
var string = 'Update available.';
|
||||||
|
io.sockets.emit('data', string);
|
||||||
|
appIcon.displayBalloon({
|
||||||
|
icon: nativeImage.createFromPath(iconPath),
|
||||||
|
title: "OpenBuilds Machine Driver",
|
||||||
|
content: string
|
||||||
|
})
|
||||||
|
})
|
||||||
|
autoUpdater.on('update-not-available', (ev, info) => {
|
||||||
|
var string = 'Update not available.';
|
||||||
|
io.sockets.emit('data', string);
|
||||||
|
appIcon.displayBalloon({
|
||||||
|
icon: nativeImage.createFromPath(iconPath),
|
||||||
|
title: "OpenBuilds Machine Driver",
|
||||||
|
content: string
|
||||||
|
})
|
||||||
|
})
|
||||||
|
autoUpdater.on('error', (ev, err) => {
|
||||||
|
var string = 'Error in auto-updater.';
|
||||||
|
io.sockets.emit('data', string);
|
||||||
|
appIcon.displayBalloon({
|
||||||
|
icon: nativeImage.createFromPath(iconPath),
|
||||||
|
title: "OpenBuilds Machine Driver",
|
||||||
|
content: string
|
||||||
|
})
|
||||||
|
})
|
||||||
|
autoUpdater.on('download-progress', (ev, progressObj) => {
|
||||||
|
var string = 'Download progress...';
|
||||||
|
io.sockets.emit('data', string);
|
||||||
|
appIcon.displayBalloon({
|
||||||
|
icon: nativeImage.createFromPath(iconPath),
|
||||||
|
title: "OpenBuilds Machine Driver",
|
||||||
|
content: string
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
|
autoUpdater.on('update-downloaded', (info) => {
|
||||||
|
var string = "New update ready";
|
||||||
|
io.sockets.emit('data', string);
|
||||||
|
appIcon.displayBalloon({
|
||||||
|
icon: nativeImage.createFromPath(iconPath),
|
||||||
|
title: "OpenBuilds Machine Driver",
|
||||||
|
content: string
|
||||||
|
})
|
||||||
|
// autoUpdater.quitAndInstall();
|
||||||
|
});
|
||||||
|
|
||||||
var uploadsDir = electronApp.getPath('userData') + '/upload/';
|
var uploadsDir = electronApp.getPath('userData') + '/upload/';
|
||||||
|
|
||||||
fs.existsSync(uploadsDir) || fs.mkdirSync(uploadsDir)
|
fs.existsSync(uploadsDir) || fs.mkdirSync(uploadsDir)
|
||||||
|
@ -586,6 +651,10 @@ io.on("connection", function(socket) {
|
||||||
electronApp.exit(0);
|
electronApp.exit(0);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
socket.on("applyUpdate", function(data) {
|
||||||
|
autoUpdater.quitAndInstall();
|
||||||
|
})
|
||||||
|
|
||||||
socket.on("connectTo", function(data) { // If a user picks a port to connect to, open a Node SerialPort Instance to it
|
socket.on("connectTo", function(data) { // If a user picks a port to connect to, open a Node SerialPort Instance to it
|
||||||
|
|
||||||
if (status.comms.connectionStatus < 1) {
|
if (status.comms.connectionStatus < 1) {
|
||||||
|
|
12
package.json
12
package.json
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "OpenBuildsMachineDriver",
|
"name": "OpenBuildsMachineDriver",
|
||||||
"version": "1.0.13",
|
"version": "1.0.14",
|
||||||
"license": "AGPL-3.0",
|
"license": "AGPL-3.0",
|
||||||
"description": "Machine Interface Driver for OpenBuilds",
|
"description": "Machine Interface Driver for OpenBuilds",
|
||||||
"author": "github.com/openbuilds",
|
"author": "github.com/openbuilds",
|
||||||
|
@ -12,6 +12,7 @@
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"directory-tree": "^2.1.0",
|
"directory-tree": "^2.1.0",
|
||||||
|
"electron-updater": "^2.23.3",
|
||||||
"express": "^4.16.2",
|
"express": "^4.16.2",
|
||||||
"formidable": "^1.2.1",
|
"formidable": "^1.2.1",
|
||||||
"gcodethumbnail": "^1.0.1",
|
"gcodethumbnail": "^1.0.1",
|
||||||
|
@ -28,14 +29,12 @@
|
||||||
"test": "echo \"Error: no test specified\" && exit 0",
|
"test": "echo \"Error: no test specified\" && exit 0",
|
||||||
"dist": "build",
|
"dist": "build",
|
||||||
"distmac": "build --mac ",
|
"distmac": "build --mac ",
|
||||||
"distwinx86": "build --win --ia32 ",
|
"ship": "build --win -p always"
|
||||||
"distwinx64": "build --win --x64",
|
|
||||||
"distlinx86": "build --linux --ia32 ",
|
|
||||||
"distlinx64": "build --linux --x64"
|
|
||||||
},
|
},
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"usb"
|
"usb"
|
||||||
],
|
],
|
||||||
|
"repository": "https://github.com/OpenBuilds/SW-Machine-Drivers",
|
||||||
"build": {
|
"build": {
|
||||||
"appId": "openbuilds.projectmakr",
|
"appId": "openbuilds.projectmakr",
|
||||||
"productName": "OpenBuilds Machine Driver",
|
"productName": "OpenBuilds Machine Driver",
|
||||||
|
@ -51,6 +50,9 @@
|
||||||
"files": [
|
"files": [
|
||||||
"**/*"
|
"**/*"
|
||||||
],
|
],
|
||||||
|
"extraFiles": [
|
||||||
|
"ssl"
|
||||||
|
],
|
||||||
"linux": {
|
"linux": {
|
||||||
"icon": "build/"
|
"icon": "build/"
|
||||||
},
|
},
|
||||||
|
|
Ładowanie…
Reference in New Issue