]> git.immae.eu Git - github/bastienwirtz/homer.git/commitdiff
Linting update v23.10.1
authorBastien Wirtz <bastien.wirtz@gmail.com>
Sat, 21 Oct 2023 12:24:05 +0000 (14:24 +0200)
committerBastien Wirtz <bastien.wirtz@gmail.com>
Sat, 21 Oct 2023 12:24:05 +0000 (14:24 +0200)
20 files changed:
package.json
src/App.vue
src/components/ConnectivityChecker.vue
src/components/DarkMode.vue
src/components/services/AdGuardHome.vue
src/components/services/Healthchecks.vue
src/components/services/Immich.vue
src/components/services/Mealie.vue
src/components/services/OctoPrint.vue
src/components/services/PaperlessNG.vue
src/components/services/PiAlert.vue
src/components/services/PiHole.vue
src/components/services/Portainer.vue
src/components/services/Prometheus.vue
src/components/services/Proxmox.vue
src/components/services/Rtorrent.vue
src/components/services/SABnzbd.vue
src/components/services/Tautulli.vue
src/components/services/Tdarr.vue
src/components/services/qBittorrent.vue

index ee314e3f8bcc2103cdaf4418abec616fb10142a4..04f7c0774028fc820a0d53de7506d5a80e9da27e 100644 (file)
@@ -1,6 +1,6 @@
 {
   "name": "homer",
-  "version": "23.09.1",
+  "version": "23.10.1",
   "scripts": {
     "dev": "vite",
     "mock": "http-server dummy-data/ --cors",
index a329775d789f7c9266834fb1f45ffcbef5bb3d7c..e84f083590454f3885a7d7697460f143d5d42c68 100644 (file)
@@ -208,7 +208,7 @@ export default {
 
         if (this.currentPage !== "default") {
           let pageConfig = await this.getConfig(
-            `assets/${this.currentPage}.yml`
+            `assets/${this.currentPage}.yml`,
           );
           config = Object.assign(config, pageConfig);
         }
@@ -245,7 +245,7 @@ export default {
         return response
           .text()
           .then((body) => {
-            return parse(body, {merge: true});
+            return parse(body, { merge: true });
           })
           .then(function (config) {
             if (config.externalConfig) {
index 5c7761815051bbc4f75a475d1ab87832c685b1e0..c58bfa7edf0648926b5db23a024bbf160477358a 100644 (file)
@@ -30,21 +30,21 @@ export default {
           that.checkOffline();
         }
       },
-      false
+      false,
     );
     window.addEventListener(
       "online",
       function () {
         that.checkOffline();
       },
-      false
+      false,
     );
     window.addEventListener(
       "offline",
       function () {
         this.offline = true;
       },
-      false
+      false,
     );
   },
   methods: {
@@ -57,7 +57,9 @@ export default {
       // extra check to make sure we're not offline
       let that = this;
       const urlPath = window.location.pathname.replace(/\/+$/, "");
-      const aliveCheckUrl = `${window.location.origin}${urlPath}/index.html?t=${new Date().valueOf()}`;
+      const aliveCheckUrl = `${
+        window.location.origin
+      }${urlPath}/index.html?t=${new Date().valueOf()}`;
       return fetch(aliveCheckUrl, {
         method: "HEAD",
         cache: "no-store",
index f0f823db198977917425fe7685e05e66201d5479..f1ed139dcd10a1fe9a5cdf4ed59a8f6213b1cfab 100644 (file)
@@ -84,10 +84,13 @@ export default {
     },
 
     watchIsDark: function () {
-      matchMedia("(prefers-color-scheme: dark)").addEventListener("change", () => {
-        this.isDark = this.getIsDark();
-        this.$emit("updated", this.isDark);
-      });
+      matchMedia("(prefers-color-scheme: dark)").addEventListener(
+        "change",
+        () => {
+          this.isDark = this.getIsDark();
+          this.$emit("updated", this.isDark);
+        },
+      );
     },
   },
 };
index 4c5339873f909e980a5fe3c5c3947ad5563bd42a..d5b84f62d6f162b5f398bb44192fd4ee25ab37ec 100644 (file)
@@ -63,12 +63,12 @@ export default {
   methods: {
     fetchStatus: async function () {
       this.status = await this.fetch("/control/status").catch((e) =>
-        console.log(e)
+        console.log(e),
       );
     },
     fetchStats: async function () {
       this.stats = await this.fetch("/control/stats").catch((e) =>
-        console.log(e)
+        console.log(e),
       );
     },
   },
index c60f24183087c3ff32586dc63b68241db972370c..0aefb74fb9fd07d05f5d6f0ab68d6b097fcdb4a0 100644 (file)
@@ -66,7 +66,7 @@ export default {
       const apikey = this.item.apikey;
       if (!apikey) {
         console.error(
-          "apikey is not present in config.yml for the Healthchecks entry!"
+          "apikey is not present in config.yml for the Healthchecks entry!",
         );
         return;
       }
index e86ecd6ea7a35ff57700c91e4b1a89d6d7a0d9c7..7cde3065408f41f654ea5be3274483ea7a75137d 100644 (file)
@@ -40,7 +40,7 @@ export default {
   },
   data: () => {
     return {
-      users: null,          
+      users: null,
       photos: null,
       videos: null,
       usage: null,
@@ -56,25 +56,27 @@ export default {
   },
   computed: {
     humanizeSize: function () {
-        let bytes = this.usage;
-        if (Math.abs(bytes) < 1024)
-                return bytes + ' B';
+      let bytes = this.usage;
+      if (Math.abs(bytes) < 1024) return bytes + " B";
 
-        const units = ['KiB', 'MiB', 'GiB', 'TiB'];
-        let u = -1;
-        do {
-                bytes /= 1024;
-                ++u;
-        } while (Math.round(Math.abs(bytes) * 100) / 100 >= 1024 && u < units.length - 1);
+      const units = ["KiB", "MiB", "GiB", "TiB"];
+      let u = -1;
+      do {
+        bytes /= 1024;
+        ++u;
+      } while (
+        Math.round(Math.abs(bytes) * 100) / 100 >= 1024 &&
+        u < units.length - 1
+      );
 
-        return bytes.toFixed(2) + ' ' + units[u];
+      return bytes.toFixed(2) + " " + units[u];
     },
   },
   methods: {
     fetchConfig: function () {
       const headers = {
         "x-api-key": this.item.apikey,
-      }; 
+      };
 
       this.fetch(`/api/server-info/stats`, { headers })
         .then((stats) => {
@@ -82,7 +84,7 @@ export default {
           this.videos = stats.videos;
           this.usage = stats.usage;
           this.users = stats.usageByUser.length;
-        })                  
+        })
         .catch((e) => {
           console.error(e);
           this.serverError = true;
@@ -123,4 +125,4 @@ export default {
     }
   }
 }
-</style>
\ No newline at end of file
+</style>
index b5b22558ee6a2f06dd3526ed4daf756a497448ba..43550d876c20ce6a487410b36b5f5b0128300b90 100644 (file)
@@ -45,7 +45,7 @@ export default {
       if (this.item.subtitle != null) return;
 
       this.meal = await this.fetch("/api/meal-plans/today/", { headers }).catch(
-        (e) => console.log(e)
+        (e) => console.log(e),
       );
       this.stats = await this.fetch("/api/debug/statistics/", {
         headers,
index 1428d9a2a1f26b8d4e5c33b3320414e36efb9140..aceb2d87b3ee447a0bf8896b36064c4b4ba914c7 100644 (file)
@@ -6,7 +6,9 @@
         <template v-if="item.subtitle && !state">
           {{ item.subtitle }}
         </template>
-        <template v-if="!error && display == 'text' && statusClass == 'in-progress'">
+        <template
+          v-if="!error && display == 'text' && statusClass == 'in-progress'"
+        >
           <i class="fa-solid fa-gear mr-1"></i>
           <b v-if="completion">{{ completion.toFixed() }}%</b>
           <span class="separator mx-1"> | </span>
         </template>
         <template v-if="!error && display == 'text' && statusClass == 'ready'">
           <i class="fa-solid fa-temperature-half mr-1"></i>
-          <b v-if="printer.temperature.bed">{{ printer.temperature.bed.actual.toFixed() }} C</b>
+          <b v-if="printer.temperature.bed"
+            >{{ printer.temperature.bed.actual.toFixed() }} C</b
+          >
           <span class="separator mx-1"> | </span>
-          <b v-if="printer.temperature.tool0">{{ printer.temperature.tool0.actual.toFixed() }} C</b>
+          <b v-if="printer.temperature.tool0"
+            >{{ printer.temperature.tool0.actual.toFixed() }} C</b
+          >
         </template>
         <template v-if="!error && display == 'bar'">
           <progress
@@ -28,7 +34,7 @@
             :value="completion"
             max="100"
             :title="`${state} - ${completion.toFixed()}%, ${toTime(
-              printTimeLeft
+              printTimeLeft,
             )} left`"
           >
             {{ completion }}%
@@ -99,7 +105,9 @@ export default {
     },
     fetchPrinterStatus: async function () {
       try {
-        const response = await this.fetch(`api/printer?apikey=${this.item.apikey}`);
+        const response = await this.fetch(
+          `api/printer?apikey=${this.item.apikey}`,
+        );
         this.printer = response;
         this.error = response.error;
       } catch (e) {
index 69f2437378a7249d1103269f94a190d35a124d56..8f7122acb6c976e03a2355076d64b3557d459269 100644 (file)
@@ -40,7 +40,7 @@ export default {
       const apikey = this.item.apikey;
       if (!apikey) {
         console.error(
-          "apikey is not present in config.yml for the paperless entry!"
+          "apikey is not present in config.yml for the paperless entry!",
         );
         return;
       }
index fb0d9ed4b99733ef3284efe84aa1ee327806ac4a..fd1fd9ee73aca78b79f5a6a78280ad80f953d643 100644 (file)
 <template>
-    <Generic :item="item">
-        <template #indicator>
-            <div class="notifs">
-                <strong class="notif total" title="Total Devices">
-                    {{ total }}
-                </strong>
-                <strong class="notif connected" title="Connected Devices">
-                    {{ connected }}
-                </strong>
-                <strong class="notif newdevices" title="New Devices">
-                    {{ newdevices }}
-                </strong>
-                <strong class="notif alert" title="Down Alerts">
-                    {{ downalert }}
-                </strong>
-                <strong v-if="serverError" class="notif alert"
-                    title="Connection error to PiAlert server, check the url in config.yml">?</strong>
-            </div>
-        </template>
-    </Generic>
+  <Generic :item="item">
+    <template #indicator>
+      <div class="notifs">
+        <strong class="notif total" title="Total Devices">
+          {{ total }}
+        </strong>
+        <strong class="notif connected" title="Connected Devices">
+          {{ connected }}
+        </strong>
+        <strong class="notif newdevices" title="New Devices">
+          {{ newdevices }}
+        </strong>
+        <strong class="notif alert" title="Down Alerts">
+          {{ downalert }}
+        </strong>
+        <strong
+          v-if="serverError"
+          class="notif alert"
+          title="Connection error to PiAlert server, check the url in config.yml"
+          >?</strong
+        >
+      </div>
+    </template>
+  </Generic>
 </template>
-  
+
 <script>
 import service from "@/mixins/service.js";
 import Generic from "./Generic.vue";
 
 export default {
-    name: "PiAlert",
-    mixins: [service],
-    props: {
-        item: Object,
-    },
-    components: {
-        Generic,
-    },
-    data: () => {
-        return {
-            total: 0,
-            connected: 0,
-            newdevices: 0,
-            downalert: 0,
-            serverError: false,
-        };
-    },
-    created() {
-        const updateInterval = parseInt(this.item.updateInterval, 10) || 0;
-        if (updateInterval > 0) {
-            setInterval(() => this.fetchStatus(), updateInterval);
-        }
-        this.fetchStatus();
-    },
-    methods: {
-        fetchStatus: async function () {
-            this.fetch("/php/server/devices.php?action=getDevicesTotals")
-                .then((response) => {
-                    this.total = response[0];
-                    this.connected = response[1];
-                    this.newdevices = response[3];
-                    this.downalert = response[4];
-                })
-                .catch((e) => {
-                    console.log(e);
-                    this.serverError = true;
-                });
-        },
+  name: "PiAlert",
+  mixins: [service],
+  props: {
+    item: Object,
+  },
+  components: {
+    Generic,
+  },
+  data: () => {
+    return {
+      total: 0,
+      connected: 0,
+      newdevices: 0,
+      downalert: 0,
+      serverError: false,
+    };
+  },
+  created() {
+    const updateInterval = parseInt(this.item.updateInterval, 10) || 0;
+    if (updateInterval > 0) {
+      setInterval(() => this.fetchStatus(), updateInterval);
+    }
+    this.fetchStatus();
+  },
+  methods: {
+    fetchStatus: async function () {
+      this.fetch("/php/server/devices.php?action=getDevicesTotals")
+        .then((response) => {
+          this.total = response[0];
+          this.connected = response[1];
+          this.newdevices = response[3];
+          this.downalert = response[4];
+        })
+        .catch((e) => {
+          console.log(e);
+          this.serverError = true;
+        });
     },
+  },
 };
 </script>
-  
+
 <style scoped lang="scss">
 .notifs {
-    position: absolute;
-    color: white;
-    font-family: sans-serif;
-    top: 0.3em;
-    right: 0.5em;
+  position: absolute;
+  color: white;
+  font-family: sans-serif;
+  top: 0.3em;
+  right: 0.5em;
 
-    .notif {
-        display: inline-block;
-        padding: 0.2em 0.35em;
-        border-radius: 0.25em;
-        position: relative;
-        margin-left: 0.3em;
-        font-size: 0.8em;
+  .notif {
+    display: inline-block;
+    padding: 0.2em 0.35em;
+    border-radius: 0.25em;
+    position: relative;
+    margin-left: 0.3em;
+    font-size: 0.8em;
 
-        &.total {
-            background-color: #4fb5d6;
-        }
+    &.total {
+      background-color: #4fb5d6;
+    }
 
-        &.connected {
-            background-color: #4fd671;
-        }
+    &.connected {
+      background-color: #4fd671;
+    }
 
-        &.newdevices {
-            background-color: #d08d2e;
-        }
+    &.newdevices {
+      background-color: #d08d2e;
+    }
 
-        &.alert {
-            background-color: #e51111;
-        }
+    &.alert {
+      background-color: #e51111;
     }
+  }
 }
-</style>
\ No newline at end of file
+</style>
index 237cb12973c6bcd4143356a524033a4a0995fc45..b111456dada6dfb49f2cc10f71672526bcdcbb8f 100644 (file)
@@ -52,8 +52,9 @@ export default {
       const authQueryParams = this.item.apikey
         ? `?summaryRaw&auth=${this.item.apikey}`
         : "";
-      const result = await this.fetch(`/api.php${authQueryParams}`)
-        .catch((e) => console.log(e));
+      const result = await this.fetch(`/api.php${authQueryParams}`).catch((e) =>
+        console.log(e),
+      );
 
       this.status = result.status;
       this.ads_percentage_today = result.ads_percentage_today;
index d101ecc36c35293a6d552a703f8f4ebd6c7beefb..cfc762e984e3c35764183d02dc78ba266fe2a4e0 100644 (file)
@@ -78,7 +78,7 @@ export default {
       this.endpoints = await this.fetch("/api/endpoints", { headers }).catch(
         (e) => {
           console.error(e);
-        }
+        },
       );
 
       let containers = [];
@@ -93,7 +93,7 @@ export default {
         const endpointContainers = await this.fetch(uri, { headers }).catch(
           (e) => {
             console.error(e);
-          }
+          },
         );
 
         if (endpointContainers) {
index 6efcb34e8c9e46efe1f6f5ad775112dfd06aa558..7f661caeae731f7bd3a52010baec7368ae077dd2 100644 (file)
@@ -72,7 +72,7 @@ export default {
     countFiring: function () {
       if (this.api) {
         return this.api.data?.alerts?.filter(
-          (alert) => alert.state === AlertsStatus.firing
+          (alert) => alert.state === AlertsStatus.firing,
         ).length;
       }
       return 0;
@@ -80,7 +80,7 @@ export default {
     countPending: function () {
       if (this.api) {
         return this.api.data?.alerts?.filter(
-          (alert) => alert.state === AlertsStatus.pending
+          (alert) => alert.state === AlertsStatus.pending,
         ).length;
       }
       return 0;
@@ -88,7 +88,7 @@ export default {
     countInactive: function () {
       if (this.api) {
         return this.api.data?.alerts?.filter(
-          (alert) => alert.state === AlertsStatus.pending
+          (alert) => alert.state === AlertsStatus.pending,
         ).length;
       }
       return 0;
index 813605038dbb6425858d0e857f961d2507491f50..5d0c950fcc041982b4fcfa3062aaac1709cbaec7 100644 (file)
@@ -122,7 +122,7 @@ export default {
         };
         const status = await this.fetch(
           `/api2/json/nodes/${this.item.node}/status`,
-          options
+          options,
         );
         // main metrics:
         const decimalsToShow = this.item.hide_decimals ? 0 : 1;
@@ -139,7 +139,7 @@ export default {
         if (this.isValueShown("vms")) {
           const vms = await this.fetch(
             `/api2/json/nodes/${this.item.node}/qemu`,
-            options
+            options,
           );
           this.parseVMsAndLXCs(vms, this.vms);
         }
@@ -147,7 +147,7 @@ export default {
         if (this.isValueShown("lxcs")) {
           const lxcs = await this.fetch(
             `/api2/json/nodes/${this.item.node}/lxc`,
-            options
+            options,
           );
           this.parseVMsAndLXCs(lxcs, this.lxcs);
         }
index ed8e7a6bd26027fb65f96cf54c9dce76eef9ddcc..59dd84368c63309aa9e99c68e9ace56534612f2e 100644 (file)
@@ -41,7 +41,7 @@ const displayRate = (rate) => {
 
   return (
     Intl.NumberFormat(undefined, { maximumFractionDigits: 2 }).format(
-      rate || 0
+      rate || 0,
     ) + ` ${units[i]}/s`
   );
 };
@@ -105,8 +105,8 @@ export default {
       return this.getXml(methodName).then((xml) =>
         parseInt(
           xml.getElementsByTagName("value")[0].firstChild.textContent,
-          10
-        )
+          10,
+        ),
       );
     },
     // Fetch the numer of torrents by requesting the download list
@@ -143,7 +143,7 @@ export default {
           return response.text();
         })
         .then((text) =>
-          Promise.resolve(new DOMParser().parseFromString(text, "text/xml"))
+          Promise.resolve(new DOMParser().parseFromString(text, "text/xml")),
         );
     },
   },
index 2f93c716dc8bab3c5cf3a1b6edf9afdc33620371..e92e5870a4de022faf848961e6607a79347af10c 100644 (file)
@@ -56,7 +56,7 @@ export default {
     fetchStatus: async function () {
       try {
         const response = await this.fetch(
-          `/api?output=json&apikey=${this.item.apikey}&mode=queue`
+          `/api?output=json&apikey=${this.item.apikey}&mode=queue`,
         );
         this.error = false;
         this.stats = response.queue;
index 0f27ff1b06b8d1d5dbf9f76944f56186ec20f30c..db27c7fbff5eb25667797b309c477157a10bc74f 100644 (file)
@@ -51,7 +51,7 @@ export default {
     fetchStatus: async function () {
       try {
         const response = await this.fetch(
-          `/api/v2?apikey=${this.item.apikey}&cmd=get_activity`
+          `/api/v2?apikey=${this.item.apikey}&cmd=get_activity`,
         );
         this.error = false;
         this.stats = response.response.data;
index a2734f09aa99d299bea2fd3f243a7e0b50b99482..22341d929b11ef091d8e2aad4de678afe54abeae 100644 (file)
@@ -72,14 +72,20 @@ export default {
           method: "POST",
           headers: {
             "Content-Type": "application/json",
-            "Accept": "application/json",
+            Accept: "application/json",
           },
-          body: JSON.stringify({"headers":{"content-Type":"application/json"},"data":{"collection":"StatisticsJSONDB","mode":"getById","docID":"statistics","obj":{}},"timeout":1000}),
+          body: JSON.stringify({
+            headers: { "content-Type": "application/json" },
+            data: {
+              collection: "StatisticsJSONDB",
+              mode: "getById",
+              docID: "statistics",
+              obj: {},
+            },
+            timeout: 1000,
+          }),
         };
-        const response = await this.fetch(
-          `/api/v2/cruddb`,
-          options
-        );
+        const response = await this.fetch(`/api/v2/cruddb`, options);
         this.error = false;
         this.stats = response;
       } catch (e) {
index 06dd47c105c74ed604aaac0267302a2c006b915c..d47ed0b1eca77a6f45cdc165ab858131f909a69d 100644 (file)
@@ -43,7 +43,7 @@ const displayRate = (rate) => {
   }
   return (
     Intl.NumberFormat(undefined, { maximumFractionDigits: 2 }).format(
-      rate || 0
+      rate || 0,
     ) + ` ${units[i]}/s`
   );
 };