fix: adapt NodeSummaryTable column widths per tab context
Count columns now have appropriate widths based on their header text: - Dashboard: VMs/CTs use compact 40-50px (short labels) - Storage: Storage/Disks use wider 50-70px and 45-60px - Backups: Backups uses wider 50-70px This fixes the broken appearance on Storage and Backups tabs where longer header text didn't fit in the narrow fixed-width columns.
This commit is contained in:
parent
5dce402d62
commit
661ca22eab
1 changed files with 9 additions and 7 deletions
|
|
@ -139,6 +139,8 @@ export const NodeSummaryTable: Component<NodeSummaryTableProps> = (props) => {
|
||||||
header: string;
|
header: string;
|
||||||
key: CountSortKey;
|
key: CountSortKey;
|
||||||
icon: Component<{ class?: string }>;
|
icon: Component<{ class?: string }>;
|
||||||
|
minWidth?: string;
|
||||||
|
maxWidth?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
const [sortKey, setSortKey] = createSignal<SortKey>('default');
|
const [sortKey, setSortKey] = createSignal<SortKey>('default');
|
||||||
|
|
@ -148,16 +150,16 @@ export const NodeSummaryTable: Component<NodeSummaryTableProps> = (props) => {
|
||||||
switch (props.currentTab) {
|
switch (props.currentTab) {
|
||||||
case 'dashboard':
|
case 'dashboard':
|
||||||
return [
|
return [
|
||||||
{ header: 'VMs', key: 'vmCount', icon: VMIcon },
|
{ header: 'VMs', key: 'vmCount', icon: VMIcon, minWidth: '40px', maxWidth: '50px' },
|
||||||
{ header: 'CTs', key: 'containerCount', icon: ContainerIcon },
|
{ header: 'CTs', key: 'containerCount', icon: ContainerIcon, minWidth: '40px', maxWidth: '50px' },
|
||||||
];
|
];
|
||||||
case 'storage':
|
case 'storage':
|
||||||
return [
|
return [
|
||||||
{ header: 'Storage', key: 'storageCount', icon: DiskIcon },
|
{ header: 'Storage', key: 'storageCount', icon: DiskIcon, minWidth: '50px', maxWidth: '70px' },
|
||||||
{ header: 'Disks', key: 'diskCount', icon: DiskIcon },
|
{ header: 'Disks', key: 'diskCount', icon: DiskIcon, minWidth: '45px', maxWidth: '60px' },
|
||||||
];
|
];
|
||||||
case 'backups':
|
case 'backups':
|
||||||
return [{ header: 'Backups', key: 'backupCount', icon: BackupIcon }];
|
return [{ header: 'Backups', key: 'backupCount', icon: BackupIcon, minWidth: '50px', maxWidth: '70px' }];
|
||||||
default:
|
default:
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
|
|
@ -186,8 +188,8 @@ export const NodeSummaryTable: Component<NodeSummaryTableProps> = (props) => {
|
||||||
label: cc.header,
|
label: cc.header,
|
||||||
priority: 'essential' as ColumnPriority,
|
priority: 'essential' as ColumnPriority,
|
||||||
icon: cc.icon,
|
icon: cc.icon,
|
||||||
minWidth: '40px',
|
minWidth: cc.minWidth || '40px',
|
||||||
maxWidth: '50px',
|
maxWidth: cc.maxWidth || '50px',
|
||||||
align: 'center',
|
align: 'center',
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue