mirror of
https://github.com/louislam/uptime-kuma.git
synced 2025-08-21 20:02:29 +08:00
Status page certificate expiry
This commit is contained in:
@@ -60,6 +60,7 @@
|
||||
@click="$refs.monitorSettingDialog.show(group, monitor)"
|
||||
/>
|
||||
</span>
|
||||
<p v-if="showCertificateExpiry" class="item-name"> Expiry: {{ formatExpiry(monitor) }} </p>
|
||||
</div>
|
||||
<div v-if="showTags" class="tags">
|
||||
<Tag v-for="tag in monitor.element.tags" :key="tag" :item="tag" :size="'sm'" />
|
||||
@@ -103,6 +104,10 @@ export default {
|
||||
/** Should tags be shown? */
|
||||
showTags: {
|
||||
type: Boolean,
|
||||
},
|
||||
/** Should expiry be shown? */
|
||||
showCertificateExpiry: {
|
||||
type: Boolean,
|
||||
}
|
||||
},
|
||||
data() {
|
||||
@@ -154,6 +159,19 @@ export default {
|
||||
}
|
||||
return monitor.element.sendUrl && monitor.element.url && monitor.element.url !== "https://" && !this.editMode;
|
||||
},
|
||||
|
||||
/**
|
||||
* Returns formatted certificate expiry or Bad cert message
|
||||
* @param {Object} monitor Monitor to show expiry for
|
||||
* @returns {string}
|
||||
*/
|
||||
formatExpiry(monitor) {
|
||||
if (monitor?.element?.validCert) {
|
||||
return monitor.element.certExpiryDaysRemaining + " days";
|
||||
} else {
|
||||
return monitor.element.certExpiryDaysRemaining;
|
||||
}
|
||||
},
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
Reference in New Issue
Block a user