]> git.immae.eu Git - github/bastienwirtz/homer.git/commitdiff
Fix lint issues
authorBastien Wirtz <bastien.wirtz@gmail.com>
Sun, 3 Jul 2022 19:59:57 +0000 (21:59 +0200)
committerBastien Wirtz <bastien.wirtz@gmail.com>
Sun, 3 Jul 2022 19:59:57 +0000 (21:59 +0200)
.eslintrc.cjs
src/components/ConnectivityChecker.vue
src/components/services/OpenWeather.vue
src/components/services/UptimeKuma.vue
vite.config.js

index ed2ab703963c9be08437cfe3acf1ff1d843cfb5e..ee347c09c1c54d31d9ca55393d332ab065bd2f7c 100644 (file)
@@ -11,4 +11,7 @@ module.exports = {
   env: {
     "vue/setup-compiler-macros": true,
   },
+  rules: {
+    "vue/multi-word-component-names": "off",
+  },
 };
index 3066b7d6c5ae384bc2753f79781d5fc4864c1d2a..0e724fc6d59ced9c8077bd71ca29a2ec381bae9f 100644 (file)
@@ -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",
index 79d5e37d67eb981e1420d487a9fe9c4cd1c480fd..756abf77f2b1656bb6aa3167034490dca78d2b50 100644 (file)
@@ -22,7 +22,7 @@
               <div v-else>
                 <p class="title is-4">{{ name }}</p>
                 <p class="subtitle is-6">
-                  {{ temp | tempSuffix(this.item.units) }}
+                  {{ temperature }}
                 </p>
               </div>
             </div>
@@ -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}`;
-    },
-  },
 };
 </script>
 
index 3be53b8b9d44a6fa3863fd1fc9a9a73fc55b209e..5117a059671e4b536e93a3188a51c38ad819a06d 100644 (file)
@@ -99,6 +99,7 @@ export default {
     },
   },
   created() {
+    /* eslint-disable */
     this.item.url = `${this.item.url}/status/${this.dashboard}`;
     this.fetchStatus();
   },
index 0400b789641b06faae826aa821ae6abc2891748e..262f3117a81d60f7c926c950a37822f22ecdfb03 100644 (file)
@@ -1,4 +1,4 @@
-import { VitePWA } from 'vite-plugin-pwa'
+import { VitePWA } from "vite-plugin-pwa";
 import { fileURLToPath, URL } from "url";
 
 import { defineConfig } from "vite";
@@ -10,30 +10,30 @@ export default defineConfig({
     assetsDir: "resources",
   },
   plugins: [
-    vue(), 
-    VitePWA({ 
-      registerType: 'autoUpdate',
+    vue(),
+    VitePWA({
+      registerType: "autoUpdate",
       useCredentials: true,
       manifestFilename: "assets/manifest.json",
       manifest: {
-        name: 'Homer dashboard',
-        short_name: 'Homer',
-        description: 'Home Server Dashboard',
-        theme_color: '#3367D6',
+        name: "Homer dashboard",
+        short_name: "Homer",
+        description: "Home Server Dashboard",
+        theme_color: "#3367D6",
         icons: [
           {
-            src: 'pwa-192x192.png',
-            sizes: '192x192',
-            type: 'image/png'
+            src: "pwa-192x192.png",
+            sizes: "192x192",
+            type: "image/png",
           },
           {
-            src: 'pwa-512x512.png',
-            sizes: '512x512',
-            type: 'image/png'
-          }
+            src: "pwa-512x512.png",
+            sizes: "512x512",
+            type: "image/png",
+          },
         ],
       },
-    })
+    }),
   ],
   resolve: {
     alias: {
@@ -41,4 +41,3 @@ export default defineConfig({
     },
   },
 });
-