aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/components/services
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/services
parentb4207f27821617d83e4cf018c169ca3bac30fda1 (diff)
downloadhomer-59994bfee8ae2151238e0ba98b84dd04ae3a43a4.tar.gz
homer-59994bfee8ae2151238e0ba98b84dd04ae3a43a4.tar.zst
homer-59994bfee8ae2151238e0ba98b84dd04ae3a43a4.zip
Fix lint issues
Diffstat (limited to 'src/components/services')
-rw-r--r--src/components/services/OpenWeather.vue28
-rw-r--r--src/components/services/UptimeKuma.vue1
2 files changed, 15 insertions, 14 deletions
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 },