aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/components
diff options
context:
space:
mode:
authorBastien Wirtz <bastien.wirtz@gmail.com>2022-07-03 21:59:57 +0200
committerBastien Wirtz <bastien.wirtz@gmail.com>2022-07-03 21:59:57 +0200
commit59994bfee8ae2151238e0ba98b84dd04ae3a43a4 (patch)
tree7fdcc986bd006ff212120c58ded4635045d79452 /src/components
parentb4207f27821617d83e4cf018c169ca3bac30fda1 (diff)
downloadhomer-59994bfee8ae2151238e0ba98b84dd04ae3a43a4.tar.gz
homer-59994bfee8ae2151238e0ba98b84dd04ae3a43a4.tar.zst
homer-59994bfee8ae2151238e0ba98b84dd04ae3a43a4.zip
Fix lint issues
Diffstat (limited to 'src/components')
-rw-r--r--src/components/ConnectivityChecker.vue4
-rw-r--r--src/components/services/OpenWeather.vue28
-rw-r--r--src/components/services/UptimeKuma.vue1
3 files changed, 18 insertions, 15 deletions
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 {
56 56
57 // extra check to make sure we're not offline 57 // extra check to make sure we're not offline
58 let that = this; 58 let that = this;
59 const aliveCheckUrl = `${window.location.origin}${window.location.pathname}/index.html?t=${new Date().valueOf()}`; 59 const aliveCheckUrl = `${window.location.origin}${
60 window.location.pathname
61 }/index.html?t=${new Date().valueOf()}`;
60 return fetch(aliveCheckUrl, { 62 return fetch(aliveCheckUrl, {
61 method: "HEAD", 63 method: "HEAD",
62 cache: "no-store", 64 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 @@
22 <div v-else> 22 <div v-else>
23 <p class="title is-4">{{ name }}</p> 23 <p class="title is-4">{{ name }}</p>
24 <p class="subtitle is-6"> 24 <p class="subtitle is-6">
25 {{ temp | tempSuffix(this.item.units) }} 25 {{ temperature }}
26 </p> 26 </p>
27 </div> 27 </div>
28 </div> 28 </div>
@@ -50,6 +50,19 @@ export default {
50 conditions: null, 50 conditions: null,
51 error: false, 51 error: false,
52 }), 52 }),
53 computed: {
54 temperature: function () {
55 if (!this.temp) return "";
56
57 let unit = "K";
58 if (this.item.type === "metric") {
59 unit = "°C";
60 } else if (this.item.type === "imperial") {
61 unit = "°F";
62 }
63 return `${this.temp} ${unit}`;
64 },
65 },
53 created() { 66 created() {
54 this.fetchWeather(); 67 this.fetchWeather();
55 }, 68 },
@@ -86,19 +99,6 @@ export default {
86 }); 99 });
87 }, 100 },
88 }, 101 },
89 filters: {
90 tempSuffix: function (value, type) {
91 if (!value) return "";
92
93 let unit = "K";
94 if (type === "metric") {
95 unit = "°C";
96 } else if (type === "imperial") {
97 unit = "°F";
98 }
99 return `${value} ${unit}`;
100 },
101 },
102}; 102};
103</script> 103</script>
104 104
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 {
99 }, 99 },
100 }, 100 },
101 created() { 101 created() {
102 /* eslint-disable */
102 this.item.url = `${this.item.url}/status/${this.dashboard}`; 103 this.item.url = `${this.item.url}/status/${this.dashboard}`;
103 this.fetchStatus(); 104 this.fetchStatus();
104 }, 105 },