Compare commits

..

29 Commits

Author SHA1 Message Date
Ben Belov fcd9a715d9 Enhancement: Add bearer authentication to whatsupdocker widget (#7134)
Docker CI / Docker Build & Push (push) Waiting to run
Lint / Linting Checks (push) Waiting to run
Release Drafter / Update Release Draft (push) Waiting to run
Release Drafter / Auto Label PR (push) Waiting to run
Tests / vitest (1) (push) Waiting to run
Tests / vitest (2) (push) Waiting to run
Tests / vitest (3) (push) Waiting to run
Tests / vitest (4) (push) Waiting to run
2026-09-11 23:24:08 -07:00
dependabot[bot] eacc205249 Chore(deps): Bump crowdin/github-action from 3.0.0 to 3.0.1 (#7128)
Docker CI / Docker Build & Push (push) Has been cancelled
Lint / Linting Checks (push) Has been cancelled
Release Drafter / Update Release Draft (push) Has been cancelled
Release Drafter / Auto Label PR (push) Has been cancelled
Tests / vitest (1) (push) Has been cancelled
Tests / vitest (2) (push) Has been cancelled
Tests / vitest (3) (push) Has been cancelled
Tests / vitest (4) (push) Has been cancelled
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-09-10 16:57:51 +00:00
dependabot[bot] 4249a3fb95 Chore(deps): Bump actions/deploy-pages from 5.0.0 to 5.0.1 (#7127)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-09-10 16:50:37 +00:00
dependabot[bot] 0b98428ab5 Chore(deps): Bump docker/setup-qemu-action from 4.2.0 to 4.3.0 (#7129)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-09-10 09:44:14 -07:00
dependabot[bot] bbe52519bb Chore(deps): Bump js-yaml from 5.4.0 to 5.4.1 (#7119)
Docker CI / Docker Build & Push (push) Has been cancelled
Tests / vitest (1) (push) Has been cancelled
Tests / vitest (2) (push) Has been cancelled
Tests / vitest (3) (push) Has been cancelled
Tests / vitest (4) (push) Has been cancelled
Lint / Linting Checks (push) Has been cancelled
Release Drafter / Update Release Draft (push) Has been cancelled
Release Drafter / Auto Label PR (push) Has been cancelled
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-09-09 15:12:08 -07:00
shamoon 541b2fe9f1 2.3.0
Docker CI / Docker Build & Push (push) Has been cancelled
Docs / Test Build Docs (push) Has been cancelled
Docs / Build & Deploy Docs (push) Has been cancelled
Lint / Linting Checks (push) Has been cancelled
Tests / vitest (1) (push) Has been cancelled
Tests / vitest (2) (push) Has been cancelled
Tests / vitest (3) (push) Has been cancelled
Tests / vitest (4) (push) Has been cancelled
2026-09-09 14:45:28 -07:00
github-actions[bot] 574ba2c7cb New Crowdin translations by GitHub Action (#7090)
Co-authored-by: Crowdin Bot <support+bot@crowdin.com>
Co-authored-by: shamoon <4887959+shamoon@users.noreply.github.com>
2026-09-09 14:43:53 -07:00
shamoon f78cab7557 Documentation: update jellyfin versioning 2026-09-09 14:43:02 -07:00
shamoon 2cd77eae1f Fixhancement: use ghostfolio baseCurrency for net worth (#7116)
Docker CI / Docker Build & Push (push) Has been cancelled
Lint / Linting Checks (push) Has been cancelled
Release Drafter / Update Release Draft (push) Has been cancelled
Release Drafter / Auto Label PR (push) Has been cancelled
Tests / vitest (1) (push) Has been cancelled
Tests / vitest (2) (push) Has been cancelled
Tests / vitest (3) (push) Has been cancelled
Tests / vitest (4) (push) Has been cancelled
2026-09-08 09:25:58 -07:00
shamoon 6ab83b0b5f Tweak: handle QL selection without hover (#7105)
Release Drafter / Auto Label PR (push) Has been cancelled
Docker CI / Docker Build & Push (push) Has been cancelled
Lint / Linting Checks (push) Has been cancelled
Release Drafter / Update Release Draft (push) Has been cancelled
Tests / vitest (1) (push) Has been cancelled
Tests / vitest (2) (push) Has been cancelled
Tests / vitest (3) (push) Has been cancelled
Tests / vitest (4) (push) Has been cancelled
2026-09-06 18:35:01 -07:00
shamoon 9aa5a79c41 Fix: dont fire search on empty field (#7101)
Release Drafter / Update Release Draft (push) Has been cancelled
Release Drafter / Auto Label PR (push) Has been cancelled
Tests / vitest (1) (push) Has been cancelled
Docker CI / Docker Build & Push (push) Has been cancelled
Lint / Linting Checks (push) Has been cancelled
Tests / vitest (2) (push) Has been cancelled
Tests / vitest (3) (push) Has been cancelled
Tests / vitest (4) (push) Has been cancelled
2026-09-05 16:07:12 -07:00
shamoon 1c2cb76702 Enhancement: render more docker states (#7099)
Docker CI / Docker Build & Push (push) Has been cancelled
Lint / Linting Checks (push) Has been cancelled
Release Drafter / Update Release Draft (push) Has been cancelled
Release Drafter / Auto Label PR (push) Has been cancelled
Tests / vitest (1) (push) Has been cancelled
Tests / vitest (2) (push) Has been cancelled
Tests / vitest (3) (push) Has been cancelled
Tests / vitest (4) (push) Has been cancelled
2026-09-05 10:24:59 -07:00
shamoon 7de1faa769 Performance: use bulk request for docker stats (#7098) 2026-09-05 10:08:20 -07:00
shamoon 1024a382ee Enhancement: allow OIDC auto-login (#7096) 2026-09-05 08:25:00 -07:00
DaddyBoard 438788240b Performance: fetch all docker container statuses in one request (#7092)
Co-authored-by: shamoon <4887959+shamoon@users.noreply.github.com>
2026-09-05 15:17:52 +00:00
dependabot[bot] df34927198 Chore(deps): Bump crowdin/github-action from 2.17.1 to 3.0.0 (#7091)
Docker CI / Docker Build & Push (push) Has been cancelled
Lint / Linting Checks (push) Has been cancelled
Release Drafter / Update Release Draft (push) Has been cancelled
Release Drafter / Auto Label PR (push) Has been cancelled
Tests / vitest (1) (push) Has been cancelled
Tests / vitest (2) (push) Has been cancelled
Tests / vitest (3) (push) Has been cancelled
Tests / vitest (4) (push) Has been cancelled
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-09-05 02:21:31 -07:00
shamoon ddc5adc91c Fix: handle literal null from crowdsec api alerts (#7088)
Docker CI / Docker Build & Push (push) Has been cancelled
Lint / Linting Checks (push) Has been cancelled
Release Drafter / Update Release Draft (push) Has been cancelled
Release Drafter / Auto Label PR (push) Has been cancelled
Tests / vitest (1) (push) Has been cancelled
Tests / vitest (2) (push) Has been cancelled
Tests / vitest (3) (push) Has been cancelled
Tests / vitest (4) (push) Has been cancelled
2026-09-02 12:40:40 -07:00
shamoon 22f1317ad3 2.2.0
Docs / Test Build Docs (push) Has been cancelled
Release Drafter / Update Release Draft (push) Has been cancelled
Release Drafter / Auto Label PR (push) Has been cancelled
Docs / Build & Deploy Docs (push) Has been cancelled
Docker CI / Docker Build & Push (push) Has been cancelled
Lint / Linting Checks (push) Has been cancelled
Tests / vitest (1) (push) Has been cancelled
Tests / vitest (2) (push) Has been cancelled
Tests / vitest (3) (push) Has been cancelled
Tests / vitest (4) (push) Has been cancelled
2026-09-01 20:34:02 -07:00
shamoon 7c36d09217 Merge branch 'dev' 2026-09-01 20:33:49 -07:00
github-actions[bot] 378f2d5d6d New Crowdin translations by GitHub Action (#7043)
Co-authored-by: Crowdin Bot <support+bot@crowdin.com>
2026-09-01 20:33:38 -07:00
shamoon d907ca1d0e Merge changes from fork 2026-09-01 20:25:13 -07:00
dependabot[bot] 81accd8dbe Chore(deps-dev): Bump eslint-config-next from 15.5.22 to 16.3.3 (#7082)
Lint / Linting Checks (push) Has been cancelled
Release Drafter / Update Release Draft (push) Has been cancelled
Docker CI / Docker Build & Push (push) Has been cancelled
Tests / vitest (1) (push) Has been cancelled
Tests / vitest (2) (push) Has been cancelled
Release Drafter / Auto Label PR (push) Has been cancelled
Tests / vitest (3) (push) Has been cancelled
Tests / vitest (4) (push) Has been cancelled
Co-authored-by: shamoon <4887959+shamoon@users.noreply.github.com>
Signed-off-by: dependabot[bot] <support@github.com>
2026-09-01 10:52:46 -07:00
dependabot[bot] 070e1b9cca Chore(deps): Bump next from 16.3.0 to 16.3.3 (#7084)
Signed-off-by: dependabot[bot] <support@github.com>
2026-09-01 17:02:22 +00:00
dependabot[bot] 6324c5ee63 Chore(deps): Bump react-i18next from 17.0.11 to 17.0.12 (#7085)
Signed-off-by: dependabot[bot] <support@github.com>
2026-09-01 16:55:53 +00:00
dependabot[bot] 9b475f48d8 Chore(deps): Bump js-yaml from 5.3.0 to 5.4.0 (#7083)
Docker CI / Docker Build & Push (push) Has been cancelled
Lint / Linting Checks (push) Has been cancelled
Release Drafter / Update Release Draft (push) Has been cancelled
Release Drafter / Auto Label PR (push) Has been cancelled
Tests / vitest (1) (push) Has been cancelled
Tests / vitest (2) (push) Has been cancelled
Tests / vitest (3) (push) Has been cancelled
Tests / vitest (4) (push) Has been cancelled
Signed-off-by: dependabot[bot] <support@github.com>
2026-09-01 16:48:35 +00:00
dependabot[bot] 35b72b65de Chore(deps-dev): Bump typescript from 5.9.3 to 6.0.3 (#7081)
Signed-off-by: dependabot[bot] <support@github.com>
2026-09-01 09:42:44 -07:00
shamoon 5873f8e7d5 2.1.2
Docker CI / Docker Build & Push (push) Has been cancelled
Docs / Test Build Docs (push) Has been cancelled
Docs / Build & Deploy Docs (push) Has been cancelled
Lint / Linting Checks (push) Has been cancelled
Tests / vitest (1) (push) Has been cancelled
Tests / vitest (2) (push) Has been cancelled
Tests / vitest (3) (push) Has been cancelled
Tests / vitest (4) (push) Has been cancelled
2026-08-21 09:58:19 -07:00
shamoon 6099837373 Merge branch 'dev' 2026-08-21 09:52:58 -07:00
shamoon 21bf7ed8e2 2.1.1 2026-08-21 08:47:00 -07:00
277 changed files with 2923 additions and 1831 deletions
+1 -1
View File
@@ -23,7 +23,7 @@ jobs:
- name: Checkout - name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: crowdin action - name: crowdin action
uses: crowdin/github-action@8f01d54f70f1713ee3f09d82c2bbb2daeac28689 # v2 uses: crowdin/github-action@71fdb8814261dd703be4ca7c6450d21b1868da4b # v3.0.1
with: with:
upload_translations: false upload_translations: false
download_translations: true download_translations: true
+1 -1
View File
@@ -99,7 +99,7 @@ jobs:
password: ${{ secrets.DOCKERHUB_TOKEN }} password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Setup QEMU - name: Setup QEMU
uses: docker/setup-qemu-action@96fe6ef7f33517b61c61be40b68a1882f3264fb8 # v4.2.0 uses: docker/setup-qemu-action@1f40c72289eff860ee54a304f1438e3cff362e0a # v4.3.0
- name: Setup Docker buildx - name: Setup Docker buildx
uses: docker/setup-buildx-action@37fe631027851001ddb9b187196cc803df7f5f0e # v4 uses: docker/setup-buildx-action@37fe631027851001ddb9b187196cc803df7f5f0e # v4
+1 -1
View File
@@ -52,5 +52,5 @@ jobs:
- uses: actions/upload-pages-artifact@fc324d3547104276b827a68afc52ff2a11cc49c9 # v5.0.0 - uses: actions/upload-pages-artifact@fc324d3547104276b827a68afc52ff2a11cc49c9 # v5.0.0
with: with:
path: site path: site
- uses: actions/deploy-pages@cd2ce8fcbc39b97be8ca5fce6e763baed58fa128 # v5.0.0 - uses: actions/deploy-pages@368f82528645a54fb793d4d04e342629a3f51346 # v5.0.1
id: deployment id: deployment
+5
View File
@@ -69,6 +69,11 @@ For OIDC login (overrides password login):
- `HOMEPAGE_OIDC_CLIENT_ID` - `HOMEPAGE_OIDC_CLIENT_ID`
- `HOMEPAGE_OIDC_CLIENT_SECRET` - `HOMEPAGE_OIDC_CLIENT_SECRET`
- Optional: `HOMEPAGE_OIDC_NAME` (display name), `HOMEPAGE_OIDC_SCOPE` (defaults to `openid email profile`) - Optional: `HOMEPAGE_OIDC_NAME` (display name), `HOMEPAGE_OIDC_SCOPE` (defaults to `openid email profile`)
- Optional: `HOMEPAGE_OIDC_AUTO_LOGIN=true` to skip the login page and send unauthenticated visitors straight to the provider
!!! tip
With auto-login enabled, visit `/auth/signin?autologin=0` to reach the login page without being redirected, e.g. in case something goes wrong!
!!! warning !!! warning
+2 -2
View File
@@ -13,8 +13,8 @@ Allowed fields: `["movies", "series", "episodes", "songs", "albums"]`.
| Jellyfin Version | Homepage Widget Version | | Jellyfin Version | Homepage Widget Version |
| ---------------- | ----------------------- | | ---------------- | ----------------------- |
| < 10.12 | 1 (default) | | < 12 (10.12) | 1 (default) |
| >= 10.12 | 2 | | >= 12 (10.12) | 2 |
```yaml ```yaml
widget: widget:
+1
View File
@@ -13,4 +13,5 @@ widget:
url: http://whatsupdocker:port url: http://whatsupdocker:port
username: username # optional username: username # optional
password: password # optional password: password # optional
key: bearer-token # optional, takes precedence over username/password
``` ```
+4 -21
View File
@@ -1,30 +1,13 @@
import path from "node:path"; import nextCoreWebVitals from "eslint-config-next/core-web-vitals";
import { fileURLToPath } from "node:url"; import prettierConfig from "eslint-config-prettier/flat";
import { fixupConfigRules } from "@eslint/compat";
import { FlatCompat } from "@eslint/eslintrc";
import js from "@eslint/js";
import prettier from "eslint-plugin-prettier";
import { defineConfig, globalIgnores } from "eslint/config"; import { defineConfig, globalIgnores } from "eslint/config";
const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
const compat = new FlatCompat({
baseDirectory: __dirname,
recommendedConfig: js.configs.recommended,
allConfig: js.configs.all,
});
export default defineConfig([ export default defineConfig([
...nextCoreWebVitals,
prettierConfig,
{ {
files: ["**/*.{js,mjs,cjs,jsx}"], files: ["**/*.{js,mjs,cjs,jsx}"],
extends: fixupConfigRules(compat.extends("next/core-web-vitals", "prettier", "plugin:react-hooks/recommended")),
plugins: {
prettier,
},
languageOptions: { languageOptions: {
ecmaVersion: 6, ecmaVersion: 6,
sourceType: "module", sourceType: "module",
+6 -14
View File
@@ -1,6 +1,6 @@
{ {
"name": "homepage", "name": "homepage",
"version": "2.1.0", "version": "2.3.0",
"private": true, "private": true,
"scripts": { "scripts": {
"preinstall": "npx only-allow pnpm", "preinstall": "npx only-allow pnpm",
@@ -23,12 +23,12 @@
"gamedig": "^5.3.3", "gamedig": "^5.3.3",
"i18next": "^26.3.6", "i18next": "^26.3.6",
"ical.js": "^2.2.1", "ical.js": "^2.2.1",
"js-yaml": "^5.3.0", "js-yaml": "^5.4.1",
"json-rpc-2.0": "^1.7.1", "json-rpc-2.0": "^1.7.1",
"luxon": "^3.7.2", "luxon": "^3.7.2",
"memory-cache": "^0.2.0", "memory-cache": "^0.2.0",
"minecraftstatuspinger": "^1.2.2", "minecraftstatuspinger": "^1.2.2",
"next": "^16.2.12", "next": "^16.3.3",
"next-auth": "^4.24.15", "next-auth": "^4.24.15",
"next-i18next": "^16.0.8", "next-i18next": "^16.0.8",
"ping": "^1.0.0", "ping": "^1.0.0",
@@ -36,7 +36,7 @@
"raw-body": "^4.0.0", "raw-body": "^4.0.0",
"react": "^19.2.8", "react": "^19.2.8",
"react-dom": "^19.2.8", "react-dom": "^19.2.8",
"react-i18next": "^17.0.11", "react-i18next": "^17.0.12",
"react-icons": "^5.6.0", "react-icons": "^5.6.0",
"recharts": "^3.1.2", "recharts": "^3.1.2",
"swr": "^2.5.1", "swr": "^2.5.1",
@@ -48,29 +48,21 @@
"xml-js": "^1.6.11" "xml-js": "^1.6.11"
}, },
"devDependencies": { "devDependencies": {
"@eslint/compat": "^2.1.0",
"@eslint/eslintrc": "^3.3.3",
"@eslint/js": "^9.39.4",
"@tailwindcss/forms": "^0.5.11", "@tailwindcss/forms": "^0.5.11",
"@tailwindcss/postcss": "^4.3.3", "@tailwindcss/postcss": "^4.3.3",
"@testing-library/jest-dom": "^7.0.1", "@testing-library/jest-dom": "^7.0.1",
"@testing-library/react": "^16.3.0", "@testing-library/react": "^16.3.0",
"@vitest/coverage-v8": "^4.1.10", "@vitest/coverage-v8": "^4.1.10",
"eslint": "^9.25.1", "eslint": "^9.25.1",
"eslint-config-next": "^15.5.11", "eslint-config-next": "^16.3.3",
"eslint-config-prettier": "^10.1.8", "eslint-config-prettier": "^10.1.8",
"eslint-plugin-import": "^2.32.0",
"eslint-plugin-jsx-a11y": "^6.10.2",
"eslint-plugin-prettier": "^5.5.6",
"eslint-plugin-react": "^7.37.4",
"eslint-plugin-react-hooks": "^7.1.1",
"jsdom": "^30.0.1", "jsdom": "^30.0.1",
"postcss": "^8.5.26", "postcss": "^8.5.26",
"prettier": "^3.8.4", "prettier": "^3.8.4",
"prettier-plugin-organize-imports": "^4.3.0", "prettier-plugin-organize-imports": "^4.3.0",
"tailwind-scrollbar": "^4.0.2", "tailwind-scrollbar": "^4.0.2",
"tailwindcss": "^4.3.3", "tailwindcss": "^4.3.3",
"typescript": "^5.7.3", "typescript": "^6.0.3",
"vitest": "^4.1.0" "vitest": "^4.1.0"
}, },
"optionalDependencies": { "optionalDependencies": {
+302 -382
View File
File diff suppressed because it is too large Load Diff
+10 -5
View File
@@ -21,7 +21,7 @@
"seconds": "s" "seconds": "s"
}, },
"auth": { "auth": {
"signout": "Sign out" "signout": "Teken uit"
}, },
"widget": { "widget": {
"missing_type": "Ontbrekende legstuk-tipe: {{type}}", "missing_type": "Ontbrekende legstuk-tipe: {{type}}",
@@ -40,8 +40,8 @@
}, },
"search": { "search": {
"placeholder": "Soek…", "placeholder": "Soek…",
"provider": "Search engine: {{name}}", "provider": "Soekenjin: {{name}}",
"select_provider": "Select search engine" "select_provider": "Kies soekenjin"
}, },
"resources": { "resources": {
"cpu": "SVE", "cpu": "SVE",
@@ -99,7 +99,12 @@
"unhealthy": "Ongesond", "unhealthy": "Ongesond",
"not_found": "Nie Gevind Nie", "not_found": "Nie Gevind Nie",
"exited": "Verlaat", "exited": "Verlaat",
"partial": "Gedeeltelik" "partial": "Gedeeltelik",
"created": "Created",
"paused": "Paused",
"restarting": "Restarting",
"removing": "Removing",
"dead": "Dead"
}, },
"ping": { "ping": {
"error": "Fout", "error": "Fout",
@@ -474,7 +479,7 @@
"users": "Gebruikers", "users": "Gebruikers",
"loginsLast24H": "Aantekenings (24h)", "loginsLast24H": "Aantekenings (24h)",
"failedLoginsLast24H": "Mislukte Aantekenings (24h)", "failedLoginsLast24H": "Mislukte Aantekenings (24h)",
"authorizationsLast24H": "Auths (24h)" "authorizationsLast24H": "Magtigings (24h)"
}, },
"proxmox": { "proxmox": {
"mem": "GEH", "mem": "GEH",
+6 -1
View File
@@ -99,7 +99,12 @@
"unhealthy": "غير سليم", "unhealthy": "غير سليم",
"not_found": "غير موجود", "not_found": "غير موجود",
"exited": "خرجت", "exited": "خرجت",
"partial": "جزئي" "partial": "جزئي",
"created": "Created",
"paused": "Paused",
"restarting": "Restarting",
"removing": "Removing",
"dead": "Dead"
}, },
"ping": { "ping": {
"error": "خطأ", "error": "خطأ",
+6 -1
View File
@@ -99,7 +99,12 @@
"unhealthy": "Нездравословен", "unhealthy": "Нездравословен",
"not_found": "Не е открит", "not_found": "Не е открит",
"exited": "Напуснал", "exited": "Напуснал",
"partial": "Частично" "partial": "Частично",
"created": "Created",
"paused": "Paused",
"restarting": "Restarting",
"removing": "Removing",
"dead": "Dead"
}, },
"ping": { "ping": {
"error": "Грешка", "error": "Грешка",
+259 -254
View File
@@ -21,7 +21,7 @@
"seconds": "s" "seconds": "s"
}, },
"auth": { "auth": {
"signout": "Sign out" "signout": "Tanca la sessió"
}, },
"widget": { "widget": {
"missing_type": "Falta el tipus de widget: {{type}}", "missing_type": "Falta el tipus de widget: {{type}}",
@@ -40,8 +40,8 @@
}, },
"search": { "search": {
"placeholder": "Cerca…", "placeholder": "Cerca…",
"provider": "Search engine: {{name}}", "provider": "Motor de cerca: {{name}}",
"select_provider": "Select search engine" "select_provider": "Escull motor de cerca"
}, },
"resources": { "resources": {
"cpu": "CPU", "cpu": "CPU",
@@ -72,17 +72,17 @@
"empty_data": "Estat del subsistema desconegut" "empty_data": "Estat del subsistema desconegut"
}, },
"unifi_drive": { "unifi_drive": {
"healthy": "Healthy", "healthy": "Saludable",
"degraded": "Degraded", "degraded": "Degradat",
"no_data": "No storage data available" "no_data": "Sense dades d'emmagatzematge disponible"
}, },
"duplicati": { "duplicati": {
"jobs": "Jobs", "jobs": "Tasques",
"stored": "Stored", "stored": "Desat",
"lastBackup": "Last Run", "lastBackup": "Darrera execució",
"nextRun": "Next Run", "nextRun": "Propera execució",
"running": "Running", "running": "En execució",
"warnings": "Warnings", "warnings": "Avisos",
"errors": "Errors" "errors": "Errors"
}, },
"docker": { "docker": {
@@ -99,7 +99,12 @@
"unhealthy": "No saludable", "unhealthy": "No saludable",
"not_found": "No trobat", "not_found": "No trobat",
"exited": "Tancat", "exited": "Tancat",
"partial": "Parcial" "partial": "Parcial",
"created": "Creat",
"paused": "Pausat",
"restarting": "Reiniciant",
"removing": "Eliminant",
"dead": "Mort"
}, },
"ping": { "ping": {
"error": "Error", "error": "Error",
@@ -135,7 +140,7 @@
"series": "Sèries", "series": "Sèries",
"episodes": "Episodis", "episodes": "Episodis",
"songs": "Cançons", "songs": "Cançons",
"albums": "Albums" "albums": "Àlbums"
}, },
"esphome": { "esphome": {
"offline": "Desconnectat", "offline": "Desconnectat",
@@ -246,10 +251,10 @@
"seed": "Sembrat" "seed": "Sembrat"
}, },
"qbittorrent": { "qbittorrent": {
"download": "Download", "download": "Baixada",
"upload": "Upload", "upload": "Pujada",
"leech": "Leech", "leech": "Sangonera",
"seed": "Seed" "seed": "Sembrat"
}, },
"qnap": { "qnap": {
"cpuUsage": "Ús de CPU", "cpuUsage": "Ús de CPU",
@@ -260,44 +265,44 @@
"invalid": "No vàlid" "invalid": "No vàlid"
}, },
"deluge": { "deluge": {
"download": "Download", "download": "Baixada",
"upload": "Upload", "upload": "Pujada",
"leech": "Leech", "leech": "Sangonera",
"seed": "Seed" "seed": "Sembrat"
}, },
"develancacheui": { "develancacheui": {
"cachehitbytes": "Bytes trobats a la memòria cau", "cachehitbytes": "Bytes trobats a la memòria cau",
"cachemissbytes": "Bytes no trobats a la memòria cau" "cachemissbytes": "Bytes no trobats a la memòria cau"
}, },
"downloadstation": { "downloadstation": {
"download": "Download", "download": "Baixada",
"upload": "Upload", "upload": "Pujada",
"leech": "Leech", "leech": "Sangonera",
"seed": "Seed" "seed": "Sembrat"
}, },
"sonarr": { "sonarr": {
"wanted": "Volgut", "wanted": "Volgut",
"queued": "En cua", "queued": "En cua",
"series": "Series", "series": "Sèries",
"queue": "Queue", "queue": "Cua",
"unknown": "Unknown" "unknown": "Desconegut"
}, },
"radarr": { "radarr": {
"wanted": "Wanted", "wanted": "Volguts",
"missing": "Falten", "missing": "Falten",
"queued": "Queued", "queued": "Encuat",
"movies": "Movies", "movies": "Pel·lícules",
"queue": "Queue", "queue": "Cua",
"unknown": "Unknown" "unknown": "Desconegut"
}, },
"lidarr": { "lidarr": {
"wanted": "Wanted", "wanted": "Volguts",
"queued": "Queued", "queued": "Encuat",
"artists": "Artistes" "artists": "Artistes"
}, },
"readarr": { "readarr": {
"wanted": "Wanted", "wanted": "Volguts",
"queued": "Queued", "queued": "Encuat",
"books": "Llibres" "books": "Llibres"
}, },
"bazarr": { "bazarr": {
@@ -310,16 +315,16 @@
"available": "Disponible" "available": "Disponible"
}, },
"seerr": { "seerr": {
"pending": "Pending", "pending": "Pendent",
"approved": "Approved", "approved": "Aprovat",
"available": "Available", "available": "Disponible",
"completed": "Completed", "completed": "Completat",
"processing": "Processing", "processing": "Processant",
"issues": "Open Issues" "issues": "Temes oberts"
}, },
"netalertx": { "netalertx": {
"total": "Total", "total": "Total",
"connected": "Connected", "connected": "Connectat",
"new_devices": "Nous dispositius", "new_devices": "Nous dispositius",
"down_alerts": "Alertes de caigudes" "down_alerts": "Alertes de caigudes"
}, },
@@ -330,18 +335,18 @@
"gravity": "Gravetat" "gravity": "Gravetat"
}, },
"adguard": { "adguard": {
"queries": "Queries", "queries": "Consultes",
"blocked": "Blocked", "blocked": "Bloquejat",
"filtered": "Filtrat", "filtered": "Filtrat",
"latency": "Latència" "latency": "Latència"
}, },
"speedtest": { "speedtest": {
"upload": "Upload", "upload": "Pujada",
"download": "Download", "download": "Baixada",
"ping": "Ping" "ping": "Latència"
}, },
"portainer": { "portainer": {
"running": "Running", "running": "En execució",
"stopped": "Aturat", "stopped": "Aturat",
"total": "Total" "total": "Total"
}, },
@@ -359,16 +364,16 @@
"address": "Adreça", "address": "Adreça",
"expires": "Caduca", "expires": "Caduca",
"never": "Mai", "never": "Mai",
"user": "User", "user": "Usuari",
"hostname": "Hostname", "hostname": "Nom d'hoste",
"name": "Name", "name": "Nom",
"client_version": "Client Version", "client_version": "Versió de client",
"os": "OS", "os": "OS",
"created": "Created", "created": "Creat",
"authorized": "Authorized", "authorized": "Autoritzat",
"is_external": "Is External", "is_external": "És extern",
"update_available": "Update Available", "update_available": "Actualització disponible",
"tags": "Tags", "tags": "Etiquetes",
"last_seen": "Vist per darrer cop", "last_seen": "Vist per darrer cop",
"now": "Ara", "now": "Ara",
"years": "{{number}}a", "years": "{{number}}a",
@@ -378,7 +383,7 @@
"minutes": "{{number}}m", "minutes": "{{number}}m",
"seconds": "{{number}}s", "seconds": "{{number}}s",
"ago": "Fa {{value}}", "ago": "Fa {{value}}",
"true": "Yes", "true": "",
"false": "No" "false": "No"
}, },
"technitium": { "technitium": {
@@ -474,7 +479,7 @@
"users": "Usuaris", "users": "Usuaris",
"loginsLast24H": "Inicis de sessió (24h)", "loginsLast24H": "Inicis de sessió (24h)",
"failedLoginsLast24H": "Errors d'inici de sessió (24h)", "failedLoginsLast24H": "Errors d'inici de sessió (24h)",
"authorizationsLast24H": "Auths (24h)" "authorizationsLast24H": "Autentificacions (últ. 24h)"
}, },
"proxmox": { "proxmox": {
"mem": "MEM", "mem": "MEM",
@@ -542,37 +547,37 @@
"61-day": "Pluja lleugera", "61-day": "Pluja lleugera",
"61-night": "Pluja lleugera", "61-night": "Pluja lleugera",
"63-day": "Pluja", "63-day": "Pluja",
"63-night": "Rain", "63-night": "Pluja",
"65-day": "Pluja intensa", "65-day": "Pluja intensa",
"65-night": "Heavy Rain", "65-night": "Pluja forta",
"66-day": "Pluja gelada", "66-day": "Pluja gelada",
"66-night": "Freezing Rain", "66-night": "Pluja gelada",
"67-day": "Freezing Rain", "67-day": "Pluja gelada",
"67-night": "Freezing Rain", "67-night": "Pluja gelada",
"71-day": "Neu lleugera", "71-day": "Neu lleugera",
"71-night": "Light Snow", "71-night": "Nevada lleugera",
"73-day": "Neu", "73-day": "Neu",
"73-night": "Snow", "73-night": "Nevada",
"75-day": "Neu intensa", "75-day": "Neu intensa",
"75-night": "Heavy Snow", "75-night": "Nevada forta",
"77-day": "Neu lleugera", "77-day": "Neu lleugera",
"77-night": "Snow Grains", "77-night": "Flocs de neu",
"80-day": "Plovisqueig", "80-day": "Plovisqueig",
"80-night": "Light Showers", "80-night": "Plugims suaus",
"81-day": "Xàfecs", "81-day": "Xàfecs",
"81-night": "Showers", "81-night": "Plugims",
"82-day": "Xàfecs intensos", "82-day": "Xàfecs intensos",
"82-night": "Heavy Showers", "82-night": "Plugims forts",
"85-day": "Xàfecs de neu", "85-day": "Xàfecs de neu",
"85-night": "Snow Showers", "85-night": "Plugims amb neu",
"86-day": "Snow Showers", "86-day": "Plugims amb neu",
"86-night": "Snow Showers", "86-night": "Plugims amb neu",
"95-day": "Tempesta", "95-day": "Tempesta",
"95-night": "Thunderstorm", "95-night": "Tormenta",
"96-day": "Tempesta amb calamarsa", "96-day": "Tempesta amb calamarsa",
"96-night": "Thunderstorm With Hail", "96-night": "Tormenta amb calamarsa",
"99-day": "Thunderstorm With Hail", "99-day": "Tormenta amb calamarsa",
"99-night": "Thunderstorm With Hail" "99-night": "Tormenta amb calamarsa"
}, },
"homebridge": { "homebridge": {
"available_update": "Sistema", "available_update": "Sistema",
@@ -581,18 +586,18 @@
"up_to_date": "Actualitzat", "up_to_date": "Actualitzat",
"child_bridges": "Ponts fills", "child_bridges": "Ponts fills",
"child_bridges_status": "{{ok}}/{{total}}", "child_bridges_status": "{{ok}}/{{total}}",
"up": "Up", "up": "En línia",
"pending": "Pending", "pending": "Pendent",
"down": "Down", "down": "Inactiu",
"ok": "Ok" "ok": "Ok"
}, },
"healthchecks": { "healthchecks": {
"new": "Nou", "new": "Nou",
"up": "Up", "up": "Actiu",
"grace": "En Període de gràcia", "grace": "En Període de gràcia",
"down": "Down", "down": "Inactiu",
"paused": "En pausa", "paused": "En pausa",
"status": "Status", "status": "Estat",
"last_ping": "Últim ping", "last_ping": "Últim ping",
"never": "Sense pings" "never": "Sense pings"
}, },
@@ -602,74 +607,74 @@
"containers_failed": "Error" "containers_failed": "Error"
}, },
"autobrr": { "autobrr": {
"approvedPushes": "Approved", "approvedPushes": "Aprovat",
"rejectedPushes": "Rebutjat", "rejectedPushes": "Rebutjat",
"filters": "Filtres", "filters": "Filtres",
"indexers": "Indexers" "indexers": "Indexadors"
}, },
"tubearchivist": { "tubearchivist": {
"downloads": "Queue", "downloads": "Cua",
"videos": "Vídeos", "videos": "Vídeos",
"channels": "Canals", "channels": "Canals",
"playlists": "Llistes de reproducció" "playlists": "Llistes de reproducció"
}, },
"truenas": { "truenas": {
"load": "Càrrega del sistema", "load": "Càrrega del sistema",
"uptime": "Uptime", "uptime": "Temps actiu",
"alerts": "Alerts" "alerts": "Alertes"
}, },
"pyload": { "pyload": {
"speed": "Velocitat", "speed": "Velocitat",
"active": "Active", "active": "Actiu",
"queue": "Queue", "queue": "Cua",
"total": "Total" "total": "Total"
}, },
"gluetun": { "gluetun": {
"public_ip": "IP Pública", "public_ip": "IP Pública",
"region": "Regió", "region": "Regió",
"country": "País", "country": "País",
"port_forwarded": "Port Forwarded" "port_forwarded": "Ports redirigits"
}, },
"hdhomerun": { "hdhomerun": {
"channels": "Channels", "channels": "Canals",
"hd": "HD", "hd": "HD",
"tunerCount": "Sintonitzadors", "tunerCount": "Sintonitzadors",
"channelNumber": "Canal", "channelNumber": "Canal",
"channelNetwork": "Xarxa", "channelNetwork": "Xarxa",
"signalStrength": "Intensitat", "signalStrength": "Intensitat",
"signalQuality": "Qualitat", "signalQuality": "Qualitat",
"symbolQuality": "Quality", "symbolQuality": "Qualitat",
"networkRate": "Bitrate", "networkRate": "Taxa de bits",
"clientIP": "Client" "clientIP": "Client"
}, },
"scrutiny": { "scrutiny": {
"passed": "Aprovat", "passed": "Aprovat",
"failed": "Failed", "failed": "Error",
"unknown": "Unknown" "unknown": "Desconegut"
}, },
"paperlessngx": { "paperlessngx": {
"inbox": "Safata d'entrada", "inbox": "Safata d'entrada",
"total": "Total" "total": "Total"
}, },
"pangolin": { "pangolin": {
"orgs": "Orgs", "orgs": "Organitzacions",
"sites": "Sites", "sites": "Llocs",
"resources": "Resources", "resources": "Recursos",
"targets": "Targets", "targets": "Objectius",
"traffic": "Traffic", "traffic": "Tràfic",
"in": "In", "in": "Dins",
"out": "Out" "out": "Fora"
}, },
"peanut": { "peanut": {
"battery_charge": "Càrrega de la bateria", "battery_charge": "Càrrega de la bateria",
"ups_load": "Càrrega del SAI", "ups_load": "Càrrega del SAI",
"ups_status": "Estat del SAI", "ups_status": "Estat del SAI",
"online": "Online", "online": "En línia",
"on_battery": "En Bateria", "on_battery": "En Bateria",
"low_battery": "Bateria Baixa" "low_battery": "Bateria Baixa"
}, },
"nextdns": { "nextdns": {
"wait": "Please Wait", "wait": "Espereu si us plau",
"no_devices": "No s'han rebut dades del Dispositiu" "no_devices": "No s'han rebut dades del Dispositiu"
}, },
"mikrotik": { "mikrotik": {
@@ -857,37 +862,37 @@
"jdownloader": { "jdownloader": {
"downloadCount": "Cua", "downloadCount": "Cua",
"downloadBytesRemaining": "Restant", "downloadBytesRemaining": "Restant",
"downloadTotalBytes": "Size", "downloadTotalBytes": "Mida",
"downloadSpeed": "Speed" "downloadSpeed": "Velocitat"
}, },
"kavita": { "kavita": {
"seriesCount": "Series", "seriesCount": "Sèries",
"totalFiles": "Files" "totalFiles": "Fitxers"
}, },
"azuredevops": { "azuredevops": {
"result": "Resultat", "result": "Resultat",
"status": "Status", "status": "Estat",
"buildId": "Id de compilació", "buildId": "Id de compilació",
"succeeded": "Amb èxit", "succeeded": "Amb èxit",
"notStarted": "No Iniciat", "notStarted": "No Iniciat",
"failed": "Failed", "failed": "Error",
"canceled": "Cancel·lat", "canceled": "Cancel·lat",
"inProgress": "En curs", "inProgress": "En curs",
"totalPrs": "PRs Totals", "totalPrs": "PRs Totals",
"myPrs": "Les meves PRs", "myPrs": "Les meves PRs",
"approved": "Approved" "approved": "Aprovat"
}, },
"gamedig": { "gamedig": {
"status": "Status", "status": "Estat",
"online": "Online", "online": "En línia",
"offline": "Offline", "offline": "Desconnectat",
"name": "Nom", "name": "Nom",
"map": "Mapa", "map": "Mapa",
"currentPlayers": "Jugadors actuals", "currentPlayers": "Jugadors actuals",
"players": "Players", "players": "Jugadors",
"maxPlayers": "Màxim de jugadors", "maxPlayers": "Màxim de jugadors",
"bots": "Bots", "bots": "Bots",
"ping": "Ping" "ping": "Latència"
}, },
"urbackup": { "urbackup": {
"ok": "Ok", "ok": "Ok",
@@ -897,39 +902,39 @@
}, },
"mealie": { "mealie": {
"recipes": "Receptes", "recipes": "Receptes",
"users": "Users", "users": "Usuaris",
"categories": "Categories", "categories": "Categories",
"tags": "Etiquetes" "tags": "Etiquetes"
}, },
"openmediavault": { "openmediavault": {
"downloading": "Descarregant", "downloading": "Descarregant",
"total": "Total", "total": "Total",
"running": "Running", "running": "En execució",
"stopped": "Stopped", "stopped": "Aturat",
"passed": "Passed", "passed": "Aprovat",
"failed": "Failed" "failed": "Error"
}, },
"openwrt": { "openwrt": {
"uptime": "Uptime", "uptime": "Temps actiu",
"cpuLoad": "Càrrega mitjana de CPU (5min)", "cpuLoad": "Càrrega mitjana de CPU (5min)",
"up": "Up", "up": "En línia",
"down": "Down", "down": "Desconnectat",
"bytesTx": "Enviat", "bytesTx": "Enviat",
"bytesRx": "Received" "bytesRx": "Rebut"
}, },
"uptimerobot": { "uptimerobot": {
"status": "Status", "status": "Estat",
"uptime": "Uptime", "uptime": "Temps actiu",
"lastDown": "Darrera Inactivitat", "lastDown": "Darrera Inactivitat",
"downDuration": "Duració d'Inactivitat", "downDuration": "Duració d'Inactivitat",
"sitesUp": "Sites Up", "sitesUp": "Pàgines actives",
"sitesDown": "Sites Down", "sitesDown": "Pàgines inactives",
"paused": "Paused", "paused": "Pausat",
"notyetchecked": "Sense verificar", "notyetchecked": "Sense verificar",
"up": "Up", "up": "En línia",
"seemsdown": "Sembla caigut", "seemsdown": "Sembla caigut",
"down": "Down", "down": "Desconnectat",
"unknown": "Unknown" "unknown": "Desconegut"
}, },
"calendar": { "calendar": {
"inCinemas": "En cines", "inCinemas": "En cines",
@@ -937,7 +942,7 @@
"digitalRelease": "Estrena digital", "digitalRelease": "Estrena digital",
"noEventsToday": "Cap esdeveniment per avui!", "noEventsToday": "Cap esdeveniment per avui!",
"noEventsFound": "No s'han trobat esdeveniments", "noEventsFound": "No s'han trobat esdeveniments",
"errorWhenLoadingData": "Error when loading calendar data" "errorWhenLoadingData": "Error carregant dades del calendari"
}, },
"romm": { "romm": {
"platforms": "Plataformes", "platforms": "Plataformes",
@@ -948,50 +953,50 @@
"totalfilesize": "Tamany total" "totalfilesize": "Tamany total"
}, },
"mailcow": { "mailcow": {
"domains": "Domains", "domains": "Dominis",
"mailboxes": "Bústies", "mailboxes": "Bústies",
"mails": "Correus", "mails": "Correus",
"storage": "Storage" "storage": "Emmagatzematge"
}, },
"maintainerr": { "maintainerr": {
"itemsHandled": "Items Handled", "itemsHandled": "Items gestionats",
"episodesHandled": "Episodes Handled", "episodesHandled": "Episodis gestionats",
"moviesHandled": "Movies Handled", "moviesHandled": "Pel·lícules gestionades",
"showsHandled": "Shows Handled", "showsHandled": "Sèries gestionades",
"seasonsHandled": "Seasons Handled", "seasonsHandled": "Temporades gestionades",
"reclaimable": "Reclaimable", "reclaimable": "Reclamable",
"movieReclaimable": "Movie Reclaimable", "movieReclaimable": "Pel·lícula reclamable",
"showReclaimable": "Show Reclaimable", "showReclaimable": "Sèrie reclamable",
"totalCapacity": "Total Capacity" "totalCapacity": "Capacitat total"
}, },
"netdata": { "netdata": {
"warnings": "Avisos", "warnings": "Avisos",
"criticals": "Crítics" "criticals": "Crítics"
}, },
"ntfy": { "ntfy": {
"title": "Title", "title": "Títol",
"priority": "Priority", "priority": "Prioritat",
"lastReceived": "Last Received", "lastReceived": "Rebut per últim cop",
"message": "Message", "message": "Missatge",
"tags": "Tags", "tags": "Etiquetes",
"none": "None", "none": "Cap",
"min": "Min", "min": "Min",
"low": "Low", "low": "Baix",
"default": "Default", "default": "Per defecte",
"high": "High", "high": "Alt",
"urgent": "Urgent" "urgent": "Urgent"
}, },
"plantit": { "plantit": {
"events": "Esdeveniments", "events": "Esdeveniments",
"plants": "Plantes", "plants": "Plantes",
"photos": "Photos", "photos": "Fotos",
"species": "Espècies" "species": "Espècies"
}, },
"gitea": { "gitea": {
"notifications": "Notificacions", "notifications": "Notificacions",
"issues": "Issues", "issues": "Problemes",
"pulls": "Sol·licitud de Canvis", "pulls": "Sol·licitud de Canvis",
"repositories": "Repositories" "repositories": "Repositoris"
}, },
"stash": { "stash": {
"scenes": "Escenes", "scenes": "Escenes",
@@ -1005,13 +1010,13 @@
"galleries": "Biblioteques", "galleries": "Biblioteques",
"performers": "Intèrprets", "performers": "Intèrprets",
"studios": "Estudis", "studios": "Estudis",
"movies": "Movies", "movies": "Pel·lícules",
"tags": "Tags", "tags": "Etiquetes",
"oCount": "O Count" "oCount": "O Count"
}, },
"tandoor": { "tandoor": {
"users": "Users", "users": "Usuaris",
"recipes": "Recipes", "recipes": "Receptes",
"keywords": "Paraules claus" "keywords": "Paraules claus"
}, },
"homebox": { "homebox": {
@@ -1019,17 +1024,17 @@
"totalWithWarranty": "Amb Garantia", "totalWithWarranty": "Amb Garantia",
"locations": "Ubicacions", "locations": "Ubicacions",
"labels": "Etiquetes", "labels": "Etiquetes",
"users": "Users", "users": "Usuaris",
"totalValue": "Valor total" "totalValue": "Valor total"
}, },
"crowdsec": { "crowdsec": {
"alerts": "Alerts", "alerts": "Alertes",
"bans": "Prohibicions" "bans": "Prohibicions"
}, },
"wgeasy": { "wgeasy": {
"connected": "Connected", "connected": "Connectat",
"enabled": "Enabled", "enabled": "Habilitat",
"disabled": "Disabled", "disabled": "Deshabilitat",
"total": "Total" "total": "Total"
}, },
"swagdashboard": { "swagdashboard": {
@@ -1039,9 +1044,9 @@
"banned": "Bloquejat" "banned": "Bloquejat"
}, },
"myspeed": { "myspeed": {
"ping": "Ping", "ping": "Latència",
"download": "Download", "download": "Baixada",
"upload": "Upload" "upload": "Pujada"
}, },
"stocks": { "stocks": {
"stocks": "Accions", "stocks": "Accions",
@@ -1138,120 +1143,120 @@
"tags": "Etiquetes" "tags": "Etiquetes"
}, },
"slskd": { "slskd": {
"slskStatus": "Network", "slskStatus": "Xarxa",
"connected": "Connected", "connected": "Connectat",
"disconnected": "Disconnected", "disconnected": "Desconnectat",
"updateStatus": "Update", "updateStatus": "Actualitza",
"update_yes": "Available", "update_yes": "Disponible",
"update_no": "Up to Date", "update_no": "Actualitzat",
"downloads": "Downloads", "downloads": "Descàrregues",
"uploads": "Uploads", "uploads": "Pujades",
"sharedFiles": "Files" "sharedFiles": "Fitxers"
}, },
"jellystat": { "jellystat": {
"songs": "Songs", "songs": "Cançons",
"movies": "Movies", "movies": "Pel·lícules",
"episodes": "Episodes", "episodes": "Episodis",
"other": "Other" "other": "Altres"
}, },
"checkmk": { "checkmk": {
"serviceErrors": "Service issues", "serviceErrors": "Errors de servei",
"hostErrors": "Host issues" "hostErrors": "Problemes de l'hoste"
}, },
"komodo": { "komodo": {
"total": "Total", "total": "Total",
"running": "Running", "running": "En execució",
"stopped": "Stopped", "stopped": "Aturat",
"down": "Down", "down": "Fora de servei",
"unhealthy": "Unhealthy", "unhealthy": "No saludable",
"unknown": "Unknown", "unknown": "Desconegut",
"servers": "Servers", "servers": "Servidors",
"stacks": "Stacks", "stacks": "Stacks",
"containers": "Containers" "containers": "Contenidors"
}, },
"filebrowser": { "filebrowser": {
"available": "Available", "available": "Disponible",
"used": "Used", "used": "Utilitzat",
"total": "Total" "total": "Total"
}, },
"wallos": { "wallos": {
"activeSubscriptions": "Subscriptions", "activeSubscriptions": "Subscripcions",
"thisMonthlyCost": "This Month", "thisMonthlyCost": "Aquest mes",
"nextMonthlyCost": "Next Month", "nextMonthlyCost": "Mes que ve",
"previousMonthlyCost": "Prev. Month", "previousMonthlyCost": "Mes passat",
"nextRenewingSubscription": "Next Payment" "nextRenewingSubscription": "Proper pagament"
}, },
"unraid": { "unraid": {
"STARTED": "Started", "STARTED": "Iniciat",
"STOPPED": "Stopped", "STOPPED": "Aturat",
"NEW_ARRAY": "New Array", "NEW_ARRAY": "Nou array",
"RECON_DISK": "Reconstructing Disk", "RECON_DISK": "Reconstruint disc",
"DISABLE_DISK": "Disk Disabled", "DISABLE_DISK": "Disc desactivat",
"SWAP_DSBL": "Swap Disable", "SWAP_DSBL": "Swap desactivat",
"INVALID_EXPANSION": "Invalid Expansion", "INVALID_EXPANSION": "Expansió invàlida",
"PARITY_NOT_BIGGEST": "Parity Not Biggest", "PARITY_NOT_BIGGEST": "Paritat no del més gran",
"TOO_MANY_MISSING_DISKS": "Too Many Missing Disks", "TOO_MANY_MISSING_DISKS": "Falten masses discs",
"NEW_DISK_TOO_SMALL": "New Disk Too Small", "NEW_DISK_TOO_SMALL": "Nou disc massa petit",
"NO_DATA_DISKS": "No Data Disks", "NO_DATA_DISKS": "Sense discs de dades",
"notifications": "Notifications", "notifications": "Notificacions",
"status": "Status", "status": "Estat",
"cpu": "CPU", "cpu": "CPU",
"memoryUsed": "Memory Used", "memoryUsed": "Memòria emprada",
"memoryAvailable": "Memory Available", "memoryAvailable": "Memòria disponible",
"arrayUsed": "Array Used", "arrayUsed": "Array en ús",
"arrayFree": "Array Free", "arrayFree": "Array lliure",
"poolUsed": "{{pool}} Used", "poolUsed": "{{pool}} en ús",
"poolFree": "{{pool}} Free" "poolFree": "{{pool}} lliure"
}, },
"backrest": { "backrest": {
"num_plans": "Plans", "num_plans": "Plans",
"num_success_30": "Successes", "num_success_30": "Èxits",
"num_failure_30": "Failures", "num_failure_30": "Fallades",
"num_success_latest": "Succeeding", "num_success_latest": "Triomfant",
"num_failure_latest": "Failing", "num_failure_latest": "Fallant",
"bytes_added_30": "Bytes Added" "bytes_added_30": "Bytes afegits"
}, },
"yourspotify": { "yourspotify": {
"songs": "Songs", "songs": "Cançons",
"time": "Time", "time": "Temps",
"artists": "Artists" "artists": "Artistes"
}, },
"arcane": { "arcane": {
"containers": "Containers", "containers": "Contenidors",
"images": "Images", "images": "Imatges",
"image_updates": "Image Updates", "image_updates": "Actualitzacions d'imatges",
"images_unused": "Unused", "images_unused": "Sense utilitzar",
"environment_required": "Environment ID Required" "environment_required": "ID d'entorn requerit"
}, },
"dockhand": { "dockhand": {
"running": "Running", "running": "En execució",
"stopped": "Stopped", "stopped": "Aturats",
"cpu": "CPU", "cpu": "CPU",
"memory": "Memory", "memory": "Memòria",
"images": "Images", "images": "Imatges",
"volumes": "Volumes", "volumes": "Volums",
"events_today": "Events Today", "events_today": "Esdeveniments avui",
"pending_updates": "Pending Updates", "pending_updates": "Actualitzacions pendents",
"stacks": "Stacks", "stacks": "Stacks",
"paused": "Paused", "paused": "Pausats",
"total": "Total", "total": "Total",
"environment_not_found": "Environment Not Found" "environment_not_found": "Entorn no trobat"
}, },
"sparkyfitness": { "sparkyfitness": {
"eaten": "Eaten", "eaten": "Menjat",
"burned": "Burned", "burned": "Cremat",
"remaining": "Remaining", "remaining": "Restant",
"steps": "Steps" "steps": "Passes"
}, },
"syncthing": { "syncthing": {
"connected": "Connected", "connected": "Connectat",
"synced": "Synced", "synced": "Sincronitzat",
"errors": "Errors", "errors": "Errors",
"storage": "Storage" "storage": "Emmagatzematge"
}, },
"sportarr": { "sportarr": {
"wanted": "Wanted", "wanted": "Volgut",
"queued": "Queued", "queued": "Encuat",
"leagues": "Leagues" "leagues": "Lligues"
} }
} }
+6 -1
View File
@@ -99,7 +99,12 @@
"unhealthy": "Nezdravý", "unhealthy": "Nezdravý",
"not_found": "Nenalezen", "not_found": "Nenalezen",
"exited": "Ukončen", "exited": "Ukončen",
"partial": "Částečný" "partial": "Částečný",
"created": "Created",
"paused": "Paused",
"restarting": "Restarting",
"removing": "Removing",
"dead": "Dead"
}, },
"ping": { "ping": {
"error": "Chyba", "error": "Chyba",
+6 -1
View File
@@ -99,7 +99,12 @@
"unhealthy": "Usund", "unhealthy": "Usund",
"not_found": "Ikke Fundet", "not_found": "Ikke Fundet",
"exited": "Forladt", "exited": "Forladt",
"partial": "Delvis" "partial": "Delvis",
"created": "Created",
"paused": "Paused",
"restarting": "Restarting",
"removing": "Removing",
"dead": "Dead"
}, },
"ping": { "ping": {
"error": "Error", "error": "Error",
+6 -1
View File
@@ -99,7 +99,12 @@
"unhealthy": "Fehlerhaft", "unhealthy": "Fehlerhaft",
"not_found": "Nicht gefunden", "not_found": "Nicht gefunden",
"exited": "Beendet", "exited": "Beendet",
"partial": "Teilweise" "partial": "Teilweise",
"created": "Created",
"paused": "Paused",
"restarting": "Restarting",
"removing": "Removing",
"dead": "Dead"
}, },
"ping": { "ping": {
"error": "Fehler", "error": "Fehler",
+22 -17
View File
@@ -21,7 +21,7 @@
"seconds": "s" "seconds": "s"
}, },
"auth": { "auth": {
"signout": "Sign out" "signout": "Αποσύνδεση"
}, },
"widget": { "widget": {
"missing_type": "Λείπει ο τύπος widget: {{type}}", "missing_type": "Λείπει ο τύπος widget: {{type}}",
@@ -41,7 +41,7 @@
"search": { "search": {
"placeholder": "Αναζήτηση…", "placeholder": "Αναζήτηση…",
"provider": "Search engine: {{name}}", "provider": "Search engine: {{name}}",
"select_provider": "Select search engine" "select_provider": "Επιλέξτε τις μηχανές αναζήτησης"
}, },
"resources": { "resources": {
"cpu": "Επεξεργαστής", "cpu": "Επεξεργαστής",
@@ -66,24 +66,24 @@
"wlan_devices": "WLAN Συσκευές", "wlan_devices": "WLAN Συσκευές",
"lan_users": "LAN Χρήστες", "lan_users": "LAN Χρήστες",
"wlan_users": "WLAN Χρήστες", "wlan_users": "WLAN Χρήστες",
"up": "UP", "up": "ΕΠΑΝΩ",
"down": "ΚΑΤΩ", "down": "ΚΑΤΩ",
"wait": "Please wait", "wait": "Παρακαλώ περιμένετε",
"empty_data": "Άγνωστη κατάσταση υποσυστήματος" "empty_data": "Άγνωστη κατάσταση υποσυστήματος"
}, },
"unifi_drive": { "unifi_drive": {
"healthy": "Healthy", "healthy": "Υγειές",
"degraded": "Degraded", "degraded": "Degraded",
"no_data": "No storage data available" "no_data": "No storage data available"
}, },
"duplicati": { "duplicati": {
"jobs": "Jobs", "jobs": "Εργασίες",
"stored": "Stored", "stored": "Αποθηκευμένα",
"lastBackup": "Last Run", "lastBackup": "Τελευταία εκτέλεση",
"nextRun": "Next Run", "nextRun": "Επόμενη εκτέλεση",
"running": "Running", "running": "Εκτελείται",
"warnings": "Warnings", "warnings": "Προειδοποιήσεις",
"errors": "Errors" "errors": "Σφάλματα"
}, },
"docker": { "docker": {
"rx": "RX", "rx": "RX",
@@ -99,10 +99,15 @@
"unhealthy": "Άρρωστο", "unhealthy": "Άρρωστο",
"not_found": "Δεν βρέθηκε", "not_found": "Δεν βρέθηκε",
"exited": "Έκλεισε", "exited": "Έκλεισε",
"partial": "Μερικό" "partial": "Μερικό",
"created": "Δημιουργήθηκε",
"paused": "Σε παύση",
"restarting": "Γίνεται επανεκκίνηση",
"removing": "Αφαιρείται",
"dead": "Dead"
}, },
"ping": { "ping": {
"error": "Error", "error": "Σφάλμα",
"ping": "Ping", "ping": "Ping",
"down": "Ping down", "down": "Ping down",
"up": "Ping up", "up": "Ping up",
@@ -110,11 +115,11 @@
}, },
"siteMonitor": { "siteMonitor": {
"http_status": "Κατάσταση HTTP", "http_status": "Κατάσταση HTTP",
"error": "Error", "error": "Σφάλμα",
"response": "Απόκριση", "response": "Απόκριση",
"down": "Down", "down": "Down",
"up": "Up", "up": "Up",
"not_available": "Not Available" "not_available": "Μη Διαθέσιμο"
}, },
"emby": { "emby": {
"playing": "Παίζει", "playing": "Παίζει",
@@ -127,7 +132,7 @@
"songs": "Τραγούδια" "songs": "Τραγούδια"
}, },
"jellyfin": { "jellyfin": {
"playing": "Playing", "playing": "Γίνεται αναπαραγωγή",
"transcoding": "Transcoding", "transcoding": "Transcoding",
"bitrate": "Bitrate", "bitrate": "Bitrate",
"no_active": "No Active Streams", "no_active": "No Active Streams",
+6 -1
View File
@@ -99,7 +99,12 @@
"unhealthy": "Unhealthy", "unhealthy": "Unhealthy",
"not_found": "Not Found", "not_found": "Not Found",
"exited": "Exited", "exited": "Exited",
"partial": "Partial" "partial": "Partial",
"created": "Created",
"paused": "Paused",
"restarting": "Restarting",
"removing": "Removing",
"dead": "Dead"
}, },
"ping": { "ping": {
"error": "Error", "error": "Error",
+6 -1
View File
@@ -99,7 +99,12 @@
"unhealthy": "Malsana", "unhealthy": "Malsana",
"not_found": "Ne trovita", "not_found": "Ne trovita",
"exited": "Eliris", "exited": "Eliris",
"partial": "Parta" "partial": "Parta",
"created": "Created",
"paused": "Paused",
"restarting": "Restarting",
"removing": "Removing",
"dead": "Dead"
}, },
"ping": { "ping": {
"error": "Error", "error": "Error",
+6 -1
View File
@@ -99,7 +99,12 @@
"unhealthy": "No saludable", "unhealthy": "No saludable",
"not_found": "No encontrado", "not_found": "No encontrado",
"exited": "Terminado", "exited": "Terminado",
"partial": "Parcial" "partial": "Parcial",
"created": "Created",
"paused": "Paused",
"restarting": "Restarting",
"removing": "Removing",
"dead": "Dead"
}, },
"ping": { "ping": {
"error": "Error", "error": "Error",
+6 -1
View File
@@ -99,7 +99,12 @@
"unhealthy": "Unhealthy", "unhealthy": "Unhealthy",
"not_found": "Not Found", "not_found": "Not Found",
"exited": "Exited", "exited": "Exited",
"partial": "Partial" "partial": "Partial",
"created": "Created",
"paused": "Paused",
"restarting": "Restarting",
"removing": "Removing",
"dead": "Dead"
}, },
"ping": { "ping": {
"error": "Error", "error": "Error",
+6 -1
View File
@@ -99,7 +99,12 @@
"unhealthy": "Unhealthy", "unhealthy": "Unhealthy",
"not_found": "Not Found", "not_found": "Not Found",
"exited": "Exited", "exited": "Exited",
"partial": "Partial" "partial": "Partial",
"created": "Created",
"paused": "Paused",
"restarting": "Restarting",
"removing": "Removing",
"dead": "Dead"
}, },
"ping": { "ping": {
"error": "Error", "error": "Error",
+6 -1
View File
@@ -99,7 +99,12 @@
"unhealthy": "Mauvaise santé", "unhealthy": "Mauvaise santé",
"not_found": "Inconnu", "not_found": "Inconnu",
"exited": "Arrêté", "exited": "Arrêté",
"partial": "Partiel" "partial": "Partiel",
"created": "Créé",
"paused": "En pause",
"restarting": "Redémarrage",
"removing": "Suppression",
"dead": "Mort"
}, },
"ping": { "ping": {
"error": "Erreur", "error": "Erreur",
+64 -59
View File
@@ -21,7 +21,7 @@
"seconds": "שניות" "seconds": "שניות"
}, },
"auth": { "auth": {
"signout": "Sign out" "signout": "התנתק"
}, },
"widget": { "widget": {
"missing_type": "סוג ווידג'ט חסר: {{type}}", "missing_type": "סוג ווידג'ט חסר: {{type}}",
@@ -40,8 +40,8 @@
}, },
"search": { "search": {
"placeholder": "חיפוש…", "placeholder": "חיפוש…",
"provider": "Search engine: {{name}}", "provider": "מנוע חיפוש: {{name}}",
"select_provider": "Select search engine" "select_provider": "בחר מנוע חיפוש"
}, },
"resources": { "resources": {
"cpu": "מעבד", "cpu": "מעבד",
@@ -72,18 +72,18 @@
"empty_data": "מצב תת-מערכת לא ידוע" "empty_data": "מצב תת-מערכת לא ידוע"
}, },
"unifi_drive": { "unifi_drive": {
"healthy": "Healthy", "healthy": "בריא",
"degraded": "Degraded", "degraded": "ירוד",
"no_data": "No storage data available" "no_data": "אין אחסון זמין"
}, },
"duplicati": { "duplicati": {
"jobs": "Jobs", "jobs": "משימות",
"stored": "Stored", "stored": "שמור",
"lastBackup": "Last Run", "lastBackup": "Last Run",
"nextRun": "Next Run", "nextRun": "Next Run",
"running": "Running", "running": "Running",
"warnings": "Warnings", "warnings": "הזהרות",
"errors": "Errors" "errors": "שגיאות"
}, },
"docker": { "docker": {
"rx": "RX", "rx": "RX",
@@ -99,7 +99,12 @@
"unhealthy": "לא בריא", "unhealthy": "לא בריא",
"not_found": "לא נמצא", "not_found": "לא נמצא",
"exited": "יצא", "exited": "יצא",
"partial": "חלקי" "partial": "חלקי",
"created": "Created",
"paused": "Paused",
"restarting": "Restarting",
"removing": "Removing",
"dead": "Dead"
}, },
"ping": { "ping": {
"error": "שגיאה", "error": "שגיאה",
@@ -127,15 +132,15 @@
"songs": "שירים" "songs": "שירים"
}, },
"jellyfin": { "jellyfin": {
"playing": "Playing", "playing": "מנגן",
"transcoding": "Transcoding", "transcoding": "Transcoding",
"bitrate": "Bitrate", "bitrate": "Bitrate",
"no_active": "No Active Streams", "no_active": "אין מדיה פעילה",
"movies": "Movies", "movies": "סרטים",
"series": "Series", "series": "סדרות",
"episodes": "Episodes", "episodes": "פרקים",
"songs": "Songs", "songs": "שירים",
"albums": "Albums" "albums": "אלבומים"
}, },
"esphome": { "esphome": {
"offline": "מכובה", "offline": "מכובה",
@@ -310,11 +315,11 @@
"available": "זמין" "available": "זמין"
}, },
"seerr": { "seerr": {
"pending": "Pending", "pending": "ממתין",
"approved": "Approved", "approved": "מאושר",
"available": "Available", "available": "זמין",
"completed": "Completed", "completed": "הסתיים",
"processing": "Processing", "processing": "מעבד",
"issues": "Open Issues" "issues": "Open Issues"
}, },
"netalertx": { "netalertx": {
@@ -359,16 +364,16 @@
"address": "כתובת", "address": "כתובת",
"expires": "תאריך תפוגה", "expires": "תאריך תפוגה",
"never": "אף פעם", "never": "אף פעם",
"user": "User", "user": "משתמש",
"hostname": "Hostname", "hostname": "Hostname",
"name": "Name", "name": "שם",
"client_version": "Client Version", "client_version": "Client Version",
"os": "OS", "os": "מערכת הפעלה",
"created": "Created", "created": "יוצר",
"authorized": "Authorized", "authorized": "מורשה",
"is_external": "Is External", "is_external": "האם חיצוני",
"update_available": "Update Available", "update_available": "עדכון זמין",
"tags": "Tags", "tags": "תגיות",
"last_seen": "נראה לאחרונה", "last_seen": "נראה לאחרונה",
"now": "כעת", "now": "כעת",
"years": "{{number}}y", "years": "{{number}}y",
@@ -378,8 +383,8 @@
"minutes": "{{number}}m", "minutes": "{{number}}m",
"seconds": "{{number}}s", "seconds": "{{number}}s",
"ago": "{{value}} Ago", "ago": "{{value}} Ago",
"true": "Yes", "true": "כן",
"false": "No" "false": "לא"
}, },
"technitium": { "technitium": {
"totalQueries": "שאילתות", "totalQueries": "שאילתות",
@@ -484,7 +489,7 @@
}, },
"pulse": { "pulse": {
"nodes": "Nodes", "nodes": "Nodes",
"vms": "VMs", "vms": "מכונות וירטואליות",
"lxcs": "LXCs" "lxcs": "LXCs"
}, },
"glances": { "glances": {
@@ -584,7 +589,7 @@
"up": "למעלה", "up": "למעלה",
"pending": "ממתין", "pending": "ממתין",
"down": "למטה", "down": "למטה",
"ok": "Ok" "ok": "אוקיי"
}, },
"healthchecks": { "healthchecks": {
"new": "חדש", "new": "חדש",
@@ -653,9 +658,9 @@
}, },
"pangolin": { "pangolin": {
"orgs": "Orgs", "orgs": "Orgs",
"sites": "Sites", "sites": "אתרים",
"resources": "Resources", "resources": "משאבים",
"targets": "Targets", "targets": "מטרות",
"traffic": "Traffic", "traffic": "Traffic",
"in": "In", "in": "In",
"out": "Out" "out": "Out"
@@ -757,7 +762,7 @@
"volumeAvailable": "זמין" "volumeAvailable": "זמין"
}, },
"dispatcharr": { "dispatcharr": {
"channels": "Channels", "channels": "ערוצים",
"streams": "Streams" "streams": "Streams"
}, },
"mylar": { "mylar": {
@@ -1182,9 +1187,9 @@
"nextRenewingSubscription": "תשלום הבא" "nextRenewingSubscription": "תשלום הבא"
}, },
"unraid": { "unraid": {
"STARTED": "Started", "STARTED": "התחיל",
"STOPPED": "Stopped", "STOPPED": "נעצר",
"NEW_ARRAY": "New Array", "NEW_ARRAY": "מערך חדש",
"RECON_DISK": "Reconstructing Disk", "RECON_DISK": "Reconstructing Disk",
"DISABLE_DISK": "Disk Disabled", "DISABLE_DISK": "Disk Disabled",
"SWAP_DSBL": "Swap Disable", "SWAP_DSBL": "Swap Disable",
@@ -1196,31 +1201,31 @@
"notifications": "Notifications", "notifications": "Notifications",
"status": "Status", "status": "Status",
"cpu": "CPU", "cpu": "CPU",
"memoryUsed": "Memory Used", "memoryUsed": "זיכרון בשימוש",
"memoryAvailable": "Memory Available", "memoryAvailable": "זיכרון זמין",
"arrayUsed": "Array Used", "arrayUsed": "Array Used",
"arrayFree": "Array Free", "arrayFree": "Array Free",
"poolUsed": "{{pool}} Used", "poolUsed": "{{pool}} Used",
"poolFree": "{{pool}} Free" "poolFree": "{{pool}} Free"
}, },
"backrest": { "backrest": {
"num_plans": "Plans", "num_plans": "תוכניות",
"num_success_30": "Successes", "num_success_30": "הצלחות",
"num_failure_30": "Failures", "num_failure_30": "כשלונות",
"num_success_latest": "Succeeding", "num_success_latest": "Succeeding",
"num_failure_latest": "Failing", "num_failure_latest": "Failing",
"bytes_added_30": "Bytes Added" "bytes_added_30": "Bytes Added"
}, },
"yourspotify": { "yourspotify": {
"songs": "Songs", "songs": "שירים",
"time": "Time", "time": "זמן",
"artists": "Artists" "artists": "אומנים"
}, },
"arcane": { "arcane": {
"containers": "Containers", "containers": "Containers",
"images": "Images", "images": "Images",
"image_updates": "Image Updates", "image_updates": "Image Updates",
"images_unused": "Unused", "images_unused": "לא בשימוש",
"environment_required": "Environment ID Required" "environment_required": "Environment ID Required"
}, },
"dockhand": { "dockhand": {
@@ -1230,7 +1235,7 @@
"memory": "Memory", "memory": "Memory",
"images": "Images", "images": "Images",
"volumes": "Volumes", "volumes": "Volumes",
"events_today": "Events Today", "events_today": "אירועים היום",
"pending_updates": "Pending Updates", "pending_updates": "Pending Updates",
"stacks": "Stacks", "stacks": "Stacks",
"paused": "Paused", "paused": "Paused",
@@ -1238,16 +1243,16 @@
"environment_not_found": "Environment Not Found" "environment_not_found": "Environment Not Found"
}, },
"sparkyfitness": { "sparkyfitness": {
"eaten": "Eaten", "eaten": "נאכלו",
"burned": "Burned", "burned": "נשרפו",
"remaining": "Remaining", "remaining": "נותרו",
"steps": "Steps" "steps": "צעדים"
}, },
"syncthing": { "syncthing": {
"connected": "Connected", "connected": "Connected",
"synced": "Synced", "synced": "מסונכרן",
"errors": "Errors", "errors": "שגיאות",
"storage": "Storage" "storage": "אחסון"
}, },
"sportarr": { "sportarr": {
"wanted": "Wanted", "wanted": "Wanted",
+6 -1
View File
@@ -99,7 +99,12 @@
"unhealthy": "Unhealthy", "unhealthy": "Unhealthy",
"not_found": "Not Found", "not_found": "Not Found",
"exited": "Exited", "exited": "Exited",
"partial": "Partial" "partial": "Partial",
"created": "Created",
"paused": "Paused",
"restarting": "Restarting",
"removing": "Removing",
"dead": "Dead"
}, },
"ping": { "ping": {
"error": "Error", "error": "Error",
+20 -15
View File
@@ -21,7 +21,7 @@
"seconds": "s" "seconds": "s"
}, },
"auth": { "auth": {
"signout": "Sign out" "signout": "Odjavi se"
}, },
"widget": { "widget": {
"missing_type": "Nedostajuća vrsta widgeta: {{type}}", "missing_type": "Nedostajuća vrsta widgeta: {{type}}",
@@ -40,8 +40,8 @@
}, },
"search": { "search": {
"placeholder": "Traži …", "placeholder": "Traži …",
"provider": "Search engine: {{name}}", "provider": "Tražilica: {{name}}",
"select_provider": "Select search engine" "select_provider": "Odaberi tražilicu"
}, },
"resources": { "resources": {
"cpu": "CPU", "cpu": "CPU",
@@ -99,7 +99,12 @@
"unhealthy": "Nefunkcionalno", "unhealthy": "Nefunkcionalno",
"not_found": "Nepronađeno", "not_found": "Nepronađeno",
"exited": "Zatoreno", "exited": "Zatoreno",
"partial": "Djelomično" "partial": "Djelomično",
"created": "Created",
"paused": "Paused",
"restarting": "Restarting",
"removing": "Removing",
"dead": "Dead"
}, },
"ping": { "ping": {
"error": "Greška", "error": "Greška",
@@ -135,7 +140,7 @@
"series": "Serije", "series": "Serije",
"episodes": "Epizode", "episodes": "Epizode",
"songs": "Pjesme", "songs": "Pjesme",
"albums": "Albums" "albums": "Albumi"
}, },
"esphome": { "esphome": {
"offline": "Offline", "offline": "Offline",
@@ -474,7 +479,7 @@
"users": "Korisnici", "users": "Korisnici",
"loginsLast24H": "Prijave (24 h)", "loginsLast24H": "Prijave (24 h)",
"failedLoginsLast24H": "Neuspjele prijave (24 h)", "failedLoginsLast24H": "Neuspjele prijave (24 h)",
"authorizationsLast24H": "Auths (24h)" "authorizationsLast24H": "Autorizacije (24h)"
}, },
"proxmox": { "proxmox": {
"mem": "MEM", "mem": "MEM",
@@ -954,15 +959,15 @@
"storage": "Spremište" "storage": "Spremište"
}, },
"maintainerr": { "maintainerr": {
"itemsHandled": "Items Handled", "itemsHandled": "Obrađene stavke",
"episodesHandled": "Episodes Handled", "episodesHandled": "Obrađene epizode",
"moviesHandled": "Movies Handled", "moviesHandled": "Obrađeni filmovi",
"showsHandled": "Shows Handled", "showsHandled": "Obrađene emisije",
"seasonsHandled": "Seasons Handled", "seasonsHandled": "Obrađene sezone",
"reclaimable": "Reclaimable", "reclaimable": "Reclaimable",
"movieReclaimable": "Movie Reclaimable", "movieReclaimable": "Movie Reclaimable",
"showReclaimable": "Show Reclaimable", "showReclaimable": "Show Reclaimable",
"totalCapacity": "Total Capacity" "totalCapacity": "Ukupni kapacitet"
}, },
"netdata": { "netdata": {
"warnings": "Upozorenja", "warnings": "Upozorenja",
@@ -1250,8 +1255,8 @@
"storage": "Spremište" "storage": "Spremište"
}, },
"sportarr": { "sportarr": {
"wanted": "Wanted", "wanted": "Željeno",
"queued": "Queued", "queued": "U redu čekanja",
"leagues": "Leagues" "leagues": "Lige"
} }
} }
+6 -1
View File
@@ -99,7 +99,12 @@
"unhealthy": "Egészségtelen", "unhealthy": "Egészségtelen",
"not_found": "Nem található", "not_found": "Nem található",
"exited": "Kilépett", "exited": "Kilépett",
"partial": "Részleges" "partial": "Részleges",
"created": "Created",
"paused": "Paused",
"restarting": "Restarting",
"removing": "Removing",
"dead": "Dead"
}, },
"ping": { "ping": {
"error": "Hiba", "error": "Hiba",
+6 -1
View File
@@ -99,7 +99,12 @@
"unhealthy": "Tidak Lancar", "unhealthy": "Tidak Lancar",
"not_found": "Tidak Ditemukan", "not_found": "Tidak Ditemukan",
"exited": "Terkeluar", "exited": "Terkeluar",
"partial": "Sebagian" "partial": "Sebagian",
"created": "Created",
"paused": "Paused",
"restarting": "Restarting",
"removing": "Removing",
"dead": "Dead"
}, },
"ping": { "ping": {
"error": "Error", "error": "Error",
+6 -1
View File
@@ -99,7 +99,12 @@
"unhealthy": "Non sano", "unhealthy": "Non sano",
"not_found": "Non trovato", "not_found": "Non trovato",
"exited": "Uscito", "exited": "Uscito",
"partial": "Parziale" "partial": "Parziale",
"created": "Created",
"paused": "Paused",
"restarting": "Restarting",
"removing": "Removing",
"dead": "Dead"
}, },
"ping": { "ping": {
"error": "Errore", "error": "Errore",
+6 -1
View File
@@ -99,7 +99,12 @@
"unhealthy": "非健全", "unhealthy": "非健全",
"not_found": "不明", "not_found": "不明",
"exited": "停止しました", "exited": "停止しました",
"partial": "部分的" "partial": "部分的",
"created": "Created",
"paused": "Paused",
"restarting": "Restarting",
"removing": "Removing",
"dead": "Dead"
}, },
"ping": { "ping": {
"error": "エラー", "error": "エラー",
+8 -3
View File
@@ -40,8 +40,8 @@
}, },
"search": { "search": {
"placeholder": "검색…", "placeholder": "검색…",
"provider": "Search engine: {{name}}", "provider": "검색 엔진: {{name}}",
"select_provider": "Select search engine" "select_provider": "검색 엔진 선택"
}, },
"resources": { "resources": {
"cpu": "CPU", "cpu": "CPU",
@@ -99,7 +99,12 @@
"unhealthy": "비정상", "unhealthy": "비정상",
"not_found": "찾을 수 없음", "not_found": "찾을 수 없음",
"exited": "종료됨", "exited": "종료됨",
"partial": "부분적" "partial": "부분적",
"created": "Created",
"paused": "Paused",
"restarting": "Restarting",
"removing": "Removing",
"dead": "Dead"
}, },
"ping": { "ping": {
"error": "오류", "error": "오류",
+6 -1
View File
@@ -99,7 +99,12 @@
"unhealthy": "Unhealthy", "unhealthy": "Unhealthy",
"not_found": "Not Found", "not_found": "Not Found",
"exited": "Exited", "exited": "Exited",
"partial": "Partial" "partial": "Partial",
"created": "Created",
"paused": "Paused",
"restarting": "Restarting",
"removing": "Removing",
"dead": "Dead"
}, },
"ping": { "ping": {
"error": "Error", "error": "Error",
+6 -1
View File
@@ -99,7 +99,12 @@
"unhealthy": "Kurang sihat", "unhealthy": "Kurang sihat",
"not_found": "Tidak dijumpai", "not_found": "Tidak dijumpai",
"exited": "Dimatikan", "exited": "Dimatikan",
"partial": "Sebahagian" "partial": "Sebahagian",
"created": "Created",
"paused": "Paused",
"restarting": "Restarting",
"removing": "Removing",
"dead": "Dead"
}, },
"ping": { "ping": {
"error": "Error", "error": "Error",
+6 -1
View File
@@ -99,7 +99,12 @@
"unhealthy": "Ongezond", "unhealthy": "Ongezond",
"not_found": "Niet Gevonden", "not_found": "Niet Gevonden",
"exited": "Gestopt", "exited": "Gestopt",
"partial": "Gedeeltelijk" "partial": "Gedeeltelijk",
"created": "Created",
"paused": "Paused",
"restarting": "Restarting",
"removing": "Removing",
"dead": "Dead"
}, },
"ping": { "ping": {
"error": "Fout", "error": "Fout",
+6 -1
View File
@@ -99,7 +99,12 @@
"unhealthy": "Usunn", "unhealthy": "Usunn",
"not_found": "Not Found", "not_found": "Not Found",
"exited": "Exited", "exited": "Exited",
"partial": "Delvis" "partial": "Delvis",
"created": "Created",
"paused": "Paused",
"restarting": "Restarting",
"removing": "Removing",
"dead": "Dead"
}, },
"ping": { "ping": {
"error": "Error", "error": "Error",
+6 -1
View File
@@ -99,7 +99,12 @@
"unhealthy": "Niezdrowy", "unhealthy": "Niezdrowy",
"not_found": "Nie znaleziono", "not_found": "Nie znaleziono",
"exited": "Zakończony", "exited": "Zakończony",
"partial": "Częściowy" "partial": "Częściowy",
"created": "Created",
"paused": "Paused",
"restarting": "Restarting",
"removing": "Removing",
"dead": "Dead"
}, },
"ping": { "ping": {
"error": "Błąd", "error": "Błąd",
+6 -1
View File
@@ -99,7 +99,12 @@
"unhealthy": "Não-saudável", "unhealthy": "Não-saudável",
"not_found": "Não Encontrado", "not_found": "Não Encontrado",
"exited": "Saiu", "exited": "Saiu",
"partial": "Parcial" "partial": "Parcial",
"created": "Created",
"paused": "Paused",
"restarting": "Restarting",
"removing": "Removing",
"dead": "Dead"
}, },
"ping": { "ping": {
"error": "Erro", "error": "Erro",
+6 -1
View File
@@ -99,7 +99,12 @@
"unhealthy": "Não-saudável", "unhealthy": "Não-saudável",
"not_found": "Não Encontrado", "not_found": "Não Encontrado",
"exited": "Encerrado", "exited": "Encerrado",
"partial": "Parcial" "partial": "Parcial",
"created": "Created",
"paused": "Paused",
"restarting": "Restarting",
"removing": "Removing",
"dead": "Dead"
}, },
"ping": { "ping": {
"error": "Erro", "error": "Erro",
+6 -1
View File
@@ -99,7 +99,12 @@
"unhealthy": "Nesănătos", "unhealthy": "Nesănătos",
"not_found": "Negăsit", "not_found": "Negăsit",
"exited": "Ieşit", "exited": "Ieşit",
"partial": "Parțial" "partial": "Parțial",
"created": "Created",
"paused": "Paused",
"restarting": "Restarting",
"removing": "Removing",
"dead": "Dead"
}, },
"ping": { "ping": {
"error": "Error", "error": "Error",
+6 -1
View File
@@ -99,7 +99,12 @@
"unhealthy": "Нездоровый", "unhealthy": "Нездоровый",
"not_found": "Не найдено", "not_found": "Не найдено",
"exited": "Вышел", "exited": "Вышел",
"partial": "Частичный" "partial": "Частичный",
"created": "Создан",
"paused": "Приостановлен",
"restarting": "Перезапуск",
"removing": "Удаление",
"dead": "Мёртв"
}, },
"ping": { "ping": {
"error": "Ошибка", "error": "Ошибка",
+8 -3
View File
@@ -40,8 +40,8 @@
}, },
"search": { "search": {
"placeholder": "Hľadať…", "placeholder": "Hľadať…",
"provider": "Search engine: {{name}}", "provider": "Vyhľadávač: {{name}}",
"select_provider": "Select search engine" "select_provider": "Vyberte vyhľadávač"
}, },
"resources": { "resources": {
"cpu": "CPU", "cpu": "CPU",
@@ -99,7 +99,12 @@
"unhealthy": "Nezdravý", "unhealthy": "Nezdravý",
"not_found": "Nenájdené", "not_found": "Nenájdené",
"exited": "Ukončené", "exited": "Ukončené",
"partial": "Čiastočný" "partial": "Čiastočný",
"created": "Created",
"paused": "Paused",
"restarting": "Restarting",
"removing": "Removing",
"dead": "Dead"
}, },
"ping": { "ping": {
"error": "Chyba", "error": "Chyba",
+6 -1
View File
@@ -99,7 +99,12 @@
"unhealthy": "Ni zdrav", "unhealthy": "Ni zdrav",
"not_found": "Ni najden", "not_found": "Ni najden",
"exited": "V izhodu", "exited": "V izhodu",
"partial": "Delni" "partial": "Delni",
"created": "Created",
"paused": "Paused",
"restarting": "Restarting",
"removing": "Removing",
"dead": "Dead"
}, },
"ping": { "ping": {
"error": "Error", "error": "Error",
+6 -1
View File
@@ -99,7 +99,12 @@
"unhealthy": "Нездравих", "unhealthy": "Нездравих",
"not_found": "Није пронађено", "not_found": "Није пронађено",
"exited": "Напуштених", "exited": "Напуштених",
"partial": "Делимично" "partial": "Делимично",
"created": "Created",
"paused": "Paused",
"restarting": "Restarting",
"removing": "Removing",
"dead": "Dead"
}, },
"ping": { "ping": {
"error": "Грешка", "error": "Грешка",
+6 -1
View File
@@ -99,7 +99,12 @@
"unhealthy": "Unhealthy", "unhealthy": "Unhealthy",
"not_found": "Not Found", "not_found": "Not Found",
"exited": "Exited", "exited": "Exited",
"partial": "Partial" "partial": "Partial",
"created": "Created",
"paused": "Paused",
"restarting": "Restarting",
"removing": "Removing",
"dead": "Dead"
}, },
"ping": { "ping": {
"error": "Error", "error": "Error",
+6 -1
View File
@@ -99,7 +99,12 @@
"unhealthy": "Unhealthy", "unhealthy": "Unhealthy",
"not_found": "Not Found", "not_found": "Not Found",
"exited": "Exited", "exited": "Exited",
"partial": "Partial" "partial": "Partial",
"created": "Created",
"paused": "Paused",
"restarting": "Restarting",
"removing": "Removing",
"dead": "Dead"
}, },
"ping": { "ping": {
"error": "Error", "error": "Error",
+6 -1
View File
@@ -99,7 +99,12 @@
"unhealthy": "Unhealthy", "unhealthy": "Unhealthy",
"not_found": "Not Found", "not_found": "Not Found",
"exited": "Exited", "exited": "Exited",
"partial": "Partial" "partial": "Partial",
"created": "Created",
"paused": "Paused",
"restarting": "Restarting",
"removing": "Removing",
"dead": "Dead"
}, },
"ping": { "ping": {
"error": "Error", "error": "Error",
+6 -1
View File
@@ -99,7 +99,12 @@
"unhealthy": "Sağlıksız", "unhealthy": "Sağlıksız",
"not_found": "Bulunamadı", "not_found": "Bulunamadı",
"exited": "Kapandı", "exited": "Kapandı",
"partial": "Kısmi" "partial": "Kısmi",
"created": "Created",
"paused": "Paused",
"restarting": "Restarting",
"removing": "Removing",
"dead": "Dead"
}, },
"ping": { "ping": {
"error": "Hata", "error": "Hata",
+6 -1
View File
@@ -99,7 +99,12 @@
"unhealthy": "Нездоровий", "unhealthy": "Нездоровий",
"not_found": "Не знайдено", "not_found": "Не знайдено",
"exited": "Вийшов", "exited": "Вийшов",
"partial": "Частковий" "partial": "Частковий",
"created": "Created",
"paused": "Paused",
"restarting": "Restarting",
"removing": "Removing",
"dead": "Dead"
}, },
"ping": { "ping": {
"error": "Помилка", "error": "Помилка",
+6 -1
View File
@@ -99,7 +99,12 @@
"unhealthy": "Bất thường", "unhealthy": "Bất thường",
"not_found": "Không tìm thấy", "not_found": "Không tìm thấy",
"exited": "Đã thoát", "exited": "Đã thoát",
"partial": "Một phần" "partial": "Một phần",
"created": "Created",
"paused": "Paused",
"restarting": "Restarting",
"removing": "Removing",
"dead": "Dead"
}, },
"ping": { "ping": {
"error": "Lỗi", "error": "Lỗi",
+6 -1
View File
@@ -99,7 +99,12 @@
"unhealthy": "不健康的", "unhealthy": "不健康的",
"not_found": "未找到", "not_found": "未找到",
"exited": "已退出", "exited": "已退出",
"partial": "部分" "partial": "部分",
"created": "Created",
"paused": "Paused",
"restarting": "Restarting",
"removing": "Removing",
"dead": "Dead"
}, },
"ping": { "ping": {
"error": "Error", "error": "Error",
+6 -1
View File
@@ -99,7 +99,12 @@
"unhealthy": "不健康", "unhealthy": "不健康",
"not_found": "未找到", "not_found": "未找到",
"exited": "已退出", "exited": "已退出",
"partial": "部分" "partial": "部分",
"created": "Created",
"paused": "Paused",
"restarting": "Restarting",
"removing": "Removing",
"dead": "Dead"
}, },
"ping": { "ping": {
"error": "错误", "error": "错误",
+6 -1
View File
@@ -99,7 +99,12 @@
"unhealthy": "不健康的", "unhealthy": "不健康的",
"not_found": "找不到", "not_found": "找不到",
"exited": "已退出", "exited": "已退出",
"partial": "部分" "partial": "部分",
"created": "Created",
"paused": "Paused",
"restarting": "Restarting",
"removing": "Removing",
"dead": "Dead"
}, },
"ping": { "ping": {
"error": "Error", "error": "Error",
@@ -0,0 +1,60 @@
import { beforeEach, describe, expect, it, vi } from "vitest";
import createMockRes from "test-utils/create-mock-res";
const { getDockerStats, logger } = vi.hoisted(() => ({
getDockerStats: vi.fn(),
logger: { error: vi.fn() },
}));
vi.mock("utils/docker/stats", () => ({ getDockerStats }));
vi.mock("utils/logger", () => ({
default: () => logger,
}));
import handler from "pages/api/docker/stats";
describe("pages/api/docker/stats", () => {
beforeEach(() => {
vi.clearAllMocks();
});
it("returns the stats map for the requested server", async () => {
getDockerStats.mockResolvedValue({ stats: { app: { cpu: 20, mem: 900, rx: 4, tx: 6 } } });
const req = { query: { server: "local" } };
const res = createMockRes();
await handler(req, res);
expect(getDockerStats).toHaveBeenCalledWith("local");
expect(res.statusCode).toBe(200);
expect(res.body).toEqual({ stats: { app: { cpu: 20, mem: 900, rx: 4, tx: 6 } } });
});
it("returns 500 when the stats lookup reports an error", async () => {
getDockerStats.mockResolvedValue({ error: "query failed" });
const req = { query: { server: "local" } };
const res = createMockRes();
await handler(req, res);
expect(res.statusCode).toBe(500);
expect(res.body).toEqual({ error: "query failed" });
});
it("logs and returns 500 when the stats lookup throws", async () => {
getDockerStats.mockRejectedValue(new Error("boom"));
const req = { query: { server: "local" } };
const res = createMockRes();
await handler(req, res);
expect(res.statusCode).toBe(500);
expect(res.body).toEqual({ error: { message: "boom" } });
expect(logger.error).toHaveBeenCalled();
});
});
@@ -1,153 +0,0 @@
import { beforeEach, describe, expect, it, vi } from "vitest";
import createMockRes from "test-utils/create-mock-res";
const { state, DockerCtor, getDockerArguments, logger } = vi.hoisted(() => {
const state = {
docker: null,
dockerArgs: { conn: { socketPath: "/var/run/docker.sock" }, swarm: false },
};
function DockerCtor() {
return state.docker;
}
return {
state,
DockerCtor,
getDockerArguments: vi.fn(() => state.dockerArgs),
logger: { error: vi.fn() },
};
});
vi.mock("dockerode", () => ({
default: DockerCtor,
}));
vi.mock("utils/config/docker", () => ({
default: getDockerArguments,
}));
vi.mock("utils/logger", () => ({
default: () => logger,
}));
import handler from "pages/api/docker/stats/[...service]";
describe("pages/api/docker/stats/[...service]", () => {
beforeEach(() => {
vi.clearAllMocks();
state.dockerArgs = { conn: { socketPath: "/var/run/docker.sock" }, swarm: false };
state.docker = {
listContainers: vi.fn(),
getContainer: vi.fn(),
listTasks: vi.fn(),
};
});
it("returns 400 when container name/server params are missing", async () => {
const req = { query: { service: [] } };
const res = createMockRes();
await handler(req, res);
expect(res.statusCode).toBe(400);
expect(res.body).toEqual({ error: "docker query parameters are required" });
});
it("returns 500 when docker returns a non-array containers payload", async () => {
state.docker.listContainers.mockResolvedValue(Buffer.from("bad"));
const req = { query: { service: ["c", "local"] } };
const res = createMockRes();
await handler(req, res);
expect(res.statusCode).toBe(500);
expect(res.body).toEqual({ error: "query failed" });
});
it("returns stats for an existing container", async () => {
state.docker.listContainers.mockResolvedValue([{ Names: ["/myapp"], Id: "cid1" }]);
const containerStats = { cpu_stats: { cpu_usage: { total_usage: 1 } } };
state.docker.getContainer.mockReturnValue({
stats: vi.fn().mockResolvedValue(containerStats),
});
const req = { query: { service: ["myapp", "local"] } };
const res = createMockRes();
await handler(req, res);
expect(res.statusCode).toBe(200);
expect(res.body).toEqual({ stats: containerStats });
});
it("uses swarm tasks to locate a container and reports a friendly error when stats cannot be retrieved", async () => {
state.dockerArgs.swarm = true;
state.docker.listContainers.mockResolvedValue([{ Names: ["/other"], Id: "local1" }]);
state.docker.listTasks.mockResolvedValue([
{ Status: { ContainerStatus: { ContainerID: "local1" } } },
{ Status: { ContainerStatus: { ContainerID: "remote1" } } },
]);
state.docker.getContainer.mockReturnValue({
stats: vi.fn().mockRejectedValue(new Error("nope")),
});
const req = { query: { service: ["svc", "local"] } };
const res = createMockRes();
await handler(req, res);
expect(res.statusCode).toBe(200);
expect(res.body).toEqual({ error: "Unable to retrieve stats" });
});
it("returns stats for a swarm task container when present locally", async () => {
state.dockerArgs.swarm = true;
state.docker.listContainers.mockResolvedValue([{ Names: ["/other"], Id: "local1" }]);
state.docker.listTasks.mockResolvedValue([{ Status: { ContainerStatus: { ContainerID: "local1" } } }]);
const containerStats = { cpu_stats: { cpu_usage: { total_usage: 2 } } };
state.docker.getContainer.mockReturnValue({
stats: vi.fn().mockResolvedValue(containerStats),
});
const req = { query: { service: ["svc", "local"] } };
const res = createMockRes();
await handler(req, res);
expect(res.statusCode).toBe(200);
expect(res.body).toEqual({ stats: containerStats });
});
it("returns 404 when no container or swarm task is found", async () => {
state.dockerArgs.swarm = true;
state.docker.listContainers.mockResolvedValue([{ Names: ["/other"], Id: "local1" }]);
state.docker.listTasks.mockResolvedValue([]);
const req = { query: { service: ["missing", "local"] } };
const res = createMockRes();
await handler(req, res);
expect(res.statusCode).toBe(404);
expect(res.body).toEqual({ error: "not found" });
});
it("logs and returns 500 when the docker query throws", async () => {
getDockerArguments.mockImplementationOnce(() => {
throw new Error("boom");
});
const req = { query: { service: ["myapp", "local"] } };
const res = createMockRes();
await handler(req, res);
expect(res.statusCode).toBe(500);
expect(res.body).toEqual({ error: { message: "boom" } });
expect(logger.error).toHaveBeenCalled();
});
});
@@ -1,211 +0,0 @@
import { beforeEach, describe, expect, it, vi } from "vitest";
import createMockRes from "test-utils/create-mock-res";
const { state, DockerCtor, getDockerArguments, logger } = vi.hoisted(() => {
const state = {
docker: null,
dockerCtorArgs: [],
dockerArgs: { conn: { socketPath: "/var/run/docker.sock" }, swarm: false },
};
function DockerCtor(conn) {
state.dockerCtorArgs.push(conn);
return state.docker;
}
return {
state,
DockerCtor,
getDockerArguments: vi.fn(() => state.dockerArgs),
logger: { error: vi.fn() },
};
});
vi.mock("dockerode", () => ({
default: DockerCtor,
}));
vi.mock("utils/config/docker", () => ({
default: getDockerArguments,
}));
vi.mock("utils/logger", () => ({
default: () => logger,
}));
import handler from "pages/api/docker/status/[...service]";
describe("pages/api/docker/status/[...service]", () => {
beforeEach(() => {
vi.clearAllMocks();
state.dockerCtorArgs.length = 0;
state.dockerArgs = { conn: { socketPath: "/var/run/docker.sock" }, swarm: false };
state.docker = {
listContainers: vi.fn(),
getContainer: vi.fn(),
getService: vi.fn(),
listTasks: vi.fn(),
};
});
it("returns 400 when container name/server params are missing", async () => {
const req = { query: { service: [] } };
const res = createMockRes();
await handler(req, res);
expect(res.statusCode).toBe(400);
expect(res.body).toEqual({ error: "docker query parameters are required" });
});
it("returns 500 when docker returns a non-array containers payload", async () => {
state.docker.listContainers.mockResolvedValue(Buffer.from("bad"));
const req = { query: { service: ["c", "local"] } };
const res = createMockRes();
await handler(req, res);
expect(res.statusCode).toBe(500);
expect(res.body).toEqual({ error: "query failed" });
});
it("inspects an existing container and returns status + health", async () => {
state.docker.listContainers.mockResolvedValue([{ Names: ["/myapp"], Id: "cid1" }]);
state.docker.getContainer.mockReturnValue({
inspect: vi.fn().mockResolvedValue({ State: { Status: "running", Health: { Status: "healthy" } } }),
});
const req = { query: { service: ["myapp", "local"] } };
const res = createMockRes();
await handler(req, res);
expect(getDockerArguments).toHaveBeenCalledWith("local");
expect(state.dockerCtorArgs).toHaveLength(1);
expect(res.statusCode).toBe(200);
expect(res.body).toEqual({ status: "running", health: "healthy" });
});
it("returns 404 when container does not exist and swarm is disabled", async () => {
state.docker.listContainers.mockResolvedValue([{ Names: ["/other"], Id: "cid1" }]);
const req = { query: { service: ["missing", "local"] } };
const res = createMockRes();
await handler(req, res);
expect(res.statusCode).toBe(404);
expect(res.body).toEqual({ status: "not found" });
});
it("reports replicated swarm service status based on desired replicas", async () => {
state.dockerArgs.swarm = true;
state.docker.listContainers.mockResolvedValue([{ Names: ["/other"], Id: "cid1" }]);
state.docker.getService.mockReturnValue({
inspect: vi.fn().mockResolvedValue({ Spec: { Mode: { Replicated: { Replicas: "2" } } } }),
});
state.docker.listTasks.mockResolvedValue([{ Status: {} }, { Status: {} }]);
const req = { query: { service: ["svc", "local"] } };
const res = createMockRes();
await handler(req, res);
expect(res.statusCode).toBe(200);
expect(res.body).toEqual({ status: "running 2/2" });
});
it("reports partial status for replicated services with fewer running tasks", async () => {
state.dockerArgs.swarm = true;
state.docker.listContainers.mockResolvedValue([{ Names: ["/other"], Id: "cid1" }]);
state.docker.getService.mockReturnValue({
inspect: vi.fn().mockResolvedValue({ Spec: { Mode: { Replicated: { Replicas: "3" } } } }),
});
state.docker.listTasks.mockResolvedValue([{ Status: {} }]);
const req = { query: { service: ["svc", "local"] } };
const res = createMockRes();
await handler(req, res);
expect(res.statusCode).toBe(200);
expect(res.body).toEqual({ status: "partial 1/3" });
});
it("handles global services by inspecting a local task container when possible", async () => {
state.dockerArgs.swarm = true;
state.docker.listContainers.mockResolvedValue([{ Names: ["/other"], Id: "local1" }]);
state.docker.getService.mockReturnValue({
inspect: vi.fn().mockResolvedValue({ Spec: { Mode: { Global: {} } } }),
});
state.docker.listTasks.mockResolvedValue([
{ Status: { ContainerStatus: { ContainerID: "local1" }, State: "running" } },
]);
state.docker.getContainer.mockReturnValue({
inspect: vi.fn().mockResolvedValue({ State: { Status: "running", Health: { Status: "unhealthy" } } }),
});
const req = { query: { service: ["svc", "local"] } };
const res = createMockRes();
await handler(req, res);
expect(res.statusCode).toBe(200);
expect(res.body).toEqual({ status: "running", health: "unhealthy" });
});
it("falls back to task status when global service container inspect fails", async () => {
state.dockerArgs.swarm = true;
state.docker.listContainers.mockResolvedValue([{ Names: ["/other"], Id: "local1" }]);
state.docker.getService.mockReturnValue({
inspect: vi.fn().mockResolvedValue({ Spec: { Mode: { Global: {} } } }),
});
state.docker.listTasks.mockResolvedValue([
{ Status: { ContainerStatus: { ContainerID: "local1" }, State: "pending" } },
]);
state.docker.getContainer.mockReturnValue({
inspect: vi.fn().mockRejectedValue(new Error("nope")),
});
const req = { query: { service: ["svc", "local"] } };
const res = createMockRes();
await handler(req, res);
expect(res.statusCode).toBe(200);
expect(res.body).toEqual({ status: "pending" });
});
it("returns 404 when swarm is enabled but the service does not exist", async () => {
state.dockerArgs.swarm = true;
state.docker.listContainers.mockResolvedValue([{ Names: ["/other"], Id: "cid1" }]);
state.docker.getService.mockReturnValue({
inspect: vi.fn().mockRejectedValue(new Error("not found")),
});
const req = { query: { service: ["svc", "local"] } };
const res = createMockRes();
await handler(req, res);
expect(res.statusCode).toBe(404);
expect(res.body).toEqual({ status: "not found" });
});
it("logs and returns 500 when the docker query throws", async () => {
getDockerArguments.mockImplementationOnce(() => {
throw new Error("boom");
});
const req = { query: { service: ["svc", "local"] } };
const res = createMockRes();
await handler(req, res);
expect(res.statusCode).toBe(500);
expect(res.body).toEqual({ error: { message: "boom" } });
expect(logger.error).toHaveBeenCalled();
});
});
@@ -0,0 +1,265 @@
import { beforeEach, describe, expect, it, vi } from "vitest";
import createMockRes from "test-utils/create-mock-res";
const { state, DockerCtor, getDockerArguments, containersFromConfig, hasHomepageLabels, getSettings, logger } =
vi.hoisted(() => {
const state = {
docker: null,
containers: [],
health: {},
containers: [],
health: {},
dockerArgs: { conn: { socketPath: "/var/run/docker.sock" }, swarm: false },
};
function DockerCtor() {
return state.docker;
}
return {
state,
DockerCtor,
getDockerArguments: vi.fn(() => state.dockerArgs),
containersFromConfig: vi.fn(async () => new Set()),
hasHomepageLabels: vi.fn(() => false),
getSettings: vi.fn(() => ({ instanceName: undefined })),
logger: { error: vi.fn() },
};
});
vi.mock("dockerode", () => ({
default: DockerCtor,
}));
vi.mock("utils/config/docker", () => ({
default: getDockerArguments,
}));
vi.mock("utils/config/service-helpers", () => ({
containersFromConfig,
hasHomepageLabels,
}));
vi.mock("utils/config/config", () => ({
getSettings,
}));
vi.mock("utils/logger", () => ({
default: () => logger,
}));
import handler from "pages/api/docker/statuses";
describe("pages/api/docker/statuses", () => {
beforeEach(() => {
vi.clearAllMocks();
state.dockerArgs = { conn: { socketPath: "/var/run/docker.sock" }, swarm: false };
state.containers = [];
state.health = {};
state.docker = {
listContainers: vi.fn(async (options) => {
const health = options?.filters?.health?.[0];
return health ? (state.health[health] ?? []) : state.containers;
}),
listServices: vi.fn(),
listTasks: vi.fn(),
};
containersFromConfig.mockResolvedValue(new Set());
hasHomepageLabels.mockReturnValue(false);
getSettings.mockReturnValue({ instanceName: undefined });
});
it("returns configured container statuses with health from the docker health filters", async () => {
containersFromConfig.mockResolvedValue(new Set(["glance", "share"]));
state.containers = [
{ Names: ["/glance"], Id: "cid-glance", State: "running" },
{ Names: ["/share"], Id: "cid-share", State: "exited" },
];
state.health = { healthy: [{ Id: "cid-glance" }] };
const req = { query: { server: "local" } };
const res = createMockRes();
await handler(req, res);
expect(getDockerArguments).toHaveBeenCalledWith("local");
expect(containersFromConfig).toHaveBeenCalledWith("local");
// one list plus one per health state, constant regardless of container count
expect(state.docker.listContainers).toHaveBeenCalledTimes(4);
expect(state.docker.listServices).not.toHaveBeenCalled();
expect(res.statusCode).toBe(200);
expect(res.body).toEqual({
statuses: {
glance: { status: "running", health: "healthy" },
share: { status: "exited" },
},
});
});
it("takes health from the filter results rather than the status string", async () => {
containersFromConfig.mockResolvedValue(new Set(["app"]));
state.containers = [{ Names: ["/app"], Id: "cid1", State: "running", Status: "Up 2 hours (healthy)" }];
state.health = { unhealthy: [{ Id: "cid1" }] };
const req = { query: { server: "local" } };
const res = createMockRes();
await handler(req, res);
expect(res.body).toEqual({ statuses: { app: { status: "running", health: "unhealthy" } } });
});
it("omits health when the docker daemon rejects the health filter", async () => {
containersFromConfig.mockResolvedValue(new Set(["app"]));
state.containers = [{ Names: ["/app"], Id: "cid1", State: "running", Status: "Up 2 hours (healthy)" }];
state.docker.listContainers.mockImplementation(async (options) => {
if (options?.filters?.health) throw new Error("filter unsupported");
return state.containers;
});
const req = { query: { server: "local" } };
const res = createMockRes();
await handler(req, res);
expect(res.body).toEqual({ statuses: { app: { status: "running" } } });
});
it("omits containers that are neither configured nor labelled for homepage", async () => {
containersFromConfig.mockResolvedValue(new Set(["glance"]));
state.containers = [
{ Names: ["/glance"], State: "running", Status: "Up" },
{ Names: ["/secret-db"], State: "running", Status: "Up" },
];
const req = { query: { server: "local" } };
const res = createMockRes();
await handler(req, res);
expect(res.body).toEqual({ statuses: { glance: { status: "running" } } });
expect(res.body.statuses["secret-db"]).toBeUndefined();
});
it("includes containers discovered through homepage labels", async () => {
hasHomepageLabels.mockImplementation((labels) => labels?.["homepage.name"] !== undefined);
state.containers = [
{ Names: ["/labelled"], State: "running", Status: "Up", Labels: { "homepage.name": "App" } },
{ Names: ["/unlabelled"], State: "running", Status: "Up", Labels: {} },
];
const req = { query: { server: "local" } };
const res = createMockRes();
await handler(req, res);
expect(res.body).toEqual({ statuses: { labelled: { status: "running" } } });
});
it("includes swarm services when the server is in swarm mode", async () => {
state.dockerArgs.swarm = true;
containersFromConfig.mockResolvedValue(new Set(["web", "api"]));
state.containers = [{ Names: ["/web"], Id: "cid1", State: "running", Status: "Up" }];
state.docker.listServices.mockResolvedValue([
{ ID: "sid", Spec: { Name: "api", Mode: { Replicated: { Replicas: "2" } } } },
]);
state.docker.listTasks.mockResolvedValue([
{ ServiceID: "sid", Status: {} },
{ ServiceID: "sid", Status: {} },
]);
const req = { query: { server: "swarm" } };
const res = createMockRes();
await handler(req, res);
expect(res.statusCode).toBe(200);
expect(res.body).toEqual({
statuses: {
web: { status: "running" },
api: { status: "running 2/2" },
},
});
});
it("omits swarm services that are neither configured nor labelled", async () => {
state.dockerArgs.swarm = true;
containersFromConfig.mockResolvedValue(new Set());
state.containers = [];
state.docker.listServices.mockResolvedValue([
{ ID: "sid", Spec: { Name: "internal", Mode: { Replicated: { Replicas: "1" } } } },
]);
state.docker.listTasks.mockResolvedValue([{ ServiceID: "sid", Status: {} }]);
const req = { query: { server: "swarm" } };
const res = createMockRes();
await handler(req, res);
expect(res.body).toEqual({ statuses: {} });
});
it("includes swarm services discovered through homepage labels", async () => {
state.dockerArgs.swarm = true;
hasHomepageLabels.mockImplementation((labels) => labels?.["homepage.name"] !== undefined);
state.containers = [];
state.docker.listServices.mockResolvedValue([
{
ID: "sid",
Spec: { Name: "api", Labels: { "homepage.name": "Api" }, Mode: { Replicated: { Replicas: "1" } } },
},
]);
state.docker.listTasks.mockResolvedValue([{ ServiceID: "sid", Status: {} }]);
const req = { query: { server: "swarm" } };
const res = createMockRes();
await handler(req, res);
expect(res.body).toEqual({ statuses: { api: { status: "running 1/1" } } });
});
it("returns only listed containers when swarm queries fail", async () => {
state.dockerArgs.swarm = true;
containersFromConfig.mockResolvedValue(new Set(["web"]));
state.containers = [{ Names: ["/web"], Id: "cid1", State: "running", Status: "Up" }];
state.docker.listServices.mockRejectedValue(new Error("no services"));
state.docker.listTasks.mockRejectedValue(new Error("no tasks"));
const req = { query: { server: "swarm" } };
const res = createMockRes();
await handler(req, res);
expect(res.statusCode).toBe(200);
expect(res.body).toEqual({ statuses: { web: { status: "running" } } });
});
it("returns 500 when docker returns a non-array containers payload", async () => {
state.containers = Buffer.from("bad");
const req = { query: { server: "local" } };
const res = createMockRes();
await handler(req, res);
expect(res.statusCode).toBe(500);
expect(res.body).toEqual({ error: "query failed" });
});
it("logs and returns 500 when the docker query throws", async () => {
getDockerArguments.mockImplementationOnce(() => {
throw new Error("boom");
});
const req = { query: { server: "local" } };
const res = createMockRes();
await handler(req, res);
expect(res.statusCode).toBe(500);
expect(res.body).toEqual({ error: { message: "boom" } });
expect(logger.error).toHaveBeenCalled();
});
});
+92 -3
View File
@@ -1,11 +1,15 @@
// @vitest-environment jsdom // @vitest-environment jsdom
import { render, screen, waitFor } from "@testing-library/react"; import { render, screen, waitFor } from "@testing-library/react";
import { describe, expect, it, vi } from "vitest"; import { StrictMode } from "react";
import { beforeEach, describe, expect, it, vi } from "vitest";
const { getSettingsMock, authOptionsMock } = vi.hoisted(() => ({ const { getSettingsMock, authOptionsMock, signInMock, replaceMock, routerQuery } = vi.hoisted(() => ({
getSettingsMock: vi.fn(), getSettingsMock: vi.fn(),
authOptionsMock: vi.fn(), authOptionsMock: vi.fn(),
signInMock: vi.fn(),
replaceMock: vi.fn(),
routerQuery: {},
})); }));
vi.mock("utils/config/config", () => ({ vi.mock("utils/config/config", () => ({
@@ -20,13 +24,25 @@ vi.mock("pages/api/auth/[...nextauth]", () => ({
vi.mock("next/router", () => ({ vi.mock("next/router", () => ({
useRouter: () => ({ useRouter: () => ({
query: {}, query: routerQuery,
replace: replaceMock,
}), }),
})); }));
vi.mock("next-auth/react", () => ({ signIn: signInMock }));
import SignInPage, { getServerSideProps } from "pages/auth/signin"; import SignInPage, { getServerSideProps } from "pages/auth/signin";
const OIDC_PROVIDERS = { "homepage-oidc": { id: "homepage-oidc", name: "Homepage OIDC", type: "oauth" } };
const SETTINGS = { theme: "dark", color: "slate", title: "Homepage" };
describe("pages/auth/signin", () => { describe("pages/auth/signin", () => {
beforeEach(() => {
vi.clearAllMocks();
Object.keys(routerQuery).forEach((key) => delete routerQuery[key]);
window.sessionStorage.clear();
});
it("renders an error state when no providers are configured", async () => { it("renders an error state when no providers are configured", async () => {
render( render(
<SignInPage <SignInPage
@@ -66,6 +82,67 @@ describe("pages/auth/signin", () => {
expect(screen.getByRole("button", { name: /login via oidc/i })).toBeInTheDocument(); expect(screen.getByRole("button", { name: /login via oidc/i })).toBeInTheDocument();
}); });
it("redirects to the provider when auto-login is enabled", () => {
routerQuery.callbackUrl = "/some/page";
render(<SignInPage providers={OIDC_PROVIDERS} settings={SETTINGS} autoLogin />);
expect(signInMock).toHaveBeenCalledWith("homepage-oidc", { callbackUrl: "/some/page" });
expect(screen.getByText(/redirecting to homepage oidc/i)).toBeInTheDocument();
expect(screen.queryByRole("button", { name: /login via/i })).not.toBeInTheDocument();
});
it("does not auto-login when the provider returned an error", () => {
routerQuery.error = "OAuthCallback";
render(<SignInPage providers={OIDC_PROVIDERS} settings={SETTINGS} autoLogin />);
expect(signInMock).not.toHaveBeenCalled();
expect(screen.getByRole("button", { name: /login via homepage oidc/i })).toBeInTheDocument();
});
it("does not auto-login when it is explicitly disabled in the url", () => {
routerQuery.autologin = "0";
render(<SignInPage providers={OIDC_PROVIDERS} settings={SETTINGS} autoLogin />);
expect(signInMock).not.toHaveBeenCalled();
expect(screen.getByRole("button", { name: /login via homepage oidc/i })).toBeInTheDocument();
});
it("redirects once under strict mode, rather than tripping its own loop guard", () => {
render(
<StrictMode>
<SignInPage providers={OIDC_PROVIDERS} settings={SETTINGS} autoLogin />
</StrictMode>,
);
expect(signInMock).toHaveBeenCalledTimes(1);
expect(replaceMock).not.toHaveBeenCalled();
});
it("stops auto-login and hands back the page when the session never sticks", () => {
routerQuery.callbackUrl = "/some/page";
render(<SignInPage providers={OIDC_PROVIDERS} settings={SETTINGS} autoLogin />);
render(<SignInPage providers={OIDC_PROVIDERS} settings={SETTINGS} autoLogin />);
expect(signInMock).toHaveBeenCalledTimes(1);
expect(replaceMock).toHaveBeenCalledWith("/auth/signin?autologin=0&callbackUrl=%2Fsome%2Fpage");
});
it("does not auto-login the password provider", () => {
render(
<SignInPage
providers={{ credentials: { id: "credentials", name: "Password", type: "credentials" } }}
settings={SETTINGS}
autoLogin
/>,
);
expect(signInMock).not.toHaveBeenCalled();
});
it("getServerSideProps returns providers and only public sign-in settings", async () => { it("getServerSideProps returns providers and only public sign-in settings", async () => {
authOptionsMock.mockReturnValueOnce({ providers: [{ id: "foo", name: "Foo", type: "oauth" }] }); authOptionsMock.mockReturnValueOnce({ providers: [{ id: "foo", name: "Foo", type: "oauth" }] });
getSettingsMock.mockReturnValueOnce({ getSettingsMock.mockReturnValueOnce({
@@ -88,6 +165,7 @@ describe("pages/auth/signin", () => {
expect(getSettingsMock).toHaveBeenCalled(); expect(getSettingsMock).toHaveBeenCalled();
expect(res).toEqual({ expect(res).toEqual({
props: { props: {
autoLogin: false,
providers: { foo: { id: "foo", name: "Foo", type: "oauth" } }, providers: { foo: { id: "foo", name: "Foo", type: "oauth" } },
settings: { settings: {
theme: "dark", theme: "dark",
@@ -102,6 +180,17 @@ describe("pages/auth/signin", () => {
expect(res.props.settings).not.toHaveProperty("layout"); expect(res.props.settings).not.toHaveProperty("layout");
}); });
it("getServerSideProps enables auto-login from the environment", async () => {
authOptionsMock.mockReturnValueOnce({ providers: [] });
getSettingsMock.mockReturnValueOnce({ theme: "dark" });
vi.stubEnv("HOMEPAGE_OIDC_AUTO_LOGIN", "true");
const res = await getServerSideProps({});
expect(res.props.autoLogin).toBe(true);
vi.unstubAllEnvs();
});
it("getServerSideProps falls back to no providers when auth options fail to load", async () => { it("getServerSideProps falls back to no providers when auth options fail to load", async () => {
const consoleError = vi.spyOn(console, "error").mockImplementation(() => {}); const consoleError = vi.spyOn(console, "error").mockImplementation(() => {});
authOptionsMock.mockImplementationOnce(() => { authOptionsMock.mockImplementationOnce(() => {
+3 -2
View File
@@ -1,10 +1,11 @@
import { Disclosure, Transition } from "@headlessui/react"; import { Disclosure, Transition } from "@headlessui/react";
import classNames from "classnames"; import classNames from "classnames";
import { useEffect, useRef } from "react";
import { MdKeyboardArrowDown } from "react-icons/md";
import List from "components/bookmarks/list"; import List from "components/bookmarks/list";
import ErrorBoundary from "components/errorboundry"; import ErrorBoundary from "components/errorboundry";
import ResolvedIcon from "components/resolvedicon"; import ResolvedIcon from "components/resolvedicon";
import { useEffect, useRef } from "react";
import { MdKeyboardArrowDown } from "react-icons/md";
export default function BookmarksGroup({ export default function BookmarksGroup({
bookmarks, bookmarks,
+2 -1
View File
@@ -1,6 +1,7 @@
import classNames from "classnames"; import classNames from "classnames";
import ResolvedIcon from "components/resolvedicon";
import { useContext } from "react"; import { useContext } from "react";
import ResolvedIcon from "components/resolvedicon";
import { SettingsContext } from "utils/contexts/settings"; import { SettingsContext } from "utils/contexts/settings";
export default function Item({ bookmark, iconOnly = false }) { export default function Item({ bookmark, iconOnly = false }) {
+2 -1
View File
@@ -1,8 +1,9 @@
import classNames from "classnames"; import classNames from "classnames";
import Item from "components/bookmarks/item";
import { columnMap } from "../../utils/layout/columns"; import { columnMap } from "../../utils/layout/columns";
import Item from "components/bookmarks/item";
export default function List({ bookmarks, layout, bookmarksStyle }) { export default function List({ bookmarks, layout, bookmarksStyle }) {
let classes = layout?.style === "row" ? `grid ${columnMap[layout?.columns]} gap-x-2` : "flex flex-col bookmark-list"; let classes = layout?.style === "row" ? `grid ${columnMap[layout?.columns]} gap-x-2` : "flex flex-col bookmark-list";
const style = {}; const style = {};
+1 -1
View File
@@ -1,8 +1,8 @@
/* eslint-disable @next/next/no-img-element */ /* eslint-disable @next/next/no-img-element */
/* eslint-disable jsx-a11y/alt-text */ /* eslint-disable jsx-a11y/alt-text */
import { useContext, useEffect, useRef } from "react"; import { useContext, useEffect, useRef } from "react";
import { ColorContext } from "utils/contexts/color";
import { ColorContext } from "utils/contexts/color";
import themes from "utils/styles/themes"; import themes from "utils/styles/themes";
export function Svg({ svgRef = null }) { export function Svg({ svgRef = null }) {
+6 -4
View File
@@ -3,11 +3,12 @@ import { useTranslation } from "next-i18next/pages";
import { useCallback, useContext, useEffect, useRef, useState } from "react"; import { useCallback, useContext, useEffect, useRef, useState } from "react";
import { FiSearch } from "react-icons/fi"; import { FiSearch } from "react-icons/fi";
import useSWR from "swr"; import useSWR from "swr";
import { SettingsContext } from "utils/contexts/settings";
import ResolvedIcon from "./resolvedicon"; import ResolvedIcon from "./resolvedicon";
import { getStoredProvider, searchProviders } from "./widgets/search/search"; import { getStoredProvider, searchProviders } from "./widgets/search/search";
import { SettingsContext } from "utils/contexts/settings";
const MOBILE_BUTTON_POSITIONS = { const MOBILE_BUTTON_POSITIONS = {
"top-left": "top-4 left-4", "top-left": "top-4 left-4",
"top-right": "top-4 right-4", "top-right": "top-4 right-4",
@@ -123,8 +124,8 @@ export default function QuickLaunch({ servicesAndBookmarks, searchString, setSea
? MOBILE_BUTTON_POSITIONS[settings.quicklaunch.mobileButtonPosition] ? MOBILE_BUTTON_POSITIONS[settings.quicklaunch.mobileButtonPosition]
: null; : null;
function openCurrentItem(newWindow) { function openCurrentItem(newWindow, index = activeItemIndex) {
const result = results[activeItemIndex]; const result = results[index];
window.open( window.open(
result.href, result.href,
newWindow ? "_blank" : (result.target ?? searchProvider?.target ?? settings.target ?? "_blank"), newWindow ? "_blank" : (result.target ?? searchProvider?.target ?? settings.target ?? "_blank"),
@@ -179,7 +180,8 @@ export default function QuickLaunch({ servicesAndBookmarks, searchString, setSea
function handleItemClick(event) { function handleItemClick(event) {
closeAndReset(); closeAndReset();
openCurrentItem(event.metaKey); // in case hover doesnt fire, use the clicked item, not the highlighted one
openCurrentItem(event.metaKey, parseInt(event.currentTarget.dataset.index, 10));
} }
function handleItemKeyDown(event) { function handleItemKeyDown(event) {
+31
View File
@@ -263,6 +263,37 @@ describe("components/quicklaunch", () => {
openSpy.mockRestore(); openSpy.mockRestore();
}); });
it("opens the clicked result even without a preceding hover event", async () => {
const openSpy = vi.spyOn(window, "open").mockImplementation(() => null);
renderWithProviders(
<Wrapper
servicesAndBookmarks={[
{ name: "Alpha", href: "https://alpha.example" },
{ name: "Alpine", href: "https://alpine.example" },
{ name: "Almond", href: "https://almond.example" },
]}
/>,
{ settings: { target: "_self", quicklaunch: { showSearchSuggestions: false } } },
);
const input = screen.getByPlaceholderText("Search");
await waitFor(() => expect(input).toHaveFocus());
fireEvent.change(input, { target: { value: "al" } });
await waitFor(() => expect(document.querySelector('button[data-index="2"]')).toBeTruthy());
// touch devices don't fire mouseEnter, so the highlighted item is still the first one
fireEvent.click(document.querySelector('button[data-index="2"]'));
await act(async () => {
await new Promise((r) => setTimeout(r, 350));
});
expect(openSpy).toHaveBeenCalledWith("https://almond.example", "_self", "noreferrer");
openSpy.mockRestore();
});
it("handles Escape on a result button (not just the input)", async () => { it("handles Escape on a result button (not just the input)", async () => {
renderWithProviders(<Wrapper servicesAndBookmarks={[{ name: "Alpha", href: "https://alpha.example" }]} />, { renderWithProviders(<Wrapper servicesAndBookmarks={[{ name: "Alpha", href: "https://alpha.example" }]} />, {
settings: { quicklaunch: { showSearchSuggestions: false } }, settings: { quicklaunch: { showSearchSuggestions: false } },
+1
View File
@@ -1,5 +1,6 @@
import Image from "next/image"; import Image from "next/image";
import { useContext } from "react"; import { useContext } from "react";
import { SettingsContext } from "utils/contexts/settings"; import { SettingsContext } from "utils/contexts/settings";
import { ThemeContext } from "utils/contexts/theme"; import { ThemeContext } from "utils/contexts/theme";
+3 -2
View File
@@ -1,12 +1,13 @@
import { Disclosure, Transition } from "@headlessui/react"; import { Disclosure, Transition } from "@headlessui/react";
import classNames from "classnames"; import classNames from "classnames";
import ResolvedIcon from "components/resolvedicon";
import List from "components/services/list";
import { useEffect, useRef } from "react"; import { useEffect, useRef } from "react";
import { MdKeyboardArrowDown } from "react-icons/md"; import { MdKeyboardArrowDown } from "react-icons/md";
import { columnMap } from "../../utils/layout/columns"; import { columnMap } from "../../utils/layout/columns";
import ResolvedIcon from "components/resolvedicon";
import List from "components/services/list";
export default function ServicesGroup({ export default function ServicesGroup({
group, group,
layout, layout,
+6 -5
View File
@@ -1,10 +1,5 @@
import classNames from "classnames"; import classNames from "classnames";
import ResolvedIcon from "components/resolvedicon";
import { useContext, useState } from "react"; import { useContext, useState } from "react";
import { SettingsContext } from "utils/contexts/settings";
import Docker from "widgets/docker/component";
import Kubernetes from "widgets/kubernetes/component";
import ProxmoxVM from "widgets/proxmoxvm/component";
import KubernetesStatus from "./kubernetes-status"; import KubernetesStatus from "./kubernetes-status";
import Ping from "./ping"; import Ping from "./ping";
@@ -13,6 +8,12 @@ import SiteMonitor from "./site-monitor";
import Status from "./status"; import Status from "./status";
import Widget from "./widget"; import Widget from "./widget";
import ResolvedIcon from "components/resolvedicon";
import { SettingsContext } from "utils/contexts/settings";
import Docker from "widgets/docker/component";
import Kubernetes from "widgets/kubernetes/component";
import ProxmoxVM from "widgets/proxmoxvm/component";
export default function Item({ service, groupName, useEqualHeights }) { export default function Item({ service, groupName, useEqualHeights }) {
const hasLink = service.href && service.href !== "#"; const hasLink = service.href && service.href !== "#";
const { settings } = useContext(SettingsContext); const { settings } = useContext(SettingsContext);
+2 -1
View File
@@ -1,8 +1,9 @@
import classNames from "classnames"; import classNames from "classnames";
import Item from "components/services/item";
import { columnMap } from "../../utils/layout/columns"; import { columnMap } from "../../utils/layout/columns";
import Item from "components/services/item";
export default function List({ groupName, services, layout, useEqualHeights, header }) { export default function List({ groupName, services, layout, useEqualHeights, header }) {
return ( return (
<ul <ul
+40 -24
View File
@@ -1,45 +1,61 @@
import { useTranslation } from "next-i18next/pages"; import { useTranslation } from "next-i18next/pages";
import useSWR from "swr"; import useSWR from "swr";
const WARNING_CLASS = "text-orange-400/50 dark:text-orange-400/80";
// docker container states other than running
const STATE_LABELS = {
created: "docker.created",
dead: "docker.dead",
exited: "docker.exited",
"not found": "docker.not_found",
paused: "docker.paused",
removing: "docker.removing",
restarting: "docker.restarting",
};
// states that mean something is wrong rather than merely not started
const WARNING_STATES = new Set(["dead", "exited", "not found", "restarting"]);
export default function Status({ service, style }) { export default function Status({ service, style }) {
const { t } = useTranslation(); const { t } = useTranslation();
const { data, error } = useSWR(`/api/docker/status/${service.container}/${service.server || ""}`); const { data: response, error } = useSWR(`/api/docker/statuses?server=${encodeURIComponent(service.server || "")}`);
const statusError = error ?? response?.error;
const { statuses } = response ?? {};
const data = statuses ? (statuses[service.container] ?? { status: "not found" }) : undefined;
let statusLabel = t("docker.unknown"); let statusLabel = t("docker.unknown");
let backgroundClass = "px-1.5 py-0.5 bg-theme-500/10 dark:bg-theme-900/50"; let backgroundClass = "px-1.5 py-0.5 bg-theme-500/10 dark:bg-theme-900/50";
let colorClass = "text-black/20 dark:text-white/40 "; let colorClass = "text-black/20 dark:text-white/40 ";
if (error) { if (statusError) {
statusLabel = t("docker.error"); statusLabel = t("docker.error");
colorClass = "text-rose-500/80"; colorClass = "text-rose-500/80";
} else if (data) { } else if (data?.status?.includes("running")) {
if (data.status?.includes("running")) { colorClass = "text-emerald-500/80";
colorClass = "text-emerald-500/80";
if (!data.health) { if (!data.health) {
statusLabel = data.status.replace("running", t("docker.running")); statusLabel = data.status.replace("running", t("docker.running"));
} else { } else {
statusLabel = data.health === "healthy" ? t("docker.healthy") : data.health; statusLabel = data.health === "healthy" ? t("docker.healthy") : data.health;
if (data.health === "starting") { if (data.health === "starting") {
statusLabel = t("docker.starting"); statusLabel = t("docker.starting");
colorClass = "text-blue-500/80"; colorClass = "text-blue-500/80";
} }
if (data.health === "unhealthy") { if (data.health === "unhealthy") {
statusLabel = t("docker.unhealthy"); statusLabel = t("docker.unhealthy");
colorClass = "text-orange-400/50 dark:text-orange-400/80"; colorClass = WARNING_CLASS;
}
} }
} }
} else if (data?.status?.startsWith("partial")) {
if (data.status === "not found" || data.status === "exited" || data.status?.startsWith("partial")) { statusLabel = data.status.replace("partial", t("docker.partial"));
if (data.status === "not found") statusLabel = t("docker.not_found"); colorClass = WARNING_CLASS;
else if (data.status === "exited") statusLabel = t("docker.exited"); } else if (data && STATE_LABELS[data.status]) {
else statusLabel = data.status.replace("partial", t("docker.partial")); statusLabel = t(STATE_LABELS[data.status]);
colorClass = "text-orange-400/50 dark:text-orange-400/80"; if (WARNING_STATES.has(data.status)) colorClass = WARNING_CLASS;
}
} }
if (style === "dot") { if (style === "dot") {
+60 -8
View File
@@ -21,8 +21,11 @@ describe("components/services/status", () => {
render(<Status service={{ container: "c", server: "s" }} />); render(<Status service={{ container: "c", server: "s" }} />);
expect(useSWR).toHaveBeenCalledWith("/api/docker/status/c/s"); expect(useSWR).toHaveBeenCalledWith("/api/docker/statuses?server=s");
expect(screen.getByText("docker.unknown")).toBeInTheDocument(); expect(screen.getByText("docker.unknown")).toBeInTheDocument();
render(<Status service={{ container: "c" }} />);
expect(useSWR).toHaveBeenCalledWith("/api/docker/statuses?server=");
}); });
it("renders error when SWR fails", () => { it("renders error when SWR fails", () => {
@@ -33,38 +36,87 @@ describe("components/services/status", () => {
expect(screen.getByText("docker.error")).toBeInTheDocument(); expect(screen.getByText("docker.error")).toBeInTheDocument();
}); });
it("renders error when the api returns an error payload with a 200-parsed body", () => {
useSWR.mockReturnValue({ data: { error: "query failed" }, error: undefined });
render(<Status service={{ container: "c", server: "s" }} />);
expect(screen.getByText("docker.error")).toBeInTheDocument();
expect(screen.queryByText("docker.not_found")).not.toBeInTheDocument();
});
it("renders healthy/unhealthy and partial/exited/not found statuses", () => { it("renders healthy/unhealthy and partial/exited/not found statuses", () => {
useSWR.mockReturnValue({ data: { status: "running", health: "healthy" }, error: undefined }); useSWR.mockReturnValue({ data: { statuses: { c: { status: "running", health: "healthy" } } }, error: undefined });
render(<Status service={{ container: "c", server: "s" }} />); render(<Status service={{ container: "c", server: "s" }} />);
expect(screen.getByText("docker.healthy")).toBeInTheDocument(); expect(screen.getByText("docker.healthy")).toBeInTheDocument();
useSWR.mockReturnValue({ data: { status: "running", health: "unhealthy" }, error: undefined }); useSWR.mockReturnValue({ data: { statuses: { c: { status: "running", health: "unhealthy" } } }, error: undefined });
render(<Status service={{ container: "c", server: "s" }} />); render(<Status service={{ container: "c", server: "s" }} />);
expect(screen.getByText("docker.unhealthy")).toBeInTheDocument(); expect(screen.getByText("docker.unhealthy")).toBeInTheDocument();
useSWR.mockReturnValue({ data: { status: "partial 1/2" }, error: undefined }); useSWR.mockReturnValue({ data: { statuses: { c: { status: "partial 1/2" } } }, error: undefined });
render(<Status service={{ container: "c", server: "s" }} />); render(<Status service={{ container: "c", server: "s" }} />);
expect(screen.getByText("docker.partial 1/2")).toBeInTheDocument(); expect(screen.getByText("docker.partial 1/2")).toBeInTheDocument();
useSWR.mockReturnValue({ data: { status: "exited" }, error: undefined }); useSWR.mockReturnValue({ data: { statuses: { c: { status: "exited" } } }, error: undefined });
render(<Status service={{ container: "c", server: "s" }} />); render(<Status service={{ container: "c", server: "s" }} />);
expect(screen.getByText("docker.exited")).toBeInTheDocument(); expect(screen.getByText("docker.exited")).toBeInTheDocument();
useSWR.mockReturnValue({ data: { status: "not found" }, error: undefined }); useSWR.mockReturnValue({ data: { statuses: {} }, error: undefined });
render(<Status service={{ container: "c", server: "s" }} />); render(<Status service={{ container: "c", server: "s" }} />);
expect(screen.getByText("docker.not_found")).toBeInTheDocument(); expect(screen.getByText("docker.not_found")).toBeInTheDocument();
}); });
it("renders starting health when container is running and starting", () => { it("renders starting health when container is running and starting", () => {
useSWR.mockReturnValue({ data: { status: "running", health: "starting" }, error: undefined }); useSWR.mockReturnValue({ data: { statuses: { c: { status: "running", health: "starting" } } }, error: undefined });
render(<Status service={{ container: "c", server: "s" }} />); render(<Status service={{ container: "c", server: "s" }} />);
expect(screen.getByText("docker.starting")).toBeInTheDocument(); expect(screen.getByText("docker.starting")).toBeInTheDocument();
}); });
it("renders the remaining container states instead of falling through to unknown", () => {
const states = {
created: "docker.created",
paused: "docker.paused",
restarting: "docker.restarting",
removing: "docker.removing",
dead: "docker.dead",
};
Object.entries(states).forEach(([status, label]) => {
useSWR.mockReturnValue({ data: { statuses: { c: { status } } }, error: undefined });
render(<Status service={{ container: "c", server: "s" }} />);
expect(screen.getByText(label)).toBeInTheDocument();
});
expect(screen.queryByText("docker.unknown")).not.toBeInTheDocument();
});
it("colors problem states as warnings and merely stopped states neutrally", () => {
useSWR.mockReturnValue({ data: { statuses: { c: { status: "restarting" } } }, error: undefined });
const { container: restarting } = render(<Status service={{ container: "c", server: "s" }} style="dot" />);
expect(restarting.querySelector(".bg-orange-400")).toBeInTheDocument();
useSWR.mockReturnValue({ data: { statuses: { c: { status: "paused" } } }, error: undefined });
const { container: paused } = render(<Status service={{ container: "c", server: "s" }} style="dot" />);
expect(paused.querySelector(".bg-orange-400")).not.toBeInTheDocument();
});
it("does not surface health for containers that are not running", () => {
useSWR.mockReturnValue({
data: { statuses: { c: { status: "paused", health: "unhealthy" } } },
error: undefined,
});
render(<Status service={{ container: "c", server: "s" }} />);
expect(screen.getByText("docker.paused")).toBeInTheDocument();
expect(screen.queryByText("docker.unhealthy")).not.toBeInTheDocument();
});
it("renders a dot when style is dot", () => { it("renders a dot when style is dot", () => {
useSWR.mockReturnValue({ data: { status: "running" }, error: undefined }); useSWR.mockReturnValue({ data: { statuses: { c: { status: "running" } } }, error: undefined });
const { container } = render(<Status service={{ container: "c", server: "s" }} style="dot" />); const { container } = render(<Status service={{ container: "c", server: "s" }} style="dot" />);
+1 -1
View File
@@ -1,6 +1,6 @@
import ErrorBoundary from "components/errorboundry";
import { useTranslation } from "next-i18next/pages"; import { useTranslation } from "next-i18next/pages";
import ErrorBoundary from "components/errorboundry";
import components from "widgets/components"; import components from "widgets/components";
export default function Widget({ widget, service }) { export default function Widget({ widget, service }) {
+1 -1
View File
@@ -1,9 +1,9 @@
import { useContext, useMemo } from "react"; import { useContext, useMemo } from "react";
import { SettingsContext } from "utils/contexts/settings";
import Error from "./error"; import Error from "./error";
import { BlockHighlightContext } from "./highlight-context"; import { BlockHighlightContext } from "./highlight-context";
import { SettingsContext } from "utils/contexts/settings";
import { buildHighlightConfig } from "utils/highlights"; import { buildHighlightConfig } from "utils/highlights";
const ALIASED_WIDGETS = { const ALIASED_WIDGETS = {
+1
View File
@@ -1,5 +1,6 @@
import classNames from "classnames"; import classNames from "classnames";
import { useContext } from "react"; import { useContext } from "react";
import { TabContext } from "utils/contexts/tab"; import { TabContext } from "utils/contexts/tab";
function slugify(tabName) { function slugify(tabName) {
+1
View File
@@ -2,6 +2,7 @@ import { Popover, Transition } from "@headlessui/react";
import classNames from "classnames"; import classNames from "classnames";
import { Fragment, useContext } from "react"; import { Fragment, useContext } from "react";
import { IoColorPalette } from "react-icons/io5"; import { IoColorPalette } from "react-icons/io5";
import { ColorContext } from "utils/contexts/color"; import { ColorContext } from "utils/contexts/color";
const colors = [ const colors = [
+5 -1
View File
@@ -12,7 +12,11 @@ export default function SignOut() {
return ( return (
<div id="signout" className="rounded-full flex align-middle self-center mr-3"> <div id="signout" className="rounded-full flex align-middle self-center mr-3">
<button type="button" onClick={() => signOut({ callbackUrl: "/" })} className="outline-hidden"> <button
type="button"
onClick={() => signOut({ callbackUrl: "/auth/signin?autologin=0" })}
className="outline-hidden"
>
<MdLogout className="text-theme-800 dark:text-theme-200 w-6 h-6 cursor-pointer" aria-hidden="true" /> <MdLogout className="text-theme-800 dark:text-theme-200 w-6 h-6 cursor-pointer" aria-hidden="true" />
<span className="sr-only">{t("auth.signout")}</span> <span className="sr-only">{t("auth.signout")}</span>
</button> </button>
+2 -1
View File
@@ -32,6 +32,7 @@ describe("components/toggles/signout", () => {
const { getByRole } = render(<SignOut />); const { getByRole } = render(<SignOut />);
fireEvent.click(getByRole("button")); fireEvent.click(getByRole("button"));
expect(signOut).toHaveBeenCalledWith({ callbackUrl: "/" }); // Not "/", which would bounce straight back into the provider when auto-login is on
expect(signOut).toHaveBeenCalledWith({ callbackUrl: "/auth/signin?autologin=0" });
}); });
}); });
+1
View File
@@ -1,5 +1,6 @@
import { useContext } from "react"; import { useContext } from "react";
import { MdDarkMode, MdLightMode, MdToggleOff, MdToggleOn } from "react-icons/md"; import { MdDarkMode, MdLightMode, MdToggleOff, MdToggleOn } from "react-icons/md";
import { ThemeContext } from "utils/contexts/theme"; import { ThemeContext } from "utils/contexts/theme";
export default function ThemeToggle() { export default function ThemeToggle() {
+2 -1
View File
@@ -4,13 +4,14 @@ import { useContext } from "react";
import { FaMemory, FaRegClock, FaThermometerHalf } from "react-icons/fa"; import { FaMemory, FaRegClock, FaThermometerHalf } from "react-icons/fa";
import { FiCpu, FiHardDrive } from "react-icons/fi"; import { FiCpu, FiHardDrive } from "react-icons/fi";
import useSWR from "swr"; import useSWR from "swr";
import { SettingsContext } from "utils/contexts/settings";
import Error from "../widget/error"; import Error from "../widget/error";
import Resource from "../widget/resource"; import Resource from "../widget/resource";
import Resources from "../widget/resources"; import Resources from "../widget/resources";
import WidgetLabel from "../widget/widget_label"; import WidgetLabel from "../widget/widget_label";
import { SettingsContext } from "utils/contexts/settings";
const defaultCpuSensorLabels = ["cpu_thermal", "Core", "Tctl", "Temperature"]; const defaultCpuSensorLabels = ["cpu_thermal", "Core", "Tctl", "Temperature"];
function convertToFahrenheit(t) { function convertToFahrenheit(t) {
+2 -2
View File
@@ -1,8 +1,8 @@
import ResolvedIcon from "components/resolvedicon";
import Container from "../widget/container"; import Container from "../widget/container";
import Raw from "../widget/raw"; import Raw from "../widget/raw";
import ResolvedIcon from "components/resolvedicon";
export default function Logo({ options }) { export default function Logo({ options }) {
return ( return (
<Container <Container
+2
View File
@@ -139,6 +139,8 @@ export default function Search({ options }) {
}, [selectedProvider, options, query, searchSuggestions]); }, [selectedProvider, options, query, searchSuggestions]);
function doSearch(value) { function doSearch(value) {
if (!value) return;
const q = encodeURIComponent(value); const q = encodeURIComponent(value);
const { url } = selectedProvider; const { url } = selectedProvider;
if (url) { if (url) {
+28 -1
View File
@@ -24,7 +24,19 @@ vi.mock("@headlessui/react", async () => {
<div>{children}</div> <div>{children}</div>
</ComboboxContext.Provider> </ComboboxContext.Provider>
), ),
ComboboxInput: (props) => <input {...props} />, ComboboxInput: (props) => {
const ctx = useContext(ComboboxContext);
// real headlessui fires onChange(null) when the input is cleared
return (
<input
{...props}
onChange={(event) => {
props.onChange?.(event);
if (event.target.value === "") ctx?.onChange?.(null);
}}
/>
);
},
ComboboxOption: ({ as: As = "div", value, children, ...props }) => { ComboboxOption: ({ as: As = "div", value, children, ...props }) => {
const ctx = useContext(ComboboxContext); const ctx = useContext(ComboboxContext);
const content = typeof children === "function" ? children({ active: false }) : children; const content = typeof children === "function" ? children({ active: false }) : children;
@@ -83,6 +95,21 @@ describe("components/widgets/search", () => {
openSpy.mockRestore(); openSpy.mockRestore();
}); });
it("does not search when the input is cleared", () => {
const openSpy = vi.spyOn(window, "open").mockImplementation(() => null);
renderWithProviders(<Search options={{ provider: ["google"], showSearchSuggestions: false, target: "_self" }} />, {
settings: {},
});
const input = screen.getByPlaceholderText("search.placeholder");
fireEvent.change(input, { target: { value: "a" } });
fireEvent.change(input, { target: { value: "" } });
expect(openSpy).not.toHaveBeenCalled();
openSpy.mockRestore();
});
it("accepts provider configured as a string", () => { it("accepts provider configured as a string", () => {
const openSpy = vi.spyOn(window, "open").mockImplementation(() => null); const openSpy = vi.spyOn(window, "open").mockImplementation(() => null);
+2 -1
View File
@@ -1,6 +1,7 @@
import ErrorBoundary from "components/errorboundry";
import dynamic from "next/dynamic"; import dynamic from "next/dynamic";
import ErrorBoundary from "components/errorboundry";
const widgetMappings = { const widgetMappings = {
weatherapi: dynamic(() => import("components/widgets/weather/weather")), weatherapi: dynamic(() => import("components/widgets/weather/weather")),
openweathermap: dynamic(() => import("components/widgets/openweathermap/weather")), openweathermap: dynamic(() => import("components/widgets/openweathermap/weather")),
+2 -1
View File
@@ -1,12 +1,13 @@
import classNames from "classnames"; import classNames from "classnames";
import { useContext } from "react"; import { useContext } from "react";
import { SettingsContext } from "utils/contexts/settings";
import PrimaryText from "./primary_text"; import PrimaryText from "./primary_text";
import Raw from "./raw"; import Raw from "./raw";
import SecondaryText from "./secondary_text"; import SecondaryText from "./secondary_text";
import WidgetIcon from "./widget_icon"; import WidgetIcon from "./widget_icon";
import { SettingsContext } from "utils/contexts/settings";
export function getAllClasses(options, additionalClassNames = "") { export function getAllClasses(options, additionalClassNames = "") {
if (options?.style?.header === "boxedWidgets") { if (options?.style?.header === "boxedWidgets") {
if (options?.style?.cardBlur !== undefined) { if (options?.style?.cardBlur !== undefined) {
+3 -2
View File
@@ -32,7 +32,7 @@ export async function middleware(req) {
return NextResponse.json({ error: "Host validation failed. See logs for more details." }, { status: 400 }); return NextResponse.json({ error: "Host validation failed. See logs for more details." }, { status: 400 });
} }
const pathname = new URL(req.url).pathname; const { pathname, search } = new URL(req.url);
const isPublicAuthPath = pathname.startsWith("/api/healthcheck") || pathname === "/api/config/custom.css"; const isPublicAuthPath = pathname.startsWith("/api/healthcheck") || pathname === "/api/config/custom.css";
if (authEnabled && !isPublicAuthPath) { if (authEnabled && !isPublicAuthPath) {
// The MCP API handler authorizes both bearer tokens and Homepage sessions. // The MCP API handler authorizes both bearer tokens and Homepage sessions.
@@ -43,7 +43,8 @@ export async function middleware(req) {
const token = await getToken({ req, secret: authSecret }); const token = await getToken({ req, secret: authSecret });
if (!token) { if (!token) {
const signInUrl = new URL("/auth/signin", req.url); const signInUrl = new URL("/auth/signin", req.url);
signInUrl.searchParams.set("callbackUrl", "/"); // Same-origin by construction, so this cannot be used as an open redirect
signInUrl.searchParams.set("callbackUrl", `${pathname}${search}`);
return withPrivateCache(NextResponse.redirect(signInUrl)); return withPrivateCache(NextResponse.redirect(signInUrl));
} }
} }
+12
View File
@@ -153,6 +153,18 @@ describe("middleware", () => {
expect(String(res.url)).toContain("/auth/signin"); expect(String(res.url)).toContain("/auth/signin");
}); });
it("preserves the requested path and query as the callback url", async () => {
process.env.HOMEPAGE_AUTH_ENABLED = "true";
process.env.HOMEPAGE_AUTH_SECRET = "secret";
getToken.mockResolvedValueOnce(null);
const middleware = await loadMiddleware();
const res = await middleware(createReq("localhost:3000", "http://localhost:3000/some/page?tab=2"));
expect(new URL(res.url).searchParams.get("callbackUrl")).toBe("/some/page?tab=2");
});
it("allows requests when auth is enabled and a token is present", async () => { it("allows requests when auth is enabled and a token is present", async () => {
process.env.HOMEPAGE_AUTH_ENABLED = "true"; process.env.HOMEPAGE_AUTH_ENABLED = "true";
process.env.HOMEPAGE_AUTH_SECRET = "secret"; process.env.HOMEPAGE_AUTH_SECRET = "secret";
+3 -2
View File
@@ -5,13 +5,14 @@ import "styles/globals.css";
import "styles/manrope.css"; import "styles/manrope.css";
import "styles/theme.css"; import "styles/theme.css";
import { SWRConfig } from "swr"; import { SWRConfig } from "swr";
import nextI18nextConfig from "../../next-i18next.config";
import { ColorProvider } from "utils/contexts/color"; import { ColorProvider } from "utils/contexts/color";
import { SettingsProvider } from "utils/contexts/settings"; import { SettingsProvider } from "utils/contexts/settings";
import { TabProvider } from "utils/contexts/tab"; import { TabProvider } from "utils/contexts/tab";
import { ThemeProvider } from "utils/contexts/theme"; import { ThemeProvider } from "utils/contexts/theme";
import nextI18nextConfig from "../../next-i18next.config";
const tailwindSafelist = [ const tailwindSafelist = [
// TODO: remove pending https://github.com/tailwindlabs/tailwindcss/pull/17147 // TODO: remove pending https://github.com/tailwindlabs/tailwindcss/pull/17147
"backdrop-blur", "backdrop-blur",
+21
View File
@@ -0,0 +1,21 @@
import { getDockerStats } from "utils/docker/stats";
import createLogger from "utils/logger";
const logger = createLogger("dockerStats");
export default async function handler(req, res) {
try {
const result = await getDockerStats(req.query.server);
if (result.error) {
return res.status(500).send({ error: result.error });
}
return res.status(200).json(result);
} catch (e) {
if (e) logger.error(e);
return res.status(500).send({
error: { message: e?.message ?? "Unknown error" },
});
}
}
@@ -1,88 +0,0 @@
import Docker from "dockerode";
import getDockerArguments from "utils/config/docker";
import createLogger from "utils/logger";
const logger = createLogger("dockerStatsService");
export default async function handler(req, res) {
const { service } = req.query;
const [containerName, containerServer] = service;
if (!containerName && !containerServer) {
return res.status(400).send({
error: "docker query parameters are required",
});
}
try {
const dockerArgs = getDockerArguments(containerServer);
const docker = new Docker(dockerArgs.conn);
const containers = await docker.listContainers({
all: true,
});
// bad docker connections can result in a <Buffer ...> object?
// in any case, this ensures the result is the expected array
if (!Array.isArray(containers)) {
return res.status(500).send({
error: "query failed",
});
}
const containerNames = containers.flatMap((container) => container.Names.map((name) => name.replace(/^\//, "")));
const containerExists = containerNames.includes(containerName);
if (containerExists) {
const container = docker.getContainer(containerName);
const stats = await container.stats({ stream: false });
return res.status(200).json({
stats,
});
}
// Try with a service deployed in Docker Swarm, if enabled
if (dockerArgs.swarm) {
const tasks = await docker
.listTasks({
filters: {
service: [containerName],
// A service can have several offline containers, so we only look for an active one.
"desired-state": ["running"],
},
})
.catch(() => []);
// TODO: Show the result for all replicas/containers?
// We can only get stats for 'local' containers so try to find one
const localContainerIDs = containers.map((c) => c.Id);
const task = tasks.find((t) => localContainerIDs.includes(t.Status?.ContainerStatus?.ContainerID)) ?? tasks.at(0);
const taskContainerId = task?.Status?.ContainerStatus?.ContainerID;
if (taskContainerId) {
try {
const container = docker.getContainer(taskContainerId);
const stats = await container.stats({ stream: false });
return res.status(200).json({
stats,
});
} catch (e) {
return res.status(200).json({
error: "Unable to retrieve stats",
});
}
}
}
return res.status(404).send({
error: "not found",
});
} catch (e) {
if (e) logger.error(e);
return res.status(500).send({
error: { message: e?.message ?? "Unknown error" },
});
}
}
-116
View File
@@ -1,116 +0,0 @@
import Docker from "dockerode";
import getDockerArguments from "utils/config/docker";
import createLogger from "utils/logger";
const logger = createLogger("dockerStatusService");
export default async function handler(req, res) {
const { service } = req.query;
const [containerName, containerServer] = service;
if (!containerName && !containerServer) {
return res.status(400).send({
error: "docker query parameters are required",
});
}
try {
const dockerArgs = getDockerArguments(containerServer);
const docker = new Docker(dockerArgs.conn);
const containers = await docker.listContainers({
all: true,
});
// bad docker connections can result in a <Buffer ...> object?
// in any case, this ensures the result is the expected array
if (!Array.isArray(containers)) {
return res.status(500).send({
error: "query failed",
});
}
const containerNames = containers.flatMap((container) => container.Names.map((name) => name.replace(/^\//, "")));
const containerExists = containerNames.includes(containerName);
if (containerExists) {
const container = docker.getContainer(containerName);
const info = await container.inspect();
return res.status(200).json({
status: info.State.Status,
health: info.State.Health?.Status,
});
}
if (dockerArgs.swarm) {
const serviceInfo = await docker
.getService(containerName)
.inspect()
.catch(() => undefined);
if (!serviceInfo) {
return res.status(404).send({
status: "not found",
});
}
const tasks = await docker
.listTasks({
filters: {
service: [containerName],
"desired-state": ["running"],
},
})
.catch(() => []);
if (serviceInfo.Spec.Mode?.Replicated) {
// Replicated service, check n replicas
const replicas = parseInt(serviceInfo.Spec.Mode?.Replicated?.Replicas, 10);
if (tasks.length === replicas) {
return res.status(200).json({
status: `running ${tasks.length}/${replicas}`,
});
}
if (tasks.length > 0) {
return res.status(200).json({
status: `partial ${tasks.length}/${replicas}`,
});
}
} else {
// Global service, prefer 'local' containers
const localContainerIDs = containers.map((c) => c.Id);
const task =
tasks.find((t) => localContainerIDs.includes(t.Status?.ContainerStatus?.ContainerID)) ?? tasks.at(0);
const taskContainerId = task?.Status?.ContainerStatus?.ContainerID;
if (taskContainerId) {
try {
const container = docker.getContainer(taskContainerId);
const info = await container.inspect();
return res.status(200).json({
status: info.State.Status,
health: info.State.Health?.Status,
});
} catch (e) {
if (task) {
return res.status(200).json({
status: task.Status.State,
});
}
}
}
}
}
return res.status(404).send({
status: "not found",
});
} catch (e) {
if (e) logger.error(e);
return res.status(500).send({
error: { message: e?.message ?? "Unknown error" },
});
}
}
+21
View File
@@ -0,0 +1,21 @@
import { getDockerStatuses } from "utils/docker/status";
import createLogger from "utils/logger";
const logger = createLogger("dockerStatuses");
export default async function handler(req, res) {
try {
const result = await getDockerStatuses(req.query.server);
if (result.error) {
return res.status(500).send({ error: result.error });
}
return res.status(200).json(result);
} catch (e) {
if (e) logger.error(e);
return res.status(500).send({
error: { message: e?.message ?? "Unknown error" },
});
}
}
-1
View File
@@ -1,5 +1,4 @@
import { searchProviders } from "components/widgets/search/search"; import { searchProviders } from "components/widgets/search/search";
import { getSettings } from "utils/config/config"; import { getSettings } from "utils/config/config";
import { widgetsFromConfig } from "utils/config/widget-helpers"; import { widgetsFromConfig } from "utils/config/widget-helpers";
import { cachedRequest } from "utils/proxy/http"; import { cachedRequest } from "utils/proxy/http";
+5 -1
View File
@@ -63,6 +63,8 @@ export default async function handler(req, res) {
if (serviceProxyHandler instanceof Function) { if (serviceProxyHandler instanceof Function) {
// quick return for no endpoint services, calendar is an exception // quick return for no endpoint services, calendar is an exception
if (!req.query.endpoint || serviceProxyHandler === calendarProxyHandler) { if (!req.query.endpoint || serviceProxyHandler === calendarProxyHandler) {
req.method = "GET";
req.body = undefined;
return await serviceProxyHandler(req, res); return await serviceProxyHandler(req, res);
} }
@@ -86,7 +88,7 @@ export default async function handler(req, res) {
} }
req.method = mapping?.method || "GET"; req.method = mapping?.method || "GET";
if (mapping?.body) req.body = mapping?.body; req.body = mapping?.body;
req.query.endpoint = endpoint; req.query.endpoint = endpoint;
if (mapping.segments || req.query.segments) { if (mapping.segments || req.query.segments) {
@@ -125,6 +127,8 @@ export default async function handler(req, res) {
if (widget.allowedEndpoints instanceof RegExp) { if (widget.allowedEndpoints instanceof RegExp) {
if (widget.allowedEndpoints.test(req.query.endpoint)) { if (widget.allowedEndpoints.test(req.query.endpoint)) {
req.method = "GET";
req.body = undefined;
return await serviceProxyHandler(req, res); return await serviceProxyHandler(req, res);
} }
} }
+229
View File
@@ -0,0 +1,229 @@
import { beforeEach, describe, expect, it, vi } from "vitest";
import createMockRes from "test-utils/create-mock-res";
const { getServiceWidget, logger, genericHandler, allowedHandler, mappedHandler, calendarHandler } = vi.hoisted(() => ({
getServiceWidget: vi.fn(),
logger: { debug: vi.fn(), error: vi.fn() },
genericHandler: vi.fn(),
allowedHandler: vi.fn(),
mappedHandler: vi.fn(),
calendarHandler: vi.fn(),
}));
vi.mock("utils/logger", () => ({
default: () => logger,
}));
vi.mock("utils/config/service-helpers", () => ({
default: getServiceWidget,
}));
vi.mock("widgets/calendar/proxy", () => ({
default: calendarHandler,
}));
vi.mock("widgets/widgets", () => ({
default: {
noendpoint: {
api: "{url}",
proxyHandler: genericHandler,
},
allowed: {
api: "{url}/api/{endpoint}",
proxyHandler: allowedHandler,
allowedEndpoints: /^status$/,
},
mapped: {
api: "{url}/{endpoint}",
proxyHandler: mappedHandler,
mappings: {
Sessions: {
endpoint: "Sessions",
},
Pause: {
method: "POST",
endpoint: "Sessions/Playing/Pause",
body: "mapping-body",
},
Refresh: {
method: "POST",
endpoint: "Sessions/Refresh",
},
},
},
ical: {
api: "{url}",
proxyHandler: calendarHandler,
},
},
}));
import handler from "./proxy";
function createReq({ method = "GET", body, query = {} } = {}) {
return { method, body, query };
}
describe("pages/api/services/proxy", () => {
beforeEach(() => {
vi.clearAllMocks();
});
describe("client request shaping", () => {
it("forces GET and drops the body on the no-endpoint quick return", async () => {
getServiceWidget.mockResolvedValue({ type: "noendpoint", url: "http://example" });
const req = createReq({
method: "POST",
body: '{"cmd":"delete_all"}',
query: { group: "g", service: "svc", index: "0" },
});
await handler(req, createMockRes());
expect(genericHandler).toHaveBeenCalledTimes(1);
const forwarded = genericHandler.mock.calls[0][0];
expect(forwarded.method).toBe("GET");
expect(forwarded.body).toBeUndefined();
});
it.each(["PUT", "DELETE", "PATCH"])("forces GET for a %s on the no-endpoint quick return", async (method) => {
getServiceWidget.mockResolvedValue({ type: "noendpoint", url: "http://example" });
const req = createReq({ method, body: "payload", query: { group: "g", service: "svc", index: "0" } });
await handler(req, createMockRes());
const forwarded = genericHandler.mock.calls[0][0];
expect(forwarded.method).toBe("GET");
expect(forwarded.body).toBeUndefined();
});
it("forces GET and drops the body on the allowedEndpoints path", async () => {
getServiceWidget.mockResolvedValue({ type: "allowed", url: "http://example" });
const req = createReq({
method: "DELETE",
body: "payload",
query: { group: "g", service: "svc", endpoint: "status", index: "0" },
});
await handler(req, createMockRes());
expect(allowedHandler).toHaveBeenCalledTimes(1);
const forwarded = allowedHandler.mock.calls[0][0];
expect(forwarded.method).toBe("GET");
expect(forwarded.body).toBeUndefined();
});
it("forces GET and drops the body on the calendar exception path", async () => {
getServiceWidget.mockResolvedValue({ type: "calendar", url: "http://example" });
const req = createReq({
method: "POST",
body: "payload",
query: { group: "g", service: "svc", endpoint: "events", index: "0" },
});
await handler(req, createMockRes());
expect(calendarHandler).toHaveBeenCalledTimes(1);
const forwarded = calendarHandler.mock.calls[0][0];
expect(forwarded.method).toBe("GET");
expect(forwarded.body).toBeUndefined();
});
it("forces GET for a mapping that does not declare a method", async () => {
getServiceWidget.mockResolvedValue({ type: "mapped", url: "http://example" });
const req = createReq({
method: "POST",
body: "payload",
query: { group: "g", service: "svc", endpoint: "Sessions", index: "0" },
});
await handler(req, createMockRes());
const forwarded = mappedHandler.mock.calls[0][0];
expect(forwarded.method).toBe("GET");
expect(forwarded.body).toBeUndefined();
});
it("drops a client body when a non-GET mapping does not declare one", async () => {
getServiceWidget.mockResolvedValue({ type: "mapped", url: "http://example" });
const req = createReq({
method: "POST",
body: "attacker-controlled",
query: { group: "g", service: "svc", endpoint: "Refresh", index: "0" },
});
await handler(req, createMockRes());
const forwarded = mappedHandler.mock.calls[0][0];
expect(forwarded.method).toBe("POST");
expect(forwarded.body).toBeUndefined();
});
});
describe("mapping opt-in", () => {
it("still allows a mapping to declare a non-GET method and body", async () => {
getServiceWidget.mockResolvedValue({ type: "mapped", url: "http://example" });
const req = createReq({
method: "POST",
query: { group: "g", service: "svc", endpoint: "Pause", index: "0" },
});
await handler(req, createMockRes());
expect(mappedHandler).toHaveBeenCalledTimes(1);
const forwarded = mappedHandler.mock.calls[0][0];
expect(forwarded.method).toBe("POST");
expect(forwarded.body).toBe("mapping-body");
expect(forwarded.query.endpoint).toBe("Sessions/Playing/Pause");
});
it("rejects a method that does not match the mapping", async () => {
getServiceWidget.mockResolvedValue({ type: "mapped", url: "http://example" });
const req = createReq({
method: "GET",
query: { group: "g", service: "svc", endpoint: "Pause", index: "0" },
});
const res = createMockRes();
await handler(req, res);
expect(mappedHandler).not.toHaveBeenCalled();
expect(res.statusCode).toBe(403);
expect(res.body).toEqual({ error: "Unsupported method" });
});
});
describe("dispatch guards", () => {
it("rejects an endpoint that fails the allowedEndpoints test", async () => {
getServiceWidget.mockResolvedValue({ type: "allowed", url: "http://example" });
const req = createReq({ query: { group: "g", service: "svc", endpoint: "shutdown", index: "0" } });
const res = createMockRes();
await handler(req, res);
expect(allowedHandler).not.toHaveBeenCalled();
expect(res.statusCode).toBe(403);
expect(res.body).toEqual({ error: "Unmapped proxy request." });
});
it("rejects an unknown widget type", async () => {
getServiceWidget.mockResolvedValue({ type: "nope", url: "http://example" });
const req = createReq({ query: { group: "g", service: "svc", index: "0" } });
const res = createMockRes();
await handler(req, res);
expect(res.statusCode).toBe(403);
expect(res.body).toEqual({ error: "Unknown proxy service type" });
});
});
});
+43 -5
View File
@@ -1,14 +1,16 @@
import classNames from "classnames"; import classNames from "classnames";
import { signIn } from "next-auth/react"; import { signIn } from "next-auth/react";
import { useRouter } from "next/router"; import { useRouter } from "next/router";
import { useEffect, useMemo, useState } from "react"; import { useEffect, useMemo, useRef, useState } from "react";
import { BiShieldQuarter } from "react-icons/bi"; import { BiShieldQuarter } from "react-icons/bi";
import { getSettings } from "utils/config/config"; import { getSettings } from "utils/config/config";
const PUBLIC_SIGN_IN_SETTINGS = ["theme", "color", "title", "background", "backgroundOpacity"]; const PUBLIC_SIGN_IN_SETTINGS = ["theme", "color", "title", "background", "backgroundOpacity"];
const AUTO_LOGIN_KEY = "homepage-autologin-attempt";
const AUTO_LOGIN_RETRY_MS = 10000;
export default function SignIn({ providers, settings }) { export default function SignIn({ providers, settings, autoLogin }) {
const router = useRouter(); const router = useRouter();
const [password, setPassword] = useState(""); const [password, setPassword] = useState("");
const theme = settings?.theme || "dark"; const theme = settings?.theme || "dark";
@@ -20,6 +22,36 @@ export default function SignIn({ providers, settings }) {
}, [router.query?.callbackUrl]); }, [router.query?.callbackUrl]);
const error = router.query?.error; const error = router.query?.error;
const oidcProvider = useMemo(
() => Object.values(providers ?? {}).find((provider) => provider.type !== "credentials"),
[providers],
);
// Try to avoid auto-login loop, e.g. if there was an error (or explicitly disabled via query param)
const autoLoginBlocked = Boolean(error) || router.query?.autologin === "0";
const redirecting = Boolean(autoLogin && oidcProvider && !autoLoginBlocked);
const attempted = useRef(false);
useEffect(() => {
if (!redirecting || attempted.current) return;
attempted.current = true;
let lastAttempt = 0;
try {
lastAttempt = Number(window.sessionStorage.getItem(AUTO_LOGIN_KEY)) || 0;
window.sessionStorage.setItem(AUTO_LOGIN_KEY, String(Date.now()));
} catch {
// sessionStorage throws when site data is blocked, fall through and redirect anyway
}
// Getting here quickly means the session never stuck, hand it back to the user
if (Date.now() - lastAttempt < AUTO_LOGIN_RETRY_MS) {
router.replace(`/auth/signin?autologin=0&callbackUrl=${encodeURIComponent(callbackUrl)}`);
return;
}
signIn(oidcProvider.id, { callbackUrl });
}, [redirecting, oidcProvider, callbackUrl, router]);
let backgroundImage = ""; let backgroundImage = "";
let opacity = settings?.backgroundOpacity ?? 0; let opacity = settings?.backgroundOpacity ?? 0;
let backgroundBlur = false; let backgroundBlur = false;
@@ -143,7 +175,12 @@ export default function SignIn({ providers, settings }) {
<div className="rounded-2xl border border-white/60 bg-white/70 p-6 shadow-lg shadow-black/5 dark:border-white/10 dark:bg-slate-900/70"> <div className="rounded-2xl border border-white/60 bg-white/70 p-6 shadow-lg shadow-black/5 dark:border-white/10 dark:bg-slate-900/70">
<h2 className="text-lg font-semibold text-gray-900 dark:text-slate-100">Sign in</h2> <h2 className="text-lg font-semibold text-gray-900 dark:text-slate-100">Sign in</h2>
<div className="mt-6 space-y-3"> <div className="mt-6 space-y-3">
{hasPasswordProvider && ( {redirecting && (
<p className="text-sm text-gray-600 dark:text-slate-300">
Redirecting to {oidcProvider?.name}&hellip;
</p>
)}
{!redirecting && hasPasswordProvider && (
<form <form
className="space-y-3" className="space-y-3"
onSubmit={async (event) => { onSubmit={async (event) => {
@@ -173,7 +210,8 @@ export default function SignIn({ providers, settings }) {
</button> </button>
</form> </form>
)} )}
{!hasPasswordProvider && {!redirecting &&
!hasPasswordProvider &&
Object.values(providers).map((provider) => ( Object.values(providers).map((provider) => (
<button <button
key={provider.id} key={provider.id}
@@ -218,6 +256,6 @@ export async function getServerSideProps(context) {
]), ]),
); );
return { return {
props: { providers, settings }, props: { providers, settings, autoLogin: process.env.HOMEPAGE_OIDC_AUTO_LOGIN === "true" },
}; };
} }
+10 -10
View File
@@ -1,11 +1,4 @@
import classNames from "classnames"; import classNames from "classnames";
import BookmarksGroup from "components/bookmarks/group";
import ErrorBoundary from "components/errorboundry";
import QuickLaunch from "components/quicklaunch";
import ServicesGroup from "components/services/group";
import Tab, { slugifyAndEncode } from "components/tab";
import Revalidate from "components/toggles/revalidate";
import Widget from "components/widgets/widget";
import { useTranslation } from "next-i18next/pages"; import { useTranslation } from "next-i18next/pages";
import { serverSideTranslations } from "next-i18next/pages/serverSideTranslations"; import { serverSideTranslations } from "next-i18next/pages/serverSideTranslations";
import dynamic from "next/dynamic"; import dynamic from "next/dynamic";
@@ -15,13 +8,20 @@ import Script from "next/script";
import { useCallback, useContext, useEffect, useMemo, useState } from "react"; import { useCallback, useContext, useEffect, useMemo, useState } from "react";
import { BiError } from "react-icons/bi"; import { BiError } from "react-icons/bi";
import useSWR, { SWRConfig } from "swr"; import useSWR, { SWRConfig } from "swr";
import BookmarksGroup from "components/bookmarks/group";
import ErrorBoundary from "components/errorboundry";
import QuickLaunch from "components/quicklaunch";
import ServicesGroup from "components/services/group";
import Tab, { slugifyAndEncode } from "components/tab";
import Revalidate from "components/toggles/revalidate";
import Widget from "components/widgets/widget";
import { bookmarksResponse, servicesResponse, widgetsResponse } from "utils/config/api-response";
import { getSettings } from "utils/config/config";
import { ColorContext } from "utils/contexts/color"; import { ColorContext } from "utils/contexts/color";
import { SettingsContext } from "utils/contexts/settings"; import { SettingsContext } from "utils/contexts/settings";
import { TabContext } from "utils/contexts/tab"; import { TabContext } from "utils/contexts/tab";
import { ThemeContext } from "utils/contexts/theme"; import { ThemeContext } from "utils/contexts/theme";
import { bookmarksResponse, servicesResponse, widgetsResponse } from "utils/config/api-response";
import { getSettings } from "utils/config/config";
import useWindowFocus from "utils/hooks/window-focus"; import useWindowFocus from "utils/hooks/window-focus";
import createLogger from "utils/logger"; import createLogger from "utils/logger";
import themes from "utils/styles/themes"; import themes from "utils/styles/themes";
+1
View File
@@ -1,4 +1,5 @@
import { render } from "@testing-library/react"; import { render } from "@testing-library/react";
import { SettingsContext } from "utils/contexts/settings"; import { SettingsContext } from "utils/contexts/settings";
export function renderWithProviders(ui, { settings = {} } = {}) { export function renderWithProviders(ui, { settings = {} } = {}) {
+55 -21
View File
@@ -60,6 +60,46 @@ export async function servicesFromConfig() {
return parseServicesToGroups(services); return parseServicesToGroups(services);
} }
function flattenServices(groups, services = []) {
groups.forEach((group) => {
(group.services ?? []).forEach((service) => services.push(service));
flattenServices(group.groups ?? [], services);
});
return services;
}
function dockerWidgets(service) {
const widgets = service.widget ? [service.widget, ...(service.widgets ?? [])] : (service.widgets ?? []);
return widgets.filter((widget) => widget?.type === "docker");
}
export async function containersFromConfig(server) {
const target = server || "";
const services = flattenServices(await servicesFromConfig());
// services and docker widgets both carry container + server
const refs = services.flatMap((service) => [service, ...dockerWidgets(service)]);
const matching = refs.filter((ref) => ref.container && (ref.server || "") === target);
return new Set(matching.map((ref) => ref.container));
}
// homepage.foo -> foo, homepage.instance.<this instance>.foo -> foo, another instance -> null
export function homepageLabelValue(label, instanceName) {
if (!label.startsWith("homepage.")) return null;
const value = label.replace("homepage.", "");
if (!value.startsWith("instance.")) return value;
if (instanceName && value.startsWith(`instance.${instanceName}.`)) {
return value.replace(`instance.${instanceName}.`, "");
}
return null;
}
export function hasHomepageLabels(labels, instanceName) {
return Object.keys(labels ?? {}).some((label) => homepageLabelValue(label, instanceName) !== null);
}
export async function servicesFromDocker() { export async function servicesFromDocker() {
checkAndCopyConfig("docker.yaml"); checkAndCopyConfig("docker.yaml");
@@ -95,29 +135,23 @@ export async function servicesFromDocker() {
const containerLabels = isSwarm ? shvl.get(container, "Spec.Labels") : container.Labels; const containerLabels = isSwarm ? shvl.get(container, "Spec.Labels") : container.Labels;
const containerName = isSwarm ? shvl.get(container, "Spec.Name") : container.Names[0]; const containerName = isSwarm ? shvl.get(container, "Spec.Name") : container.Names[0];
Object.keys(containerLabels).forEach((label) => { Object.keys(containerLabels ?? {}).forEach((label) => {
if (label.startsWith("homepage.")) { const value = homepageLabelValue(label, instanceName);
let value = label.replace("homepage.", ""); if (value === null) return;
if (instanceName && value.startsWith(`instance.${instanceName}.`)) {
value = value.replace(`instance.${instanceName}.`, "");
} else if (value.startsWith("instance.")) {
return;
}
if (!constructedService) { if (!constructedService) {
constructedService = { constructedService = {
container: containerName.replace(/^\//, ""), container: containerName.replace(/^\//, ""),
server: serverName, server: serverName,
weight: 0, weight: 0,
type: "service", type: "service",
}; };
}
let substitutedVal = substituteEnvironmentVars(containerLabels[label]);
if (value === "widget.version" || /^widgets\[\d+\]\.version$/.test(value)) {
substitutedVal = parseVersionForUrl(substitutedVal);
}
shvl.set(constructedService, value, substitutedVal);
} }
let substitutedVal = substituteEnvironmentVars(containerLabels[label]);
if (value === "widget.version" || /^widgets\[\d+\]\.version$/.test(value)) {
substitutedVal = parseVersionForUrl(substitutedVal);
}
shvl.set(constructedService, value, substitutedVal);
}); });
if (constructedService && (!constructedService.name || !constructedService.group)) { if (constructedService && (!constructedService.name || !constructedService.group)) {
+113
View File
@@ -103,6 +103,119 @@ describe("utils/config/service-helpers", () => {
expect(await mod.servicesFromConfig()).toEqual([]); expect(await mod.servicesFromConfig()).toEqual([]);
}); });
it("containersFromConfig returns an empty set when services.yaml is empty", async () => {
state.servicesYaml = null;
const mod = await import("./service-helpers");
expect(await mod.containersFromConfig("local")).toEqual(new Set());
});
it("containersFromConfig only returns containers for the requested server", async () => {
state.servicesYaml = [
{ Group: [{ App: { container: "app", server: "local" } }, { Other: { container: "other", server: "remote" } }] },
];
const mod = await import("./service-helpers");
expect(await mod.containersFromConfig("local")).toEqual(new Set(["app"]));
expect(await mod.containersFromConfig("remote")).toEqual(new Set(["other"]));
});
it("containersFromConfig maps a service without a server to the default connection", async () => {
state.servicesYaml = [{ Group: [{ App: { container: "app" } }] }];
const mod = await import("./service-helpers");
expect(await mod.containersFromConfig("")).toEqual(new Set(["app"]));
expect(await mod.containersFromConfig(undefined)).toEqual(new Set(["app"]));
expect(await mod.containersFromConfig("local")).toEqual(new Set());
});
it("containersFromConfig recurses into nested groups", async () => {
state.servicesYaml = [
{
Main: [
{ Child: [{ Deep: { container: "deep", server: "local" } }] },
{ Root: { container: "top", server: "local" } },
],
},
];
const mod = await import("./service-helpers");
expect(await mod.containersFromConfig("local")).toEqual(new Set(["top", "deep"]));
});
it("containersFromConfig includes docker widget containers in both widget and widgets forms", async () => {
state.servicesYaml = [
{
Group: [
{ WidgetOnly: { widget: { type: "docker", container: "widgetapp", server: "local" } } },
{
WithArray: {
container: "app",
server: "local",
widgets: [
{ type: "docker", container: "sidecar", server: "local" },
{ type: "docker", container: "elsewhere", server: "remote" },
],
},
},
],
},
];
const mod = await import("./service-helpers");
expect(await mod.containersFromConfig("local")).toEqual(new Set(["widgetapp", "app", "sidecar"]));
});
it("containersFromConfig ignores non docker widgets that carry a container field", async () => {
state.servicesYaml = [
{ Group: [{ App: { widget: { type: "portainer", container: "sneaky", server: "local" } } }] },
];
const mod = await import("./service-helpers");
expect(await mod.containersFromConfig("local")).toEqual(new Set());
});
it("homepageLabelValue strips the prefix and honors instance scoping", async () => {
const mod = await import("./service-helpers");
expect(mod.homepageLabelValue("com.docker.compose.project", "foo")).toBeNull();
expect(mod.homepageLabelValue("homepage.name", undefined)).toBe("name");
expect(mod.homepageLabelValue("homepage.instance.foo.name", "foo")).toBe("name");
expect(mod.homepageLabelValue("homepage.instance.bar.name", "foo")).toBeNull();
expect(mod.homepageLabelValue("homepage.instance.bar.name", undefined)).toBeNull();
});
it("hasHomepageLabels reports whether a container opts in for this instance", async () => {
const mod = await import("./service-helpers");
expect(mod.hasHomepageLabels(undefined, "foo")).toBe(false);
expect(mod.hasHomepageLabels({}, "foo")).toBe(false);
expect(mod.hasHomepageLabels({ "com.docker.compose.project": "x" }, "foo")).toBe(false);
expect(mod.hasHomepageLabels({ "homepage.name": "X" }, undefined)).toBe(true);
expect(mod.hasHomepageLabels({ "homepage.instance.foo.name": "X" }, "foo")).toBe(true);
expect(mod.hasHomepageLabels({ "homepage.instance.bar.name": "X" }, "foo")).toBe(false);
});
it("servicesFromDocker skips containers without labels instead of failing the whole server", async () => {
state.dockerYaml = { "docker-local": {} };
state.dockerContainersByServer["docker-local"] = [
{ Names: ["/nolabels"] },
{ Names: ["/labelled"], Labels: { "homepage.group": "G", "homepage.name": "Svc" } },
];
const mod = await import("./service-helpers");
const discovered = await mod.servicesFromDocker();
expect(discovered).toEqual(
expect.arrayContaining([
expect.objectContaining({
name: "G",
services: [expect.objectContaining({ name: "Svc", container: "labelled" })],
}),
]),
);
});
it("servicesFromDocker returns [] when docker.yaml is empty", async () => { it("servicesFromDocker returns [] when docker.yaml is empty", async () => {
state.dockerYaml = null; state.dockerYaml = null;
@@ -2,7 +2,7 @@ import { describe, expect, it } from "vitest";
import { calculateCPUPercent, calculateThroughput, calculateUsedMemory } from "./stats-helpers"; import { calculateCPUPercent, calculateThroughput, calculateUsedMemory } from "./stats-helpers";
describe("widgets/docker/stats-helpers", () => { describe("utils/docker/stats-helpers", () => {
it("calculateCPUPercent returns 0 when deltas are not positive", () => { it("calculateCPUPercent returns 0 when deltas are not positive", () => {
expect( expect(
calculateCPUPercent({ calculateCPUPercent({
+92
View File
@@ -0,0 +1,92 @@
import Docker from "dockerode";
import { getSettings } from "utils/config/config";
import getDockerArguments from "utils/config/docker";
import { containersFromConfig, hasHomepageLabels } from "utils/config/service-helpers";
import { calculateCPUPercent, calculateThroughput, calculateUsedMemory } from "utils/docker/stats-helpers";
// mem and network are omitted when docker does not report them, so the widget can skip those blocks
async function statsForContainer(docker, id) {
try {
const raw = await docker.getContainer(id).stats({ stream: false });
const stats = { cpu: calculateCPUPercent(raw) };
if (raw.memory_stats?.usage) {
stats.mem = calculateUsedMemory(raw);
}
if (raw.networks) {
const { rxBytes, txBytes } = calculateThroughput(raw);
stats.rx = rxBytes;
stats.tx = txBytes;
}
return stats;
} catch (e) {
// ensure one failed call does not look like an absent container
return { error: e?.message ?? "stats unavailable" };
}
}
export async function getDockerStats(server) {
const dockerArgs = getDockerArguments(server);
const docker = new Docker(dockerArgs.conn);
const [containers, configured] = await Promise.all([
docker.listContainers({ all: true }),
containersFromConfig(server),
]);
if (!Array.isArray(containers)) {
return { error: "query failed" };
}
const { instanceName } = getSettings();
const targets = {};
const localIds = new Set();
containers.forEach((container) => {
localIds.add(container.Id);
if (container.State !== "running") return;
const labelled = hasHomepageLabels(container.Labels, instanceName);
container.Names.forEach((name) => {
const containerName = name.replace(/^\//, "");
if (labelled || configured.has(containerName)) targets[containerName] = container.Id;
});
});
if (dockerArgs.swarm) {
const [services, tasks] = await Promise.all([
docker.listServices().catch(() => []),
docker.listTasks({ filters: { "desired-state": ["running"] } }).catch(() => []),
]);
const tasksByService = {};
tasks.forEach((task) => {
(tasksByService[task.ServiceID] ??= []).push(task);
});
services.forEach((service) => {
const name = service.Spec?.Name;
if (!name || targets[name]) return;
if (!configured.has(name) && !hasHomepageLabels(service.Spec?.Labels, instanceName)) return;
// stats are only available for containers running on this node
const serviceTasks = tasksByService[service.ID] ?? [];
const task = serviceTasks.find((candidate) => localIds.has(candidate.Status?.ContainerStatus?.ContainerID));
const containerId = task?.Status?.ContainerStatus?.ContainerID;
if (containerId) targets[name] = containerId;
});
}
const names = Object.keys(targets);
const results = await Promise.all(names.map((name) => statsForContainer(docker, targets[name])));
const stats = {};
names.forEach((name, index) => {
stats[name] = results[index];
});
return { stats };
}

Some files were not shown because too many files have changed in this diff Show More