aboutsummaryrefslogtreecommitdiff
path: root/src/SocketIO/index.js
diff options
context:
space:
mode:
authorJakob Stendahl <jakob.stendahl@outlook.com>2021-10-21 01:48:47 +0200
committerJakob Stendahl <jakob.stendahl@outlook.com>2021-10-21 01:48:47 +0200
commit909265bad527a7c1e493b4e84d0e2be64114274c (patch)
treea27f1aa7728c8c382efff444cde5a2b355cef833 /src/SocketIO/index.js
parentd12577a79300dee1fe7c8567fa71095e6c8b8a9d (diff)
downloadLuxcena-Neo-909265bad527a7c1e493b4e84d0e2be64114274c.tar.gz
Luxcena-Neo-909265bad527a7c1e493b4e84d0e2be64114274c.zip
:sparkles: Add self updater that actually does something (maybe)
Diffstat (limited to 'src/SocketIO/index.js')
-rw-r--r--src/SocketIO/index.js22
1 files changed, 21 insertions, 1 deletions
diff --git a/src/SocketIO/index.js b/src/SocketIO/index.js
index ec1cedf..6e71dbe 100644
--- a/src/SocketIO/index.js
+++ b/src/SocketIO/index.js
@@ -99,6 +99,10 @@ function createOpenSocketNamespace(io) {
socket.on("disconnect", () => {
logger.access(`SOCKET:open Client (${socket.id}@${socket.handshake.headers.host}) disconnected.`);
});
+
+ if (neoModules.selfUpdater.updater.updating) {
+ socket.emit("updater", "start");
+ }
});
neoModules.neoRuntimeManager.event.on("change", (name, value) => {
@@ -111,6 +115,12 @@ function createOpenSocketNamespace(io) {
openNamespace.emit("var", name, value);
}
});
+ neoModules.selfUpdater.updater.event.on("start", () => {
+ openNamespace.emit("updater", "start");
+ });
+ neoModules.selfUpdater.updater.event.on("end", () => {
+ openNamespace.emit("updater", "end");
+ });
}
/**
@@ -194,7 +204,7 @@ function createAuthorizedNamespace(io) {
fn({success: true});
});
socket.on("system:update_version", () => {
- neoModules.selfUpdater.doUpdate();
+ neoModules.selfUpdater.updater.forceUpdate();
});
/* SSLCert */
@@ -307,6 +317,16 @@ function createAuthorizedNamespace(io) {
}
});
});
+
+ neoModules.selfUpdater.updater.event.on("step", (step) => {
+ authorizedNamespace.emit("updater:step", step);
+ });
+ neoModules.selfUpdater.updater.event.on("command", (command) => {
+ authorizedNamespace.emit("updater:command", command);
+ });
+ neoModules.selfUpdater.updater.event.on("error", (updateLog) => {
+ authorizedNamespace.emit("updater:error", updateLog);
+ });
}
/**