From 59994bfee8ae2151238e0ba98b84dd04ae3a43a4 Mon Sep 17 00:00:00 2001 From: Bastien Wirtz Date: Sun, 3 Jul 2022 21:59:57 +0200 Subject: Fix lint issues --- src/components/ConnectivityChecker.vue | 4 +++- src/components/services/OpenWeather.vue | 28 ++++++++++++++-------------- src/components/services/UptimeKuma.vue | 1 + 3 files changed, 18 insertions(+), 15 deletions(-) (limited to 'src') diff --git a/src/components/ConnectivityChecker.vue b/src/components/ConnectivityChecker.vue index 3066b7d..0e724fc 100644 --- a/src/components/ConnectivityChecker.vue +++ b/src/components/ConnectivityChecker.vue @@ -56,7 +56,9 @@ export default { // extra check to make sure we're not offline let that = this; - const aliveCheckUrl = `${window.location.origin}${window.location.pathname}/index.html?t=${new Date().valueOf()}`; + const aliveCheckUrl = `${window.location.origin}${ + window.location.pathname + }/index.html?t=${new Date().valueOf()}`; return fetch(aliveCheckUrl, { method: "HEAD", cache: "no-store", diff --git a/src/components/services/OpenWeather.vue b/src/components/services/OpenWeather.vue index 79d5e37..756abf7 100644 --- a/src/components/services/OpenWeather.vue +++ b/src/components/services/OpenWeather.vue @@ -22,7 +22,7 @@

{{ name }}

- {{ temp | tempSuffix(this.item.units) }} + {{ temperature }}

@@ -50,6 +50,19 @@ export default { conditions: null, error: false, }), + computed: { + temperature: function () { + if (!this.temp) return ""; + + let unit = "K"; + if (this.item.type === "metric") { + unit = "°C"; + } else if (this.item.type === "imperial") { + unit = "°F"; + } + return `${this.temp} ${unit}`; + }, + }, created() { this.fetchWeather(); }, @@ -86,19 +99,6 @@ export default { }); }, }, - filters: { - tempSuffix: function (value, type) { - if (!value) return ""; - - let unit = "K"; - if (type === "metric") { - unit = "°C"; - } else if (type === "imperial") { - unit = "°F"; - } - return `${value} ${unit}`; - }, - }, }; diff --git a/src/components/services/UptimeKuma.vue b/src/components/services/UptimeKuma.vue index 3be53b8..5117a05 100644 --- a/src/components/services/UptimeKuma.vue +++ b/src/components/services/UptimeKuma.vue @@ -99,6 +99,7 @@ export default { }, }, created() { + /* eslint-disable */ this.item.url = `${this.item.url}/status/${this.dashboard}`; this.fetchStatus(); }, -- cgit v1.2.3