From c6f919b085e285909babf28dc42c427907ce2768 Mon Sep 17 00:00:00 2001 From: MacRimi Date: Sun, 18 Oct 2026 19:45:54 +0200 Subject: [PATCH] Show linked node addresses as text with an edit button - Each linked node shows its Monitor address as plain text, marked Automatic when it was detected - A pencil button opens the address field with Save and Cancel only when it needs changing - The node cards keep the dialog background so the editable fields stand out - The Add button keeps white text when disabled - New texts translated into all languages --- AppImage/components/monitor-switcher.tsx | 48 ++++++++++++++++-------- AppImage/messages/de/common.json | 4 +- AppImage/messages/en/common.json | 4 +- AppImage/messages/es/common.json | 4 +- AppImage/messages/fr/common.json | 4 +- AppImage/messages/it/common.json | 4 +- AppImage/messages/pt/common.json | 4 +- AppImage/messages/sk/common.json | 4 +- AppImage/messages/sv/common.json | 4 +- 9 files changed, 57 insertions(+), 23 deletions(-) diff --git a/AppImage/components/monitor-switcher.tsx b/AppImage/components/monitor-switcher.tsx index 0e2f6501..63b57948 100644 --- a/AppImage/components/monitor-switcher.tsx +++ b/AppImage/components/monitor-switcher.tsx @@ -2,7 +2,7 @@ import { useEffect, useState } from "react" import useSWR, { mutate as refreshCache } from "swr" -import { ArrowLeft, ChevronDown, DatabaseBackup, ExternalLink, Globe, Plus, Server, Trash2 } from "lucide-react" +import { ArrowLeft, ChevronDown, DatabaseBackup, ExternalLink, Globe, Pencil, Plus, Server, Trash2 } from "lucide-react" import { Button } from "./ui/button" import { Input } from "./ui/input" import { Label } from "./ui/label" @@ -280,6 +280,7 @@ function ManageLinksDialog({ open, onOpenChange }: { open: boolean; onOpenChange const { data, mutate } = useSWR("/api/monitor-links?all=1", fetcher, { revalidateOnFocus: false }) const [form, setForm] = useState({ name: "", url: "", product: "pve" }) const [addresses, setAddresses] = useState>({}) + const [editing, setEditing] = useState(null) const [busy, setBusy] = useState(false) const [error, setError] = useState("") @@ -304,7 +305,7 @@ function ManageLinksDialog({ open, onOpenChange }: { open: boolean; onOpenChange {t("monitorLinks.dialogDescription")} -
+

{t("monitorLinks.addTitle")}

@@ -327,7 +328,7 @@ function ManageLinksDialog({ open, onOpenChange }: { open: boolean; onOpenChange
- @@ -338,8 +339,12 @@ function ManageLinksDialog({ open, onOpenChange }: { open: boolean; onOpenChange
{data?.links.length === 0 &&

{t("monitorLinks.empty")}

} {data?.links.map(link => { - const address = addresses[link.key] ?? (link.manual || link.custom_url ? link.url || "" : "") - return
+ const own = link.manual || link.custom_url + const shown = link.url || "" + const draft = addresses[link.key] ?? (own ? shown : "") + const isEditing = editing === link.key + // A read-only card is a panel; while its address is edited it lets the field stand out. + return
{link.name} @@ -354,16 +359,29 @@ function ManageLinksDialog({ open, onOpenChange }: { open: boolean; onOpenChange }
-
- setAddresses({ ...addresses, [link.key]: event.target.value })} /> - -
+ {isEditing + ?
+ setAddresses({ ...addresses, [link.key]: event.target.value })} /> + + +
+ :
+ {shown || "—"} + {!link.manual && !link.custom_url && {t("monitorLinks.autoAddress")}} + +
}
})}
diff --git a/AppImage/messages/de/common.json b/AppImage/messages/de/common.json index 7e4012c9..6c9a5fb6 100644 --- a/AppImage/messages/de/common.json +++ b/AppImage/messages/de/common.json @@ -7379,6 +7379,8 @@ "knownTitle": "Verknüpfte Knoten hinzufügen?", "knownBody": "{name} verknüpft diese Monitore. Wählen Sie aus, welche Sie diesem Monitor hinzufügen möchten.", "addSelected": "Auswahl hinzufügen", - "pbsWebInterface": "PBS-Weboberfläche" + "pbsWebInterface": "PBS-Weboberfläche", + "changeAddress": "Adresse ändern", + "cancel": "Abbrechen" } } diff --git a/AppImage/messages/en/common.json b/AppImage/messages/en/common.json index 522e6aa9..5f144106 100644 --- a/AppImage/messages/en/common.json +++ b/AppImage/messages/en/common.json @@ -6587,6 +6587,8 @@ "knownTitle": "Add linked nodes?", "knownBody": "{name} links these Monitors. Choose the ones to add to this Monitor.", "addSelected": "Add selected", - "pbsWebInterface": "PBS web interface" + "pbsWebInterface": "PBS web interface", + "changeAddress": "Change address", + "cancel": "Cancel" } } diff --git a/AppImage/messages/es/common.json b/AppImage/messages/es/common.json index 72ae2d03..53324e23 100644 --- a/AppImage/messages/es/common.json +++ b/AppImage/messages/es/common.json @@ -7379,6 +7379,8 @@ "knownTitle": "¿Añadir nodos enlazados?", "knownBody": "{name} enlaza estos Monitores. Elige los que quieres añadir a este Monitor.", "addSelected": "Añadir seleccionados", - "pbsWebInterface": "Interfaz web de PBS" + "pbsWebInterface": "Interfaz web de PBS", + "changeAddress": "Cambiar dirección", + "cancel": "Cancelar" } } diff --git a/AppImage/messages/fr/common.json b/AppImage/messages/fr/common.json index 774e0806..c42e18fb 100644 --- a/AppImage/messages/fr/common.json +++ b/AppImage/messages/fr/common.json @@ -7379,6 +7379,8 @@ "knownTitle": "Ajouter des nœuds liés ?", "knownBody": "{name} relie ces moniteurs. Choisissez ceux à ajouter à ce moniteur.", "addSelected": "Ajouter la sélection", - "pbsWebInterface": "Interface web de PBS" + "pbsWebInterface": "Interface web de PBS", + "changeAddress": "Modifier l'adresse", + "cancel": "Annuler" } } diff --git a/AppImage/messages/it/common.json b/AppImage/messages/it/common.json index aa45651e..88fb45a7 100644 --- a/AppImage/messages/it/common.json +++ b/AppImage/messages/it/common.json @@ -7379,6 +7379,8 @@ "knownTitle": "Aggiungere nodi collegati?", "knownBody": "{name} collega questi monitor. Scegli quelli da aggiungere a questo monitor.", "addSelected": "Aggiungi selezionati", - "pbsWebInterface": "Interfaccia web di PBS" + "pbsWebInterface": "Interfaccia web di PBS", + "changeAddress": "Cambia indirizzo", + "cancel": "Annulla" } } diff --git a/AppImage/messages/pt/common.json b/AppImage/messages/pt/common.json index 78a21e14..2af0c313 100644 --- a/AppImage/messages/pt/common.json +++ b/AppImage/messages/pt/common.json @@ -7379,6 +7379,8 @@ "knownTitle": "Adicionar nós vinculados?", "knownBody": "{name} liga estes Monitores. Escolha os que quer adicionar a este Monitor.", "addSelected": "Adicionar selecionados", - "pbsWebInterface": "Interface web do PBS" + "pbsWebInterface": "Interface web do PBS", + "changeAddress": "Alterar endereço", + "cancel": "Cancelar" } } diff --git a/AppImage/messages/sk/common.json b/AppImage/messages/sk/common.json index 6d619e64..af9535b0 100644 --- a/AppImage/messages/sk/common.json +++ b/AppImage/messages/sk/common.json @@ -7378,6 +7378,8 @@ "knownTitle": "Pridať prepojené uzly?", "knownBody": "{name} prepája tieto monitory. Vyberte tie, ktoré chcete pridať do tohto monitora.", "addSelected": "Pridať vybrané", - "pbsWebInterface": "Webové rozhranie PBS" + "pbsWebInterface": "Webové rozhranie PBS", + "changeAddress": "Zmeniť adresu", + "cancel": "Zrušiť" } } diff --git a/AppImage/messages/sv/common.json b/AppImage/messages/sv/common.json index 8a5434e8..9d1c2f62 100644 --- a/AppImage/messages/sv/common.json +++ b/AppImage/messages/sv/common.json @@ -7379,6 +7379,8 @@ "knownTitle": "Lägga till länkade noder?", "knownBody": "{name} länkar dessa monitorer. Välj vilka du vill lägga till på denna monitor.", "addSelected": "Lägg till valda", - "pbsWebInterface": "PBS webbgränssnitt" + "pbsWebInterface": "PBS webbgränssnitt", + "changeAddress": "Ändra adress", + "cancel": "Avbryt" } }