|
|
@ -60,7 +60,7 @@
|
|
|
|
@click="$refs.monitorSettingDialog.show(group, monitor)"
|
|
|
|
@click="$refs.monitorSettingDialog.show(group, monitor)"
|
|
|
|
/>
|
|
|
|
/>
|
|
|
|
</span>
|
|
|
|
</span>
|
|
|
|
<p v-if="showCertificateExpiry" class="item-name"> Expiry: {{ formatExpiry(monitor) }} </p>
|
|
|
|
<span class="badge rounded-pill" :class=" 'bg-' + certExpiryColor(monitor)"> {{ $t("Expiry") }}: {{ formattedCertExpiryMessage(monitor) }} </span>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div v-if="showTags" class="tags">
|
|
|
|
<div v-if="showTags" class="tags">
|
|
|
|
<Tag v-for="tag in monitor.element.tags" :key="tag" :item="tag" :size="'sm'" />
|
|
|
|
<Tag v-for="tag in monitor.element.tags" :key="tag" :item="tag" :size="'sm'" />
|
|
|
@ -165,12 +165,26 @@ export default {
|
|
|
|
* @param {Object} monitor Monitor to show expiry for
|
|
|
|
* @param {Object} monitor Monitor to show expiry for
|
|
|
|
* @returns {string}
|
|
|
|
* @returns {string}
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
formatExpiry(monitor) {
|
|
|
|
formattedCertExpiryMessage(monitor) {
|
|
|
|
if (monitor?.element?.validCert) {
|
|
|
|
if (monitor?.element?.validCert && monitor?.element?.certExpiryDaysRemaining) {
|
|
|
|
return monitor.element.certExpiryDaysRemaining + " days";
|
|
|
|
return monitor.element.certExpiryDaysRemaining + " " + this.$tc("day", monitor.element.certExpiryDaysRemaining);
|
|
|
|
|
|
|
|
} else if (monitor?.element?.validCert === false) {
|
|
|
|
|
|
|
|
return this.$t("noOrBadCertificate");
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
return monitor.element.certExpiryDaysRemaining;
|
|
|
|
return "";
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
* Returns certificate expiry based on days remaining
|
|
|
|
|
|
|
|
* @param {Object} monitor Monitor to show expiry for
|
|
|
|
|
|
|
|
* @returns {string}
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
certExpiryColor(monitor) {
|
|
|
|
|
|
|
|
if (monitor?.element?.validCert) {
|
|
|
|
|
|
|
|
return monitor.element.certExpiryDaysRemaining > 7 ? "primary" : "danger";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return "danger";
|
|
|
|
},
|
|
|
|
},
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
};
|
|
|
|