From 8cb26d2b31c0984a34a35cb35dd01b94b02c5674 Mon Sep 17 00:00:00 2001 From: NeuralMiner Date: Fri, 15 Oct 2021 19:12:09 -0600 Subject: [PATCH] Text update --- server/database.js | 20 ++++++++++---------- server/server.js | 13 ++++++++----- src/pages/EditMonitor.vue | 2 +- src/pages/Setup.vue | 2 +- 4 files changed, 20 insertions(+), 17 deletions(-) diff --git a/server/database.js b/server/database.js index 297df655..4c7e5364 100644 --- a/server/database.js +++ b/server/database.js @@ -131,7 +131,7 @@ class Database { console.info("Latest database version: " + this.latestVersion); if (version === this.latestVersion) { - console.info("Database no need to patch"); + console.info("Database patch not needed"); } else if (version > this.latestVersion) { console.info("Warning: Database version is newer than expected"); } else { @@ -152,8 +152,8 @@ class Database { await Database.close(); console.error(ex); - console.error("Start Uptime-Kuma failed due to patch db failed"); - console.error("Please submit the bug report if you still encounter the problem after restart: https://github.com/louislam/uptime-kuma/issues"); + console.error("Start Uptime-Kuma failed due to issue patching the database"); + console.error("Please submit a bug report if you still encounter the problem after restart: https://github.com/louislam/uptime-kuma/issues"); this.restore(); process.exit(1); @@ -191,7 +191,7 @@ class Database { await Database.close(); console.error(ex); - console.error("Start Uptime-Kuma failed due to patch db failed"); + console.error("Start Uptime-Kuma failed due to issue patching the database"); console.error("Please submit the bug report if you still encounter the problem after restart: https://github.com/louislam/uptime-kuma/issues"); this.restore(); @@ -232,7 +232,7 @@ class Database { this.patched = true; await this.importSQLFile("./db/" + sqlFilename); databasePatchedFiles[sqlFilename] = true; - console.log(sqlFilename + " is patched successfully"); + console.log(sqlFilename + " was patched successfully"); } else { debug(sqlFilename + " is already patched, skip"); @@ -287,7 +287,7 @@ class Database { }; process.addListener("unhandledRejection", listener); - console.log("Closing DB"); + console.log("Closing the database"); while (true) { Database.noReject = true; @@ -297,7 +297,7 @@ class Database { if (Database.noReject) { break; } else { - console.log("Waiting to close the db"); + console.log("Waiting to close the database"); } } console.log("SQLite closed"); @@ -312,7 +312,7 @@ class Database { */ static backup(version) { if (! this.backupPath) { - console.info("Backup the db"); + console.info("Backup the database"); this.backupPath = this.dataDir + "kuma.db.bak" + version; fs.copyFileSync(Database.path, this.backupPath); @@ -335,7 +335,7 @@ class Database { */ static restore() { if (this.backupPath) { - console.error("Patch db failed!!! Restoring the backup"); + console.error("Patching the database failed!!! Restoring the backup"); const shmPath = Database.path + "-shm"; const walPath = Database.path + "-wal"; @@ -354,7 +354,7 @@ class Database { fs.unlinkSync(walPath); } } catch (e) { - console.log("Restore failed, you may need to restore the backup manually"); + console.log("Restore failed; you may need to restore the backup manually"); process.exit(1); } diff --git a/server/server.js b/server/server.js index 8d994d3b..329484f5 100644 --- a/server/server.js +++ b/server/server.js @@ -1,7 +1,6 @@ console.log("Welcome to Uptime Kuma"); const args = require("args-parser")(process.argv); const { sleep, debug, getRandomInt, genSecret } = require("../src/util"); -const config = require("./config"); debug(args); @@ -9,6 +8,10 @@ if (! process.env.NODE_ENV) { process.env.NODE_ENV = "production"; } +// Demo Mode? +const demoMode = args["demo"] || false; +exports.demoMode = demoMode; + console.log("Node Env: " + process.env.NODE_ENV); console.log("Importing Node libraries"); @@ -81,7 +84,7 @@ const sslCert = process.env.UPTIME_KUMA_SSL_CERT || process.env.SSL_CERT || args */ const testMode = !!args["test"] || false; -if (config.demoMode) { +if (demoMode) { console.log("==== Demo Mode ===="); } @@ -440,7 +443,7 @@ exports.entryPage = "dashboard"; socket.on("setup", async (username, password, callback) => { try { if ((await R.count("user")) !== 0) { - throw new Error("Uptime Kuma has been setup. If you want to setup again, please delete the database."); + throw new Error("Uptime Kuma has been set up. If you want to setup again, please delete the database."); } let user = R.dispense("user"); @@ -1328,7 +1331,7 @@ async function initDatabase() { fs.copyFileSync(Database.templatePath, Database.path); } - console.log("Connecting to Database"); + console.log("Connecting to the Database"); await Database.connect(); console.log("Connected"); @@ -1428,7 +1431,7 @@ async function shutdownFunction(signal) { } function finalFunction() { - console.log("Graceful shutdown successfully!"); + console.log("Graceful shutdown successful!"); } gracefulShutdown(server, { diff --git a/src/pages/EditMonitor.vue b/src/pages/EditMonitor.vue index b2349021..06258256 100644 --- a/src/pages/EditMonitor.vue +++ b/src/pages/EditMonitor.vue @@ -467,7 +467,7 @@ export default { return; } - // Beautiful the JSON format + // Beautify the JSON format if (this.monitor.body) { this.monitor.body = JSON.stringify(JSON.parse(this.monitor.body), null, 4); } diff --git a/src/pages/Setup.vue b/src/pages/Setup.vue index 5a4f836f..ed8ea3ef 100644 --- a/src/pages/Setup.vue +++ b/src/pages/Setup.vue @@ -75,7 +75,7 @@ export default { this.processing = true; if (this.password !== this.repeatPassword) { - toast.error("Repeat password do not match."); + toast.error("Passwords do not match."); this.processing = false; return; }