Text update

pull/716/head
NeuralMiner 3 years ago
parent a419aa527f
commit 8cb26d2b31

@ -131,7 +131,7 @@ class Database {
console.info("Latest database version: " + this.latestVersion); console.info("Latest database version: " + this.latestVersion);
if (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) { } else if (version > this.latestVersion) {
console.info("Warning: Database version is newer than expected"); console.info("Warning: Database version is newer than expected");
} else { } else {
@ -152,8 +152,8 @@ class Database {
await Database.close(); await Database.close();
console.error(ex); 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"); console.error("Please submit a bug report if you still encounter the problem after restart: https://github.com/louislam/uptime-kuma/issues");
this.restore(); this.restore();
process.exit(1); process.exit(1);
@ -191,7 +191,7 @@ class Database {
await Database.close(); await Database.close();
console.error(ex); 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"); console.error("Please submit the bug report if you still encounter the problem after restart: https://github.com/louislam/uptime-kuma/issues");
this.restore(); this.restore();
@ -232,7 +232,7 @@ class Database {
this.patched = true; this.patched = true;
await this.importSQLFile("./db/" + sqlFilename); await this.importSQLFile("./db/" + sqlFilename);
databasePatchedFiles[sqlFilename] = true; databasePatchedFiles[sqlFilename] = true;
console.log(sqlFilename + " is patched successfully"); console.log(sqlFilename + " was patched successfully");
} else { } else {
debug(sqlFilename + " is already patched, skip"); debug(sqlFilename + " is already patched, skip");
@ -287,7 +287,7 @@ class Database {
}; };
process.addListener("unhandledRejection", listener); process.addListener("unhandledRejection", listener);
console.log("Closing DB"); console.log("Closing the database");
while (true) { while (true) {
Database.noReject = true; Database.noReject = true;
@ -297,7 +297,7 @@ class Database {
if (Database.noReject) { if (Database.noReject) {
break; break;
} else { } else {
console.log("Waiting to close the db"); console.log("Waiting to close the database");
} }
} }
console.log("SQLite closed"); console.log("SQLite closed");
@ -312,7 +312,7 @@ class Database {
*/ */
static backup(version) { static backup(version) {
if (! this.backupPath) { if (! this.backupPath) {
console.info("Backup the db"); console.info("Backup the database");
this.backupPath = this.dataDir + "kuma.db.bak" + version; this.backupPath = this.dataDir + "kuma.db.bak" + version;
fs.copyFileSync(Database.path, this.backupPath); fs.copyFileSync(Database.path, this.backupPath);
@ -335,7 +335,7 @@ class Database {
*/ */
static restore() { static restore() {
if (this.backupPath) { 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 shmPath = Database.path + "-shm";
const walPath = Database.path + "-wal"; const walPath = Database.path + "-wal";
@ -354,7 +354,7 @@ class Database {
fs.unlinkSync(walPath); fs.unlinkSync(walPath);
} }
} catch (e) { } 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); process.exit(1);
} }

@ -1,7 +1,6 @@
console.log("Welcome to Uptime Kuma"); console.log("Welcome to Uptime Kuma");
const args = require("args-parser")(process.argv); const args = require("args-parser")(process.argv);
const { sleep, debug, getRandomInt, genSecret } = require("../src/util"); const { sleep, debug, getRandomInt, genSecret } = require("../src/util");
const config = require("./config");
debug(args); debug(args);
@ -9,6 +8,10 @@ if (! process.env.NODE_ENV) {
process.env.NODE_ENV = "production"; 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("Node Env: " + process.env.NODE_ENV);
console.log("Importing Node libraries"); 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; const testMode = !!args["test"] || false;
if (config.demoMode) { if (demoMode) {
console.log("==== Demo Mode ===="); console.log("==== Demo Mode ====");
} }
@ -440,7 +443,7 @@ exports.entryPage = "dashboard";
socket.on("setup", async (username, password, callback) => { socket.on("setup", async (username, password, callback) => {
try { try {
if ((await R.count("user")) !== 0) { 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"); let user = R.dispense("user");
@ -1328,7 +1331,7 @@ async function initDatabase() {
fs.copyFileSync(Database.templatePath, Database.path); fs.copyFileSync(Database.templatePath, Database.path);
} }
console.log("Connecting to Database"); console.log("Connecting to the Database");
await Database.connect(); await Database.connect();
console.log("Connected"); console.log("Connected");
@ -1428,7 +1431,7 @@ async function shutdownFunction(signal) {
} }
function finalFunction() { function finalFunction() {
console.log("Graceful shutdown successfully!"); console.log("Graceful shutdown successful!");
} }
gracefulShutdown(server, { gracefulShutdown(server, {

@ -467,7 +467,7 @@ export default {
return; return;
} }
// Beautiful the JSON format // Beautify the JSON format
if (this.monitor.body) { if (this.monitor.body) {
this.monitor.body = JSON.stringify(JSON.parse(this.monitor.body), null, 4); this.monitor.body = JSON.stringify(JSON.parse(this.monitor.body), null, 4);
} }

@ -75,7 +75,7 @@ export default {
this.processing = true; this.processing = true;
if (this.password !== this.repeatPassword) { if (this.password !== this.repeatPassword) {
toast.error("Repeat password do not match."); toast.error("Passwords do not match.");
this.processing = false; this.processing = false;
return; return;
} }

Loading…
Cancel
Save