From f6c1b92fc673b9548b7973e16d0378c3f2413106 Mon Sep 17 00:00:00 2001 From: Tarun Singh Date: Mon, 17 Jul 2023 02:01:10 -0400 Subject: [PATCH] Added http type check and tags based design --- server/model/monitor.js | 3 ++- src/components/PublicGroupList.vue | 23 ++++++++++++++++++----- 2 files changed, 20 insertions(+), 6 deletions(-) diff --git a/server/model/monitor.js b/server/model/monitor.js index 7449f1590..4d760d366 100644 --- a/server/model/monitor.js +++ b/server/model/monitor.js @@ -42,6 +42,7 @@ class Monitor extends BeanModel { id: this.id, name: this.name, sendUrl: this.sendUrl, + type: this.type, }; if (this.sendUrl) { @@ -52,7 +53,7 @@ class Monitor extends BeanModel { obj.tags = await this.getTags(); } - if (certExpiry) { + if (certExpiry && this.type === "http") { const { certExpiryDaysRemaining, validCert } = await this.getCertExpiry(this.id); obj.certExpiryDaysRemaining = certExpiryDaysRemaining; obj.validCert = validCert; diff --git a/src/components/PublicGroupList.vue b/src/components/PublicGroupList.vue index 59d639719..b885a1a17 100644 --- a/src/components/PublicGroupList.vue +++ b/src/components/PublicGroupList.vue @@ -60,10 +60,14 @@ @click="$refs.monitorSettingDialog.show(group, monitor)" /> - {{ $t("Expiry") }}: {{ formattedCertExpiryMessage(monitor) }} -
- +
+
+ +
+
+ +
@@ -182,9 +186,9 @@ export default { */ certExpiryColor(monitor) { if (monitor?.element?.validCert && monitor.element.certExpiryDaysRemaining > 7) { - return "primary"; + return "#059669"; } - return "danger"; + return "#DC2626"; }, } }; @@ -193,6 +197,15 @@ export default {