Skip to content

Commit

Permalink
Linting update
Browse files Browse the repository at this point in the history
  • Loading branch information
bastienwirtz committed Oct 21, 2023
1 parent ecf664d commit de4b7e6
Show file tree
Hide file tree
Showing 20 changed files with 169 additions and 143 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "homer",
"version": "23.09.1",
"version": "23.10.1",
"scripts": {
"dev": "vite",
"mock": "http-server dummy-data/ --cors",
Expand Down
4 changes: 2 additions & 2 deletions src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down Expand Up @@ -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) {
Expand Down
10 changes: 6 additions & 4 deletions src/components/ConnectivityChecker.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand All @@ -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",
Expand Down
11 changes: 7 additions & 4 deletions src/components/DarkMode.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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);
},
);
},
},
};
Expand Down
4 changes: 2 additions & 2 deletions src/components/services/AdGuardHome.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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),
);
},
},
Expand Down
2 changes: 1 addition & 1 deletion src/components/services/Healthchecks.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
30 changes: 16 additions & 14 deletions src/components/services/Immich.vue
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export default {
},
data: () => {
return {
users: null,
users: null,
photos: null,
videos: null,
usage: null,
Expand All @@ -56,33 +56,35 @@ 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) => {
this.photos = stats.photos;
this.videos = stats.videos;
this.usage = stats.usage;
this.users = stats.usageByUser.length;
})
})
.catch((e) => {
console.error(e);
this.serverError = true;
Expand Down Expand Up @@ -123,4 +125,4 @@ export default {
}
}
}
</style>
</style>
2 changes: 1 addition & 1 deletion src/components/services/Mealie.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
18 changes: 13 additions & 5 deletions src/components/services/OctoPrint.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand All @@ -17,9 +19,13 @@
</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
Expand All @@ -28,7 +34,7 @@
:value="completion"
max="100"
:title="`${state} - ${completion.toFixed()}%, ${toTime(
printTimeLeft
printTimeLeft,
)} left`"
>
{{ completion }}%
Expand Down Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion src/components/services/PaperlessNG.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
Loading

0 comments on commit de4b7e6

Please sign in to comment.