mirror of
https://github.com/louislam/uptime-kuma.git
synced 2025-03-09 19:04:45 +00:00
Cleaned up name selection and friendlyNameRequired
Signed-off-by: Computroniks <mnickson@sidingsmedia.com>
This commit is contained in:
parent
e049a0c98e
commit
d764e80068
1 changed files with 4 additions and 10 deletions
|
@ -497,13 +497,7 @@ export default {
|
||||||
|
|
||||||
// Check if friendly name has been supplied. If not, use URL
|
// Check if friendly name has been supplied. If not, use URL
|
||||||
// or hostname
|
// or hostname
|
||||||
if (this.monitor.name === "") {
|
this.monitor.name = this.monitor.name || this.monitor.hostname || this.monitor.url;
|
||||||
if (this.monitor.hostname === null || this.monitor.hostname === "") {
|
|
||||||
this.monitor.name = this.monitor.url;
|
|
||||||
} else {
|
|
||||||
this.monitor.name = this.monitor.hostname;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!this.isInputValid()) {
|
if (!this.isInputValid()) {
|
||||||
this.processing = false;
|
this.processing = false;
|
||||||
|
@ -554,14 +548,14 @@ export default {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Is the friendly name required for the selected option.
|
* Is the friendly name required for the selected option.
|
||||||
* Returns true if it is else null
|
* Returns true if it is else false
|
||||||
* @returns {null|true}
|
* @returns {boolean}
|
||||||
*/
|
*/
|
||||||
friendlyNameRequired() {
|
friendlyNameRequired() {
|
||||||
if (this.friendlyNameRequiredOptions.includes(this.monitor.type)) {
|
if (this.friendlyNameRequiredOptions.includes(this.monitor.type)) {
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
return null;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
Loading…
Add table
Reference in a new issue