From d3c3808daec62c15aa39d8a943d47c38e8d9b9f5 Mon Sep 17 00:00:00 2001 From: Ryo Hanafusa Date: Mon, 28 Oct 2024 11:33:02 +0000 Subject: [PATCH] revert showLink without the unused if-statement surrounding ignoreSendUrl --- src/components/MonitorSettingDialog.vue | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/components/MonitorSettingDialog.vue b/src/components/MonitorSettingDialog.vue index 2e921b5e..d62003a8 100644 --- a/src/components/MonitorSettingDialog.vue +++ b/src/components/MonitorSettingDialog.vue @@ -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://"; + }, }, };