Feat: Add database storage for TLS info

This commit is contained in:
Nelson Chan
2021-07-22 16:04:32 +08:00
parent ccda6f05f5
commit 96c60dd94a
5 changed files with 59 additions and 12 deletions

View File

@@ -59,7 +59,17 @@ export default {
this.$router.push("/setup")
});
socket.on('monitorList', (data) => {
socket.on("monitorList", (data) => {
// Add Helper function
Object.entries(data).forEach(([monitorID, monitor]) => {
monitor.getUrl = () => {
try {
return new URL(monitor.url);
} catch (_) {
return null;
}
};
});
this.monitorList = data;
});
@@ -116,7 +126,7 @@ export default {
});
socket.on('certInfo', (monitorID, data) => {
this.certInfoList[monitorID] = data
this.certInfoList[monitorID] = JSON.parse(data)
});
socket.on('importantHeartbeatList', (monitorID, data) => {

View File

@@ -54,7 +54,7 @@
</div>
</div>
<div class="shadow-box big-padding text-center stats" v-if="monitor.type === 'http' && monitor.url.startsWith('https') && certInfo != null">
<div class="shadow-box big-padding text-center stats" v-if="monitor.type === 'http' && monitor.getUrl().protocol === 'https:' && certInfo != null">
<div class="row">
<div class="col">
<h4>Certificate Info</h4>