revert showLink without the unused if-statement surrounding ignoreSendUrl

This commit is contained in:
Ryo Hanafusa 2024-10-28 11:33:02 +00:00
parent 61c68e2305
commit d3c3808dae

View file

@ -80,7 +80,7 @@ export default {
name: monitor.element.name,
monitor_index: monitor.index,
group_index: group.index,
isClickable: monitor.element.sendUrl,
isClickable: this.showLink(monitor),
};
this.MonitorSettingDialog.show();
@ -95,6 +95,17 @@ export default {
toggleLink(groupIndex, index) {
this.$root.publicGroupList[groupIndex].monitorList[index].sendUrl = !this.$root.publicGroupList[groupIndex].monitorList[index].sendUrl;
},
/**
* Should a link to the monitor be shown?
* Attempts to guess if a link should be shown based upon if
* sendUrl is set and if the URL is default or not.
* @param {object} monitor Monitor to check
* @returns {boolean} Should the link be shown?
*/
showLink(monitor) {
return monitor.element.sendUrl && monitor.element.url && monitor.element.url !== "https://";
},
},
};
</script>