mirror of
https://github.com/louislam/uptime-kuma.git
synced 2024-10-01 01:25:45 -04:00
Fix #3712
This commit is contained in:
parent
33804d8823
commit
ff51704cdf
@ -53,7 +53,7 @@ class Monitor extends BeanModel {
|
|||||||
obj.tags = await this.getTags();
|
obj.tags = await this.getTags();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (certExpiry && this.type === "http") {
|
if (certExpiry && this.type === "http" && this.getURLProtocol() === "https:") {
|
||||||
const { certExpiryDaysRemaining, validCert } = await this.getCertExpiry(this.id);
|
const { certExpiryDaysRemaining, validCert } = await this.getCertExpiry(this.id);
|
||||||
obj.certExpiryDaysRemaining = certExpiryDaysRemaining;
|
obj.certExpiryDaysRemaining = certExpiryDaysRemaining;
|
||||||
obj.validCert = validCert;
|
obj.validCert = validCert;
|
||||||
@ -1075,6 +1075,19 @@ class Monitor extends BeanModel {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Example: http: or https:
|
||||||
|
* @returns {(null|string)}
|
||||||
|
*/
|
||||||
|
getURLProtocol() {
|
||||||
|
const url = this.getUrl();
|
||||||
|
if (url) {
|
||||||
|
return this.getUrl().protocol;
|
||||||
|
} else {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Store TLS info to database
|
* Store TLS info to database
|
||||||
* @param checkCertificateResult
|
* @param checkCertificateResult
|
||||||
|
@ -62,7 +62,7 @@
|
|||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="extra-info">
|
<div class="extra-info">
|
||||||
<div v-if="showCertificateExpiry && monitor.element.type === 'http'">
|
<div v-if="showCertificateExpiry && monitor.element.certExpiryDaysRemaining">
|
||||||
<Tag :item="{name: $t('Cert Exp.'), value: formattedCertExpiryMessage(monitor), color: certExpiryColor(monitor)}" :size="'sm'" />
|
<Tag :item="{name: $t('Cert Exp.'), value: formattedCertExpiryMessage(monitor), color: certExpiryColor(monitor)}" :size="'sm'" />
|
||||||
</div>
|
</div>
|
||||||
<div v-if="showTags">
|
<div v-if="showTags">
|
||||||
|
Loading…
Reference in New Issue
Block a user