mirror of
https://github.com/MacRimi/ProxMenux.git
synced 2026-02-19 00:46:31 +00:00
Update gpu monitor
This commit is contained in:
@@ -4,20 +4,7 @@ import { Card } from "@/components/ui/card"
|
||||
import { Badge } from "@/components/ui/badge"
|
||||
import { Progress } from "@/components/ui/progress"
|
||||
import { Dialog, DialogContent, DialogDescription, DialogHeader, DialogTitle } from "@/components/ui/dialog"
|
||||
import {
|
||||
Cpu,
|
||||
HardDrive,
|
||||
Thermometer,
|
||||
Zap,
|
||||
Loader2,
|
||||
CpuIcon,
|
||||
Cpu as Gpu,
|
||||
Network,
|
||||
MemoryStick,
|
||||
PowerIcon,
|
||||
FanIcon,
|
||||
Battery,
|
||||
} from "lucide-react"
|
||||
import { Cpu, HardDrive, Thermometer, Zap, Loader2, CpuIcon, Cpu as Gpu, Network, MemoryStick, PowerIcon, FanIcon, Battery } from "lucide-react"
|
||||
import { Download } from "lucide-react"
|
||||
import { Button } from "@/components/ui/button"
|
||||
import useSWR from "swr"
|
||||
@@ -241,6 +228,7 @@ export default function Hardware() {
|
||||
const [selectedUPS, setSelectedUPS] = useState<any>(null)
|
||||
const [showNvidiaInstaller, setShowNvidiaInstaller] = useState(false)
|
||||
const [installingNvidiaDriver, setInstallingNvidiaDriver] = useState(false)
|
||||
const [showAmdInstaller, setShowAmdInstaller] = useState(false)
|
||||
|
||||
const fetcher = async (url: string) => {
|
||||
const data = await fetchApi(url)
|
||||
@@ -262,6 +250,11 @@ export default function Hardware() {
|
||||
setShowNvidiaInstaller(true)
|
||||
}
|
||||
|
||||
const handleInstallAmdTools = () => {
|
||||
console.log("[v0] Opening AMD GPU tools installer terminal")
|
||||
setShowAmdInstaller(true)
|
||||
}
|
||||
|
||||
useEffect(() => {
|
||||
if (!selectedGPU) return
|
||||
|
||||
@@ -1110,6 +1103,17 @@ export default function Hardware() {
|
||||
</>
|
||||
</Button>
|
||||
)}
|
||||
{(selectedGPU.vendor.toLowerCase().includes("amd") || selectedGPU.vendor.toLowerCase().includes("ati")) && (
|
||||
<Button
|
||||
onClick={handleInstallAmdTools}
|
||||
className="w-full bg-red-600 hover:bg-red-700 text-white"
|
||||
>
|
||||
<>
|
||||
<Download className="mr-2 h-4 w-4" />
|
||||
Install AMD GPU Tools
|
||||
</>
|
||||
</Button>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -2052,6 +2056,20 @@ export default function Hardware() {
|
||||
title="NVIDIA Driver Installation"
|
||||
description="Installing NVIDIA proprietary drivers for GPU monitoring..."
|
||||
/>
|
||||
<ScriptTerminalModal
|
||||
open={showAmdInstaller}
|
||||
onClose={() => {
|
||||
setShowAmdInstaller(false)
|
||||
mutateHardware()
|
||||
}}
|
||||
scriptPath="/usr/local/share/proxmenux/scripts/gpu_tpu/amd_gpu_tools.sh"
|
||||
scriptName="amd_gpu_tools"
|
||||
params={{
|
||||
EXECUTION_MODE: "web",
|
||||
}}
|
||||
title="AMD GPU Tools Installation"
|
||||
description="Installing amdgpu_top for AMD GPU monitoring..."
|
||||
/>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
@@ -641,13 +641,13 @@ export function ScriptTerminalModal({
|
||||
ref={resizeBarRef}
|
||||
onMouseDown={handleResizeStart}
|
||||
onTouchStart={handleResizeStart}
|
||||
className={`h-2 w-full cursor-row-resize transition-colors flex items-center justify-center group relative ${
|
||||
className={`h-4 w-full cursor-row-resize transition-colors flex items-center justify-center group relative ${
|
||||
isResizing ? "bg-blue-500" : "bg-zinc-800 hover:bg-blue-600"
|
||||
}`}
|
||||
style={{ touchAction: "none" }}
|
||||
>
|
||||
<GripHorizontal
|
||||
className={`h-4 w-4 transition-colors pointer-events-none ${
|
||||
className={`h-5 w-5 transition-colors pointer-events-none ${
|
||||
isResizing ? "text-white" : "text-zinc-600 group-hover:text-white"
|
||||
}`}
|
||||
/>
|
||||
|
||||
Reference in New Issue
Block a user