diff --git a/assets/user.css b/assets/user.css --- a/assets/user.css +++ b/assets/user.css @@ -1,5 +1,68 @@ +.asset-icon { + display: inline-block; + flex-shrink: 0; + background-color: var(--asset-color, var(--color-primary)); + -webkit-mask: var(--asset-icon) center / contain no-repeat; + mask: var(--asset-icon) center / contain no-repeat; +} + +.widget-error-icon, +.server-icon { + width: 3rem; + height: 3rem; +} + +.indexer-status-icon { + display: block; + width: 20px; + height: 20px; +} + +.server-spicy-cpu-icon { + width: 1.2em; + height: 1.2em; + margin-left: 0.3rem; +} + +.immich-stats { + display: grid; + grid-template-columns: repeat(3, minmax(0, 1fr)); + gap: 1rem; +} + +.immich-stat { + display: flex; + align-items: center; + gap: 0.7rem; + min-width: 0; +} + +.immich-stat-icon { + width: 1.8rem; + height: 1.8rem; +} + +.immich-storage-label { + display: flex; + justify-content: space-between; + margin: 1rem 0 0.4rem; + color: var(--color-text-subdue); + font-size: var(--font-size-tiny); +} + +@container widget (max-width: 420px) { + .immich-stat { + gap: 0.4rem; + } + + .immich-stat-icon { + width: 1.4rem; + height: 1.4rem; + } +} + .monitor-site { - --access-icon: url("/assets/icons/x.svg"); + --access-icon: url("/assets/icons/status/x.svg"); --access-color: var(--color-negative); --access-tooltip: "Admin-only page."; } @@ -21,7 +84,7 @@ [href^="https://ttrss."] ) ) { - --access-icon: url("/assets/icons/check.svg"); + --access-icon: url("/assets/icons/status/check.svg"); --access-color: var(--color-positive); --access-tooltip: "User access allowed."; } @@ -36,7 +99,7 @@ [href^="https://ncps."] ) ) { - --access-icon: url("/assets/icons/warning.svg"); + --access-icon: url("/assets/icons/status/warning.svg"); --access-color: hsl(34, 95%, 55%); --access-tooltip: "Ask for account creation."; } diff --git a/config/home.yml b/config/home.yml --- a/config/home.yml +++ b/config/home.yml @@ -39,7 +39,7 @@ sites: - title: Beszel url: https://beszel.${GROUND_DOMAIN} - icon: /assets/icons/beszel.svg + icon: /assets/icons/beszel/icon.svg - title: Speedtest url: https://speedtest.${GROUND_DOMAIN} icon: /assets/icons/speedtest.svg @@ -103,7 +103,7 @@ password: ${authentik_password} - title: immich url: https://immich.${GROUND_DOMAIN} - icon: /assets/icons/immich.svg + icon: /assets/icons/immich/icon.svg - type: monitor cache: 8m @@ -208,7 +208,7 @@ sites: - title: Dockhand url: https://dockhand.${GROUND_DOMAIN} - icon: /assets/icons/dockhand.png + icon: /assets/icons/dockhand/icon.png - title: Cloudbeaver url: https://cloudbeaver.${GROUND_DOMAIN} icon: /assets/icons/cloudbeaver.svg @@ -251,7 +251,7 @@ immich-machine-learning-1: name: Immich machine learning description: Smart search, facial recognition, and metadata jobs. - icon: /assets/icons/immich.svg + icon: /assets/icons/immich/icon.svg hide: false immich-postgres-1: name: Postgres for Immich diff --git a/config/statistics.yml b/config/statistics.yml --- a/config/statistics.yml +++ b/config/statistics.yml @@ -294,10 +294,8 @@ Authorization: Bearer ${DOCKHAND_API_TOKEN} template: | @@ -322,23 +320,13 @@
{{ $running }}
- - - - - - +
{{ $stopped }}
- - - - - - +
{{ printf "%d.%02d GB" $totalGB $decimal }}
- - - - - +
{{ len $volumes }}
- - - - - +
-
-
+
Networks
{{ range $networks }} -
-
{{ .String "name" }}
-
+
+
{{ .String "name" }}
+
{{ $cfg := .Array "ipam.config" }} {{ if gt (len $cfg) 0 }} {{ (index $cfg 0).String "subnet" }} @@ -401,23 +381,13 @@ {{ end }}
{{ len $networks }}
- - - - - - - +
{{ len $stacks }}
- - - - - +
@@ -442,9 +412,7 @@ {{ if or (eq $apiBaseUrl "") (eq $key "") (eq $url "") }}
ERROR
- - - +

Some options are not set or malformed.

{{ else }} @@ -478,17 +446,13 @@ {{ if .Bool "enable" }}
- - - +
{{ else }}
- - - +
{{ end }} @@ -498,97 +462,6 @@ {{ else }}

Failed to fetch data (Status: {{ $indexData.Response.StatusCode }})

{{ end }} - {{ end }} - - - type: custom-api - title: Immich Stats - hide-header: true - cache: 10m - url: https://immich.${GROUND_DOMAIN}/api/server/statistics - headers: - x-api-key: ${IMMICH_API_KEY} - subrequests: - storage: - url: https://immich.${GROUND_DOMAIN}/api/server/storage - headers: - x-api-key: ${IMMICH_API_KEY} - options: - show-cards: true - show-storage-bar: true - template: | - {{ $photos := .JSON.Int "photos" }} - {{ $videos := .JSON.Int "videos" }} - {{ $usageBytes := .JSON.Int "usage" }} - {{ $usageGiB := div (toFloat $usageBytes) 1073741824.0 }} - {{ $storage := .Subrequest "storage" }} - {{ $storage_ok := and (ge $storage.Response.StatusCode 200) (le $storage.Response.StatusCode 299) }} - {{ $totalGiB := 0.0 }} - {{ $percentage := 0.0 }} - {{ $storageError := "" }} - {{ if $storage_ok }} - {{ $totalGiB = div (toFloat ($storage.JSON.Int "diskSizeRaw")) 1073741824.0 }} - {{ $percentage = $storage.JSON.Float "diskUsagePercentage" }} - {{ else }} - {{ $storageError = printf "%d %s" $storage.Response.StatusCode $storage.Response.Status }} - {{ end }} - {{ $showCards := .Options.BoolOr "show-cards" true }} - {{ $showStorageBar := .Options.BoolOr "show-storage-bar" true }} - - {{ if $showCards }} -
-
-
- - - - Photos -
-
- {{ if lt $photos 10 }}000000000{{ else if lt $photos 100 }}00000000{{ else if lt $photos 1000 }}0000000{{ else if lt $photos 10000 }}000000{{ else if lt $photos 100000 }}00000{{ else if lt $photos 1000000 }}0000{{ end }}{{ $photos }} -
-
- -
-
- - - - Videos -
-
- {{ if lt $videos 10 }}000000000{{ else if lt $videos 100 }}00000000{{ else if lt $videos 1000 }}0000000{{ else if lt $videos 10000 }}000000{{ else if lt $videos 100000 }}00000{{ else if lt $videos 1000000 }}0000{{ end }}{{ $videos }} -
-
- -
-
- - - - Storage -
-
- {{ $gib := printf "%.0f" $usageGiB }} - {{ if lt $usageGiB 10.0 }}000000000{{ else if lt $usageGiB 100.0 }}00000000{{ else if lt $usageGiB 1000.0 }}0000000{{ end }}{{ $gib }}GiB -
-
-
- {{ end }} - - {{ if $showStorageBar }} -
-
Storage space
- {{ if gt $totalGiB 0.0 }} -
{{ printf "%.1f" $usageGiB }} GiB of {{ printf "%.1f" $totalGiB }} GiB used
-
{{ printf "%.1f" $percentage }}% full
- {{ else }} -
{{ printf "%.1f" $usageGiB }} GiB used
-
Total storage unavailable ({{ $storageError }}). Ensure API key has permissions for /api/server/storage.
- {{ end }} -
-
-
-
{{ end }} - type: custom-api @@ -606,9 +479,7 @@ {{ define "errorMsg" }}
ERROR
- - - +

{{ . }}

{{ end }} @@ -729,9 +600,7 @@
{{- end }} - - - +
@@ -740,9 +609,7 @@
CPU
{{- if ge $systemTemp 80.0 }} - - - + {{- end }}
{{ $cpuLoad }} %
@@ -849,6 +716,54 @@ {{ end }} {{ end }} {{ end }} + {{ end }} + + - type: custom-api + title: Immich Stats + cache: 10m + url: https://immich.${GROUND_DOMAIN}/api/server/statistics + headers: + x-api-key: ${IMMICH_API_KEY} + subrequests: + storage: + url: https://immich.${GROUND_DOMAIN}/api/server/storage + headers: + x-api-key: ${IMMICH_API_KEY} + template: | + {{ $photos := .JSON.Int "photos" }} + {{ $videos := .JSON.Int "videos" }} + {{ $usageGiB := div (toFloat (.JSON.Int "usage")) 1073741824.0 }} + {{ $storage := .Subrequest "storage" }} + {{ $storageOK := and (ge $storage.Response.StatusCode 200) (le $storage.Response.StatusCode 299) }} + {{ $totalGiB := 0.0 }} + {{ $percentage := 0.0 }} + {{ if $storageOK }} + {{ $totalGiB = div (toFloat ($storage.JSON.Int "diskSizeRaw")) 1073741824.0 }} + {{ $percentage = $storage.JSON.Float "diskUsagePercentage" }} + {{ end }} + +
+
+ +
{{ $photos | formatNumber }}
PHOTOS
+
+
+ +
{{ $videos | formatNumber }}
VIDEOS
+
+
+ +
{{ printf "%.1f" $usageGiB }} GiB
STORAGE
+
+
+ {{ if $storageOK }} +
+ {{ printf "%.1f" $usageGiB }} / {{ printf "%.1f" $totalGiB }} GiB + {{ printf "%.1f" $percentage }}% +
+
+ {{ else }} +
Storage total unavailable.
{{ end }} - size: small diff --git a/assets/icons/beszel.svg b/assets/icons/beszel.svg deleted file mode 100644 --- a/assets/icons/beszel.svg +++ /dev/null @@ -1,1 +0,0 @@ - \ No newline at end of file diff --git a/assets/icons/check.svg b/assets/icons/check.svg deleted file mode 100644 --- a/assets/icons/check.svg +++ /dev/null @@ -1,1 +0,0 @@ - \ No newline at end of file diff --git a/assets/icons/dockhand.png b/assets/icons/dockhand.png deleted file mode 100644 --- a/assets/icons/dockhand.png +++ /dev/null diff --git a/assets/icons/immich.svg b/assets/icons/immich.svg deleted file mode 100644 --- a/assets/icons/immich.svg +++ /dev/null @@ -1,1 +0,0 @@ - \ No newline at end of file diff --git a/assets/icons/warning.svg b/assets/icons/warning.svg deleted file mode 100644 --- a/assets/icons/warning.svg +++ /dev/null @@ -1,1 +0,0 @@ - \ No newline at end of file diff --git a/assets/icons/x.svg b/assets/icons/x.svg deleted file mode 100644 --- a/assets/icons/x.svg +++ /dev/null @@ -1,1 +0,0 @@ - \ No newline at end of file diff --git a/assets/icons/beszel/fire.svg b/assets/icons/beszel/fire.svg new file mode 100644 --- /dev/null +++ b/assets/icons/beszel/fire.svg @@ -0,0 +1,1 @@ + diff --git a/assets/icons/beszel/icon.svg b/assets/icons/beszel/icon.svg new file mode 100644 --- /dev/null +++ b/assets/icons/beszel/icon.svg @@ -0,0 +1,1 @@ + diff --git a/assets/icons/beszel/server.svg b/assets/icons/beszel/server.svg new file mode 100644 --- /dev/null +++ b/assets/icons/beszel/server.svg @@ -0,0 +1,1 @@ + diff --git a/assets/icons/dockhand/container-running.svg b/assets/icons/dockhand/container-running.svg new file mode 100644 --- /dev/null +++ b/assets/icons/dockhand/container-running.svg @@ -0,0 +1,1 @@ + diff --git a/assets/icons/dockhand/container-stopped.svg b/assets/icons/dockhand/container-stopped.svg new file mode 100644 --- /dev/null +++ b/assets/icons/dockhand/container-stopped.svg @@ -0,0 +1,1 @@ + diff --git a/assets/icons/dockhand/icon.png b/assets/icons/dockhand/icon.png new file mode 100644 --- /dev/null +++ b/assets/icons/dockhand/icon.png diff --git a/assets/icons/dockhand/images.svg b/assets/icons/dockhand/images.svg new file mode 100644 --- /dev/null +++ b/assets/icons/dockhand/images.svg @@ -0,0 +1,1 @@ + diff --git a/assets/icons/dockhand/networks.svg b/assets/icons/dockhand/networks.svg new file mode 100644 --- /dev/null +++ b/assets/icons/dockhand/networks.svg @@ -0,0 +1,1 @@ + diff --git a/assets/icons/dockhand/stacks.svg b/assets/icons/dockhand/stacks.svg new file mode 100644 --- /dev/null +++ b/assets/icons/dockhand/stacks.svg @@ -0,0 +1,1 @@ + diff --git a/assets/icons/dockhand/volumes.svg b/assets/icons/dockhand/volumes.svg new file mode 100644 --- /dev/null +++ b/assets/icons/dockhand/volumes.svg @@ -0,0 +1,1 @@ + diff --git a/assets/icons/immich/icon.svg b/assets/icons/immich/icon.svg new file mode 100644 --- /dev/null +++ b/assets/icons/immich/icon.svg @@ -0,0 +1,1 @@ + diff --git a/assets/icons/immich/photos.svg b/assets/icons/immich/photos.svg new file mode 100644 --- /dev/null +++ b/assets/icons/immich/photos.svg @@ -0,0 +1,1 @@ + diff --git a/assets/icons/immich/storage.svg b/assets/icons/immich/storage.svg new file mode 100644 --- /dev/null +++ b/assets/icons/immich/storage.svg @@ -0,0 +1,1 @@ + diff --git a/assets/icons/immich/videos.svg b/assets/icons/immich/videos.svg new file mode 100644 --- /dev/null +++ b/assets/icons/immich/videos.svg @@ -0,0 +1,1 @@ + diff --git a/assets/icons/status/check.svg b/assets/icons/status/check.svg new file mode 100644 --- /dev/null +++ b/assets/icons/status/check.svg @@ -0,0 +1,1 @@ + diff --git a/assets/icons/status/disabled.svg b/assets/icons/status/disabled.svg new file mode 100644 --- /dev/null +++ b/assets/icons/status/disabled.svg @@ -0,0 +1,1 @@ + diff --git a/assets/icons/status/enabled.svg b/assets/icons/status/enabled.svg new file mode 100644 --- /dev/null +++ b/assets/icons/status/enabled.svg @@ -0,0 +1,1 @@ + diff --git a/assets/icons/status/warning.svg b/assets/icons/status/warning.svg new file mode 100644 --- /dev/null +++ b/assets/icons/status/warning.svg @@ -0,0 +1,1 @@ + diff --git a/assets/icons/status/widget-error.svg b/assets/icons/status/widget-error.svg new file mode 100644 --- /dev/null +++ b/assets/icons/status/widget-error.svg @@ -0,0 +1,1 @@ + diff --git a/assets/icons/status/x.svg b/assets/icons/status/x.svg new file mode 100644 --- /dev/null +++ b/assets/icons/status/x.svg @@ -0,0 +1,1 @@ +