X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=src%2Fcomponents%2Fservices%2FImmich.vue;h=7cde3065408f41f654ea5be3274483ea7a75137d;hb=de4b7e6124254a192c897bdf0070b078a64ee563;hp=e86ecd6ea7a35ff57700c91e4b1a89d6d7a0d9c7;hpb=ecf664d19b2a46c9d89a9a9c1128e22b7228607a;p=github%2Fbastienwirtz%2Fhomer.git diff --git a/src/components/services/Immich.vue b/src/components/services/Immich.vue index e86ecd6..7cde306 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 +