Skip to content

Commit f3b6c1b

Browse files
fix: retain disk width maxima for pdisk previews
1 parent 067e7d5 commit f3b6c1b

2 files changed

Lines changed: 12 additions & 1 deletion

File tree

‎src/containers/Nodes/getNodes.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,5 +66,6 @@ export const getNodes: FetchData<
6666
data: preparedResponse.nodes || [],
6767
found: preparedResponse.found || 0,
6868
total: preparedResponse.total || 0,
69+
columnsSettings: preparedResponse.columnsSettings,
6970
};
7071
};

‎src/containers/Storage/utils/useStorageColumnsSettings.ts‎

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,17 @@ export function useStorageColumnsSettings() {
4545
if (!data?.columnsSettings) {
4646
return;
4747
}
48-
setMaxima((previous) => previous ?? data.columnsSettings);
48+
const {maxSlotsPerDisk, maxDisksPerNode} = data.columnsSettings;
49+
// Without backend-wide maxima, response preparation uses the current chunk only.
50+
// Keep both maxima independently: the most disks and slots may be on different pages.
51+
setMaxima((previous) => {
52+
const maxSlots = Math.max(previous?.maxSlotsPerDisk || 1, maxSlotsPerDisk || 1);
53+
const maxDisks = Math.max(previous?.maxDisksPerNode || 1, maxDisksPerNode || 1);
54+
if (previous?.maxSlotsPerDisk === maxSlots && previous.maxDisksPerNode === maxDisks) {
55+
return previous;
56+
}
57+
return {maxSlotsPerDisk: maxSlots, maxDisksPerNode: maxDisks};
58+
});
4959
}, []);
5060

5161
const columnsSettings: StorageNodesColumnsSettings = React.useMemo(() => {

0 commit comments

Comments
 (0)