diff --git a/db/patch7.sql b/db/patch7.sql
index 2e8eba15..4085daf3 100644
--- a/db/patch7.sql
+++ b/db/patch7.sql
@@ -7,4 +7,7 @@ ALTER TABLE monitor
ALTER TABLE monitor
ADD dns_resolve_server VARCHAR(255);
+ALTER TABLE monitor
+ ADD dns_last_result VARCHAR(255);
+
COMMIT;
diff --git a/db/patch8.sql b/db/patch8.sql
new file mode 100644
index 00000000..d63a5947
--- /dev/null
+++ b/db/patch8.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 dns_last_result VARCHAR(255);
+
+COMMIT;
diff --git a/server/database.js b/server/database.js
index 2b9b715c..7ce81be1 100644
--- a/server/database.js
+++ b/server/database.js
@@ -6,7 +6,7 @@ class Database {
static templatePath = "./db/kuma.db"
static path = "./data/kuma.db";
- static latestVersion = 7;
+ static latestVersion = 8;
static noReject = true;
static sqliteInstance = null;
diff --git a/server/model/monitor.js b/server/model/monitor.js
index f5efadc1..6d0d812b 100644
--- a/server/model/monitor.js
+++ b/server/model/monitor.js
@@ -50,6 +50,7 @@ class Monitor extends BeanModel {
accepted_statuscodes: this.getAcceptedStatuscodes(),
dns_resolve_type: this.dns_resolve_type,
dns_resolve_server: this.dns_resolve_server,
+ dns_last_result: this.dns_last_result,
notificationIDList,
};
}
@@ -207,6 +208,13 @@ class Monitor extends BeanModel {
dnsMessage = dnsMessage.slice(0, -2)
}
+ if (this.dnsLastResult !== dnsMessage) {
+ R.exec("UPDATE `monitor` SET dns_last_result = ? WHERE id = ? ", [
+ dnsMessage,
+ this.id
+ ]);
+ }
+
bean.msg = dnsMessage;
bean.status = UP;
}
diff --git a/src/languages/de-DE.js b/src/languages/de-DE.js
index 93d3da1d..ba852cf3 100644
--- a/src/languages/de-DE.js
+++ b/src/languages/de-DE.js
@@ -102,4 +102,6 @@ export default {
resoverserverDescription: "Cloudflare ist der Standardserver, dieser kann jederzeit geändern werden.",
"Resolver Server": "Auflösungsserver",
rrtypeDescription: "Wähle den RR-Typ aus, welchen du überwachen möchtest.",
+ "Last Result": "Letztes Ergebnis",
+ pauseMonitorMsg: "Bist du sicher das du den Monitor pausieren möchtest?",
}
diff --git a/src/languages/en.js b/src/languages/en.js
index ebacfac8..75c25dd5 100644
--- a/src/languages/en.js
+++ b/src/languages/en.js
@@ -15,4 +15,5 @@ export default {
deleteNotificationMsg: "Are you sure want to delete this notification for all monitors?",
resoverserverDescription: "Cloudflare is the default server, you can change the resolver server anytime.",
rrtypeDescription: "Select the RR-Type you want to monitor",
+ pauseMonitorMsg: "Are you sure want to pause?",
}
diff --git a/src/pages/Details.vue b/src/pages/Details.vue
index f06f9e13..cc45e403 100644
--- a/src/pages/Details.vue
+++ b/src/pages/Details.vue
@@ -10,7 +10,10 @@
{{ $t("Keyword") }}: {{ monitor.keyword }}
- [{{ monitor.dns_resolve_type }}] {{ monitor.hostname }}
+ [{{ monitor.dns_resolve_type }}] {{ monitor.hostname }}
+
+ {{ $t("Last Result") }}: {{ monitor.dns_last_result }}
+