feat: Domain name expiry (#6413)

Co-authored-by: AiroPi <47398145+AiroPi@users.noreply.github.com>
Co-authored-by: Frank Elsinga <frank@elsinga.de>
This commit is contained in:
Shaan
2025-12-20 16:32:49 +00:00
committed by GitHub
co-authored by AiroPi Frank Elsinga
parent f3c76dbc6f
commit eb0b6cdb09
17 changed files with 926 additions and 14 deletions
+19
View File
@@ -298,6 +298,21 @@
<font-awesome-icon v-if="tlsInfo.hostnameMatchMonitorUrl === false" class="cert-info-warn" icon="exclamation-triangle" :title="$t('certHostnameMismatch')" />
</span>
</div>
<div
v-if="domainInfo"
class="col-12 col-sm col row d-flex align-items-center d-sm-block"
>
<h4 class="col-4 col-sm-12">{{ $t("labelDomainExpiry") }}</h4>
<p class="col-4 col-sm-12 mb-0 mb-sm-2">
(<Datetime
:value="domainInfo.expiresOn"
date-only
/>)
</p>
<span class="col-4 col-sm-12 num">
{{ domainInfo.daysRemaining }} {{ $tc("day", domainInfo.daysRemaining ) }}
</span>
</div>
</div>
</div>
@@ -626,6 +641,10 @@ export default {
return null;
},
domainInfo() {
return this.$root.domainInfoList[this.monitor.id] || null;
},
showCertInfoBox() {
return this.tlsInfo != null && this.toggleCertInfoBox;
},
+29
View File
@@ -797,6 +797,14 @@
</div>
</div>
<div v-if="hasDomain" class="my-3 form-check">
<input id="domain-expiry-notification" v-model="monitor.domainExpiryNotification" class="form-check-input" type="checkbox">
<label class="form-check-label" for="domain-expiry-notification">
{{ $t("labelDomainNameExpiryNotification") }}
</label>
<div class="form-text">
</div>
</div>
<div v-if="monitor.type === 'websocket-upgrade' " class="my-3 form-check">
<input id="wsIgnoreSecWebsocketAcceptHeader" v-model="monitor.wsIgnoreSecWebsocketAcceptHeader" class="form-check-input" type="checkbox">
<i18n-t tag="label" keypath="Ignore Sec-WebSocket-Accept header" class="form-check-label" for="wsIgnoreSecWebsocketAcceptHeader">
@@ -1331,6 +1339,7 @@ const monitorDefaults = {
ignoreTls: false,
upsideDown: false,
expiryNotification: false,
domainExpiryNotification: true,
maxredirects: 10,
accepted_statuscodes: [ "200-299" ],
dns_resolve_type: "A",
@@ -1387,6 +1396,7 @@ export default {
notificationIDList: {},
// Do not add default value here, please check init() method
},
hasDomain: false,
acceptedStatusCodeOptions: [],
dnsresolvetypeOptions: [],
kafkaSaslMechanismOptions: [],
@@ -1461,6 +1471,16 @@ export default {
return null;
},
monitorTypeUrlHost() {
const { type, url, hostname, grpcUrl } = this.monitor;
return {
type,
url,
hostname,
grpcUrl
};
},
pageName() {
let name = "Add New Monitor";
if (this.isClone) {
@@ -1738,6 +1758,15 @@ message HealthCheckResponse {
}
},
"monitorTypeUrlHost"(data) {
this.$root.getSocket().emit("checkMointor", data, (res) => {
this.hasDomain = !!res?.domain;
if (!res?.domain) {
this.monitor.domainExpiryNotification = false;
}
});
},
"monitor.type"(newType, oldType) {
if (oldType && this.monitor.type === "websocket-upgrade") {
this.monitor.url = "wss://";
+4
View File
@@ -179,6 +179,10 @@ export default {
this.settings.tlsExpiryNotifyDays = [ 7, 14, 21 ];
}
if (this.settings.domainExpiryNotifyDays === undefined) {
this.settings.domainExpiryNotifyDays = [ 7, 14, 21 ];
}
if (this.settings.trustProxy === undefined) {
this.settings.trustProxy = false;
}