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 575827f34..f8e5856d0 100644 --- a/server/database.js +++ b/server/database.js @@ -70,7 +70,8 @@ class Database { "patch-maintenance-table2.sql": true, "patch-add-gamedig-monitor.sql": true, "patch-add-google-analytics-status-page-tag.sql": true, - "patch-http-body-encoding.sql": true + "patch-http-body-encoding.sql": true, + "patch-add-description-monitor.sql": true, }; /** diff --git a/server/model/monitor.js b/server/model/monitor.js index ef29ba3b8..312ac732b 100644 --- a/server/model/monitor.js +++ b/server/model/monitor.js @@ -72,6 +72,7 @@ class Monitor extends BeanModel { let data = { id: this.id, name: this.name, + description: this.description, url: this.url, method: this.method, hostname: this.hostname, diff --git a/server/server.js b/server/server.js index 57a6a8fa7..1965f38ed 100644 --- a/server/server.js +++ b/server/server.js @@ -678,6 +678,7 @@ let needSetup = false; } bean.name = monitor.name; + bean.description = monitor.description; bean.type = monitor.type; bean.url = monitor.url; bean.method = monitor.method; @@ -1318,6 +1319,7 @@ let needSetup = false; 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 115660a5e..d64b43c18 100644 --- a/src/components/MonitorList.vue +++ b/src/components/MonitorList.vue @@ -19,7 +19,7 @@ {{ $t("No Monitors, please") }} {{ $t("add one") }} - +
diff --git a/src/lang/en.json b/src/lang/en.json index ad55fe6e8..c9889fad6 100644 --- a/src/lang/en.json +++ b/src/lang/en.json @@ -442,6 +442,7 @@ "Clone Monitor": "Clone Monitor", "Clone": "Clone", "cloneOf": "Clone of {0}", + "Description": "Description", "smtp": "Email (SMTP)", "secureOptionNone": "None / STARTTLS (25, 587)", "secureOptionTLS": "TLS (465)", diff --git a/src/pages/Details.vue b/src/pages/Details.vue index 9cf02d65e..ba034136c 100644 --- a/src/pages/Details.vue +++ b/src/pages/Details.vue @@ -2,6 +2,7 @@

{{ monitor.name }}

+

{{ monitor.description }}

diff --git a/src/pages/EditMonitor.vue b/src/pages/EditMonitor.vue index 4a4ae9823..fa1935b0c 100644 --- a/src/pages/EditMonitor.vue +++ b/src/pages/EditMonitor.vue @@ -414,6 +414,12 @@
+ +
+ + +
+