mirror of
https://github.com/louislam/uptime-kuma.git
synced 2025-01-02 00:10:42 +02:00
Updated: Enhance null safety and set default URL in EditMonitor.vue
- Added optional chaining to safely access `this.monitor.hostname`. - Introduced default URL (`https://`) assignment to `this.monitor.url`. - Ensured `hostname` is trimmed after the URL is set. modified: src/pages/EditMonitor.vue
This commit is contained in:
parent
488e542ad8
commit
33ebfefc58
@ -1719,7 +1719,12 @@ message HealthCheckResponse {
|
||||
this.monitor.headers = JSON.stringify(JSON.parse(this.monitor.headers), null, 4);
|
||||
}
|
||||
|
||||
if (this.monitor.hostname) {
|
||||
// Check if the 'monitor' object exists and contains a 'hostname' property.
|
||||
if (this.monitor?.hostname) {
|
||||
// Initialize the 'url' property of 'monitor' to the base URL scheme.
|
||||
this.monitor.url = "https://";
|
||||
|
||||
// Remove any leading or trailing spaces from the 'hostname' value.
|
||||
this.monitor.hostname = this.monitor.hostname.trim();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user