aboutsummaryrefslogtreecommitdiffhomepage
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
parentb4207f27821617d83e4cf018c169ca3bac30fda1 (diff)
downloadhomer-59994bfee8ae2151238e0ba98b84dd04ae3a43a4.tar.gz
homer-59994bfee8ae2151238e0ba98b84dd04ae3a43a4.tar.zst
homer-59994bfee8ae2151238e0ba98b84dd04ae3a43a4.zip
Fix lint issues
-rw-r--r--.eslintrc.cjs3
-rw-r--r--src/components/ConnectivityChecker.vue4
-rw-r--r--src/components/services/OpenWeather.vue28
-rw-r--r--src/components/services/UptimeKuma.vue1
-rw-r--r--vite.config.js33
5 files changed, 37 insertions, 32 deletions
diff --git a/.eslintrc.cjs b/.eslintrc.cjs
index ed2ab70..ee347c0 100644
--- a/.eslintrc.cjs
+++ b/.eslintrc.cjs
@@ -11,4 +11,7 @@ module.exports = {
11 env: { 11 env: {
12 "vue/setup-compiler-macros": true, 12 "vue/setup-compiler-macros": true,
13 }, 13 },
14 rules: {
15 "vue/multi-word-component-names": "off",
16 },
14}; 17};
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 },
diff --git a/vite.config.js b/vite.config.js
index 0400b78..262f311 100644
--- a/vite.config.js
+++ b/vite.config.js
@@ -1,4 +1,4 @@
1import { VitePWA } from 'vite-plugin-pwa' 1import { VitePWA } from "vite-plugin-pwa";
2import { fileURLToPath, URL } from "url"; 2import { fileURLToPath, URL } from "url";
3 3
4import { defineConfig } from "vite"; 4import { defineConfig } from "vite";
@@ -10,30 +10,30 @@ export default defineConfig({
10 assetsDir: "resources", 10 assetsDir: "resources",
11 }, 11 },
12 plugins: [ 12 plugins: [
13 vue(), 13 vue(),
14 VitePWA({ 14 VitePWA({
15 registerType: 'autoUpdate', 15 registerType: "autoUpdate",
16 useCredentials: true, 16 useCredentials: true,
17 manifestFilename: "assets/manifest.json", 17 manifestFilename: "assets/manifest.json",
18 manifest: { 18 manifest: {
19 name: 'Homer dashboard', 19 name: "Homer dashboard",
20 short_name: 'Homer', 20 short_name: "Homer",
21 description: 'Home Server Dashboard', 21 description: "Home Server Dashboard",
22 theme_color: '#3367D6', 22 theme_color: "#3367D6",
23 icons: [ 23 icons: [
24 { 24 {
25 src: 'pwa-192x192.png', 25 src: "pwa-192x192.png",
26 sizes: '192x192', 26 sizes: "192x192",
27 type: 'image/png' 27 type: "image/png",
28 }, 28 },
29 { 29 {
30 src: 'pwa-512x512.png', 30 src: "pwa-512x512.png",
31 sizes: '512x512', 31 sizes: "512x512",
32 type: 'image/png' 32 type: "image/png",
33 } 33 },
34 ], 34 ],
35 }, 35 },
36 }) 36 }),
37 ], 37 ],
38 resolve: { 38 resolve: {
39 alias: { 39 alias: {
@@ -41,4 +41,3 @@ export default defineConfig({
41 }, 41 },
42 }, 42 },
43}); 43});
44