Parcourir la source

feat(devices): cctv/vacuum/doorbell icons in the manual picker; float the detail Edit button (#1330)

The #1328 glyphs are now selectable in the manual icon override (frontend map + server allowlist in lockstep), and the expanded device detail's Edit button floats 20px off the bottom-right corner.

Closes #1329.
Nacho il y a 1 mois
Parent
commit
ca321a76f4

+ 3 - 0
app/src/components/DeviceRow.tsx

@@ -61,6 +61,9 @@ export const ICON_OVERRIDES: Record<string, LucideIcon> = {
   tv: Tv,
   tv: Tv,
   gamepad: Gamepad2,
   gamepad: Gamepad2,
   camera: Camera,
   camera: Camera,
+  cctv: Cctv,
+  vacuum: BrushCleaning,
+  doorbell: BellRing,
   speaker: Speaker,
   speaker: Speaker,
   router: Network,
   router: Network,
   server: Server,
   server: Server,

+ 3 - 2
app/src/pages/Devices.tsx

@@ -885,12 +885,13 @@ function DeviceDetail({
           )}
           )}
         </DetailItem>
         </DetailItem>
       )}
       )}
-      {/* Editar a la derecha, sin texto auxiliar (#985). */}
+      {/* Editar a la derecha, sin texto auxiliar (#985). #1329: flotando
+          20px arriba y a la izquierda de la esquina del panel. */}
       <div className="col-span-2 flex justify-end md:col-span-3">
       <div className="col-span-2 flex justify-end md:col-span-3">
         <button
         <button
           type="button"
           type="button"
           onClick={onEdit}
           onClick={onEdit}
-          className="inline-flex items-center gap-1.5 rounded-lg border border-border bg-elevated px-3 py-2 text-sm font-medium text-text-secondary transition-colors hover:border-accent/40 hover:text-accent"
+          className="inline-flex -translate-x-5 -translate-y-5 items-center gap-1.5 rounded-lg border border-border bg-elevated px-3 py-2 text-sm font-medium text-text-secondary transition-colors hover:border-accent/40 hover:text-accent"
         >
         >
           <Pencil className="h-3.5 w-3.5" strokeWidth={1.75} />
           <Pencil className="h-3.5 w-3.5" strokeWidth={1.75} />
           {t('devices.edit.action')}
           {t('devices.edit.action')}

+ 2 - 1
server-go/internal/httpapi/device_overrides.go

@@ -48,7 +48,8 @@ func validateIcon(icon string) bool {
 	}
 	}
 	allowed := map[string]bool{
 	allowed := map[string]bool{
 		"monitor": true, "laptop": true, "smartphone": true, "tablet": true,
 		"monitor": true, "laptop": true, "smartphone": true, "tablet": true,
-		"tv": true, "gamepad": true, "camera": true, "speaker": true,
+		"tv": true, "gamepad": true, "camera": true, "cctv": true,
+		"vacuum": true, "doorbell": true, "speaker": true,
 		"router": true, "server": true, "watch": true, "car": true,
 		"router": true, "server": true, "watch": true, "car": true,
 		"home": true, "printer": true, "plug": true, "shield": true,
 		"home": true, "printer": true, "plug": true, "shield": true,
 		"help-circle": true, "wifi": true, "ethernet": true,
 		"help-circle": true, "wifi": true, "ethernet": true,