Update proxmox-dashboard.tsx

This commit is contained in:
MacRimi
2025-11-07 19:52:45 +01:00
parent 4b9ad0da7a
commit beefdd280f

View File

@@ -30,7 +30,6 @@ import {
Cpu, Cpu,
FileText, FileText,
SettingsIcon, SettingsIcon,
LogOut,
} from "lucide-react" } from "lucide-react"
import Image from "next/image" import Image from "next/image"
import { ThemeToggle } from "./theme-toggle" import { ThemeToggle } from "./theme-toggle"
@@ -288,10 +287,9 @@ export function ProxmoxDashboard() {
className="border-b border-border bg-card sticky top-0 z-50 shadow-sm cursor-pointer hover:bg-accent/5 transition-colors" className="border-b border-border bg-card sticky top-0 z-50 shadow-sm cursor-pointer hover:bg-accent/5 transition-colors"
onClick={() => setShowHealthModal(true)} onClick={() => setShowHealthModal(true)}
> >
<div className="container mx-auto px-4 md:px-6 py-4 md:py-4"> <div className="container mx-auto px-4 md:px-6 py-4">
<div className="flex items-start justify-between gap-3"> <div className="flex items-start justify-between gap-4">
{/* Logo and Title */} <div className="flex items-center space-x-3">
<div className="flex items-center space-x-3 flex-shrink-0">
<div className="w-12 h-12 relative flex items-center justify-center bg-primary/10"> <div className="w-12 h-12 relative flex items-center justify-center bg-primary/10">
<Image <Image
src="/images/proxmenux-logo.png" src="/images/proxmenux-logo.png"
@@ -313,27 +311,22 @@ export function ProxmoxDashboard() {
<Server className="h-6 w-6 text-primary absolute fallback-icon hidden" /> <Server className="h-6 w-6 text-primary absolute fallback-icon hidden" />
</div> </div>
<div> <div>
<h1 className="text-xl font-semibold text-foreground whitespace-nowrap">ProxMenux Monitor</h1> <h1 className="text-xl font-semibold text-foreground">ProxMenux Monitor</h1>
<p className="text-sm text-muted-foreground hidden md:block">Proxmox System Dashboard</p> <p className="text-sm text-muted-foreground hidden md:block">Proxmox System Dashboard</p>
<div className="flex items-center space-x-2 mt-1">
<Server className="h-3 w-3 text-muted-foreground" />
<span className="text-xs text-muted-foreground">Node: {systemStatus.serverName}</span>
</div>
</div> </div>
</div> </div>
{/* Desktop Actions */} <div className="flex items-center space-x-2 md:space-x-4">
<div className="hidden lg:flex items-center space-x-4 flex-shrink-0"> <div className="hidden md:flex items-center space-x-4">
<div className="flex items-center space-x-2">
<Server className="h-4 w-4 text-muted-foreground" />
<div className="text-sm">
<div className="font-medium text-foreground">Node: {systemStatus.serverName}</div>
</div>
</div>
<Badge variant="outline" className={statusColor}> <Badge variant="outline" className={statusColor}>
{statusIcon} {statusIcon}
<span className="ml-1 capitalize">{systemStatus.status}</span> <span className="ml-1 capitalize">{systemStatus.status}</span>
</Badge> </Badge>
<div className="text-sm text-muted-foreground whitespace-nowrap">Uptime: {systemStatus.uptime}</div>
<Button <Button
variant="outline" variant="outline"
size="sm" size="sm"
@@ -344,36 +337,12 @@ export function ProxmoxDashboard() {
disabled={isRefreshing} disabled={isRefreshing}
className="border-border/50 bg-transparent hover:bg-secondary" className="border-border/50 bg-transparent hover:bg-secondary"
> >
<RefreshCw className={`h-4 w-4 mr-2 ${isRefreshing ? "animate-spin" : ""}`} /> <RefreshCw className={`h-4 w-4 ${isRefreshing ? "animate-spin" : ""}`} />
Refresh
</Button> </Button>
{isAuthenticated && (
<Button
variant="outline"
size="sm"
onClick={handleLogout}
className="border-border/50 bg-transparent hover:bg-secondary"
title="Logout"
>
<LogOut className="h-4 w-4 mr-2" />
Logout
</Button>
)}
<div onClick={(e) => e.stopPropagation()}>
<ThemeToggle />
</div>
</div> </div>
{/* Mobile Actions */} <div className="flex md:hidden items-center space-x-2">
<div className="flex lg:hidden items-center gap-2 flex-shrink-0 ml-auto"> <Badge variant="outline" className={statusColor}>
<div className="flex flex-col items-end text-xs">
<span className="text-muted-foreground truncate max-w-[120px]">{systemStatus.serverName}</span>
<span className="text-muted-foreground whitespace-nowrap">Uptime: {systemStatus.uptime}</span>
</div>
<Badge variant="outline" className={`${statusColor} px-2`}>
{statusIcon} {statusIcon}
</Badge> </Badge>
@@ -386,22 +355,18 @@ export function ProxmoxDashboard() {
}} }}
disabled={isRefreshing} disabled={isRefreshing}
className="h-9 w-9 p-0" className="h-9 w-9 p-0"
title="Refresh"
> >
<RefreshCw className={`h-4 w-4 ${isRefreshing ? "animate-spin" : ""}`} /> <RefreshCw className={`h-4 w-4 ${isRefreshing ? "animate-spin" : ""}`} />
</Button> </Button>
</div>
{isAuthenticated && (
<Button variant="ghost" size="sm" onClick={handleLogout} className="h-9 w-9 p-0" title="Logout">
<LogOut className="h-4 w-4" />
</Button>
)}
<div onClick={(e) => e.stopPropagation()}> <div onClick={(e) => e.stopPropagation()}>
<ThemeToggle /> <ThemeToggle />
</div> </div>
</div> </div>
</div> </div>
<div className="mt-2 text-right text-sm text-muted-foreground">Uptime: {systemStatus.uptime}</div>
</div> </div>
</header> </header>