feat: sortable resource tables and richer dashboard stack-health columns (#1498)

Make the Resources Images, Volumes, and Networks tables sortable with a
shared useTableSort hook and SortableTableHead, move the Images scan-history
control into the Images tab header, and keep the network List/Topology toggle
anchored with Create Network visible in both modes.

Rework the dashboard Stack health table: drop the redundant Host column, add
sortable Stack/Up/CPU/Mem headers, and add Source (local/git) and Port columns.
The status endpoint now labels each stack with its git/local source, computed
outside the cache so linking changes show immediately.

Extract a reusable CreateNetworkDialog and add a create-network action to the
stack-detail Networking tab.
This commit is contained in:
Anso
2026-06-28 05:06:04 -04:00
committed by GitHub
parent cf0db36e78
commit 60536aa614
11 changed files with 512 additions and 190 deletions
@@ -0,0 +1,30 @@
import { ArrowUp, ArrowDown } from 'lucide-react';
import { TableHead } from '@/components/ui/table';
import { cn } from '@/lib/utils';
import type { SortDir } from '@/hooks/useTableSort';
/** Clickable, sort-aware `<TableHead>`. Pairs with the `useTableSort` hook. */
export function SortableTableHead<K extends string>({
label, columnKey, activeKey, dir, onSort, className,
}: {
label: string;
columnKey: K;
activeKey: K;
dir: SortDir;
onSort: (k: K) => void;
className?: string;
}) {
const active = activeKey === columnKey;
return (
<TableHead className={cn('text-[11px] cursor-pointer select-none', className)}>
<button
type="button"
onClick={() => onSort(columnKey)}
className="inline-flex items-center gap-1 hover:text-foreground"
>
{label}
{active && (dir === 'asc' ? <ArrowUp className="w-3 h-3" /> : <ArrowDown className="w-3 h-3" />)}
</button>
</TableHead>
);
}