From 947c9639e8f4ba4085ab5dff7a921deedaec58ee Mon Sep 17 00:00:00 2001 From: MacRimi Date: Thu, 23 Oct 2025 18:31:44 +0200 Subject: [PATCH] Update proxmox-dashboard.tsx --- AppImage/components/proxmox-dashboard.tsx | 333 ++++++++++++---------- 1 file changed, 187 insertions(+), 146 deletions(-) diff --git a/AppImage/components/proxmox-dashboard.tsx b/AppImage/components/proxmox-dashboard.tsx index 4d415e7..d09c631 100644 --- a/AppImage/components/proxmox-dashboard.tsx +++ b/AppImage/components/proxmox-dashboard.tsx @@ -1,5 +1,7 @@ "use client" +import type React from "react" + import { useState, useEffect, useMemo, useCallback } from "react" import { Badge } from "./ui/badge" import { Button } from "./ui/button" @@ -59,6 +61,8 @@ export function ProxmoxDashboard() { const [componentKey, setComponentKey] = useState(0) const [mobileMenuOpen, setMobileMenuOpen] = useState(false) const [activeTab, setActiveTab] = useState("overview") + const [showNavigation, setShowNavigation] = useState(true) + const [lastScrollY, setLastScrollY] = useState(0) const fetchSystemData = useCallback(async () => { console.log("[v0] Fetching system data from Flask server...") @@ -127,6 +131,28 @@ export function ProxmoxDashboard() { return () => clearInterval(interval) }, [fetchSystemData]) + useEffect(() => { + const handleScroll = () => { + const currentScrollY = window.scrollY + + // Only hide navigation if scrolled down more than 100px + if (currentScrollY < 100) { + setShowNavigation(true) + } else if (currentScrollY > lastScrollY) { + // Scrolling down - hide navigation + setShowNavigation(false) + } else if (currentScrollY < lastScrollY) { + // Scrolling up - show navigation + setShowNavigation(true) + } + + setLastScrollY(currentScrollY) + } + + window.addEventListener("scroll", handleScroll, { passive: true }) + return () => window.removeEventListener("scroll", handleScroll) + }, [lastScrollY]) + const refreshData = async () => { setIsRefreshing(true) await fetchSystemData() @@ -292,169 +318,184 @@ export function ProxmoxDashboard() { +
+
+ + + + Overview + + + Storage + + + Network + + + VMs & LXCs + + + Hardware + + + System Logs + + + + +
+ + + +
+ +
+ + + + + + +
+
+
+
+
+
+
- - - Overview - - - Storage - - - Network - - - VMs & LXCs - - - Hardware - - - System Logs - - - - -
- - - -
- -
- - - - - - -
-
-
- - + - + - + - + - + - +