diff --git a/db/patch-status-page.sql b/db/patch-status-page.sql index 584eb615c..be4667f27 100644 --- a/db/patch-status-page.sql +++ b/db/patch-status-page.sql @@ -5,14 +5,15 @@ CREATE TABLE [status_page]( [id] INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, [slug] VARCHAR(255) NOT NULL UNIQUE, [title] VARCHAR(255) NOT NULL, + [description] TEXT, [icon] VARCHAR(255) NOT NULL, [theme] VARCHAR(30) NOT NULL, [published] BOOLEAN NOT NULL DEFAULT 1, [search_engine_index] BOOLEAN NOT NULL DEFAULT 1, [show_tags] BOOLEAN NOT NULL DEFAULT 0, [password] VARCHAR, - [date_created] DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, - [date_modified] DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP + [created_date] DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, + [modified_date] DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ); CREATE UNIQUE INDEX [slug] ON [status_page]([slug]); diff --git a/server/database.js b/server/database.js index 81d77bfae..6fb99b0d2 100644 --- a/server/database.js +++ b/server/database.js @@ -233,6 +233,7 @@ class Database { let statusPage = R.dispense("status_page"); statusPage.slug = ""; statusPage.title = title; + statusPage.description = await setting("description"); statusPage.icon = await setting("icon"); statusPage.theme = await setting("statusPageTheme"); statusPage.published = await setting("statusPagePublished"); diff --git a/server/model/status_page.js b/server/model/status_page.js index eab89d4a9..6ab7a5f41 100644 --- a/server/model/status_page.js +++ b/server/model/status_page.js @@ -21,6 +21,7 @@ class StatusPage extends BeanModel { id: this.id, slug: this.slug, title: this.title, + description: this.description, icon: this.icon, theme: this.theme, published: !!this.published, @@ -32,6 +33,7 @@ class StatusPage extends BeanModel { return { slug: this.slug, title: this.title, + description: this.description, icon: this.icon, theme: this.theme, published: !!this.published, diff --git a/server/routers/api-router.js b/server/routers/api-router.js index 0b8a46b40..a9ca4710c 100644 --- a/server/routers/api-router.js +++ b/server/routers/api-router.js @@ -220,11 +220,7 @@ async function checkPublished() { * @returns {Promise} */ async function isPublished() { - const value = await setting("statusPagePublished"); - if (value === null) { - return true; - } - return value; + return true; } function send403(res, msg = "") { diff --git a/server/socket-handlers/status-page-socket-handler.js b/server/socket-handlers/status-page-socket-handler.js index 8ddc8b75b..42e0b9a0a 100644 --- a/server/socket-handlers/status-page-socket-handler.js +++ b/server/socket-handlers/status-page-socket-handler.js @@ -107,12 +107,14 @@ module.exports.statusPageSocketHandler = (socket) => { statusPage.slug = config.slug; statusPage.title = config.title; + statusPage.description = config.description; statusPage.icon = config.logo; statusPage.theme = config.theme; //statusPage.published = ; //statusPage.search_engine_index = ; statusPage.show_tags = config.showTags; //statusPage.password = null; + statusPage.modified_date = R.isoDateTime(); await R.store(statusPage); diff --git a/src/pages/StatusPage.vue b/src/pages/StatusPage.vue index de87ef9c7..09c3dc572 100644 --- a/src/pages/StatusPage.vue +++ b/src/pages/StatusPage.vue @@ -436,6 +436,14 @@ export default { this.slug = "default"; } + axios.get("/api/status-page/" + this.slug).then((res) => { + this.config = res.data; + + if (this.config.logo) { + this.imgDataUrl = this.config.logo; + } + }); + axios.get("/api/status-page/config/" + this.slug).then((res) => { this.config = res.data;