Просмотр исходного кода

fix(settings): restore native OpenWrt role in devices table (#662)

The Role column was refactored into a three-state pill and lost the
native "OpenWrt" type, so a regular OpenWrt router running the SSH
agent fell into the fallback branch and rendered as "Managed switch".

Branch on the device type: managed-switch -> typeManaged, external ->
typeExternal, otherwise (openwrt/glinet) -> openWrtBadge.

Closes #660

Co-authored-by: gnacho <hnacho@proton.me>
Nacho 2 месяцев назад
Родитель
Сommit
72946374b3

+ 2 - 1
app/public/locales/en/translation.json

@@ -1148,7 +1148,8 @@
       "snmpPort": "Port",
       "snmpPollInterval": "Interval (s)",
       "sshPort": "SSH port",
-      "sshPortHint": "SSH port of the router (default 22)"
+      "sshPortHint": "SSH port of the router (default 22)",
+      "openWrtBadge": "OpenWrt"
     },
     "overrides": {
       "title": "Topology — manual tagging",

+ 2 - 1
app/public/locales/es/translation.json

@@ -1148,7 +1148,8 @@
       "snmpPort": "Puerto",
       "snmpPollInterval": "Intervalo (s)",
       "sshPort": "Puerto SSH",
-      "sshPortHint": "Puerto SSH del router (22 por defecto)"
+      "sshPortHint": "Puerto SSH del router (22 por defecto)",
+      "openWrtBadge": "OpenWrt"
     },
     "overrides": {
       "title": "Topología — etiquetado manual",

+ 9 - 1
app/src/pages/Settings.tsx

@@ -660,10 +660,18 @@ function RoutersManager({ reduce, onSaved }: { reduce: boolean; onSaved: () => v
                       <span className="rounded bg-elevated px-1.5 py-0.5 text-[10px] font-bold uppercase tracking-wide text-text-muted ring-1 ring-inset ring-border">
                         {t('settings.routers.agentOnlyBadge')}
                       </span>
-                    ) : (
+                    ) : r.type === 'managed-switch' ? (
                       <span className="rounded bg-elevated px-1.5 py-0.5 text-[10px] font-bold uppercase tracking-wide text-text-muted ring-1 ring-inset ring-border">
                         {t('settings.routers.typeManaged')}
                       </span>
+                    ) : r.type === 'external' ? (
+                      <span className="rounded bg-elevated px-1.5 py-0.5 text-[10px] font-bold uppercase tracking-wide text-text-muted ring-1 ring-inset ring-border">
+                        {t('settings.routers.typeExternal')}
+                      </span>
+                    ) : (
+                      <span className="rounded bg-elevated px-1.5 py-0.5 text-[10px] font-bold uppercase tracking-wide text-text-primary ring-1 ring-inset ring-border">
+                        {t('settings.routers.openWrtBadge')}
+                      </span>
                     )}
                   </td>
                   <td className="px-3.5 py-2.5">