fix: persist custom_icon on canvas save + add CCTV icon

- NodeSave schema was missing custom_icon field — icon reset to default on reload
- handleSave was not including custom_icon in the payload
- CameraNode now uses Cctv icon (clearer than Camera)
- Added 'cctv' entry to ICON_REGISTRY for the icon picker
This commit is contained in:
Pouzor
2026-03-08 12:00:11 +01:00
parent 88634aeb1d
commit 4511763bac
4 changed files with 6 additions and 3 deletions
+1
View File
@@ -22,6 +22,7 @@ class NodeSave(BaseModel):
parent_id: str | None = None
container_mode: bool = False
custom_colors: dict[str, Any] | None = None
custom_icon: str | None = None
pos_x: float = 0
pos_y: float = 0
+1
View File
@@ -53,6 +53,7 @@ export default function App() {
parent_id: n.data.parent_id ?? null,
container_mode: n.data.container_mode ?? false,
custom_colors: n.data.custom_colors ?? null,
custom_icon: n.data.custom_icon ?? null,
pos_x: n.position.x,
pos_y: n.position.y,
}))
@@ -1,7 +1,7 @@
import { type NodeProps, type Node } from '@xyflow/react'
import {
Globe, Router, Network, Server, Layers, Box, Container,
HardDrive, Cpu, Wifi, Circle, Camera,
HardDrive, Cpu, Wifi, Circle, Cctv,
} from 'lucide-react'
import { BaseNode } from './BaseNode'
import type { NodeData } from '@/types'
@@ -18,5 +18,5 @@ export const LxcNode = (props: N) => <BaseNode {...props} icon={Container} /
export const NasNode = (props: N) => <BaseNode {...props} icon={HardDrive} />
export const IotNode = (props: N) => <BaseNode {...props} icon={Cpu} />
export const ApNode = (props: N) => <BaseNode {...props} icon={Wifi} />
export const CameraNode = (props: N) => <BaseNode {...props} icon={Camera} />
export const CameraNode = (props: N) => <BaseNode {...props} icon={Cctv} />
export const GenericNode = (props: N) => <BaseNode {...props} icon={Circle} />
+2 -1
View File
@@ -2,7 +2,7 @@ import {
// Infrastructure (node types)
Globe, Router, Network, Server, Layers, Box, Container, HardDrive, Cpu, Wifi, Circle,
// Media
Play, Film, Tv, Tv2, Music, Camera, Video, Headphones, Clapperboard,
Play, Film, Tv, Tv2, Music, Camera, Video, Headphones, Clapperboard, Cctv,
// Monitoring & Observability
Activity, BarChart2, LineChart, Eye, Bell, Gauge, Monitor,
// Storage & Databases
@@ -57,6 +57,7 @@ export const ICON_REGISTRY: IconEntry[] = [
{ key: 'headphones', label: 'Audiobookshelf', category: 'Media', icon: Headphones },
{ key: 'video', label: 'Video / Streaming', category: 'Media', icon: Video },
{ key: 'camera', label: 'Camera / Frigate', category: 'Media', icon: Camera },
{ key: 'cctv', label: 'CCTV / IP Camera', category: 'Media', icon: Cctv },
// --- Monitoring ---
{ key: 'activity', label: 'Prometheus / Uptime', category: 'Monitoring', icon: Activity },