Files
homelable/frontend/src/utils/demoData.ts
T
Pouzor 9bb34c99cc feat: add frontend source (fix submodule), compact node design
- Remove nested .git from Vite scaffold
- Horizontal node layout: icon left, label+IP right, reduced height
2026-03-06 23:31:15 +01:00

79 lines
3.6 KiB
TypeScript

import type { Node, Edge } from '@xyflow/react'
import type { NodeData, EdgeData } from '@/types'
export const demoNodes: Node<NodeData>[] = [
{
id: 'isp-1',
type: 'isp',
position: { x: 300, y: 20 },
data: { label: 'Freebox Ultra', type: 'isp', ip: '10.0.0.1', status: 'online', services: [] },
},
{
id: 'router-1',
type: 'router',
position: { x: 300, y: 140 },
data: { label: 'OpnSense', type: 'router', hostname: 'opnsense.lan', ip: '192.168.1.1', status: 'online', check_method: 'ping', services: [] },
},
{
id: 'switch-1',
type: 'switch',
position: { x: 140, y: 260 },
data: { label: 'Netgear GS308', type: 'switch', ip: '192.168.1.2', status: 'online', services: [] },
},
{
id: 'switch-2',
type: 'switch',
position: { x: 460, y: 260 },
data: { label: 'TP-Link TL-SG108', type: 'switch', ip: '192.168.1.3', status: 'unknown', services: [] },
},
{
id: 'proxmox-1',
type: 'proxmox',
position: { x: 60, y: 380 },
data: { label: 'PVE01', type: 'proxmox', hostname: 'pve01.lan', ip: '192.168.1.10', os: 'Proxmox VE 8.2', status: 'online', check_method: 'https', check_target: 'https://192.168.1.10:8006', services: [{ port: 8006, protocol: 'tcp', service_name: 'Proxmox VE', category: 'hypervisor' }] },
},
{
id: 'server-1',
type: 'server',
position: { x: 300, y: 380 },
data: { label: 'NAS-01', type: 'nas', hostname: 'nas.lan', ip: '192.168.1.20', status: 'online', check_method: 'http', services: [{ port: 5000, protocol: 'tcp', service_name: 'Synology DSM', category: 'nas' }] },
},
{
id: 'ap-1',
type: 'ap',
position: { x: 460, y: 380 },
data: { label: 'UniFi AP', type: 'ap', ip: '192.168.1.30', status: 'online', check_method: 'ping', services: [] },
},
{
id: 'vm-1',
type: 'vm',
position: { x: 20, y: 500 },
data: { label: 'Home Assistant', type: 'vm', hostname: 'ha.lan', ip: '192.168.1.11', status: 'online', check_method: 'http', services: [{ port: 8123, protocol: 'tcp', service_name: 'Home Assistant', category: 'automation' }] },
},
{
id: 'lxc-1',
type: 'lxc',
position: { x: 140, y: 500 },
data: { label: 'Portainer', type: 'lxc', hostname: 'portainer.lan', ip: '192.168.1.12', status: 'offline', check_method: 'https', services: [{ port: 9443, protocol: 'tcp', service_name: 'Portainer', category: 'containers' }] },
},
{
id: 'iot-1',
type: 'iot',
position: { x: 460, y: 500 },
data: { label: 'Zigbee Hub', type: 'iot', ip: '192.168.2.1', status: 'pending', check_method: 'tcp', services: [] },
},
]
export const demoEdges: Edge<EdgeData>[] = [
{ id: 'e1', source: 'isp-1', target: 'router-1', type: 'ethernet', data: { type: 'ethernet' } },
{ id: 'e2', source: 'router-1', target: 'switch-1', type: 'ethernet', data: { type: 'ethernet', label: '1G' } },
{ id: 'e3', source: 'router-1', target: 'switch-2', type: 'ethernet', data: { type: 'ethernet', label: '1G' } },
{ id: 'e4', source: 'switch-1', target: 'proxmox-1', type: 'ethernet', data: { type: 'ethernet' } },
{ id: 'e5', source: 'switch-1', target: 'server-1', type: 'ethernet', data: { type: 'ethernet' } },
{ id: 'e6', source: 'switch-2', target: 'ap-1', type: 'ethernet', data: { type: 'ethernet' } },
{ id: 'e7', source: 'proxmox-1', target: 'vm-1', type: 'virtual', data: { type: 'virtual' } },
{ id: 'e8', source: 'proxmox-1', target: 'lxc-1', type: 'virtual', data: { type: 'virtual' } },
{ id: 'e9', source: 'ap-1', target: 'iot-1', type: 'wifi', data: { type: 'wifi' } },
{ id: 'e10', source: 'router-1', target: 'server-1', type: 'vlan', data: { type: 'vlan', vlan_id: 20, label: 'VLAN 20' } },
]