mirror of
https://github.com/gethomepage/homepage.git
synced 2026-09-23 20:45:49 -07:00
Compare commits
7 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| df52670871 | |||
| 3b26d0d3f6 | |||
| 76ad5d03cc | |||
| 9c3544eeef | |||
| e031209d68 | |||
| 802201d2a9 | |||
| 8619f93ab4 |
@@ -6,7 +6,6 @@ description: Arcane Widget Configuration
|
||||
Learn more about [Arcane](https://github.com/getarcaneapp/arcane).
|
||||
|
||||
**Allowed fields** (max 4): `running`, `stopped`, `total`, `images`, `images_used`, `images_unused`, `image_updates`.
|
||||
|
||||
**Default fields**: `running`, `stopped`, `total`, `image_updates`.
|
||||
|
||||
```yaml
|
||||
@@ -18,4 +17,4 @@ widget:
|
||||
fields: ["running", "stopped", "total", "image_updates"] # optional
|
||||
```
|
||||
|
||||
Using an API key for the widget requires permissions for: `containers:list`, `images:list`, and `image-updates:read`.
|
||||
Using an api key for the widget requires permissions for: `containers:list` `images:list and `image-updates:read`
|
||||
|
||||
@@ -106,12 +106,6 @@ function relativeDate(date, formatter) {
|
||||
const unitIndex = cutoffs.findIndex((cutoff) => cutoff > Math.abs(delta));
|
||||
const divisor = unitIndex ? cutoffs[unitIndex - 1] : 1;
|
||||
|
||||
if (units[unitIndex] === "day") {
|
||||
// compare calendar days, not elapsed 24h blocks
|
||||
const startOfDay = (d) => new Date(d.getFullYear(), d.getMonth(), d.getDate());
|
||||
return formatter.format(Math.round((startOfDay(date) - startOfDay(new Date())) / 86400000), "day");
|
||||
}
|
||||
|
||||
return formatter.format(Math.floor(delta / divisor), units[unitIndex]);
|
||||
}
|
||||
|
||||
|
||||
@@ -39,6 +39,7 @@
|
||||
"react-i18next": "^17.0.12",
|
||||
"react-icons": "^5.6.0",
|
||||
"recharts": "^3.1.2",
|
||||
"sax": "^1.6.1",
|
||||
"swr": "^2.5.1",
|
||||
"systeminformation": "^5.33.1",
|
||||
"tough-cookie": "^6.0.2",
|
||||
|
||||
Generated
+3
@@ -83,6 +83,9 @@ importers:
|
||||
recharts:
|
||||
specifier: ^3.1.2
|
||||
version: 3.10.1(@types/react@19.2.18)(react-dom@19.2.8(react@19.2.8))(react-is@17.0.2)(react@19.2.8)(redux@5.0.1)
|
||||
sax:
|
||||
specifier: ^1.6.1
|
||||
version: 1.6.1
|
||||
swr:
|
||||
specifier: ^2.5.1
|
||||
version: 2.5.1(react@19.2.8)
|
||||
|
||||
+191
-191
@@ -21,7 +21,7 @@
|
||||
"seconds": "s"
|
||||
},
|
||||
"auth": {
|
||||
"signout": "Log af"
|
||||
"signout": "Sign out"
|
||||
},
|
||||
"widget": {
|
||||
"missing_type": "Manglende Widget Type: {{type}}",
|
||||
@@ -40,8 +40,8 @@
|
||||
},
|
||||
"search": {
|
||||
"placeholder": "Søg…",
|
||||
"provider": "Søgemaskine: {{name}}",
|
||||
"select_provider": "Vælg søgemaskine"
|
||||
"provider": "Search engine: {{name}}",
|
||||
"select_provider": "Select search engine"
|
||||
},
|
||||
"resources": {
|
||||
"cpu": "CPU",
|
||||
@@ -66,29 +66,29 @@
|
||||
"wlan_devices": "WLAN Enheder",
|
||||
"lan_users": "LAN Brugere",
|
||||
"wlan_users": "WLAN Brugere",
|
||||
"up": "OP",
|
||||
"up": "UP",
|
||||
"down": "NED",
|
||||
"wait": "Vent",
|
||||
"wait": "Please wait",
|
||||
"empty_data": "Subsystem status ukendt"
|
||||
},
|
||||
"unifi_drive": {
|
||||
"healthy": "Sund",
|
||||
"degraded": "Forringet",
|
||||
"no_data": "Ingen lagringsdata tilgængelige"
|
||||
"healthy": "Healthy",
|
||||
"degraded": "Degraded",
|
||||
"no_data": "No storage data available"
|
||||
},
|
||||
"duplicati": {
|
||||
"jobs": "Jobs",
|
||||
"stored": "Gemte",
|
||||
"lastBackup": "Sidste kørsel",
|
||||
"nextRun": "Næste kørsel",
|
||||
"running": "Kører",
|
||||
"warnings": "Advarsel",
|
||||
"errors": "Fejl"
|
||||
"stored": "Stored",
|
||||
"lastBackup": "Last Run",
|
||||
"nextRun": "Next Run",
|
||||
"running": "Running",
|
||||
"warnings": "Warnings",
|
||||
"errors": "Errors"
|
||||
},
|
||||
"docker": {
|
||||
"rx": "RX",
|
||||
"tx": "TX",
|
||||
"mem": "RAM",
|
||||
"mem": "MEM",
|
||||
"cpu": "CPU",
|
||||
"running": "Kører",
|
||||
"offline": "Offline",
|
||||
@@ -100,14 +100,14 @@
|
||||
"not_found": "Ikke Fundet",
|
||||
"exited": "Forladt",
|
||||
"partial": "Delvis",
|
||||
"created": "Oprettet",
|
||||
"paused": "Sat på pause",
|
||||
"restarting": "Genstarter",
|
||||
"removing": "Fjerner",
|
||||
"dead": "Død"
|
||||
"created": "Created",
|
||||
"paused": "Paused",
|
||||
"restarting": "Restarting",
|
||||
"removing": "Removing",
|
||||
"dead": "Dead"
|
||||
},
|
||||
"ping": {
|
||||
"error": "Fejl",
|
||||
"error": "Error",
|
||||
"ping": "Ping",
|
||||
"down": "Ned",
|
||||
"up": "Op",
|
||||
@@ -115,11 +115,11 @@
|
||||
},
|
||||
"siteMonitor": {
|
||||
"http_status": "HTTP-status",
|
||||
"error": "Fejl",
|
||||
"response": "Svar",
|
||||
"down": "Ned",
|
||||
"up": "Op",
|
||||
"not_available": "Ikke tilgængelig"
|
||||
"error": "Error",
|
||||
"response": "Response",
|
||||
"down": "Down",
|
||||
"up": "Up",
|
||||
"not_available": "Not Available"
|
||||
},
|
||||
"emby": {
|
||||
"playing": "Afspiller",
|
||||
@@ -132,22 +132,22 @@
|
||||
"songs": "Sange"
|
||||
},
|
||||
"jellyfin": {
|
||||
"playing": "Afspiller",
|
||||
"transcoding": "Transcoder",
|
||||
"playing": "Playing",
|
||||
"transcoding": "Transcoding",
|
||||
"bitrate": "Bitrate",
|
||||
"no_active": "Ingen Aktive Streams",
|
||||
"movies": "Film",
|
||||
"series": "Serier",
|
||||
"episodes": "Episoder",
|
||||
"songs": "Sange",
|
||||
"albums": "Album"
|
||||
"no_active": "No Active Streams",
|
||||
"movies": "Movies",
|
||||
"series": "Series",
|
||||
"episodes": "Episodes",
|
||||
"songs": "Songs",
|
||||
"albums": "Albums"
|
||||
},
|
||||
"esphome": {
|
||||
"offline": "Offline",
|
||||
"offline_alt": "Offline",
|
||||
"online": "Online",
|
||||
"total": "Total",
|
||||
"unknown": "Ukendt"
|
||||
"unknown": "Unknown"
|
||||
},
|
||||
"evcc": {
|
||||
"pv_power": "Produktion",
|
||||
@@ -169,22 +169,22 @@
|
||||
},
|
||||
"fritzbox": {
|
||||
"connectionStatus": "Status",
|
||||
"connectionStatusUnconfigured": "Ikke konfigureret",
|
||||
"connectionStatusConnecting": "Forbinder",
|
||||
"connectionStatusAuthenticating": "Godkender",
|
||||
"connectionStatusPendingDisconnect": "Afventer Afbrydelse",
|
||||
"connectionStatusDisconnecting": "Afbryder forbindelsen",
|
||||
"connectionStatusDisconnected": "Afbrudt",
|
||||
"connectionStatusConnected": "Forbundet",
|
||||
"uptime": "Oppetid",
|
||||
"maxDown": "Maks. Ned",
|
||||
"maxUp": "Maks. Op",
|
||||
"down": "Ned",
|
||||
"up": "Op",
|
||||
"connectionStatusUnconfigured": "Unconfigured",
|
||||
"connectionStatusConnecting": "Connecting",
|
||||
"connectionStatusAuthenticating": "Authenticating",
|
||||
"connectionStatusPendingDisconnect": "Pending Disconnect",
|
||||
"connectionStatusDisconnecting": "Disconnecting",
|
||||
"connectionStatusDisconnected": "Disconnected",
|
||||
"connectionStatusConnected": "Connected",
|
||||
"uptime": "Uptime",
|
||||
"maxDown": "Max. Down",
|
||||
"maxUp": "Max. Up",
|
||||
"down": "Down",
|
||||
"up": "Up",
|
||||
"received": "Modtaget",
|
||||
"sent": "Sendt",
|
||||
"externalIPAddress": "Ekstern IP",
|
||||
"externalIPv6Address": "Ekstern IPv6",
|
||||
"externalIPv6Address": "Ext. IPv6",
|
||||
"externalIPv6Prefix": "Ext. IPv6-Prefix"
|
||||
},
|
||||
"caddy": {
|
||||
@@ -203,24 +203,24 @@
|
||||
"passes": "Bestået"
|
||||
},
|
||||
"tautulli": {
|
||||
"playing": "Afspiller",
|
||||
"transcoding": "Transcoder",
|
||||
"playing": "Playing",
|
||||
"transcoding": "Transcoding",
|
||||
"bitrate": "Bitrate",
|
||||
"no_active": "Ingen Aktive Streams",
|
||||
"no_active": "No Active Streams",
|
||||
"plex_connection_error": "Tjek Plex-forbindelse"
|
||||
},
|
||||
"tracearr": {
|
||||
"no_active": "Ingen Aktive Streams",
|
||||
"no_active": "No Active Streams",
|
||||
"streams": "Streams",
|
||||
"transcodes": "Transkoder",
|
||||
"directplay": "Direkte afspilning",
|
||||
"transcodes": "Transcodes",
|
||||
"directplay": "Direct Play",
|
||||
"bitrate": "Bitrate"
|
||||
},
|
||||
"omada": {
|
||||
"connectedAp": "Forbundne APs",
|
||||
"activeUser": "Aktive enheder",
|
||||
"alerts": "Advarsler",
|
||||
"connectedGateways": "Forbundne gateways",
|
||||
"connectedGateways": "Connected gateways",
|
||||
"connectedSwitches": "Forbundne switches"
|
||||
},
|
||||
"nzbget": {
|
||||
@@ -231,7 +231,7 @@
|
||||
"plex": {
|
||||
"streams": "Aktive Streams",
|
||||
"albums": "Albums",
|
||||
"movies": "Film",
|
||||
"movies": "Movies",
|
||||
"tv": "TV-Shows"
|
||||
},
|
||||
"sabnzbd": {
|
||||
@@ -283,17 +283,17 @@
|
||||
"sonarr": {
|
||||
"wanted": "Ønsket",
|
||||
"queued": "I Kø",
|
||||
"series": "Serier",
|
||||
"queue": "Kø",
|
||||
"unknown": "Ukendt"
|
||||
"series": "Series",
|
||||
"queue": "Queue",
|
||||
"unknown": "Unknown"
|
||||
},
|
||||
"radarr": {
|
||||
"wanted": "Wanted",
|
||||
"missing": "Mangler",
|
||||
"queued": "Queued",
|
||||
"movies": "Film",
|
||||
"queue": "Kø",
|
||||
"unknown": "Ukendt"
|
||||
"movies": "Movies",
|
||||
"queue": "Queue",
|
||||
"unknown": "Unknown"
|
||||
},
|
||||
"lidarr": {
|
||||
"wanted": "Wanted",
|
||||
@@ -315,18 +315,18 @@
|
||||
"available": "Tilgængelig"
|
||||
},
|
||||
"seerr": {
|
||||
"pending": "Afventer",
|
||||
"approved": "Godkendt",
|
||||
"available": "Tilgængelig",
|
||||
"completed": "Udført",
|
||||
"processing": "Behandler",
|
||||
"issues": "Åbne problemer"
|
||||
"pending": "Pending",
|
||||
"approved": "Approved",
|
||||
"available": "Available",
|
||||
"completed": "Completed",
|
||||
"processing": "Processing",
|
||||
"issues": "Open Issues"
|
||||
},
|
||||
"netalertx": {
|
||||
"total": "Total",
|
||||
"connected": "Forbundet",
|
||||
"new_devices": "Nye Enheder",
|
||||
"down_alerts": "Nede Advarsler"
|
||||
"connected": "Connected",
|
||||
"new_devices": "New Devices",
|
||||
"down_alerts": "Down Alerts"
|
||||
},
|
||||
"pihole": {
|
||||
"queries": "Forespørgsler",
|
||||
@@ -335,8 +335,8 @@
|
||||
"gravity": "Tyngdekraft"
|
||||
},
|
||||
"adguard": {
|
||||
"queries": "Forespørgsler",
|
||||
"blocked": "Blokerede",
|
||||
"queries": "Queries",
|
||||
"blocked": "Blocked",
|
||||
"filtered": "Filtreret",
|
||||
"latency": "Latenstid"
|
||||
},
|
||||
@@ -346,33 +346,33 @@
|
||||
"ping": "Ping"
|
||||
},
|
||||
"portainer": {
|
||||
"running": "Kører",
|
||||
"running": "Running",
|
||||
"stopped": "Stoppede",
|
||||
"total": "Total"
|
||||
},
|
||||
"suwayomi": {
|
||||
"download": "Hentet",
|
||||
"nondownload": "Ikke-Downloadet",
|
||||
"read": "Læst",
|
||||
"unread": "Ulæst",
|
||||
"downloadedread": "Downloadet Og Læst",
|
||||
"downloadedunread": "Downloadet & Ulæst",
|
||||
"nondownloadedread": "Ikke-Downloadet & Læst",
|
||||
"nondownloadedunread": "Ikke-Downloadet & Ulæst"
|
||||
"download": "Downloaded",
|
||||
"nondownload": "Non-Downloaded",
|
||||
"read": "Read",
|
||||
"unread": "Unread",
|
||||
"downloadedread": "Downloaded & Read",
|
||||
"downloadedunread": "Downloaded & Unread",
|
||||
"nondownloadedread": "Non-Downloaded & Read",
|
||||
"nondownloadedunread": "Non-Downloaded & Unread"
|
||||
},
|
||||
"tailscale": {
|
||||
"address": "Adresse",
|
||||
"expires": "Udløber",
|
||||
"never": "Aldrig",
|
||||
"user": "Bruger",
|
||||
"hostname": "Værtsnavn",
|
||||
"name": "Navn",
|
||||
"client_version": "Klientversion",
|
||||
"os": "Styresystem",
|
||||
"created": "Oprettet",
|
||||
"authorized": "Autoriseret",
|
||||
"is_external": "Er ekstern",
|
||||
"update_available": "Opdatering tilgængelig",
|
||||
"user": "User",
|
||||
"hostname": "Hostname",
|
||||
"name": "Name",
|
||||
"client_version": "Client Version",
|
||||
"os": "OS",
|
||||
"created": "Created",
|
||||
"authorized": "Authorized",
|
||||
"is_external": "Is External",
|
||||
"update_available": "Update Available",
|
||||
"tags": "Tags",
|
||||
"last_seen": "Sidst Set",
|
||||
"now": "Nu",
|
||||
@@ -383,24 +383,24 @@
|
||||
"minutes": "{{number}}m",
|
||||
"seconds": "{{number}}s",
|
||||
"ago": "{{value}} Siden",
|
||||
"true": "Ja",
|
||||
"false": "Nej"
|
||||
"true": "Yes",
|
||||
"false": "No"
|
||||
},
|
||||
"technitium": {
|
||||
"totalQueries": "Forespørgsler",
|
||||
"totalNoError": "Succes",
|
||||
"totalServerFailure": "Fejl",
|
||||
"totalNxDomain": "Domæner",
|
||||
"totalRefused": "Nægtede",
|
||||
"totalAuthoritative": "Autorativ",
|
||||
"totalRecursive": "Rekursivt",
|
||||
"totalCached": "Cachet",
|
||||
"totalBlocked": "Blokeret",
|
||||
"totalDropped": "Tabt",
|
||||
"totalQueries": "Queries",
|
||||
"totalNoError": "Success",
|
||||
"totalServerFailure": "Failures",
|
||||
"totalNxDomain": "NX Domains",
|
||||
"totalRefused": "Refused",
|
||||
"totalAuthoritative": "Authoritative",
|
||||
"totalRecursive": "Recursive",
|
||||
"totalCached": "Cached",
|
||||
"totalBlocked": "Blocked",
|
||||
"totalDropped": "Dropped",
|
||||
"totalClients": "Klienter"
|
||||
},
|
||||
"tdarr": {
|
||||
"queue": "Kø",
|
||||
"queue": "Queue",
|
||||
"processed": "Behandlet",
|
||||
"errored": "Fejlet",
|
||||
"saved": "Gemt"
|
||||
@@ -412,12 +412,12 @@
|
||||
},
|
||||
"trilium": {
|
||||
"version": "Version",
|
||||
"notesCount": "Noter",
|
||||
"dbSize": "Databasestørrelse",
|
||||
"unknown": "Ukendt"
|
||||
"notesCount": "Notes",
|
||||
"dbSize": "Database Size",
|
||||
"unknown": "Unknown"
|
||||
},
|
||||
"navidrome": {
|
||||
"nothing_streaming": "Ingen Aktive Streams",
|
||||
"nothing_streaming": "No Active Streams",
|
||||
"please_wait": "Vent venligst"
|
||||
},
|
||||
"npm": {
|
||||
@@ -482,31 +482,31 @@
|
||||
"authorizationsLast24H": "Auths (24h)"
|
||||
},
|
||||
"proxmox": {
|
||||
"mem": "RAM",
|
||||
"mem": "MEM",
|
||||
"cpu": "CPU",
|
||||
"lxc": "LXC",
|
||||
"vms": "VMs"
|
||||
},
|
||||
"pulse": {
|
||||
"nodes": "Noder",
|
||||
"nodes": "Nodes",
|
||||
"vms": "VMs",
|
||||
"lxcs": "LXC"
|
||||
"lxcs": "LXCs"
|
||||
},
|
||||
"glances": {
|
||||
"cpu": "CPU",
|
||||
"load": "Indlæs",
|
||||
"wait": "Vent venligst",
|
||||
"load": "Load",
|
||||
"wait": "Please wait",
|
||||
"temp": "TEMP",
|
||||
"_temp": "Temp",
|
||||
"warn": "Advar",
|
||||
"uptime": "OP",
|
||||
"uptime": "UP",
|
||||
"total": "Total",
|
||||
"free": "Fri",
|
||||
"used": "Brugt",
|
||||
"free": "Free",
|
||||
"used": "Used",
|
||||
"days": "d",
|
||||
"hours": "t",
|
||||
"hours": "h",
|
||||
"crit": "Crit",
|
||||
"read": "Læst",
|
||||
"read": "Read",
|
||||
"write": "Skriv",
|
||||
"gpu": "GPU",
|
||||
"mem": "Ram",
|
||||
@@ -519,7 +519,7 @@
|
||||
"custom": "Brugerdefinerede",
|
||||
"visit": "Besøg",
|
||||
"url": "URL",
|
||||
"searchsuggestion": "Forslag"
|
||||
"searchsuggestion": "Suggestion"
|
||||
},
|
||||
"wmo": {
|
||||
"0-day": "Solrig",
|
||||
@@ -527,57 +527,57 @@
|
||||
"1-day": "Overvejende Solrigt",
|
||||
"1-night": "Overvejende Skyfrit",
|
||||
"2-day": "Delvist Overskyet",
|
||||
"2-night": "Delvist Overskyet",
|
||||
"2-night": "Partly Cloudy",
|
||||
"3-day": "Skyet",
|
||||
"3-night": "Skyet",
|
||||
"3-night": "Cloudy",
|
||||
"45-day": "Tåget",
|
||||
"45-night": "Tåget",
|
||||
"48-day": "Tåget",
|
||||
"48-night": "Tåget",
|
||||
"45-night": "Foggy",
|
||||
"48-day": "Foggy",
|
||||
"48-night": "Foggy",
|
||||
"51-day": "Let Støvregn",
|
||||
"51-night": "Let Støvregn",
|
||||
"51-night": "Light Drizzle",
|
||||
"53-day": "Støvregn",
|
||||
"53-night": "Støvregn",
|
||||
"53-night": "Drizzle",
|
||||
"55-day": "Kraftig Støvregn",
|
||||
"55-night": "Kraftig Støvregn",
|
||||
"55-night": "Heavy Drizzle",
|
||||
"56-day": "Let Frysende Støvregn",
|
||||
"56-night": "Light Freezing Drizzle",
|
||||
"57-day": "Frysende Støvregn",
|
||||
"57-night": "Freezing Drizzle",
|
||||
"61-day": "Let Regn",
|
||||
"61-night": "Let Regn",
|
||||
"61-night": "Light Rain",
|
||||
"63-day": "Regn",
|
||||
"63-night": "Regn",
|
||||
"63-night": "Rain",
|
||||
"65-day": "Kraftig Regn",
|
||||
"65-night": "Kraftig Regn",
|
||||
"65-night": "Heavy Rain",
|
||||
"66-day": "Frysende Regn",
|
||||
"66-night": "Freezing Rain",
|
||||
"67-day": "Freezing Rain",
|
||||
"67-night": "Freezing Rain",
|
||||
"71-day": "Let Sne",
|
||||
"71-night": "Let Sne",
|
||||
"71-night": "Light Snow",
|
||||
"73-day": "Sne",
|
||||
"73-night": "Sne",
|
||||
"73-night": "Snow",
|
||||
"75-day": "Kraftig Sne",
|
||||
"75-night": "Kraftig Sne",
|
||||
"75-night": "Heavy Snow",
|
||||
"77-day": "Snekorn",
|
||||
"77-night": "Mildt snefald",
|
||||
"77-night": "Snow Grains",
|
||||
"80-day": "Lette Byger",
|
||||
"80-night": "Lette Byger",
|
||||
"80-night": "Light Showers",
|
||||
"81-day": "Byger",
|
||||
"81-night": "Byger",
|
||||
"81-night": "Showers",
|
||||
"82-day": "Kraftige Byger",
|
||||
"82-night": "Kraftige Byger",
|
||||
"82-night": "Heavy Showers",
|
||||
"85-day": "Snebyger",
|
||||
"85-night": "Snebyger",
|
||||
"86-day": "Snebyger",
|
||||
"86-night": "Snebyger",
|
||||
"85-night": "Snow Showers",
|
||||
"86-day": "Snow Showers",
|
||||
"86-night": "Snow Showers",
|
||||
"95-day": "Tordenvejr",
|
||||
"95-night": "Tordenvejr",
|
||||
"95-night": "Thunderstorm",
|
||||
"96-day": "Tordenvejr Med Hagl",
|
||||
"96-night": "Tordenvejr Med Hagl",
|
||||
"99-day": "Tordenvejr Med Hagl",
|
||||
"99-night": "Tordenvejr Med Hagl"
|
||||
"96-night": "Thunderstorm With Hail",
|
||||
"99-day": "Thunderstorm With Hail",
|
||||
"99-night": "Thunderstorm With Hail"
|
||||
},
|
||||
"homebridge": {
|
||||
"available_update": "System",
|
||||
@@ -586,16 +586,16 @@
|
||||
"up_to_date": "Opdateret",
|
||||
"child_bridges": "Underbroer",
|
||||
"child_bridges_status": "{{ok}}/{{total}}",
|
||||
"up": "Op",
|
||||
"pending": "Afventer",
|
||||
"down": "Ned",
|
||||
"up": "Up",
|
||||
"pending": "Pending",
|
||||
"down": "Down",
|
||||
"ok": "Ok"
|
||||
},
|
||||
"healthchecks": {
|
||||
"new": "Ny",
|
||||
"up": "Op",
|
||||
"up": "Up",
|
||||
"grace": "Henstandsperiode",
|
||||
"down": "Ned",
|
||||
"down": "Down",
|
||||
"paused": "Pause",
|
||||
"status": "Status",
|
||||
"last_ping": "Sidste Ping",
|
||||
@@ -607,85 +607,85 @@
|
||||
"containers_failed": "Fejlet"
|
||||
},
|
||||
"autobrr": {
|
||||
"approvedPushes": "Godkendt",
|
||||
"approvedPushes": "Approved",
|
||||
"rejectedPushes": "Afviste",
|
||||
"filters": "Filtre",
|
||||
"indexers": "Indeksører"
|
||||
"indexers": "Indexers"
|
||||
},
|
||||
"tubearchivist": {
|
||||
"downloads": "Kø",
|
||||
"downloads": "Queue",
|
||||
"videos": "Videoer",
|
||||
"channels": "Kanaler",
|
||||
"playlists": "Afspilningslister"
|
||||
},
|
||||
"truenas": {
|
||||
"load": "Systembelastning",
|
||||
"uptime": "Oppetid",
|
||||
"alerts": "Advarsler"
|
||||
"uptime": "Uptime",
|
||||
"alerts": "Alerts"
|
||||
},
|
||||
"pyload": {
|
||||
"speed": "Hastighed",
|
||||
"active": "Aktive",
|
||||
"queue": "Kø",
|
||||
"active": "Active",
|
||||
"queue": "Queue",
|
||||
"total": "Total"
|
||||
},
|
||||
"gluetun": {
|
||||
"public_ip": "Offentlig IP",
|
||||
"region": "Område",
|
||||
"country": "Land",
|
||||
"port_forwarded": "Port Viderestillet"
|
||||
"port_forwarded": "Port Forwarded"
|
||||
},
|
||||
"hdhomerun": {
|
||||
"channels": "Kanaler",
|
||||
"channels": "Channels",
|
||||
"hd": "HD",
|
||||
"tunerCount": "Tunere",
|
||||
"channelNumber": "Kanal",
|
||||
"channelNetwork": "Netværk",
|
||||
"signalStrength": "Styrke",
|
||||
"signalQuality": "Kvalitet",
|
||||
"symbolQuality": "Kvalitet",
|
||||
"tunerCount": "Tuners",
|
||||
"channelNumber": "Channel",
|
||||
"channelNetwork": "Network",
|
||||
"signalStrength": "Strength",
|
||||
"signalQuality": "Quality",
|
||||
"symbolQuality": "Quality",
|
||||
"networkRate": "Bitrate",
|
||||
"clientIP": "Klient"
|
||||
"clientIP": "Client"
|
||||
},
|
||||
"scrutiny": {
|
||||
"passed": "Bestået",
|
||||
"failed": "Fejlet",
|
||||
"unknown": "Ukendt"
|
||||
"failed": "Failed",
|
||||
"unknown": "Unknown"
|
||||
},
|
||||
"paperlessngx": {
|
||||
"inbox": "Indbakke",
|
||||
"total": "Total"
|
||||
},
|
||||
"pangolin": {
|
||||
"orgs": "Organisationer",
|
||||
"sites": "Websteder",
|
||||
"resources": "Ressourcer",
|
||||
"targets": "Mål",
|
||||
"traffic": "Trafik",
|
||||
"in": "Ind",
|
||||
"out": "Ud"
|
||||
"orgs": "Orgs",
|
||||
"sites": "Sites",
|
||||
"resources": "Resources",
|
||||
"targets": "Targets",
|
||||
"traffic": "Traffic",
|
||||
"in": "In",
|
||||
"out": "Out"
|
||||
},
|
||||
"peanut": {
|
||||
"battery_charge": "Batteriniveau",
|
||||
"ups_load": "Ups Belastning",
|
||||
"ups_load": "UPS Load",
|
||||
"ups_status": "UPS Status",
|
||||
"online": "Online",
|
||||
"on_battery": "På batteri",
|
||||
"low_battery": "Lavt batteriniveau"
|
||||
},
|
||||
"nextdns": {
|
||||
"wait": "Vent venligst",
|
||||
"wait": "Please Wait",
|
||||
"no_devices": "Ingen Enhedsdata Modtaget"
|
||||
},
|
||||
"mikrotik": {
|
||||
"cpuLoad": "CPU Belastning",
|
||||
"memoryUsed": "Hukommelse Brugt",
|
||||
"uptime": "Oppetid",
|
||||
"uptime": "Uptime",
|
||||
"numberOfLeases": "Leasinger"
|
||||
},
|
||||
"xteve": {
|
||||
"streams_all": "Alle Streams",
|
||||
"streams_active": "Aktive Streams",
|
||||
"streams_active": "Active Streams",
|
||||
"streams_xepg": "XEPG Kanaler"
|
||||
},
|
||||
"opendtu": {
|
||||
@@ -695,7 +695,7 @@
|
||||
"limit": "Begrænsning"
|
||||
},
|
||||
"opnsense": {
|
||||
"cpu": "CPU Belastning",
|
||||
"cpu": "CPU Load",
|
||||
"memory": "Aktiv Hukommelse",
|
||||
"wanUpload": "WAN Upload",
|
||||
"wanDownload": "WAN Download"
|
||||
@@ -720,8 +720,8 @@
|
||||
"load": "Belastning Gns",
|
||||
"memory": "Hukommelse Forbrug",
|
||||
"wanStatus": "WAN Status",
|
||||
"up": "Op",
|
||||
"down": "Ned",
|
||||
"up": "Up",
|
||||
"down": "Down",
|
||||
"temp": "Temp",
|
||||
"disk": "Disk Forbrug",
|
||||
"wanIP": "WAN IP"
|
||||
@@ -733,15 +733,15 @@
|
||||
"memory_usage": "Hukommelse"
|
||||
},
|
||||
"immich": {
|
||||
"users": "Brugere",
|
||||
"users": "Users",
|
||||
"photos": "Billeder",
|
||||
"videos": "Videoer",
|
||||
"videos": "Videos",
|
||||
"storage": "Lager"
|
||||
},
|
||||
"uptimekuma": {
|
||||
"up": "Sider Oppe",
|
||||
"down": "Sider Nede",
|
||||
"uptime": "Oppetid",
|
||||
"uptime": "Uptime",
|
||||
"incident": "Hændelse",
|
||||
"m": "m"
|
||||
},
|
||||
@@ -889,7 +889,7 @@
|
||||
"name": "Navn",
|
||||
"map": "Kort",
|
||||
"currentPlayers": "Nuværende Spillere",
|
||||
"players": "Spillere",
|
||||
"players": "Players",
|
||||
"maxPlayers": "Maks spillere",
|
||||
"bots": "Bots",
|
||||
"ping": "Ping"
|
||||
@@ -902,22 +902,22 @@
|
||||
},
|
||||
"mealie": {
|
||||
"recipes": "Opskrifter",
|
||||
"users": "Brugere",
|
||||
"categories": "Kategorier",
|
||||
"users": "Users",
|
||||
"categories": "Categories",
|
||||
"tags": "Tags"
|
||||
},
|
||||
"openmediavault": {
|
||||
"downloading": "Downloader",
|
||||
"total": "Total",
|
||||
"running": "Kører",
|
||||
"running": "Running",
|
||||
"stopped": "Stopped",
|
||||
"passed": "Passed",
|
||||
"failed": "Fejlet"
|
||||
"failed": "Failed"
|
||||
},
|
||||
"openwrt": {
|
||||
"uptime": "Oppetid",
|
||||
"uptime": "Uptime",
|
||||
"cpuLoad": "CPU Load Avg (5m)",
|
||||
"up": "Op",
|
||||
"up": "Up",
|
||||
"down": "Down",
|
||||
"bytesTx": "Transmitted",
|
||||
"bytesRx": "Received"
|
||||
|
||||
@@ -1258,5 +1258,8 @@
|
||||
"wanted": "Wanted",
|
||||
"queued": "Queued",
|
||||
"leagues": "Leagues"
|
||||
},
|
||||
"feed": {
|
||||
"noItems": "No items"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -353,6 +353,9 @@ export function cleanServiceGroups(groups) {
|
||||
expandOneStreamToTwoRows,
|
||||
showEpisodeNumber,
|
||||
|
||||
// feed
|
||||
layout,
|
||||
|
||||
// frigate
|
||||
enableRecentEvents,
|
||||
|
||||
@@ -675,6 +678,9 @@ export function cleanServiceGroups(groups) {
|
||||
if (showTime) widget.showTime = showTime;
|
||||
if (timezone) widget.timezone = timezone;
|
||||
}
|
||||
if (type === "feed") {
|
||||
if (layout) widget.layout = layout;
|
||||
}
|
||||
if (type === "dockhand") {
|
||||
if (environment) widget.environment = environment;
|
||||
}
|
||||
|
||||
@@ -1,46 +0,0 @@
|
||||
import { createRequire } from "node:module";
|
||||
|
||||
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
|
||||
|
||||
const require = createRequire(import.meta.url);
|
||||
const i18nextConfig = require("../../next-i18next.config.js");
|
||||
|
||||
function getRelativeDateFormatter() {
|
||||
let relativeDateFormatter;
|
||||
|
||||
i18nextConfig.use[0].init({
|
||||
services: {
|
||||
formatter: {
|
||||
add(name, formatter) {
|
||||
if (name === "relativeDate") relativeDateFormatter = formatter;
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
return relativeDateFormatter;
|
||||
}
|
||||
|
||||
describe("relativeDate formatter", () => {
|
||||
const formatRelativeDate = getRelativeDateFormatter();
|
||||
const options = { numeric: "auto" };
|
||||
|
||||
beforeEach(() => {
|
||||
vi.useFakeTimers();
|
||||
vi.setSystemTime(new Date(2026, 8, 23, 16, 0));
|
||||
});
|
||||
|
||||
afterEach(() => {
|
||||
vi.useRealTimers();
|
||||
});
|
||||
|
||||
it.each([
|
||||
["hours away on the same day", new Date(2026, 8, 23, 20, 0), "in 4 hours"],
|
||||
["next calendar day", new Date(2026, 8, 24, 20, 0), "tomorrow"],
|
||||
["two calendar days away but under 48h", new Date(2026, 8, 25, 10, 40), "in 2 days"],
|
||||
["previous calendar day", new Date(2026, 8, 22, 10, 0), "yesterday"],
|
||||
["two calendar days ago but under 48h", new Date(2026, 8, 21, 20, 0), "2 days ago"],
|
||||
])("formats %s", (_description, value, expected) => {
|
||||
expect(formatRelativeDate(value.toISOString(), "en", options)).toBe(expected);
|
||||
});
|
||||
});
|
||||
@@ -37,6 +37,7 @@ const components = {
|
||||
emby: dynamic(() => import("./emby/component")),
|
||||
esphome: dynamic(() => import("./esphome/component")),
|
||||
evcc: dynamic(() => import("./evcc/component")),
|
||||
feed: dynamic(() => import("./feed/component")),
|
||||
filebrowser: dynamic(() => import("./filebrowser/component")),
|
||||
fileflows: dynamic(() => import("./fileflows/component")),
|
||||
firefly: dynamic(() => import("./firefly/component")),
|
||||
|
||||
@@ -0,0 +1,125 @@
|
||||
/* eslint-disable @next/next/no-img-element */
|
||||
import classNames from "classnames";
|
||||
import { useTranslation } from "next-i18next/pages";
|
||||
import { useContext } from "react";
|
||||
|
||||
import Container from "components/services/widget/container";
|
||||
import { SettingsContext } from "utils/contexts/settings";
|
||||
import useWidgetAPI from "utils/proxy/use-widget-api";
|
||||
|
||||
const rowClassName = "rounded-md bg-theme-200/50 dark:bg-theme-900/20 text-theme-700 dark:text-theme-200 text-xs";
|
||||
const hideBrokenImage = (e) => {
|
||||
e.currentTarget.style.visibility = "hidden";
|
||||
};
|
||||
|
||||
function FeedLink({ item, target, className, children }) {
|
||||
if (!item.link) return <div className={className}>{children}</div>;
|
||||
return (
|
||||
<a
|
||||
href={item.link}
|
||||
target={target}
|
||||
rel="noopener noreferrer"
|
||||
className={classNames(className, "hover:bg-theme-300/50 dark:hover:bg-theme-800/20")}
|
||||
>
|
||||
{children}
|
||||
</a>
|
||||
);
|
||||
}
|
||||
|
||||
function RelativeDate({ date }) {
|
||||
const { t } = useTranslation();
|
||||
if (!date) return null;
|
||||
return (
|
||||
<span className="shrink-0 text-theme-500 dark:text-theme-400">
|
||||
{t("common.relativeDate", { value: date, formatParams: { value: { style: "narrow", numeric: "auto" } } })}
|
||||
</span>
|
||||
);
|
||||
}
|
||||
|
||||
function ListItem({ item, target }) {
|
||||
return (
|
||||
<FeedLink
|
||||
item={item}
|
||||
target={target}
|
||||
className={classNames(rowClassName, "flex items-center gap-2 px-2", item.image ? "py-1" : "h-5")}
|
||||
>
|
||||
{item.image && (
|
||||
<img
|
||||
src={item.image}
|
||||
alt=""
|
||||
loading="lazy"
|
||||
decoding="async"
|
||||
referrerPolicy="no-referrer"
|
||||
onError={hideBrokenImage}
|
||||
className="w-12 h-8 shrink-0 rounded-sm object-cover"
|
||||
/>
|
||||
)}
|
||||
<span className="grow truncate text-left">{item.title}</span>
|
||||
<RelativeDate date={item.date} />
|
||||
</FeedLink>
|
||||
);
|
||||
}
|
||||
|
||||
function GridItem({ item, target }) {
|
||||
return (
|
||||
<FeedLink item={item} target={target} className={classNames(rowClassName, "flex flex-col overflow-hidden")}>
|
||||
<div className="relative aspect-video w-full overflow-hidden bg-theme-200/50 dark:bg-theme-900/30">
|
||||
{item.image && (
|
||||
<img
|
||||
src={item.image}
|
||||
alt=""
|
||||
loading="lazy"
|
||||
decoding="async"
|
||||
referrerPolicy="no-referrer"
|
||||
onError={hideBrokenImage}
|
||||
className="absolute inset-0 w-full h-full object-cover"
|
||||
/>
|
||||
)}
|
||||
</div>
|
||||
<div className="flex flex-col gap-0.5 px-2 py-1.5 text-left">
|
||||
<span className="line-clamp-2">{item.title}</span>
|
||||
<RelativeDate date={item.date} />
|
||||
</div>
|
||||
</FeedLink>
|
||||
);
|
||||
}
|
||||
|
||||
export default function Component({ service }) {
|
||||
const { t } = useTranslation();
|
||||
const { settings } = useContext(SettingsContext);
|
||||
const { widget } = service;
|
||||
|
||||
const { data, error } = useWidgetAPI(widget, undefined, undefined, { refreshInterval: 10 * 60 * 1000 });
|
||||
|
||||
if (error) {
|
||||
return <Container service={service} error={error} />;
|
||||
}
|
||||
|
||||
const target = service.target ?? settings?.target ?? "_blank";
|
||||
const isGrid = widget.layout === "grid";
|
||||
const Item = isGrid ? GridItem : ListItem;
|
||||
|
||||
let content;
|
||||
if (!data) {
|
||||
content = [0, 1, 2].map((i) => (
|
||||
<div key={i} className={classNames(rowClassName, "animate-pulse", isGrid ? "aspect-video" : "h-5")} />
|
||||
));
|
||||
} else if (!data.items?.length) {
|
||||
content = <div className={classNames(rowClassName, "h-5 px-2 flex items-center")}>{t("feed.noItems")}</div>;
|
||||
} else {
|
||||
content = data.items.map((item, i) => <Item key={`${item.link ?? item.title}-${i}`} item={item} target={target} />);
|
||||
}
|
||||
|
||||
return (
|
||||
<Container service={service}>
|
||||
<div
|
||||
className={classNames(
|
||||
"w-full p-1",
|
||||
isGrid ? "grid grid-cols-[repeat(auto-fill,minmax(8rem,1fr))] gap-2" : "flex flex-col gap-1",
|
||||
)}
|
||||
>
|
||||
{content}
|
||||
</div>
|
||||
</Container>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,80 @@
|
||||
// @vitest-environment jsdom
|
||||
|
||||
import { screen } from "@testing-library/react";
|
||||
import { beforeEach, describe, expect, it, vi } from "vitest";
|
||||
|
||||
import { renderWithProviders } from "test-utils/render-with-providers";
|
||||
|
||||
const { useWidgetAPI } = vi.hoisted(() => ({ useWidgetAPI: vi.fn() }));
|
||||
vi.mock("utils/proxy/use-widget-api", () => ({ default: useWidgetAPI }));
|
||||
|
||||
import Component from "./component";
|
||||
|
||||
const items = [
|
||||
{
|
||||
title: "With image",
|
||||
link: "https://example.com/1",
|
||||
date: "2020-01-01T00:00:00Z",
|
||||
image: "https://example.com/1.jpg",
|
||||
},
|
||||
{ title: "No link", link: null, date: null },
|
||||
];
|
||||
|
||||
function render(widget = {}, settings = {}) {
|
||||
return renderWithProviders(<Component service={{ widget: { type: "feed", ...widget } }} />, {
|
||||
settings: { hideErrors: false, ...settings },
|
||||
});
|
||||
}
|
||||
|
||||
describe("widgets/feed/component", () => {
|
||||
beforeEach(() => {
|
||||
vi.clearAllMocks();
|
||||
});
|
||||
|
||||
it("renders placeholders while loading", () => {
|
||||
useWidgetAPI.mockReturnValue({ data: undefined, error: undefined });
|
||||
const { container } = render();
|
||||
expect(container.querySelectorAll(".animate-pulse")).toHaveLength(3);
|
||||
});
|
||||
|
||||
it("renders an error", () => {
|
||||
useWidgetAPI.mockReturnValue({ data: undefined, error: { message: "Invalid feed" } });
|
||||
render();
|
||||
expect(screen.getAllByText(/Invalid feed/).length).toBeGreaterThan(0);
|
||||
});
|
||||
|
||||
it("renders an empty feed", () => {
|
||||
useWidgetAPI.mockReturnValue({ data: { items: [] }, error: undefined });
|
||||
render();
|
||||
expect(screen.getByText("feed.noItems")).toBeInTheDocument();
|
||||
});
|
||||
|
||||
it("renders list items with links and images", () => {
|
||||
useWidgetAPI.mockReturnValue({ data: { items }, error: undefined });
|
||||
const { container } = render({}, { target: "_self" });
|
||||
|
||||
const link = screen.getByText("With image").closest("a");
|
||||
expect(link).toHaveAttribute("href", "https://example.com/1");
|
||||
expect(link).toHaveAttribute("target", "_self");
|
||||
expect(link.querySelector("img")).toHaveAttribute("src", "https://example.com/1.jpg");
|
||||
expect(screen.getByText("No link").closest("a")).toBeNull();
|
||||
expect(container.querySelectorAll("img")).toHaveLength(1);
|
||||
});
|
||||
|
||||
it("renders the grid layout with image placeholders", () => {
|
||||
useWidgetAPI.mockReturnValue({ data: { items }, error: undefined });
|
||||
const { container } = render({ layout: "grid" });
|
||||
|
||||
expect(container.querySelector(".grid")).not.toBeNull();
|
||||
expect(container.querySelectorAll(".aspect-video")).toHaveLength(2);
|
||||
expect(container.querySelectorAll("img")).toHaveLength(1);
|
||||
});
|
||||
|
||||
it("hides images that fail to load", () => {
|
||||
useWidgetAPI.mockReturnValue({ data: { items }, error: undefined });
|
||||
const { container } = render();
|
||||
const img = container.querySelector("img");
|
||||
img.dispatchEvent(new Event("error"));
|
||||
expect(img.style.visibility).toBe("hidden");
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,61 @@
|
||||
import cache from "memory-cache";
|
||||
|
||||
import { parseFeed } from "./utils";
|
||||
|
||||
import getServiceWidget from "utils/config/service-helpers";
|
||||
import createLogger from "utils/logger";
|
||||
import { sanitizeErrorURL } from "utils/proxy/api-helpers";
|
||||
import { httpProxy } from "utils/proxy/http";
|
||||
|
||||
const logger = createLogger("feedProxyHandler");
|
||||
const CACHE_MS = 10 * 60 * 1000;
|
||||
|
||||
export default async function feedProxyHandler(req, res) {
|
||||
const { group, service, index } = req.query;
|
||||
const widget = await getServiceWidget(group, service, index);
|
||||
|
||||
if (!widget?.url) {
|
||||
return res.status(400).json({ error: "Missing feed URL" });
|
||||
}
|
||||
|
||||
let url;
|
||||
try {
|
||||
url = new URL(widget.url);
|
||||
} catch {
|
||||
return res.status(400).json({ error: "Invalid feed URL" });
|
||||
}
|
||||
|
||||
const cacheKey = `feed:${url.href}`;
|
||||
let items = cache.get(cacheKey);
|
||||
|
||||
if (!items) {
|
||||
const [status, , data] = await httpProxy(url, {
|
||||
headers: {
|
||||
"User-Agent": `gethomepage/${process.env.NEXT_PUBLIC_VERSION || "dev"}`,
|
||||
Accept: "application/rss+xml, application/atom+xml, application/xml;q=0.9, text/xml;q=0.9, */*;q=0.8",
|
||||
},
|
||||
});
|
||||
|
||||
if (status !== 200) {
|
||||
logger.debug("HTTP %d retrieving feed %s//%s%s", status, url.protocol, url.host, url.pathname);
|
||||
return res.status(status).json({ error: { message: "HTTP Error", url: sanitizeErrorURL(url) } });
|
||||
}
|
||||
|
||||
try {
|
||||
items = parseFeed(Buffer.from(data).toString(), url.href);
|
||||
} catch (e) {
|
||||
logger.debug("Error parsing feed %s//%s%s: %s", url.protocol, url.host, url.pathname, e.message);
|
||||
return res.status(500).json({ error: { message: "Invalid feed", url: sanitizeErrorURL(url) } });
|
||||
}
|
||||
|
||||
// only successful fetches are cached
|
||||
cache.put(cacheKey, items, CACHE_MS);
|
||||
}
|
||||
|
||||
const maxItems = parseInt(widget.maxItems, 10) || 5;
|
||||
const showImages = widget.images !== false && widget.images !== "false";
|
||||
|
||||
return res.status(200).json({
|
||||
items: items.slice(0, maxItems).map(({ image, ...item }) => (showImages && image ? { ...item, image } : item)),
|
||||
});
|
||||
}
|
||||
@@ -0,0 +1,148 @@
|
||||
import cache from "memory-cache";
|
||||
import { beforeEach, describe, expect, it, vi } from "vitest";
|
||||
|
||||
import createMockRes from "test-utils/create-mock-res";
|
||||
|
||||
const { httpProxy, getServiceWidget, logger } = vi.hoisted(() => ({
|
||||
httpProxy: vi.fn(),
|
||||
getServiceWidget: vi.fn(),
|
||||
logger: {
|
||||
debug: vi.fn(),
|
||||
},
|
||||
}));
|
||||
|
||||
vi.mock("utils/logger", () => ({
|
||||
default: () => logger,
|
||||
}));
|
||||
|
||||
vi.mock("utils/config/service-helpers", () => ({
|
||||
default: getServiceWidget,
|
||||
}));
|
||||
|
||||
vi.mock("utils/proxy/http", () => ({
|
||||
httpProxy,
|
||||
}));
|
||||
|
||||
import feedProxyHandler from "./proxy";
|
||||
|
||||
const items = Array.from(
|
||||
{ length: 7 },
|
||||
(_, i) => `<item><title>Item ${i}</title><link>https://example.com/${i}</link>
|
||||
<media:thumbnail url="https://example.com/${i}.jpg" /></item>`,
|
||||
).join("");
|
||||
const feed = `<rss xmlns:media="http://search.yahoo.com/mrss/"><channel>${items}</channel></rss>`;
|
||||
|
||||
const req = { query: { group: "g", service: "svc", index: "0" } };
|
||||
|
||||
describe("widgets/feed/proxy", () => {
|
||||
beforeEach(() => {
|
||||
vi.clearAllMocks();
|
||||
cache.clear();
|
||||
});
|
||||
|
||||
it("returns 400 when the url is missing or invalid", async () => {
|
||||
getServiceWidget.mockResolvedValueOnce({ type: "feed" });
|
||||
let res = createMockRes();
|
||||
await feedProxyHandler(req, res);
|
||||
expect(res.statusCode).toBe(400);
|
||||
expect(res.body).toEqual({ error: "Missing feed URL" });
|
||||
|
||||
getServiceWidget.mockResolvedValueOnce({ type: "feed", url: "nope" });
|
||||
res = createMockRes();
|
||||
await feedProxyHandler(req, res);
|
||||
expect(res.statusCode).toBe(400);
|
||||
expect(res.body).toEqual({ error: "Invalid feed URL" });
|
||||
expect(httpProxy).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it("returns the first 5 items by default", async () => {
|
||||
getServiceWidget.mockResolvedValue({ type: "feed", url: "https://example.com/feed.xml" });
|
||||
httpProxy.mockResolvedValueOnce([200, "application/rss+xml", Buffer.from(feed)]);
|
||||
|
||||
const res = createMockRes();
|
||||
await feedProxyHandler(req, res);
|
||||
|
||||
expect(httpProxy.mock.calls[0][0].href).toBe("https://example.com/feed.xml");
|
||||
expect(res.statusCode).toBe(200);
|
||||
expect(res.body.items).toHaveLength(5);
|
||||
expect(res.body.items[0]).toEqual({
|
||||
title: "Item 0",
|
||||
link: "https://example.com/0",
|
||||
date: null,
|
||||
image: "https://example.com/0.jpg",
|
||||
});
|
||||
});
|
||||
|
||||
it("respects maxItems and drops images when disabled", async () => {
|
||||
getServiceWidget.mockResolvedValue({
|
||||
type: "feed",
|
||||
url: "https://example.com/feed.xml",
|
||||
maxItems: "2",
|
||||
images: false,
|
||||
});
|
||||
httpProxy.mockResolvedValueOnce([200, "application/rss+xml", Buffer.from(feed)]);
|
||||
|
||||
const res = createMockRes();
|
||||
await feedProxyHandler(req, res);
|
||||
|
||||
expect(res.body.items).toEqual([
|
||||
{ title: "Item 0", link: "https://example.com/0", date: null },
|
||||
{ title: "Item 1", link: "https://example.com/1", date: null },
|
||||
]);
|
||||
});
|
||||
|
||||
it("passes through http errors without leaking the url", async () => {
|
||||
getServiceWidget.mockResolvedValue({ type: "feed", url: "https://example.com/feed.xml?token=secret" });
|
||||
httpProxy.mockResolvedValueOnce([404, "text/html", Buffer.from("Not found")]);
|
||||
|
||||
const res = createMockRes();
|
||||
await feedProxyHandler(req, res);
|
||||
|
||||
expect(res.statusCode).toBe(404);
|
||||
expect(res.body).toEqual({ error: { message: "HTTP Error", url: "example.com (see logs for details)" } });
|
||||
});
|
||||
|
||||
it("returns 500 for unparseable feeds", async () => {
|
||||
getServiceWidget.mockResolvedValue({ type: "feed", url: "https://example.com/feed.xml" });
|
||||
httpProxy.mockResolvedValueOnce([200, "text/html", Buffer.from("<html></html>")]);
|
||||
|
||||
const res = createMockRes();
|
||||
await feedProxyHandler(req, res);
|
||||
|
||||
expect(res.statusCode).toBe(500);
|
||||
expect(res.body).toEqual({ error: { message: "Invalid feed", url: "example.com (see logs for details)" } });
|
||||
});
|
||||
|
||||
it("shares one cached fetch across widgets with different options", async () => {
|
||||
getServiceWidget
|
||||
.mockResolvedValueOnce({ type: "feed", url: "https://example.com/feed.xml", maxItems: 1 })
|
||||
.mockResolvedValueOnce({ type: "feed", url: "https://example.com/feed.xml", images: false });
|
||||
httpProxy.mockResolvedValue([200, "application/rss+xml", Buffer.from(feed)]);
|
||||
|
||||
const first = createMockRes();
|
||||
await feedProxyHandler(req, first);
|
||||
const second = createMockRes();
|
||||
await feedProxyHandler(req, second);
|
||||
|
||||
expect(httpProxy).toHaveBeenCalledTimes(1);
|
||||
expect(first.body.items).toHaveLength(1);
|
||||
expect(second.body.items).toHaveLength(5);
|
||||
expect(second.body.items[0].image).toBeUndefined();
|
||||
});
|
||||
|
||||
it("does not cache failures", async () => {
|
||||
getServiceWidget.mockResolvedValue({ type: "feed", url: "https://example.com/feed.xml" });
|
||||
httpProxy
|
||||
.mockResolvedValueOnce([404, "text/html", Buffer.from("Not found")])
|
||||
.mockResolvedValueOnce([200, "application/rss+xml", Buffer.from(feed)]);
|
||||
|
||||
const failed = createMockRes();
|
||||
await feedProxyHandler(req, failed);
|
||||
const recovered = createMockRes();
|
||||
await feedProxyHandler(req, recovered);
|
||||
|
||||
expect(failed.statusCode).toBe(404);
|
||||
expect(recovered.statusCode).toBe(200);
|
||||
expect(httpProxy).toHaveBeenCalledTimes(2);
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,104 @@
|
||||
import sax from "sax";
|
||||
import { xml2js } from "xml-js";
|
||||
|
||||
const asArray = (value) => (value === undefined || value === null ? [] : [].concat(value));
|
||||
|
||||
function getText(node) {
|
||||
const first = asArray(node)[0];
|
||||
if (first === undefined) return "";
|
||||
if (typeof first !== "object") return String(first);
|
||||
return asArray(first._cdata ?? first._text).join("");
|
||||
}
|
||||
|
||||
export function httpUrl(value, baseUrl) {
|
||||
if (!value) return null;
|
||||
try {
|
||||
const url = new URL(value.trim(), baseUrl);
|
||||
return ["http:", "https:"].includes(url.protocol) ? url.href : null;
|
||||
} catch {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
function parseDate(value) {
|
||||
const time = Date.parse(value);
|
||||
return Number.isNaN(time) ? null : new Date(time).toISOString();
|
||||
}
|
||||
|
||||
const attrs = (node) => node?._attributes ?? {};
|
||||
const isImage = (node) => attrs(node).medium === "image" || attrs(node).type?.startsWith("image/");
|
||||
|
||||
function findImage(item) {
|
||||
const groups = [item, ...asArray(item["media:group"])];
|
||||
const candidates = [
|
||||
...groups.flatMap((group) => asArray(group["media:thumbnail"])),
|
||||
...groups.flatMap((group) => asArray(group["media:content"])).filter(isImage),
|
||||
...asArray(item.enclosure).filter(isImage),
|
||||
...asArray(item.link).filter((link) => attrs(link).rel === "enclosure" && isImage(link)),
|
||||
];
|
||||
const image = candidates.find((node) => attrs(node).url || attrs(node).href);
|
||||
return image ? attrs(image).url || attrs(image).href : null;
|
||||
}
|
||||
|
||||
const isPixel = ({ width, height }) => ["0", "1"].includes(width) || ["0", "1"].includes(height);
|
||||
|
||||
// first usable <img> in item html using sax tokenizer
|
||||
function findHtmlImage(htmls, baseUrl) {
|
||||
for (const html of htmls) {
|
||||
if (!html) continue;
|
||||
let image = null;
|
||||
const parser = sax.parser(false, { lowercase: true });
|
||||
parser.onopentag = ({ name, attributes }) => {
|
||||
if (!image && name === "img" && !isPixel(attributes)) image = httpUrl(attributes.src, baseUrl);
|
||||
};
|
||||
parser.onerror = () => {
|
||||
parser.error = null;
|
||||
parser.resume();
|
||||
};
|
||||
parser.write(html).close();
|
||||
if (image) return image;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
function parseRssItem(item) {
|
||||
const guid = asArray(item.guid)[0];
|
||||
const guidLink = attrs(guid).isPermaLink !== "false" ? getText(guid) : null;
|
||||
return {
|
||||
title: getText(item.title),
|
||||
link: getText(item.link) || guidLink,
|
||||
date: getText(item.pubDate) || getText(item["dc:date"]),
|
||||
image: findImage(item),
|
||||
html: [getText(item["content:encoded"]), getText(item.description)],
|
||||
};
|
||||
}
|
||||
|
||||
function parseAtomEntry(entry) {
|
||||
const links = asArray(entry.link);
|
||||
const link = links.find((l) => (attrs(l).rel ?? "alternate") === "alternate") ?? links[0];
|
||||
return {
|
||||
title: getText(entry.title),
|
||||
link: attrs(link).href,
|
||||
date: getText(entry.published) || getText(entry.updated),
|
||||
image: findImage(entry),
|
||||
html: [getText(entry.content), getText(entry.summary)],
|
||||
};
|
||||
}
|
||||
|
||||
export function parseFeed(xml, baseUrl) {
|
||||
const doc = xml2js(xml, { compact: true });
|
||||
|
||||
let items;
|
||||
if (doc.rss) items = asArray(doc.rss.channel?.item).map(parseRssItem);
|
||||
else if (doc.feed) items = asArray(doc.feed.entry).map(parseAtomEntry);
|
||||
else throw new Error("Unsupported feed format");
|
||||
|
||||
return items
|
||||
.map((item) => ({
|
||||
title: item.title.trim(),
|
||||
link: httpUrl(item.link, baseUrl),
|
||||
date: parseDate(item.date),
|
||||
image: httpUrl(item.image, baseUrl) ?? findHtmlImage(item.html, baseUrl),
|
||||
}))
|
||||
.filter((item) => item.title);
|
||||
}
|
||||
@@ -0,0 +1,153 @@
|
||||
import { describe, expect, it } from "vitest";
|
||||
|
||||
import { httpUrl, parseFeed } from "./utils";
|
||||
|
||||
const rss = `<?xml version="1.0"?>
|
||||
<rss version="2.0" xmlns:media="http://search.yahoo.com/mrss/" xmlns:dc="http://purl.org/dc/elements/1.1/">
|
||||
<channel>
|
||||
<title>Example</title>
|
||||
<item>
|
||||
<title><![CDATA[Tom & Jerry]]></title>
|
||||
<link>https://example.com/one</link>
|
||||
<pubDate>Tue, 22 Sep 2026 10:00:00 GMT</pubDate>
|
||||
<media:thumbnail url="https://img.example.com/one.jpg" />
|
||||
</item>
|
||||
<item>
|
||||
<title>Enclosure image</title>
|
||||
<guid>https://example.com/two</guid>
|
||||
<dc:date>2026-09-21T10:00:00Z</dc:date>
|
||||
<enclosure url="/two.png" type="image/png" length="1" />
|
||||
</item>
|
||||
<item>
|
||||
<title>Audio only</title>
|
||||
<link>javascript:alert(1)</link>
|
||||
<guid isPermaLink="false">abc-123</guid>
|
||||
<enclosure url="https://example.com/three.mp3" type="audio/mpeg" length="1" />
|
||||
</item>
|
||||
<item>
|
||||
<description>No title, skipped</description>
|
||||
</item>
|
||||
</channel>
|
||||
</rss>`;
|
||||
|
||||
const atom = `<?xml version="1.0" encoding="utf-8"?>
|
||||
<feed xmlns="http://www.w3.org/2005/Atom" xmlns:media="http://search.yahoo.com/mrss/">
|
||||
<title>Example</title>
|
||||
<entry>
|
||||
<title> Fish & chips
|
||||
</title>
|
||||
<link rel="enclosure" type="image/jpeg" href="https://example.com/one.jpg" />
|
||||
<link rel="alternate" href="https://example.com/one" />
|
||||
<updated>2026-09-22T12:00:00Z</updated>
|
||||
</entry>
|
||||
<entry>
|
||||
<title>YouTube style</title>
|
||||
<link href="https://example.com/two" />
|
||||
<published>2026-09-20T12:00:00Z</published>
|
||||
<updated>not a date</updated>
|
||||
<media:group>
|
||||
<media:content url="https://example.com/two.mp4" type="video/mp4" />
|
||||
<media:thumbnail url="https://example.com/two.jpg" />
|
||||
</media:group>
|
||||
</entry>
|
||||
</feed>`;
|
||||
|
||||
describe("widgets/feed/utils", () => {
|
||||
it("parses rss 2.0 items", () => {
|
||||
expect(parseFeed(rss, "https://example.com/feed.xml")).toEqual([
|
||||
{
|
||||
title: "Tom & Jerry",
|
||||
link: "https://example.com/one",
|
||||
date: "2026-09-22T10:00:00.000Z",
|
||||
image: "https://img.example.com/one.jpg",
|
||||
},
|
||||
{
|
||||
title: "Enclosure image",
|
||||
link: "https://example.com/two",
|
||||
date: "2026-09-21T10:00:00.000Z",
|
||||
image: "https://example.com/two.png",
|
||||
},
|
||||
{ title: "Audio only", link: null, date: null, image: null },
|
||||
]);
|
||||
});
|
||||
|
||||
it("parses atom entries", () => {
|
||||
expect(parseFeed(atom, "https://example.com/atom.xml")).toEqual([
|
||||
{
|
||||
title: "Fish & chips",
|
||||
link: "https://example.com/one",
|
||||
date: "2026-09-22T12:00:00.000Z",
|
||||
image: "https://example.com/one.jpg",
|
||||
},
|
||||
{
|
||||
title: "YouTube style",
|
||||
link: "https://example.com/two",
|
||||
date: "2026-09-20T12:00:00.000Z",
|
||||
image: "https://example.com/two.jpg",
|
||||
},
|
||||
]);
|
||||
});
|
||||
|
||||
it("falls back to the first usable image in item html", () => {
|
||||
const xml = `<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:media="http://search.yahoo.com/mrss/"><channel>
|
||||
<item>
|
||||
<title>Content image</title>
|
||||
<content:encoded><![CDATA[<p>Hi <img src="https://t.example.com/p.gif" width="1" height="1">
|
||||
<img src="data:image/gif;base64,R0"><IMG SRC="/big.jpg?w=925&h=925"><img src="/second.jpg">]]></content:encoded>
|
||||
</item>
|
||||
<item>
|
||||
<title>Description image</title>
|
||||
<description><img src="https://example.com/desc.png"> unclosed <b></description>
|
||||
</item>
|
||||
<item>
|
||||
<title>Media wins</title>
|
||||
<media:thumbnail url="https://example.com/thumb.jpg" />
|
||||
<description><![CDATA[<img src="https://example.com/html.jpg">]]></description>
|
||||
</item>
|
||||
<item>
|
||||
<title>No usable image</title>
|
||||
<description><![CDATA[<img src="javascript:alert(1)"><img>]]></description>
|
||||
</item>
|
||||
</channel></rss>`;
|
||||
|
||||
expect(parseFeed(xml, "https://example.com/feed").map((item) => item.image)).toEqual([
|
||||
"https://example.com/big.jpg?w=925&h=925",
|
||||
"https://example.com/desc.png",
|
||||
"https://example.com/thumb.jpg",
|
||||
null,
|
||||
]);
|
||||
});
|
||||
|
||||
it("finds images in atom html content and summary", () => {
|
||||
const xml = `<feed xmlns="http://www.w3.org/2005/Atom">
|
||||
<entry><title>Content</title><content type="html"><img src="https://example.com/c.jpg"></content></entry>
|
||||
<entry><title>Summary</title><summary type="html"><img src="https://example.com/s.jpg"></summary></entry>
|
||||
</feed>`;
|
||||
|
||||
expect(parseFeed(xml).map((item) => item.image)).toEqual([
|
||||
"https://example.com/c.jpg",
|
||||
"https://example.com/s.jpg",
|
||||
]);
|
||||
});
|
||||
|
||||
it("handles single-item and empty feeds", () => {
|
||||
const single = "<rss><channel><item><title>Only</title></item></channel></rss>";
|
||||
expect(parseFeed(single)).toEqual([{ title: "Only", link: null, date: null, image: null }]);
|
||||
expect(parseFeed("<feed></feed>")).toEqual([]);
|
||||
});
|
||||
|
||||
it("rejects unsupported documents", () => {
|
||||
expect(() => parseFeed("<html><body>nope</body></html>")).toThrow("Unsupported feed format");
|
||||
expect(() => parseFeed("not xml <")).toThrow();
|
||||
});
|
||||
|
||||
it.each([
|
||||
["https://a.com/x", undefined, "https://a.com/x"],
|
||||
["/x", "https://a.com/feed", "https://a.com/x"],
|
||||
["data:image/png;base64,AAAA", undefined, null],
|
||||
["not a url", undefined, null],
|
||||
["", undefined, null],
|
||||
])("httpUrl(%j, %j) is %j", (value, base, expected) => {
|
||||
expect(httpUrl(value, base)).toBe(expected);
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,8 @@
|
||||
import feedProxyHandler from "./proxy";
|
||||
|
||||
const widget = {
|
||||
api: "{url}",
|
||||
proxyHandler: feedProxyHandler,
|
||||
};
|
||||
|
||||
export default widget;
|
||||
@@ -0,0 +1,12 @@
|
||||
import { describe, expect, it } from "vitest";
|
||||
|
||||
import { expectWidgetConfigShape } from "test-utils/widget-config";
|
||||
|
||||
import widget from "./widget";
|
||||
|
||||
describe("feed widget config", () => {
|
||||
it("exports a valid widget config", () => {
|
||||
expectWidgetConfigShape(widget);
|
||||
expect(widget.api).toBe("{url}");
|
||||
});
|
||||
});
|
||||
@@ -11,13 +11,10 @@ const widget = {
|
||||
},
|
||||
issues: {
|
||||
endpoint: "repos/issues/search",
|
||||
map: (data) => {
|
||||
const items = asJson(data);
|
||||
return {
|
||||
pulls: items.filter((issue) => issue.pull_request),
|
||||
issues: items.filter((issue) => !issue.pull_request),
|
||||
};
|
||||
},
|
||||
map: (data) => ({
|
||||
pulls: asJson(data).filter((issue) => issue.pull_request),
|
||||
issues: asJson(data).filter((issue) => !issue.pull_request),
|
||||
}),
|
||||
},
|
||||
repositories: {
|
||||
endpoint: "repos/search",
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { describe, expect, it } from "vitest";
|
||||
import { describe, it } from "vitest";
|
||||
|
||||
import { expectWidgetConfigShape } from "test-utils/widget-config";
|
||||
|
||||
@@ -8,13 +8,4 @@ describe("gitea widget config", () => {
|
||||
it("exports a valid widget config", () => {
|
||||
expectWidgetConfigShape(widget);
|
||||
});
|
||||
|
||||
it("splits issues and pull requests", () => {
|
||||
const result = widget.mappings.issues.map(
|
||||
Buffer.from(JSON.stringify([{ id: 1, pull_request: {} }, { id: 2 }, { id: 3 }])),
|
||||
);
|
||||
|
||||
expect(result.pulls.map((i) => i.id)).toEqual([1]);
|
||||
expect(result.issues.map((i) => i.id)).toEqual([2, 3]);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -8,13 +8,10 @@ const widget = {
|
||||
mappings: {
|
||||
counters: {
|
||||
endpoint: "feeds/counters",
|
||||
map: (data) => {
|
||||
const { reads, unreads } = asJson(data);
|
||||
return {
|
||||
read: Object.values(reads).reduce((acc, i) => acc + i, 0),
|
||||
unread: Object.values(unreads).reduce((acc, i) => acc + i, 0),
|
||||
};
|
||||
},
|
||||
map: (data) => ({
|
||||
read: Object.values(asJson(data).reads).reduce((acc, i) => acc + i, 0),
|
||||
unread: Object.values(asJson(data).unreads).reduce((acc, i) => acc + i, 0),
|
||||
}),
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { describe, expect, it } from "vitest";
|
||||
import { describe, it } from "vitest";
|
||||
|
||||
import { expectWidgetConfigShape } from "test-utils/widget-config";
|
||||
|
||||
@@ -8,12 +8,4 @@ describe("miniflux widget config", () => {
|
||||
it("exports a valid widget config", () => {
|
||||
expectWidgetConfigShape(widget);
|
||||
});
|
||||
|
||||
it("sums read and unread counters", () => {
|
||||
const result = widget.mappings.counters.map(
|
||||
Buffer.from(JSON.stringify({ reads: { 1: 2, 2: 3 }, unreads: { 1: 4, 2: 1 } })),
|
||||
);
|
||||
|
||||
expect(result).toEqual({ read: 5, unread: 5 });
|
||||
});
|
||||
});
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { asJson } from "utils/proxy/api-helpers";
|
||||
import { asJson, jsonArrayFilter } from "utils/proxy/api-helpers";
|
||||
import genericProxyHandler from "utils/proxy/handlers/generic";
|
||||
|
||||
const widget = {
|
||||
@@ -8,18 +8,15 @@ const widget = {
|
||||
mappings: {
|
||||
movie: {
|
||||
endpoint: "movie",
|
||||
map: (data) => {
|
||||
const movieData = asJson(data) ?? [];
|
||||
return {
|
||||
wanted: movieData.filter((item) => item.monitored && !item.hasFile && item.isAvailable).length,
|
||||
have: movieData.filter((item) => item.hasFile).length,
|
||||
missing: movieData.filter((item) => item.monitored && !item.hasFile).length,
|
||||
all: movieData.map((entry) => ({
|
||||
title: entry.title,
|
||||
id: entry.id,
|
||||
})),
|
||||
};
|
||||
},
|
||||
map: (data) => ({
|
||||
wanted: jsonArrayFilter(data, (item) => item.monitored && !item.hasFile && item.isAvailable).length,
|
||||
have: jsonArrayFilter(data, (item) => item.hasFile).length,
|
||||
missing: jsonArrayFilter(data, (item) => item.monitored && !item.hasFile).length,
|
||||
all: asJson(data).map((entry) => ({
|
||||
title: entry.title,
|
||||
id: entry.id,
|
||||
})),
|
||||
}),
|
||||
},
|
||||
"queue/status": {
|
||||
endpoint: "queue/status",
|
||||
|
||||
@@ -33,27 +33,4 @@ describe("radarr widget config", () => {
|
||||
|
||||
expect(queue.map((entry) => entry.movieId)).toEqual([2, 1]);
|
||||
});
|
||||
|
||||
it("maps movie counts and titles", () => {
|
||||
const movies = widget.mappings.movie.map(
|
||||
Buffer.from(
|
||||
JSON.stringify([
|
||||
{ id: 1, title: "A", monitored: true, hasFile: false, isAvailable: true },
|
||||
{ id: 2, title: "B", monitored: true, hasFile: true },
|
||||
{ id: 3, title: "C", monitored: true, hasFile: false, isAvailable: false },
|
||||
]),
|
||||
),
|
||||
);
|
||||
|
||||
expect(movies).toEqual({
|
||||
wanted: 1,
|
||||
have: 1,
|
||||
missing: 2,
|
||||
all: [
|
||||
{ title: "A", id: 1 },
|
||||
{ title: "B", id: 2 },
|
||||
{ title: "C", id: 3 },
|
||||
],
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@@ -8,13 +8,10 @@ const widget = {
|
||||
mappings: {
|
||||
workers: {
|
||||
endpoint: "workers/status",
|
||||
map: (data) => {
|
||||
const workers = asJson(data).workers_status;
|
||||
return {
|
||||
total_workers: workers.length,
|
||||
active_workers: workers.filter((worker) => !worker.idle).length,
|
||||
};
|
||||
},
|
||||
map: (data) => ({
|
||||
total_workers: asJson(data).workers_status.length,
|
||||
active_workers: asJson(data).workers_status.filter((worker) => !worker.idle).length,
|
||||
}),
|
||||
},
|
||||
pending: {
|
||||
method: "POST",
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { describe, expect, it } from "vitest";
|
||||
import { describe, it } from "vitest";
|
||||
|
||||
import { expectWidgetConfigShape } from "test-utils/widget-config";
|
||||
|
||||
@@ -8,12 +8,4 @@ describe("unmanic widget config", () => {
|
||||
it("exports a valid widget config", () => {
|
||||
expectWidgetConfigShape(widget);
|
||||
});
|
||||
|
||||
it("counts total and active workers", () => {
|
||||
const result = widget.mappings.workers.map(
|
||||
Buffer.from(JSON.stringify({ workers_status: [{ idle: true }, { idle: false }, { idle: false }] })),
|
||||
);
|
||||
|
||||
expect(result).toEqual({ total_workers: 3, active_workers: 2 });
|
||||
});
|
||||
});
|
||||
|
||||
@@ -31,6 +31,7 @@ import duplicati from "./duplicati/widget";
|
||||
import emby from "./emby/widget";
|
||||
import esphome from "./esphome/widget";
|
||||
import evcc from "./evcc/widget";
|
||||
import feed from "./feed/widget";
|
||||
import filebrowser from "./filebrowser/widget";
|
||||
import fileflows from "./fileflows/widget";
|
||||
import firefly from "./firefly/widget";
|
||||
@@ -191,6 +192,7 @@ const widgets = {
|
||||
emby,
|
||||
esphome,
|
||||
evcc,
|
||||
feed,
|
||||
filebrowser,
|
||||
fileflows,
|
||||
firefly,
|
||||
|
||||
Reference in New Issue
Block a user