diff --git a/src/renderer/src/App.tsx b/src/renderer/src/App.tsx index b03392d..74209ed 100644 --- a/src/renderer/src/App.tsx +++ b/src/renderer/src/App.tsx @@ -313,6 +313,7 @@ export default function App() { vms={vms} states={states} usage={latestUsage} + work={vmWork} selected={selected} draftName={null} query={query} diff --git a/src/renderer/src/components/Sidebar.tsx b/src/renderer/src/components/Sidebar.tsx index 1f8cd2f..8eb0abb 100644 --- a/src/renderer/src/components/Sidebar.tsx +++ b/src/renderer/src/components/Sidebar.tsx @@ -1,15 +1,17 @@ import { forwardRef } from 'react' import { Search } from 'lucide-react' import type { VmConfig } from '@shared/config' -import type { VmStatus, VmUsage } from '@shared/ipc' +import type { VmStatus, VmUsage, VmWork } from '@shared/ipc' import OsMark from './OsMark' -import { filterVms, statusLabel } from '../util' +import { filterVms, statusLabel, workLabel } from '../util' interface Props { vms: VmConfig[] states: Record /** latest sample of each running VM */ usage: Record + /** profile operations and disk work by VM name, shown instead of the status */ + work: Record selected: string | null draftName: string | null /** the filter text. Kept in App, since the arrow keys move through what it shows */ @@ -19,7 +21,7 @@ interface Props { } // the ref is the filter box, for Ctrl+F -const Sidebar = forwardRef(function Sidebar({ vms, states, usage, selected, draftName, query, onQuery, onSelect }, filterRef) { +const Sidebar = forwardRef(function Sidebar({ vms, states, usage, work, selected, draftName, query, onQuery, onSelect }, filterRef) { const q = query.trim() const shown = filterVms(vms, query) @@ -60,6 +62,7 @@ const Sidebar = forwardRef(function Sidebar({ vms, stat {shown.map((v) => { const s = states[v.name] ?? 'off' const u = s === 'running' ? usage[v.name] : undefined + const w = work[v.name] return (