92bed208e0
ARCHITECTURE ============ Backend: FastAPI + uvicorn (port 8000) - JWT authentication with PAM system users - ZFS CLI wrapper with caching (30-60s TTL) - WebSocket pool status broadcaster (30s interval) - Services: auth, zfs_runner, file_manager, shares, identities, system_info - Routers: pools, datasets, snapshots, shares, identities, navigator, system Frontend: Next.js 15 + TypeScript (static export) - Incremental Static Regeneration (ISR) for weak hardware - Type-safe API client (lib/api.ts) - Dark mode + custom Tailwind theme - Pages: Dashboard, Login, Snapshots, Datasets, Shares, etc. DEPLOYMENT ========== Test Target: 192.168.1.179:8090 (Debian LXC) Production: 10.66.120.3:9090 (Raspberry Pi 4GB ARM64) Updater: Automated Gitea-based deployment (update-test.sh, update-pi.sh) FEATURES COMPLETED ================== Phase 3a: Dashboard Quick Stats (System, CPU, Memory, Storage) - Real-time stats with color-coded progress bars - Responsive grid layout (mobile: 1, tablet: 2, desktop: 4 columns) - ISR-optimized for fast loads on weak hardware REBRANDING ========== Renamed throughout: - Project: 'ZFS Manager' → 'ZMB Webui' - Services: 'zfs-manager' → 'zmb-webui' - Systemd units: zfs-manager-backend → zmb-webui-backend - Configuration files and documentation Co-Authored-By: Patrick <patrick@perlbach24.de>
47 lines
1.0 KiB
TypeScript
47 lines
1.0 KiB
TypeScript
interface ProgressProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
value: number
|
|
max?: number
|
|
color?: "default" | "success" | "warning" | "danger"
|
|
}
|
|
|
|
const colorStyles = {
|
|
default: "bg-primary",
|
|
success: "bg-green-600",
|
|
warning: "bg-yellow-600",
|
|
danger: "bg-red-600",
|
|
}
|
|
|
|
export function Progress({
|
|
value,
|
|
max = 100,
|
|
color = "default",
|
|
className = "",
|
|
...props
|
|
}: ProgressProps) {
|
|
const percentage = Math.min((value / max) * 100, 100)
|
|
|
|
let colorClass = colorStyles[color]
|
|
// Auto-select color based on percentage
|
|
if (color === "default") {
|
|
if (percentage >= 90) {
|
|
colorClass = colorStyles.danger
|
|
} else if (percentage >= 75) {
|
|
colorClass = colorStyles.warning
|
|
} else {
|
|
colorClass = colorStyles.success
|
|
}
|
|
}
|
|
|
|
return (
|
|
<div
|
|
className={`relative w-full h-2 rounded-full bg-secondary overflow-hidden ${className}`}
|
|
{...props}
|
|
>
|
|
<div
|
|
className={`h-full ${colorClass} transition-all`}
|
|
style={{ width: `${percentage}%` }}
|
|
/>
|
|
</div>
|
|
)
|
|
}
|