Cleaned up name selection and friendlyNameRequired

Signed-off-by: Computroniks <mnickson@sidingsmedia.com>
This commit is contained in:
Computroniks 2022-01-29 21:29:52 +00:00
parent e049a0c98e
commit d764e80068
No known key found for this signature in database
GPG key ID: AB524D88499439A1

View file

@ -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;
} }
} }
}, },