diff --git a/db/patch-add-description-monitor.sql b/db/patch-add-description-monitor.sql new file mode 100644 index 000000000..da1aa55bc --- /dev/null +++ b/db/patch-add-description-monitor.sql @@ -0,0 +1,7 @@ +-- You should not modify if this have pushed to Github, unless it does serious wrong with the db. +BEGIN TRANSACTION; + +ALTER TABLE monitor + ADD description TEXT default null; + +COMMIT; diff --git a/server/database.js b/server/database.js index afcace705..55f08a0c7 100644 --- a/server/database.js +++ b/server/database.js @@ -53,6 +53,7 @@ class Database { "patch-2fa-invalidate-used-token.sql": true, "patch-notification_sent_history.sql": true, "patch-monitor-basic-auth.sql": true, + "patch-add-description-monitor.sql": true, } /** diff --git a/server/model/monitor.js b/server/model/monitor.js index 6aa614b74..50f11e879 100644 --- a/server/model/monitor.js +++ b/server/model/monitor.js @@ -31,6 +31,7 @@ class Monitor extends BeanModel { return { id: this.id, name: this.name, + description: this.description, }; } @@ -54,6 +55,7 @@ class Monitor extends BeanModel { return { id: this.id, name: this.name, + description: this.description, url: this.url, method: this.method, body: this.body, diff --git a/server/server.js b/server/server.js index 868bbd5ef..794f67b42 100644 --- a/server/server.js +++ b/server/server.js @@ -568,6 +568,7 @@ exports.entryPage = "dashboard"; } bean.name = monitor.name; + bean.description = monitor.description; bean.type = monitor.type; bean.url = monitor.url; bean.method = monitor.method; @@ -1134,6 +1135,7 @@ exports.entryPage = "dashboard"; let monitor = { // Define the new variable from earlier here name: monitorListData[i].name, + description: monitorListData[i].description, type: monitorListData[i].type, url: monitorListData[i].url, method: monitorListData[i].method || "GET", diff --git a/src/components/MonitorList.vue b/src/components/MonitorList.vue index ef51e89cd..29d14d1f9 100644 --- a/src/components/MonitorList.vue +++ b/src/components/MonitorList.vue @@ -23,6 +23,9 @@