Skip to content

Commit

Permalink
fix(detail): chart detail info
Browse files Browse the repository at this point in the history
  • Loading branch information
hamster1963 committed Dec 1, 2024
1 parent a9186f1 commit 924f7e2
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
13 changes: 10 additions & 3 deletions src/components/ServerDetailChart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -354,10 +354,17 @@ function MemChart({ now, data }: { now: number; data: NezhaServer }) {
<section className="flex flex-col items-end gap-0.5">
<div className="flex text-[11px] font-medium items-center gap-2">
{formatBytes(data.state.mem_used)} /{" "}
{formatBytes(data.state.mem_total)}
{formatBytes(data.host.mem_total)}
</div>
<div className="flex text-[11px] font-medium items-center gap-2">
swap: {formatBytes(data.state.swap_used)}
{data.host.swap_total ? (
<>
swap: {formatBytes(data.state.swap_used)} /{" "}
{formatBytes(data.host.swap_total)}
</>
) : (
<>no swap</>
)}
</div>
</section>
</div>
Expand Down Expand Up @@ -468,7 +475,7 @@ function DiskChart({ now, data }: { now: number; data: NezhaServer }) {
</section>
<div className="flex text-[11px] font-medium items-center gap-2">
{formatBytes(data.state.disk_used)} /{" "}
{formatBytes(data.state.disk_total)}
{formatBytes(data.host.disk_total)}
</div>
</section>
</div>
Expand Down
2 changes: 0 additions & 2 deletions src/types/nezha-api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,8 @@ export interface NezhaServerHost {
export interface NezhaServerStatus {
cpu: number;
mem_used: number;
mem_total: number;
swap_used: number;
disk_used: number;
disk_total: number;
net_in_transfer: number;
net_out_transfer: number;
net_in_speed: number;
Expand Down

0 comments on commit 924f7e2

Please sign in to comment.