import React, { useState } from 'react'; import { HardDrive, Cpu, Layers, FolderSync, ShieldCheck, Activity, ArrowUpRight, TrendingUp, Zap, } from 'lucide-react'; import { AppIcon } from '../components/AppIcon.js'; import type { SystemStatus, ZfsPool, InstalledApp } from '../types/index.js'; interface OverviewViewProps { status: SystemStatus | null; pools: ZfsPool[]; apps: InstalledApp[]; onNavigate: (tab: string) => void; } export const OverviewView: React.FC = ({ status, pools, apps, onNavigate, }) => { const primaryPool = pools[0]; const [telemetryRange, setTelemetryRange] = useState<'15m' | '1h' | '6h' | '24h'>('1h'); // Sparkline data based on selected time range const throughputData = { '15m': [34, 45, 62, 50, 78, 110, 95, 82, 60, 88, 115, 142, 90, 75, 105], '1h': [42, 65, 30, 85, 95, 120, 80, 45, 60, 90, 110, 75, 40, 95, 130], '6h': [20, 35, 45, 80, 110, 145, 130, 95, 70, 85, 60, 50, 65, 90, 85], '24h': [15, 25, 40, 65, 90, 120, 140, 110, 85, 70, 60, 55, 70, 80, 95], }[telemetryRange]; const arcRatioData = { '15m': [98.2, 98.4, 98.5, 98.3, 98.6, 98.8, 98.7, 98.5, 98.9, 98.6, 98.7, 98.6, 98.8, 98.7, 98.6], '1h': [97.8, 98.1, 98.4, 98.2, 98.6, 98.8, 98.5, 98.7, 98.4, 98.9, 98.6, 98.7, 98.5, 98.8, 98.6], '6h': [97.2, 97.6, 98.0, 98.3, 98.5, 98.7, 98.4, 98.6, 98.8, 98.5, 98.7, 98.6, 98.4, 98.6, 98.6], '24h': [96.8, 97.2, 97.9, 98.1, 98.4, 98.6, 98.7, 98.5, 98.6, 98.7, 98.5, 98.6, 98.7, 98.8, 98.6], }[telemetryRange]; const cpuData = { '15m': [8, 12, 14, 22, 38, 18, 11, 9, 15, 18, 28, 15, 12, 14, 11], '1h': [10, 14, 18, 25, 42, 19, 12, 10, 16, 20, 32, 16, 14, 15, 12], '6h': [8, 10, 15, 30, 48, 25, 14, 12, 18, 22, 35, 18, 15, 16, 13], '24h': [6, 8, 12, 28, 45, 30, 15, 11, 16, 24, 38, 20, 16, 18, 12], }[telemetryRange]; return (
{/* Top Banner / Hero Header with Portara Styling */}
NaxOS

Appliance Overview

NixOS 26.05 OpenZFS 2.2

Active Node: {status?.hostname || 'naxos-storage'} · Generation {status?.nixosGeneration || 42} · GitOps Engine Synchronized

{/* KPI Cards Grid */}
{/* Storage Pool Card */}
Pool: {primaryPool?.name || 'tank'} {primaryPool?.health || 'ONLINE'}
{primaryPool?.allocated || '8.2T'} / {primaryPool?.size || '14.5T'}
{/* Progress Bar */}
Free: {primaryPool?.free || '6.3T'} Frag: {primaryPool?.fragmentation || '14%'}
{/* ZFS ARC Hit Ratio */}
ZFS ARC Cache
{status?.arcHitRatioPercent || 98.6}% Efficiency

ARC Size: 4.0 GB (Target: 4.0 GB)

Optimal cache hit performance
{/* Workloads Card */}
Running Workloads
{apps.length || 2} Active Services
Runtime Engine: Docker + Systemd
{/* Network Shares */}
Active File Shares
{status?.activeSharesCount || 3}

SMB (Time Machine) + NFS v4

Bonjour / mDNS discovery active
{/* SEAMLESS LIVE TELEMETRY & SYSTEM PERFORMANCE */}

Live System & Storage Telemetry

Real-time OpenZFS ARC caching, storage pool I/O bandwidth, and host telemetry

{(['15m', '1h', '6h', '24h'] as const).map((range) => ( ))}
Live Feed
{/* 4-Panel Telemetry Grid */}
{/* Telemetry 1: ZFS ARC Cache Hit Ratio */}
ZFS ARC Hit Ratio
98.6%
{arcRatioData.map((val, i) => (
))}
Data: 99.1% Metadata: 97.8%
{/* Telemetry 2: Storage Pool Read/Write Bandwidth */}
Pool I/O Throughput
142 MB/s Peak
{throughputData.map((val, i) => (
))}
Read: 94 MB/s Write: 48 MB/s
{/* Telemetry 3: CPU Core Utilization */}
CPU Load & Cores
12.4% Avg
{cpuData.map((val, i) => (
))}
4 Cores active Load: 0.42, 0.38
{/* Telemetry 4: Memory & ARC Footprint */}
RAM & ARC Footprint
13.2 / 32.0 GB
ZFS ARC Cache 4.0 GB (100%)
Apps & Workloads 9.2 GB
Free: 18.8 GB ZFS ARC Limit: 4 GB
{/* Homarr-Style Active Services & Workloads Hub */}

Appliance Services & Workloads

Native Workload Engine
{/* Workload 1: Immich Photo Hub */}
ONLINE

Immich Photo Hub

Hardware-accelerated photo & video backup with Intel QuickSync ML

:2283 Launch
{/* Workload 2: Jellyfin Media Server */}
ONLINE

Jellyfin Media Server

4K HDR media streaming with hardware transcoding & DLNA

:8096 Launch
{/* Workload 3: Nextcloud Hub */}
CATALOG

Nextcloud Hub

Collaborative office, encrypted file sync, and calendar sharing

Ready
{/* Workload 4: Paperless-ngx */}
CATALOG

Paperless-ngx

Automated document archiving with OCR and full-text search

Ready
); };