From 010ebea21070c84a6466bbc2bdf5c8b032e5fc3e Mon Sep 17 00:00:00 2001 From: LouisLam Date: Tue, 13 Jul 2021 18:08:12 +0800 Subject: [PATCH] show version in the footer --- server/server.js | 16 ++++++---------- src/layouts/Layout.vue | 18 +++++++++++++++++- src/mixins/socket.js | 12 ++++++++++++ 3 files changed, 35 insertions(+), 11 deletions(-) diff --git a/server/server.js b/server/server.js index a03e5acbb..c335b25f2 100644 --- a/server/server.js +++ b/server/server.js @@ -14,9 +14,7 @@ const {getSettings} = require("./util-server"); const {Notification} = require("./notification") const args = require('args-parser')(process.argv); -console.log("args:") -console.log(args) - +const version = require('../package.json').version; const hostname = args.host || "0.0.0.0" const port = args.port || 3001 @@ -32,18 +30,16 @@ let needSetup = false; app.use('/', express.static("dist")); - app.post('/test-webhook', function(request, response, next) { - console.log("Test Webhook (application/json only)") - console.log("Content-Type: " + request.header("Content-Type")) - console.log(request.body) - response.end(); - }); - app.get('*', function(request, response, next) { response.sendFile(process.cwd() + '/dist/index.html'); }); io.on('connection', async (socket) => { + + socket.emit("info", { + version, + }) + console.log('a user connected'); totalClient++; diff --git a/src/layouts/Layout.vue b/src/layouts/Layout.vue index ef116f4c1..b9aca97f6 100644 --- a/src/layouts/Layout.vue +++ b/src/layouts/Layout.vue @@ -33,6 +33,14 @@ + +