diff --git a/package.json b/package.json index ee314e3f8..04f7c0774 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "homer", - "version": "23.09.1", + "version": "23.10.1", "scripts": { "dev": "vite", "mock": "http-server dummy-data/ --cors", diff --git a/src/App.vue b/src/App.vue index a329775d7..e84f08359 100644 --- a/src/App.vue +++ b/src/App.vue @@ -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) { diff --git a/src/components/ConnectivityChecker.vue b/src/components/ConnectivityChecker.vue index 5c7761815..c58bfa7ed 100644 --- a/src/components/ConnectivityChecker.vue +++ b/src/components/ConnectivityChecker.vue @@ -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", diff --git a/src/components/DarkMode.vue b/src/components/DarkMode.vue index f0f823db1..f1ed139dc 100644 --- a/src/components/DarkMode.vue +++ b/src/components/DarkMode.vue @@ -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); + }, + ); }, }, }; diff --git a/src/components/services/AdGuardHome.vue b/src/components/services/AdGuardHome.vue index 4c5339873..d5b84f62d 100644 --- a/src/components/services/AdGuardHome.vue +++ b/src/components/services/AdGuardHome.vue @@ -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), ); }, }, diff --git a/src/components/services/Healthchecks.vue b/src/components/services/Healthchecks.vue index c60f24183..0aefb74fb 100644 --- a/src/components/services/Healthchecks.vue +++ b/src/components/services/Healthchecks.vue @@ -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; } diff --git a/src/components/services/Immich.vue b/src/components/services/Immich.vue index e86ecd6ea..7cde30654 100644 --- a/src/components/services/Immich.vue +++ b/src/components/services/Immich.vue @@ -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 { } } } - \ No newline at end of file + diff --git a/src/components/services/Mealie.vue b/src/components/services/Mealie.vue index b5b22558e..43550d876 100644 --- a/src/components/services/Mealie.vue +++ b/src/components/services/Mealie.vue @@ -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, diff --git a/src/components/services/OctoPrint.vue b/src/components/services/OctoPrint.vue index 1428d9a2a..aceb2d87b 100644 --- a/src/components/services/OctoPrint.vue +++ b/src/components/services/OctoPrint.vue @@ -6,7 +6,9 @@ {{ item.subtitle }} - + {{ completion.toFixed() }}% | @@ -17,9 +19,13 @@ - {{ printer.temperature.bed.actual.toFixed() }} C + {{ printer.temperature.bed.actual.toFixed() }} C | - {{ printer.temperature.tool0.actual.toFixed() }} C + {{ printer.temperature.tool0.actual.toFixed() }} C {{ 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) { diff --git a/src/components/services/PaperlessNG.vue b/src/components/services/PaperlessNG.vue index 69f243737..8f7122acb 100644 --- a/src/components/services/PaperlessNG.vue +++ b/src/components/services/PaperlessNG.vue @@ -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; } diff --git a/src/components/services/PiAlert.vue b/src/components/services/PiAlert.vue index fb0d9ed4b..fd1fd9ee7 100644 --- a/src/components/services/PiAlert.vue +++ b/src/components/services/PiAlert.vue @@ -1,104 +1,108 @@ - - - - - {{ total }} - - - {{ connected }} - - - {{ newdevices }} - - - {{ downalert }} - - ? - - - + + + + + {{ total }} + + + {{ connected }} + + + {{ newdevices }} + + + {{ downalert }} + + ? + + + - + - + \ No newline at end of file + diff --git a/src/components/services/PiHole.vue b/src/components/services/PiHole.vue index 237cb1297..b111456da 100644 --- a/src/components/services/PiHole.vue +++ b/src/components/services/PiHole.vue @@ -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; diff --git a/src/components/services/Portainer.vue b/src/components/services/Portainer.vue index d101ecc36..cfc762e98 100644 --- a/src/components/services/Portainer.vue +++ b/src/components/services/Portainer.vue @@ -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) { diff --git a/src/components/services/Prometheus.vue b/src/components/services/Prometheus.vue index 6efcb34e8..7f661caea 100644 --- a/src/components/services/Prometheus.vue +++ b/src/components/services/Prometheus.vue @@ -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; diff --git a/src/components/services/Proxmox.vue b/src/components/services/Proxmox.vue index 813605038..5d0c950fc 100644 --- a/src/components/services/Proxmox.vue +++ b/src/components/services/Proxmox.vue @@ -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); } diff --git a/src/components/services/Rtorrent.vue b/src/components/services/Rtorrent.vue index ed8e7a6bd..59dd84368 100644 --- a/src/components/services/Rtorrent.vue +++ b/src/components/services/Rtorrent.vue @@ -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")), ); }, }, diff --git a/src/components/services/SABnzbd.vue b/src/components/services/SABnzbd.vue index 2f93c716d..e92e5870a 100644 --- a/src/components/services/SABnzbd.vue +++ b/src/components/services/SABnzbd.vue @@ -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; diff --git a/src/components/services/Tautulli.vue b/src/components/services/Tautulli.vue index 0f27ff1b0..db27c7fbf 100644 --- a/src/components/services/Tautulli.vue +++ b/src/components/services/Tautulli.vue @@ -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; diff --git a/src/components/services/Tdarr.vue b/src/components/services/Tdarr.vue index a2734f09a..22341d929 100644 --- a/src/components/services/Tdarr.vue +++ b/src/components/services/Tdarr.vue @@ -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) { diff --git a/src/components/services/qBittorrent.vue b/src/components/services/qBittorrent.vue index 06dd47c10..d47ed0b1e 100644 --- a/src/components/services/qBittorrent.vue +++ b/src/components/services/qBittorrent.vue @@ -43,7 +43,7 @@ const displayRate = (rate) => { } return ( Intl.NumberFormat(undefined, { maximumFractionDigits: 2 }).format( - rate || 0 + rate || 0, ) + ` ${units[i]}/s` ); };