mirror of
https://github.com/louislam/uptime-kuma.git
synced 2025-05-24 07:42:35 +02:00
Fixed the issue that clicking the Settings button on the edit status page was invalid
This commit is contained in:
parent
436ac1b2ca
commit
853e84178e
2 changed files with 182 additions and 170 deletions
|
@ -72,11 +72,17 @@ export default {
|
|||
* @returns {void}
|
||||
*/
|
||||
show(group, monitor) {
|
||||
// Check if monitor exists and has required properties
|
||||
if (!monitor || !monitor.id) {
|
||||
console.error("Invalid monitor object", monitor);
|
||||
return;
|
||||
}
|
||||
|
||||
this.monitor = {
|
||||
id: monitor.element.id,
|
||||
name: monitor.element.name,
|
||||
monitor_index: monitor.index,
|
||||
group_index: group.index,
|
||||
id: monitor.id,
|
||||
name: monitor.name,
|
||||
monitor_index: monitor.index || 0,
|
||||
group_index: group.index || 0,
|
||||
isClickAble: this.showLink(monitor),
|
||||
};
|
||||
|
||||
|
@ -103,12 +109,18 @@ export default {
|
|||
* @returns {boolean} Should the link be shown?
|
||||
*/
|
||||
showLink(monitor, ignoreSendUrl = false) {
|
||||
if (!monitor || !monitor.id) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// We must check if there are any elements in monitorList to
|
||||
// prevent undefined errors if it hasn't been loaded yet
|
||||
if (this.$parent.editMode && ignoreSendUrl && Object.keys(this.$root.monitorList).length) {
|
||||
return this.$root.monitorList[monitor.element.id].type === "http" || this.$root.monitorList[monitor.element.id].type === "keyword" || this.$root.monitorList[monitor.element.id].type === "json-query";
|
||||
return this.$root.monitorList[monitor.id].type === "http" ||
|
||||
this.$root.monitorList[monitor.id].type === "keyword" ||
|
||||
this.$root.monitorList[monitor.id].type === "json-query";
|
||||
}
|
||||
return monitor.element.sendUrl && monitor.element.url && monitor.element.url !== "https://" && !this.editMode;
|
||||
return monitor.sendUrl && monitor.url && monitor.url !== "https://" && !this.editMode;
|
||||
},
|
||||
},
|
||||
};
|
||||
|
|
|
@ -235,7 +235,7 @@
|
|||
v-if="editMode"
|
||||
:class="{'link-active': true, 'btn-link': true}"
|
||||
icon="cog" class="action me-3"
|
||||
@click="$refs.monitorSettingDialog.show(group.element, monitor)"
|
||||
@click="$refs.monitorSettingDialog.show(group, monitor)"
|
||||
/>
|
||||
</span>
|
||||
</div>
|
||||
|
|
Loading…
Add table
Reference in a new issue