import { useState } from 'react'
import { Link } from 'react-router-dom'
import { useQuery } from '@tanstack/react-query'
import { systemAPI, NetworkInterface } from '@/api/system'
export default function System() {
const [snmpEnabled, setSnmpEnabled] = useState(false)
// Fetch network interfaces
const { data: interfaces = [], isLoading: interfacesLoading } = useQuery({
queryKey: ['system', 'interfaces'],
queryFn: () => systemAPI.listNetworkInterfaces(),
refetchInterval: 5000, // Refresh every 5 seconds
})
return (
{/* Top Navigation */}
{/* Breadcrumbs */}
System
/
Configuration
{/* Scrollable Content */}
{/* Page Header */}
System Configuration
Manage network interfaces, time synchronization, service states, and remote management protocols.
{/* Grid Layout */}
{/* Network Card */}
lan
Network Interfaces
{interfacesLoading ? (
Loading interfaces...
) : interfaces.length === 0 ? (
No network interfaces found
) : (
interfaces.map((iface: NetworkInterface) => {
const isConnected = iface.status === 'Connected'
const roleBgColor = iface.role === 'ISCSI' ? 'bg-purple-500/20' : 'bg-primary/20'
const roleTextColor = iface.role === 'ISCSI' ? 'text-purple-400' : 'text-primary'
return (
settings_ethernet
{iface.name}
{iface.role && (
{iface.role}
)}
{iface.ip_address ? (
{iface.ip_address} / {iface.subnet}
) : (
No Carrier
)}
{isConnected ? (
<>
{iface.speed && iface.speed !== 'Unknown' && (
{iface.speed}
)}
>
) : (
)}
)
})
)}
{/* Services Card */}
memory
Service Control
All Systems Normal
{/* Service Row */}
terminal
SSH Service
Remote command line access
{/* Service Row */}
folder_shared
SMB / CIFS
Windows file sharing
{/* Service Row */}
storage
iSCSI Target
Block storage sharing
{/* Service Row */}
share
NFS Service
Unix file sharing
{/* Service Row - VTL (MHVTL) */}
album
VTL Service
Virtual tape library emulation
{/* Date & Time Card */}
expand_more
{/* Management & SNMP Card */}
{/* Bottom Spacer */}
)
}