import React from 'react'; import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/index'; import { Tabs, TabsContent, TabsList, TabsTrigger } from '@/components/ui/index'; import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from '@/components/ui/index'; import { Button } from '@/components/ui/index'; interface VMInfo { id: string; name: string; vmid: number; node: string; status: string; cpu: number; memory: number; disk: number; uptime?: string; } interface VMOverviewProps { vm: VMInfo; onRefresh?: () => void; isLoading?: boolean; onPowerAction?: (action: 'start' | 'stop' | 'reboot' | 'shutdown' | 'resume' | 'suspend') => void; onConsole?: () => void; } export function VMOverview({ vm, onRefresh, isLoading, onPowerAction, onConsole }: VMOverviewProps) { const statusColors = { running: 'bg-green-100 text-green-800', stopped: 'bg-gray-100 text-gray-800', suspended: 'bg-yellow-100 text-yellow-800', paused: 'bg-orange-100 text-orange-800', error: 'bg-red-100 text-red-800', }; return (

{vm.name}

VM ID: {vm.vmid} • Node: {vm.node}

{vm.status === 'running' && ( <> )} {vm.status === 'stopped' && ( )} {vm.status === 'suspended' && ( )}
{}}> Overview Configuration Hardware Snapshots Metrics
Status {vm.status} CPU Cores
{vm.cpu}
Memory
{vm.memory} MB
Disk
{vm.disk} GB
Quick Actions
Configuration
VM ID
{vm.vmid}
Node
{vm.node}
Status
{vm.status}
Uptime
{vm.uptime || 'N/A'}
Hardware Configuration Device Type Size Status Disk 0 virtio {vm.disk} GB connected Network 0 virtio - connected CPU host {vm.cpu} cores active Memory size {vm.memory} MB active
Snapshots
No snapshots found for this VM
Resource Metrics
Metrics data will be displayed here
); }