Show latest dns result in Details.vue
This commit is contained in:
parent
712da02324
commit
303adbf9b1
|
@ -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;
|
||||
|
|
|
@ -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,17 @@ class Monitor extends BeanModel {
|
|||
dnsMessage = dnsMessage.slice(0, -2)
|
||||
}
|
||||
|
||||
let dnsLastResult = await R.findOne("monitor", "id = ?", [
|
||||
this.id,
|
||||
]);
|
||||
|
||||
if (dnsLastResult.dnsLastResult !== dnsMessage) {
|
||||
R.exec("UPDATE `monitor` SET dns_last_result = ? WHERE id = ? ", [
|
||||
dnsMessage,
|
||||
this.id
|
||||
]);
|
||||
}
|
||||
|
||||
bean.msg = dnsMessage;
|
||||
bean.status = UP;
|
||||
}
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
<br>
|
||||
<span>{{ $t("Keyword") }}:</span> <span class="keyword">{{ monitor.keyword }}</span>
|
||||
</span>
|
||||
<span v-if="monitor.type === 'dns'">[{{ monitor.dns_resolve_type }}] {{ monitor.hostname }}</span>
|
||||
<span v-if="monitor.type === 'dns'">[{{ monitor.dns_resolve_type }}] {{ monitor.hostname }} [ {{ monitor.dns_last_result }} ]</span>
|
||||
</p>
|
||||
|
||||
<div class="functions">
|
||||
|
|
Loading…
Reference in New Issue