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
System Healthy
{/* 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 ? ( <>
Connected
{iface.speed && iface.speed !== 'Unknown' && ( {iface.speed} )} ) : (
Down
)}
) }) )}
{/* Services Card */}
memory

Service Control

All Systems Normal
{/* Service Row */}
terminal

SSH Service

Remote command line access

RUNNING
{/* Service Row */}
folder_shared

SMB / CIFS

Windows file sharing

RUNNING
{/* Service Row */}
storage

iSCSI Target

Block storage sharing

STOPPED
{/* Service Row */}
share

NFS Service

Unix file sharing

RUNNING
{/* Service Row - VTL (MHVTL) */}
album

VTL Service

Virtual tape library emulation

RUNNING
{/* Date & Time Card */}
schedule

Date & Time

UTC
expand_more
pool.ntp.org
Stratum 2 • 12ms
time.google.com
Stratum 1 • 45ms
{/* Management & SNMP Card */}
hub

Management

SNMP Monitoring

Enable Simple Network Management Protocol

setSnmpEnabled(e.target.checked)} className="toggle-checkbox absolute block w-5 h-5 rounded-full bg-white border-4 appearance-none cursor-pointer checked:right-0 checked:border-primary transition-all duration-300" id="snmp-toggle" name="toggle" type="checkbox" />

Syslog Forwarding

{/* Bottom Spacer */}
) }