mirror of
https://github.com/MacRimi/ProxMenux.git
synced 2026-05-02 04:16:24 +00:00
Update storage-overview.tsx
This commit is contained in:
@@ -273,13 +273,9 @@ export function StorageOverview() {
|
|||||||
const params = new URLSearchParams()
|
const params = new URLSearchParams()
|
||||||
if (disk.name) params.set('device', disk.name)
|
if (disk.name) params.set('device', disk.name)
|
||||||
if (disk.serial && disk.serial !== 'Unknown') params.set('serial', disk.serial)
|
if (disk.serial && disk.serial !== 'Unknown') params.set('serial', disk.serial)
|
||||||
const url = `/api/storage/observations?${params.toString()}`
|
const data = await fetchApi<{ observations: DiskObservation[] }>(`/api/storage/observations?${params.toString()}`)
|
||||||
console.log("[v0] Fetching observations:", url, "disk:", disk.name, disk.serial)
|
|
||||||
const data = await fetchApi<{ observations: DiskObservation[] }>(url)
|
|
||||||
console.log("[v0] Observations response:", data)
|
|
||||||
setDiskObservations(data.observations || [])
|
setDiskObservations(data.observations || [])
|
||||||
} catch (err) {
|
} catch {
|
||||||
console.error("[v0] Observations fetch error:", err)
|
|
||||||
setDiskObservations([])
|
setDiskObservations([])
|
||||||
} finally {
|
} finally {
|
||||||
setLoadingObservations(false)
|
setLoadingObservations(false)
|
||||||
@@ -845,10 +841,10 @@ export function StorageOverview() {
|
|||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
{disk.observations_count && disk.observations_count > 0 && (
|
{(disk.observations_count ?? 0) > 0 && (
|
||||||
<Badge className="bg-blue-500/10 text-blue-400 border-blue-500/20 gap-1 text-[10px] px-1.5 py-0">
|
<Badge className="bg-blue-500/10 text-blue-400 border-blue-500/20 gap-1">
|
||||||
<Info className="h-3 w-3" />
|
<Info className="h-3 w-3" />
|
||||||
{disk.observations_count}
|
{disk.observations_count} obs.
|
||||||
</Badge>
|
</Badge>
|
||||||
)}
|
)}
|
||||||
{getHealthBadge(disk.health)}
|
{getHealthBadge(disk.health)}
|
||||||
@@ -931,10 +927,10 @@ export function StorageOverview() {
|
|||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
{disk.observations_count && disk.observations_count > 0 && (
|
{(disk.observations_count ?? 0) > 0 && (
|
||||||
<Badge className="bg-blue-500/10 text-blue-400 border-blue-500/20 gap-1 text-[10px] px-1.5 py-0">
|
<Badge className="bg-blue-500/10 text-blue-400 border-blue-500/20 gap-1">
|
||||||
<Info className="h-3 w-3" />
|
<Info className="h-3 w-3" />
|
||||||
{disk.observations_count}
|
{disk.observations_count} obs.
|
||||||
</Badge>
|
</Badge>
|
||||||
)}
|
)}
|
||||||
{getHealthBadge(disk.health)}
|
{getHealthBadge(disk.health)}
|
||||||
@@ -1040,7 +1036,7 @@ export function StorageOverview() {
|
|||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
{getHealthBadge(disk.health)}
|
{getHealthBadge(disk.health)}
|
||||||
{disk.observations_count && disk.observations_count > 0 && (
|
{(disk.observations_count ?? 0) > 0 && (
|
||||||
<Badge className="bg-blue-500/10 text-blue-400 border-blue-500/20 gap-1 text-[10px] px-1.5 py-0">
|
<Badge className="bg-blue-500/10 text-blue-400 border-blue-500/20 gap-1 text-[10px] px-1.5 py-0">
|
||||||
<Info className="h-3 w-3" />
|
<Info className="h-3 w-3" />
|
||||||
{disk.observations_count}
|
{disk.observations_count}
|
||||||
@@ -1072,10 +1068,10 @@ export function StorageOverview() {
|
|||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
{getHealthBadge(disk.health)}
|
{getHealthBadge(disk.health)}
|
||||||
{disk.observations_count && disk.observations_count > 0 && (
|
{(disk.observations_count ?? 0) > 0 && (
|
||||||
<Badge className="bg-blue-500/10 text-blue-400 border-blue-500/20 gap-1 text-[10px] px-1.5 py-0">
|
<Badge className="bg-blue-500/10 text-blue-400 border-blue-500/20 gap-1">
|
||||||
<Info className="h-3 w-3" />
|
<Info className="h-3 w-3" />
|
||||||
{disk.observations_count}
|
{disk.observations_count} obs.
|
||||||
</Badge>
|
</Badge>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
@@ -1181,11 +1177,11 @@ export function StorageOverview() {
|
|||||||
<p className="text-sm text-muted-foreground">Health Status</p>
|
<p className="text-sm text-muted-foreground">Health Status</p>
|
||||||
<div className="flex items-center gap-2 mt-1">
|
<div className="flex items-center gap-2 mt-1">
|
||||||
{getHealthBadge(selectedDisk.health)}
|
{getHealthBadge(selectedDisk.health)}
|
||||||
{selectedDisk.observations_count && selectedDisk.observations_count > 0 && (
|
{(selectedDisk.observations_count ?? 0) > 0 && (
|
||||||
<Badge className="bg-blue-500/10 text-blue-400 border-blue-500/20 gap-1 text-[10px] px-1.5 py-0">
|
<Badge className="bg-blue-500/10 text-blue-400 border-blue-500/20 gap-1">
|
||||||
<Info className="h-3 w-3" />
|
<Info className="h-3 w-3" />
|
||||||
{selectedDisk.observations_count} obs.
|
{selectedDisk.observations_count} obs.
|
||||||
</Badge>
|
</Badge>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user