ydb-embedded-ui 6.17.2 → 6.18.0
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/assets/icons/decommission.svg +6 -0
- package/dist/components/ButtonWithConfirmDialog/ButtonWithConfirmDialog.d.ts +3 -2
- package/dist/components/ButtonWithConfirmDialog/ButtonWithConfirmDialog.js +10 -16
- package/dist/components/ButtonWithConfirmDialog/ButtonWithConfirmDialog.js.map +1 -1
- package/dist/components/CriticalActionDialog/CriticalActionDialog.d.ts +4 -2
- package/dist/components/CriticalActionDialog/CriticalActionDialog.js +7 -4
- package/dist/components/CriticalActionDialog/CriticalActionDialog.js.map +1 -1
- package/dist/components/CriticalActionDialog/CriticalActionDialog.scss +23 -1
- package/dist/components/CriticalActionDialog/utils.d.ts +5 -0
- package/dist/components/CriticalActionDialog/utils.js +4 -0
- package/dist/components/CriticalActionDialog/utils.js.map +1 -0
- package/dist/components/DiskStateProgressBar/DiskStateProgressBar.scss +5 -3
- package/dist/components/EntityPageTitle/EntityPageTitle.d.ts +1 -2
- package/dist/components/EntityPageTitle/EntityPageTitle.js +2 -2
- package/dist/components/EntityPageTitle/EntityPageTitle.js.map +1 -1
- package/dist/components/InfoViewerSkeleton/InfoViewerSkeleton.js +1 -1
- package/dist/components/InfoViewerSkeleton/InfoViewerSkeleton.js.map +1 -1
- package/dist/components/LinkWithIcon/LinkWithIcon.d.ts +2 -1
- package/dist/components/LinkWithIcon/LinkWithIcon.js +3 -3
- package/dist/components/LinkWithIcon/LinkWithIcon.js.map +1 -1
- package/dist/components/Loader/Loader.js +1 -1
- package/dist/components/Loader/Loader.js.map +1 -1
- package/dist/components/PDiskInfo/PDiskInfo.js +1 -7
- package/dist/components/PDiskInfo/PDiskInfo.js.map +1 -1
- package/dist/components/PDiskInfo/i18n/en.json +0 -1
- package/dist/components/PDiskInfo/i18n/index.d.ts +1 -1
- package/dist/components/PDiskPopup/PDiskPopup.js +3 -5
- package/dist/components/PDiskPopup/PDiskPopup.js.map +1 -1
- package/dist/components/PaginatedTable/PaginatedTable.d.ts +2 -1
- package/dist/components/PaginatedTable/PaginatedTable.js +2 -2
- package/dist/components/PaginatedTable/PaginatedTable.js.map +1 -1
- package/dist/components/PaginatedTable/PaginatedTable.scss +12 -14
- package/dist/components/PaginatedTable/ResizeablePaginatedTable.js +2 -1
- package/dist/components/PaginatedTable/ResizeablePaginatedTable.js.map +1 -1
- package/dist/components/PaginatedTable/TableChunk.js +7 -2
- package/dist/components/PaginatedTable/TableChunk.js.map +1 -1
- package/dist/components/PaginatedTable/TableHead.js +14 -10
- package/dist/components/PaginatedTable/TableHead.js.map +1 -1
- package/dist/components/PaginatedTable/TableRow.js +14 -6
- package/dist/components/PaginatedTable/TableRow.js.map +1 -1
- package/dist/components/PaginatedTable/types.d.ts +1 -1
- package/dist/components/Skeleton/Skeleton.js +1 -1
- package/dist/components/Skeleton/Skeleton.js.map +1 -1
- package/dist/components/TableWithControlsLayout/TableWithControlsLayout.scss +5 -0
- package/dist/components/VDisk/VDisk.d.ts +6 -3
- package/dist/components/VDisk/VDisk.js +6 -4
- package/dist/components/VDisk/VDisk.js.map +1 -1
- package/dist/components/VDisk/VDiskWithDonorsStack.d.ts +3 -5
- package/dist/components/VDisk/VDiskWithDonorsStack.js +4 -4
- package/dist/components/VDisk/VDiskWithDonorsStack.js.map +1 -1
- package/dist/components/VDiskPopup/VDiskPopup.js +1 -1
- package/dist/components/VDiskPopup/VDiskPopup.js.map +1 -1
- package/dist/containers/PDiskPage/DecommissionButton/DecommissionButton.d.ts +11 -0
- package/dist/containers/PDiskPage/DecommissionButton/DecommissionButton.js +91 -0
- package/dist/containers/PDiskPage/DecommissionButton/DecommissionButton.js.map +1 -0
- package/dist/containers/PDiskPage/DecommissionButton/DecommissionButton.scss +6 -0
- package/dist/containers/PDiskPage/DecommissionLabel/DecommissionLabel.d.ts +6 -0
- package/dist/containers/PDiskPage/DecommissionLabel/DecommissionLabel.js +20 -0
- package/dist/containers/PDiskPage/DecommissionLabel/DecommissionLabel.js.map +1 -0
- package/dist/containers/PDiskPage/PDiskGroups/PDiskGroups.js +4 -8
- package/dist/containers/PDiskPage/PDiskGroups/PDiskGroups.js.map +1 -1
- package/dist/containers/PDiskPage/PDiskPage.js +32 -14
- package/dist/containers/PDiskPage/PDiskPage.js.map +1 -1
- package/dist/containers/PDiskPage/PDiskPage.scss +7 -0
- package/dist/containers/PDiskPage/i18n/en.json +16 -2
- package/dist/containers/PDiskPage/i18n/index.d.ts +1 -1
- package/dist/containers/Storage/Disks/Disks.d.ts +9 -0
- package/dist/containers/Storage/Disks/Disks.js +37 -0
- package/dist/containers/Storage/Disks/Disks.js.map +1 -0
- package/dist/containers/Storage/Disks/Disks.scss +46 -0
- package/dist/containers/Storage/PDisk/PDisk.d.ts +6 -2
- package/dist/containers/Storage/PDisk/PDisk.js +14 -7
- package/dist/containers/Storage/PDisk/PDisk.js.map +1 -1
- package/dist/containers/Storage/PDisk/PDisk.scss +4 -2
- package/dist/containers/Storage/PaginatedStorage.js +1 -4
- package/dist/containers/Storage/PaginatedStorage.js.map +1 -1
- package/dist/containers/Storage/Storage.js +2 -4
- package/dist/containers/Storage/Storage.js.map +1 -1
- package/dist/containers/Storage/StorageGroups/PaginatedStorageGroups.d.ts +1 -3
- package/dist/containers/Storage/StorageGroups/PaginatedStorageGroups.js +4 -5
- package/dist/containers/Storage/StorageGroups/PaginatedStorageGroups.js.map +1 -1
- package/dist/containers/Storage/StorageGroups/StorageGroups.d.ts +1 -4
- package/dist/containers/Storage/StorageGroups/StorageGroups.js +4 -7
- package/dist/containers/Storage/StorageGroups/StorageGroups.js.map +1 -1
- package/dist/containers/Storage/StorageGroups/{StorageGroups.scss → columns/StorageGroupsColumns.scss} +3 -2
- package/dist/containers/Storage/StorageGroups/columns/getStorageGroupsColumns.d.ts +21 -0
- package/dist/containers/Storage/StorageGroups/{getStorageGroupsColumns.js → columns/getStorageGroupsColumns.js} +41 -21
- package/dist/containers/Storage/StorageGroups/columns/getStorageGroupsColumns.js.map +1 -0
- package/dist/containers/Storage/StorageGroups/columns/hooks.d.ts +3 -0
- package/dist/containers/Storage/StorageGroups/columns/hooks.js +19 -0
- package/dist/containers/Storage/StorageGroups/columns/hooks.js.map +1 -0
- package/dist/containers/Storage/StorageGroups/columns/types.d.ts +14 -0
- package/dist/containers/Storage/StorageGroups/columns/types.js +2 -0
- package/dist/containers/Storage/StorageGroups/columns/types.js.map +1 -0
- package/dist/containers/Storage/StorageNodes/getStorageNodesColumns.d.ts +1 -1
- package/dist/containers/Storage/StorageNodes/getStorageNodesColumns.js +1 -1
- package/dist/containers/Storage/StorageNodes/getStorageNodesColumns.js.map +1 -1
- package/dist/containers/Tablet/Tablet.js +13 -11
- package/dist/containers/Tablet/Tablet.js.map +1 -1
- package/dist/containers/Tablet/components/TabletControls/TabletControls.js +1 -1
- package/dist/containers/Tablet/components/TabletControls/TabletControls.js.map +1 -1
- package/dist/containers/Tablet/i18n/en.json +6 -3
- package/dist/containers/Tablet/i18n/index.d.ts +1 -1
- package/dist/containers/Tablets/Tablets.js +1 -1
- package/dist/containers/Tablets/Tablets.js.map +1 -1
- package/dist/containers/Tablets/i18n/en.json +2 -1
- package/dist/containers/Tablets/i18n/index.d.ts +1 -1
- package/dist/containers/Tenant/Diagnostics/TenantOverview/TenantStorage/TopGroups.js +1 -1
- package/dist/containers/Tenant/Diagnostics/TenantOverview/TenantStorage/TopGroups.js.map +1 -1
- package/dist/containers/Tenant/Diagnostics/TopShards/TopShards.js +1 -1
- package/dist/containers/Tenant/Diagnostics/TopShards/TopShards.js.map +1 -1
- package/dist/containers/Tenant/Query/ExecuteResult/ExecuteResult.js +3 -1
- package/dist/containers/Tenant/Query/ExecuteResult/ExecuteResult.js.map +1 -1
- package/dist/containers/Tenant/Query/ExecuteResult/ExecuteResult.scss +6 -0
- package/dist/containers/Tenant/Query/ExecuteResult/TraceButton.d.ts +5 -0
- package/dist/containers/Tenant/Query/ExecuteResult/TraceButton.js +43 -0
- package/dist/containers/Tenant/Query/ExecuteResult/TraceButton.js.map +1 -0
- package/dist/containers/Tenant/Query/ExecuteResult/i18n/en.json +2 -1
- package/dist/containers/Tenant/Query/ExecuteResult/i18n/index.d.ts +1 -1
- package/dist/containers/Tenant/Query/utils/__test__/replaceParams.test.d.ts +1 -0
- package/dist/containers/Tenant/Query/utils/__test__/replaceParams.test.js +50 -0
- package/dist/containers/Tenant/Query/utils/__test__/replaceParams.test.js.map +1 -0
- package/dist/containers/Tenant/Query/utils/replaceParams.d.ts +1 -0
- package/dist/containers/Tenant/Query/utils/replaceParams.js +6 -0
- package/dist/containers/Tenant/Query/utils/replaceParams.js.map +1 -0
- package/dist/containers/UserSettings/i18n/en.json +2 -0
- package/dist/containers/UserSettings/i18n/index.d.ts +1 -1
- package/dist/containers/UserSettings/settings.d.ts +1 -0
- package/dist/containers/UserSettings/settings.js +12 -2
- package/dist/containers/UserSettings/settings.js.map +1 -1
- package/dist/containers/VDiskPage/VDiskPage.js +5 -8
- package/dist/containers/VDiskPage/VDiskPage.js.map +1 -1
- package/dist/containers/VDiskPage/i18n/en.json +2 -1
- package/dist/containers/VDiskPage/i18n/index.d.ts +1 -1
- package/dist/services/api.d.ts +10 -1
- package/dist/services/api.js +51 -8
- package/dist/services/api.js.map +1 -1
- package/dist/services/parsers/parseMetaCluster.js +34 -1
- package/dist/services/parsers/parseMetaCluster.js.map +1 -1
- package/dist/services/settings.d.ts +1 -0
- package/dist/services/settings.js +2 -1
- package/dist/services/settings.js.map +1 -1
- package/dist/store/reducers/cluster/cluster.js.map +1 -1
- package/dist/store/reducers/executeQuery.js +2 -0
- package/dist/store/reducers/executeQuery.js.map +1 -1
- package/dist/store/reducers/trace.d.ts +8 -0
- package/dist/store/reducers/trace.js +21 -0
- package/dist/store/reducers/trace.js.map +1 -0
- package/dist/types/api/cluster.d.ts +3 -0
- package/dist/types/api/meta.d.ts +2 -0
- package/dist/types/api/modifyDisk.d.ts +1 -0
- package/dist/types/api/pdisk.d.ts +1 -1
- package/dist/types/api/query.d.ts +7 -1
- package/dist/types/api/trace.d.ts +7 -0
- package/dist/types/api/trace.js +2 -0
- package/dist/types/api/trace.js.map +1 -0
- package/dist/types/store/query.d.ts +1 -0
- package/dist/utils/constants.d.ts +1 -0
- package/dist/utils/constants.js +1 -0
- package/dist/utils/constants.js.map +1 -1
- package/dist/utils/disks/helpers.d.ts +1 -1
- package/dist/utils/disks/helpers.js +5 -1
- package/dist/utils/disks/helpers.js.map +1 -1
- package/dist/utils/disks/prepareDisks.js +10 -5
- package/dist/utils/disks/prepareDisks.js.map +1 -1
- package/dist/utils/hooks/useDelayed.d.ts +1 -1
- package/dist/utils/hooks/useDelayed.js +6 -1
- package/dist/utils/hooks/useDelayed.js.map +1 -1
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.js +5 -0
- package/dist/utils/index.js.map +1 -1
- package/dist/utils/query.js.map +1 -1
- package/package.json +1 -1
- package/dist/components/CriticalActionDialog/index.d.ts +0 -1
- package/dist/components/CriticalActionDialog/index.js +0 -2
- package/dist/components/CriticalActionDialog/index.js.map +0 -1
- package/dist/containers/Storage/StorageGroups/getStorageGroupsColumns.d.ts +0 -62
- package/dist/containers/Storage/StorageGroups/getStorageGroupsColumns.js.map +0 -1
@@ -5,7 +5,6 @@ import { getArray } from '../../utils';
|
|
5
5
|
import { useAutoRefreshInterval } from '../../utils/hooks';
|
6
6
|
import { ResponseError } from '../Errors/ResponseError';
|
7
7
|
import { EmptyTableRow, LoadingTableRow, TableRow } from './TableRow';
|
8
|
-
import { b } from './shared';
|
9
8
|
const DEBOUNCE_TIMEOUT = 200;
|
10
9
|
export const TableChunk = ({ id, limit, rowHeight, columns, fetchData, tableName, filters, sortParams, observer, getRowClassName, renderErrorMessage, onDataFetched, isActive, }) => {
|
11
10
|
var _a;
|
@@ -70,6 +69,12 @@ export const TableChunk = ({ id, limit, rowHeight, columns, fetchData, tableName
|
|
70
69
|
return currentData.data.map((rowData, index) => (_jsx(TableRow, { index: index, row: rowData, columns: columns, height: rowHeight, getRowClassName: getRowClassName }, index)));
|
71
70
|
};
|
72
71
|
const chunkHeight = dataLength ? dataLength * rowHeight : limit * rowHeight;
|
73
|
-
return (_jsx("tbody", {
|
72
|
+
return (_jsx("tbody", { ref: ref, id: id.toString(), style: {
|
73
|
+
height: `${chunkHeight}px`,
|
74
|
+
// Default display: table-row-group doesn't work in Safari and breaks the table
|
75
|
+
// display: block works in Safari, but disconnects thead and tbody cell grids
|
76
|
+
// Hack to make it work in all cases
|
77
|
+
display: isActive ? 'table-row-group' : 'block',
|
78
|
+
}, children: renderContent() }));
|
74
79
|
};
|
75
80
|
//# sourceMappingURL=TableChunk.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"TableChunk.js","sourceRoot":"","sources":["../../../src/components/PaginatedTable/TableChunk.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAC,YAAY,EAAC,MAAM,gCAAgC,CAAC;AAE5D,OAAO,EAAC,QAAQ,EAAC,MAAM,aAAa,CAAC;AACrC,OAAO,EAAC,sBAAsB,EAAC,MAAM,mBAAmB,CAAC;AACzD,OAAO,EAAC,aAAa,EAAC,MAAM,yBAAyB,CAAC;AAEtD,OAAO,EAAC,aAAa,EAAE,eAAe,EAAE,QAAQ,EAAC,MAAM,YAAY,CAAC;
|
1
|
+
{"version":3,"file":"TableChunk.js","sourceRoot":"","sources":["../../../src/components/PaginatedTable/TableChunk.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAC,YAAY,EAAC,MAAM,gCAAgC,CAAC;AAE5D,OAAO,EAAC,QAAQ,EAAC,MAAM,aAAa,CAAC;AACrC,OAAO,EAAC,sBAAsB,EAAC,MAAM,mBAAmB,CAAC;AACzD,OAAO,EAAC,aAAa,EAAC,MAAM,yBAAyB,CAAC;AAEtD,OAAO,EAAC,aAAa,EAAE,eAAe,EAAE,QAAQ,EAAC,MAAM,YAAY,CAAC;AAGpE,MAAM,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ACnB,CAAC;YACN,CAAC;iBAAM,CAAC;gBACJ,OAAO,QAAQ,CAAC,UAAU,CAAC,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CACvC,KAAC,eAAe,IAEZ,OAAO,EAAE,OAAO,EAChB,MAAM,EAAE,SAAS,EACjB,KAAK,EAAE,KAAK,IAHP,KAAK,CAIZ,CACL,CAAC,CAAC;YACP,CAAC;QACL,CAAC;QAED,OAAO,WAAW,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,KAAK,EAAE,EAAE,CAAC,CAC5C,KAAC,QAAQ,IAEL,KAAK,EAAE,KAAK,EACZ,GAAG,EAAE,OAAY,EACjB,OAAO,EAAE,OAAO,EAChB,MAAM,EAAE,SAAS,EACjB,eAAe,EAAE,eAAe,IAL3B,KAAK,CAMZ,CACL,CAAC,CAAC;IACP,CAAC,CAAC;IAEF,MAAM,WAAW,GAAG,UAAU,CAAC,CAAC,CAAC,UAAU,GAAG,SAAS,CAAC,CAAC,CAAC,KAAK,GAAG,SAAS,CAAC;IAE5E,OAAO,CACH,gBACI,GAAG,EAAE,GAAG,EACR,EAAE,EAAE,EAAE,CAAC,QAAQ,EAAE,EACjB,KAAK,EAAE;YACH,MAAM,EAAE,GAAG,WAAW,IAAI;YAC1B,+EAA+E;YAC/E,6EAA6E;YAC7E,oCAAoC;YACpC,OAAO,EAAE,QAAQ,CAAC,CAAC,CAAC,iBAAiB,CAAC,CAAC,CAAC,OAAO;SAClD,YAEA,aAAa,EAAE,GACZ,CACX,CAAC;AACN,CAAC,CAAC"}
|
@@ -37,14 +37,18 @@ export const TableHeadCell = ({ column, resizeable, sortOrder, defaultSortOrder,
|
|
37
37
|
onColumnsResize === null || onColumnsResize === void 0 ? void 0 : onColumnsResize(column.name, newWidth);
|
38
38
|
}, [onColumnsResize, column.name]);
|
39
39
|
const content = (_a = column.header) !== null && _a !== void 0 ? _a : column.name;
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
40
|
+
const style = {
|
41
|
+
height: `${rowHeight}px`,
|
42
|
+
width: `${column.width}px`,
|
43
|
+
// Additional minWidth and maxWidth for resizeable columns to ensure proper resize
|
44
|
+
minWidth: resizeable ? `${column.width}px` : undefined,
|
45
|
+
maxWidth: resizeable ? `${column.width}px` : undefined,
|
46
|
+
};
|
47
|
+
return (_jsxs("th", { ref: cellWrapperRef, className: b('head-cell-wrapper'), style: style, children: [_jsxs("div", { className: b('head-cell', { align: column.align, sortable: column.sortable }, column.className), onClick: () => {
|
48
|
+
if (column.sortable) {
|
49
|
+
onSort === null || onSort === void 0 ? void 0 : onSort(column.name);
|
50
|
+
}
|
51
|
+
}, children: [_jsx("div", { className: b('head-cell-content'), children: content }), _jsx(ColumnSortIcon, { sortOrder: sortOrder, sortable: column.sortable, defaultSortOrder: defaultSortOrder })] }), resizeable ? (_jsx(ResizeHandler, { maxWidth: column.resizeMaxWidth, minWidth: column.resizeMinWidth, getCurrentColumnWidth: getCurrentColumnWidth, onResize: handleResize })) : null] }));
|
48
52
|
};
|
49
53
|
export const TableHead = ({ columns, onSort, onColumnsResize, defaultSortOrder = DEFAULT_SORT_ORDER, rowHeight = DEFAULT_TABLE_ROW_HEIGHT, }) => {
|
50
54
|
const [sortParams, setSortParams] = React.useState({});
|
@@ -76,12 +80,12 @@ export const TableHead = ({ columns, onSort, onColumnsResize, defaultSortOrder =
|
|
76
80
|
setSortParams(newSortParams);
|
77
81
|
};
|
78
82
|
const renderTableColGroups = () => {
|
79
|
-
return (_jsx("colgroup", {
|
83
|
+
return (_jsx("colgroup", { children: columns.map((column) => {
|
80
84
|
return _jsx("col", { style: { width: `${column.width}px` } }, column.name);
|
81
85
|
}) }));
|
82
86
|
};
|
83
87
|
const renderTableHead = () => {
|
84
|
-
return (_jsx("thead", { className: b('head'), children: _jsx("tr", {
|
88
|
+
return (_jsx("thead", { className: b('head'), children: _jsx("tr", { children: columns.map((column) => {
|
85
89
|
var _a;
|
86
90
|
const sortOrder = sortParams.columnId === column.name ? sortParams.sortOrder : undefined;
|
87
91
|
const resizeable = onColumnsResize && ((_a = column.resizeable) !== null && _a !== void 0 ? _a : DEFAULT_RESIZEABLE);
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"TableHead.js","sourceRoot":"","sources":["../../../src/components/PaginatedTable/TableHead.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAC,aAAa,EAAC,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EACH,SAAS,EACT,kBAAkB,EAClB,kBAAkB,EAClB,wBAAwB,EACxB,UAAU,GACb,MAAM,aAAa,CAAC;AACrB,OAAO,EAAC,CAAC,EAAC,MAAM,UAAU,CAAC;AAG3B,kGAAkG;AAClG,MAAM,QAAQ,GAAG,CAAC,EAAC,KAAK,EAA0B,EAAE,EAAE;IAClD,OAAO,CACH,cACI,SAAS,EAAE,CAAC,CAAC,WAAW,EAAE,EAAC,IAAI,EAAE,KAAK,KAAK,UAAU,EAAC,CAAC,EACvD,OAAO,EAAC,UAAU,EAClB,KAAK,EAAC,IAAI,EACV,MAAM,EAAC,GAAG,YAEV,eAAM,IAAI,EAAC,cAAc,EAAC,CAAC,EAAC,gBAAgB,GAAG,GAC7C,CACT,CAAC;AACN,CAAC,CAAC;AAQF,MAAM,cAAc,GAAG,CAAC,EAAC,SAAS,EAAE,QAAQ,EAAE,gBAAgB,EAAsB,EAAE,EAAE;IACpF,IAAI,QAAQ,EAAE,CAAC;QACX,OAAO,CACH,eAAM,SAAS,EAAE,CAAC,CAAC,qBAAqB,EAAE,EAAC,MAAM,EAAE,CAAC,SAAS,EAAC,CAAC,YAC3D,KAAC,QAAQ,IAAC,KAAK,EAAE,SAAS,IAAI,gBAAgB,GAAI,GAC/C,CACV,CAAC;IACN,CAAC;SAAM,CAAC;QACJ,OAAO,IAAI,CAAC;IAChB,CAAC;AACL,CAAC,CAAC;AAcF,MAAM,CAAC,MAAM,aAAa,GAAG,CAAK,EAC9B,MAAM,EACN,UAAU,EACV,SAAS,EACT,gBAAgB,EAChB,MAAM,EACN,SAAS,EACT,WAAW,EACX,aAAa,EACb,eAAe,GACK,EAAE,EAAE;;IACxB,MAAM,cAAc,GAAG,KAAK,CAAC,MAAM,
|
1
|
+
{"version":3,"file":"TableHead.js","sourceRoot":"","sources":["../../../src/components/PaginatedTable/TableHead.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAC,aAAa,EAAC,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EACH,SAAS,EACT,kBAAkB,EAClB,kBAAkB,EAClB,wBAAwB,EACxB,UAAU,GACb,MAAM,aAAa,CAAC;AACrB,OAAO,EAAC,CAAC,EAAC,MAAM,UAAU,CAAC;AAG3B,kGAAkG;AAClG,MAAM,QAAQ,GAAG,CAAC,EAAC,KAAK,EAA0B,EAAE,EAAE;IAClD,OAAO,CACH,cACI,SAAS,EAAE,CAAC,CAAC,WAAW,EAAE,EAAC,IAAI,EAAE,KAAK,KAAK,UAAU,EAAC,CAAC,EACvD,OAAO,EAAC,UAAU,EAClB,KAAK,EAAC,IAAI,EACV,MAAM,EAAC,GAAG,YAEV,eAAM,IAAI,EAAC,cAAc,EAAC,CAAC,EAAC,gBAAgB,GAAG,GAC7C,CACT,CAAC;AACN,CAAC,CAAC;AAQF,MAAM,cAAc,GAAG,CAAC,EAAC,SAAS,EAAE,QAAQ,EAAE,gBAAgB,EAAsB,EAAE,EAAE;IACpF,IAAI,QAAQ,EAAE,CAAC;QACX,OAAO,CACH,eAAM,SAAS,EAAE,CAAC,CAAC,qBAAqB,EAAE,EAAC,MAAM,EAAE,CAAC,SAAS,EAAC,CAAC,YAC3D,KAAC,QAAQ,IAAC,KAAK,EAAE,SAAS,IAAI,gBAAgB,GAAI,GAC/C,CACV,CAAC;IACN,CAAC;SAAM,CAAC;QACJ,OAAO,IAAI,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CAAC,CAAC;IAEF,MAAM,eAAe,GAAG,GAAG,EAAE;QACzB,OAAO,CACH,gBAAO,SAAS,EAAE,CAAC,CAAC,MAAM,CAAC,YACvB,uBACK,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE;;oBACpB,MAAM,SAAS,GACX,UAAU,CAAC,QAAQ,KAAK,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC;oBAE3E,MAAM,UAAU,GACZ,eAAe,IAAI,CAAC,MAAA,MAAM,CAAC,UAAU,mCAAI,kBAAkB,CAAC,CAAC;oBAEjE,OAAO,CACH,KAAC,aAAa,IAEV,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,UAAU,EACtB,SAAS,EAAE,SAAS,EACpB,gBAAgB,EAAE,gBAAgB,EAClC,MAAM,EAAE,UAAU,EAClB,SAAS,EAAE,SAAS,EACpB,eAAe,EAAE,eAAe,IAP3B,MAAM,CAAC,IAAI,CAQlB,CACL,CAAC;gBACN,CAAC,CAAC,GACD,GACD,CACX,CAAC;IACN,CAAC,CAAC;IAEF,OAAO,CACH,MAAC,KAAK,CAAC,QAAQ,eACV,oBAAoB,EAAE,EACtB,eAAe,EAAE,IACL,CACpB,CAAC;AACN,CAAC,CAAC"}
|
@@ -1,20 +1,28 @@
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
2
2
|
import { Skeleton } from '@gravity-ui/uikit';
|
3
|
-
import { DEFAULT_ALIGN } from './constants';
|
3
|
+
import { DEFAULT_ALIGN, DEFAULT_RESIZEABLE } from './constants';
|
4
4
|
import { b } from './shared';
|
5
|
-
const TableRowCell = ({ children, className, height, width, align = DEFAULT_ALIGN, }) => {
|
6
|
-
|
7
|
-
|
5
|
+
const TableRowCell = ({ children, className, height, width, align = DEFAULT_ALIGN, resizeable, }) => {
|
6
|
+
return (_jsx("td", { className: b('row-cell', { align: align }, className), style: {
|
7
|
+
height: `${height}px`,
|
8
|
+
width: `${width}px`,
|
9
|
+
// Additional maxWidth for resizeable columns to ensure overflow hidden for <td>
|
10
|
+
maxWidth: resizeable ? `${width}px` : undefined,
|
11
|
+
}, children: children }));
|
8
12
|
};
|
9
13
|
export const LoadingTableRow = ({ index, columns, height }) => {
|
10
14
|
return (_jsx("tr", { className: b('row', { loading: true }), children: columns.map((column) => {
|
11
|
-
|
15
|
+
var _a;
|
16
|
+
const resizeable = (_a = column.resizeable) !== null && _a !== void 0 ? _a : DEFAULT_RESIZEABLE;
|
17
|
+
return (_jsx(TableRowCell, { height: height, width: column.width, align: column.align, className: column.className, resizeable: resizeable, children: _jsx(Skeleton, { style: { width: '80%', height: '50%' } }) }, `${column.name}${index}`));
|
12
18
|
}) }));
|
13
19
|
};
|
14
20
|
export const TableRow = ({ row, index, columns, getRowClassName, height }) => {
|
15
21
|
const additionalClassName = getRowClassName === null || getRowClassName === void 0 ? void 0 : getRowClassName(row);
|
16
22
|
return (_jsx("tr", { className: b('row', additionalClassName), children: columns.map((column) => {
|
17
|
-
|
23
|
+
var _a;
|
24
|
+
const resizeable = (_a = column.resizeable) !== null && _a !== void 0 ? _a : DEFAULT_RESIZEABLE;
|
25
|
+
return (_jsx(TableRowCell, { height: height, width: column.width, align: column.align, className: column.className, resizeable: resizeable, children: column.render({ row, index }) }, `${column.name}${index}`));
|
18
26
|
}) }));
|
19
27
|
};
|
20
28
|
export const EmptyTableRow = ({ columns, children }) => {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"TableRow.js","sourceRoot":"","sources":["../../../src/components/PaginatedTable/TableRow.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAC,QAAQ,EAAC,MAAM,mBAAmB,CAAC;AAE3C,OAAO,EAAC,aAAa,EAAC,MAAM,aAAa,CAAC;
|
1
|
+
{"version":3,"file":"TableRow.js","sourceRoot":"","sources":["../../../src/components/PaginatedTable/TableRow.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAC,QAAQ,EAAC,M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jsx-runtime";
|
|
2
2
|
import { Skeleton as KitSkeleton } from '@gravity-ui/uikit';
|
3
3
|
import { useDelayed } from '../../utils/hooks/useDelayed';
|
4
4
|
export const Skeleton = ({ delay = 600, className }) => {
|
5
|
-
const show = useDelayed(delay);
|
5
|
+
const [show] = useDelayed(delay);
|
6
6
|
if (!show) {
|
7
7
|
return null;
|
8
8
|
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Skeleton.js","sourceRoot":"","sources":["../../../src/components/Skeleton/Skeleton.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAC,QAAQ,IAAI,WAAW,EAAC,MAAM,mBAAmB,CAAC;AAE1D,OAAO,EAAC,UAAU,EAAC,MAAM,8BAA8B,CAAC;AAOxD,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,EAAC,KAAK,GAAG,GAAG,EAAE,SAAS,EAAgB,EAAE,EAAE;IAChE,MAAM,IAAI,GAAG,UAAU,CAAC,KAAK,CAAC,CAAC;
|
1
|
+
{"version":3,"file":"Skeleton.js","sourceRoot":"","sources":["../../../src/components/Skeleton/Skeleton.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAC,QAAQ,IAAI,WAAW,EAAC,MAAM,mBAAmB,CAAC;AAE1D,OAAO,EAAC,UAAU,EAAC,MAAM,8BAA8B,CAAC;AAOxD,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,EAAC,KAAK,GAAG,GAAG,EAAE,SAAS,EAAgB,EAAE,EAAE;IAChE,MAAM,CAAC,IAAI,CAAC,GAAG,UAAU,CAAC,KAAK,CAAC,CAAC;IACjC,IAAI,CAAC,IAAI,EAAE,CAAC;QACR,OAAO,IAAI,CAAC;IAChB,CAAC;IACD,OAAO,KAAC,WAAW,IAAC,SAAS,EAAE,SAAS,GAAI,CAAC;AACjD,CAAC,CAAC"}
|
@@ -1,10 +1,13 @@
|
|
1
1
|
import type { NodesMap } from '../../types/store/nodesList';
|
2
2
|
import type { PreparedVDisk } from '../../utils/disks/types';
|
3
3
|
import './VDisk.scss';
|
4
|
-
interface VDiskProps {
|
4
|
+
export interface VDiskProps {
|
5
5
|
data?: PreparedVDisk;
|
6
6
|
nodes?: NodesMap;
|
7
7
|
compact?: boolean;
|
8
|
+
showPopup?: boolean;
|
9
|
+
onShowPopup?: VoidFunction;
|
10
|
+
onHidePopup?: VoidFunction;
|
11
|
+
progressBarClassName?: string;
|
8
12
|
}
|
9
|
-
export declare const VDisk: ({ data, nodes, compact }: VDiskProps) => import("react/jsx-runtime").JSX.Element;
|
10
|
-
export {};
|
13
|
+
export declare const VDisk: ({ data, nodes, compact, showPopup, onShowPopup, onHidePopup, progressBarClassName, }: VDiskProps) => import("react/jsx-runtime").JSX.Element;
|
@@ -12,16 +12,18 @@ import { InternalLink } from '../InternalLink';
|
|
12
12
|
import { VDiskPopup } from '../VDiskPopup/VDiskPopup';
|
13
13
|
import './VDisk.scss';
|
14
14
|
const b = cn('ydb-vdisk-component');
|
15
|
-
export const VDisk = ({ data = {}, nodes, compact }) => {
|
15
|
+
export const VDisk = ({ data = {}, nodes, compact, showPopup, onShowPopup, onHidePopup, progressBarClassName, }) => {
|
16
16
|
const isFullData = isFullVDiskData(data);
|
17
17
|
const diskPagesAvailable = useDiskPagesAvailable();
|
18
18
|
const [isPopupVisible, setIsPopupVisible] = React.useState(false);
|
19
19
|
const anchor = React.useRef(null);
|
20
|
-
const
|
20
|
+
const handleShowPopup = () => {
|
21
21
|
setIsPopupVisible(true);
|
22
|
+
onShowPopup === null || onShowPopup === void 0 ? void 0 : onShowPopup();
|
22
23
|
};
|
23
|
-
const
|
24
|
+
const handleHidePopup = () => {
|
24
25
|
setIsPopupVisible(false);
|
26
|
+
onHidePopup === null || onHidePopup === void 0 ? void 0 : onHidePopup();
|
25
27
|
};
|
26
28
|
let vDiskPath;
|
27
29
|
if (diskPagesAvailable &&
|
@@ -36,6 +38,6 @@ export const VDisk = ({ data = {}, nodes, compact }) => {
|
|
36
38
|
vdiskId: stringifyVdiskId(data.VDiskId),
|
37
39
|
});
|
38
40
|
}
|
39
|
-
return (_jsxs(React.Fragment, { children: [_jsx(
|
41
|
+
return (_jsxs(React.Fragment, { children: [_jsx("div", { className: b(), ref: anchor, onMouseEnter: handleShowPopup, onMouseLeave: handleHidePopup, children: _jsx(InternalLink, { to: vDiskPath, className: b('content'), children: _jsx(DiskStateProgressBar, { diskAllocatedPercent: data.AllocatedPercent, severity: data.Severity, compact: compact, className: progressBarClassName }) }) }), _jsx(VDiskPopup, { data: data, nodes: nodes, anchorRef: anchor, open: isPopupVisible || showPopup })] }));
|
40
42
|
};
|
41
43
|
//# sourceMappingURL=VDisk.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"VDisk.js","sourceRoot":"","sources":["../../../src/components/VDisk/VDisk.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAC,SAAS,EAAC,MAAM,iCAAiC,CAAC;AAC1D,OAAO,MAAM,EAAE,EAAC,UAAU,EAAE,gBAAgB,EAAC,MAAM,cAAc,CAAC;AAClE,OAAO,EAAC,qBAAqB,EAAC,MAAM,yCAAyC,CAAC;AAE9E,OAAO,EAAC,cAAc,EAAC,MAAM,aAAa,CAAC;AAC3C,OAAO,EAAC,EAAE,EAAC,MAAM,gBAAgB,CAAC;AAClC,OAAO,EAAC,gBAAgB,EAAC,MAAM,2CAA2C,CAAC;AAC3E,OAAO,EAAC,eAAe,EAAC,MAAM,2BAA2B,CAAC;AAE1D,OAAO,EAAC,oBAAoB,EAAC,MAAM,8CAA8C,CAAC;AAClF,OAAO,EAAC,YAAY,EAAC,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAC,UAAU,EAAC,MAAM,0BAA0B,CAAC;AAEpD,OAAO,cAAc,CAAC;AAEtB,MAAM,CAAC,GAAG,EAAE,CAAC,qBAAqB,CAAC,CAAC;
|
1
|
+
{"version":3,"file":"VDisk.js","sourceRoot":"","sources":["../../../src/components/VDisk/V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,KAAK,EACZ,SAAS,EAAE,MAAM,EACjB,IAAI,EAAE,cAAc,IAAI,SAAS,GACnC,IACW,CACpB,CAAC;AACN,CAAC,CAAC"}
|
@@ -1,11 +1,9 @@
|
|
1
|
-
import type { NodesMap } from '../../types/store/nodesList';
|
2
1
|
import type { PreparedVDisk } from '../../utils/disks/types';
|
3
|
-
|
2
|
+
import type { VDiskProps } from './VDisk';
|
3
|
+
interface VDiskWithDonorsStackProps extends VDiskProps {
|
4
4
|
data?: PreparedVDisk;
|
5
|
-
nodes?: NodesMap;
|
6
|
-
compact?: boolean;
|
7
5
|
className?: string;
|
8
6
|
stackClassName?: string;
|
9
7
|
}
|
10
|
-
export declare function VDiskWithDonorsStack({ data,
|
8
|
+
export declare function VDiskWithDonorsStack({ data, className, stackClassName, ...restProps }: VDiskWithDonorsStackProps): import("react/jsx-runtime").JSX.Element;
|
11
9
|
export {};
|
@@ -3,13 +3,13 @@ import { stringifyVdiskId } from '../../utils/dataFormatters/dataFormatters';
|
|
3
3
|
import { isFullVDiskData } from '../../utils/disks/helpers';
|
4
4
|
import { Stack } from '../Stack/Stack';
|
5
5
|
import { VDisk } from './VDisk';
|
6
|
-
export function VDiskWithDonorsStack({ data,
|
6
|
+
export function VDiskWithDonorsStack({ data, className, stackClassName, ...restProps }) {
|
7
7
|
const donors = data === null || data === void 0 ? void 0 : data.Donors;
|
8
|
-
const content = donors && donors.length > 0 ? (_jsxs(Stack, { className: stackClassName, children: [_jsx(VDisk, { data: data,
|
8
|
+
const content = donors && donors.length > 0 ? (_jsxs(Stack, { className: stackClassName, children: [_jsx(VDisk, { data: data, ...restProps }), donors.map((donor) => {
|
9
9
|
const isFullData = isFullVDiskData(donor);
|
10
10
|
// donor and acceptor are always in the same group
|
11
|
-
return (_jsx(VDisk, { data: donor,
|
12
|
-
})] })) : (_jsx(VDisk, { data: data,
|
11
|
+
return (_jsx(VDisk, { data: donor, ...restProps }, stringifyVdiskId(isFullData ? donor.VDiskId : donor)));
|
12
|
+
})] })) : (_jsx(VDisk, { data: data, ...restProps }));
|
13
13
|
return _jsx("div", { className: className, children: content });
|
14
14
|
}
|
15
15
|
//# sourceMappingURL=VDiskWithDonorsStack.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"VDiskWithDonorsStack.js","sourceRoot":"","sources":["../../../src/components/VDisk/VDiskWithDonorsStack.tsx"],"names":[],"mappings":";
|
1
|
+
{"version":3,"file":"VDiskWithDonorsStack.js","sourceRoot":"","sources":["../../../src/components/VDisk/VDiskWithDonorsStack.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAC,gBAAgB,EAAC,MAAM,2CAA2C,CAAC;AAC3E,OAAO,EAAC,eAAe,EAAC,MAAM,2BAA2B,CAAC;AAE1D,OAAO,EAAC,KAAK,EAAC,MAAM,gBAAgB,CAAC;AAGrC,OAAO,EAAC,KAAK,EAAC,MAAM,SAAS,CAAC;AAQ9B,MAAM,UAAU,oBAAoB,CAAC,EACjC,IAAI,EACJ,SAAS,EACT,cAAc,EACd,GAAG,SAAS,EACY;IACxB,MAAM,MAAM,GAAG,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,MAAM,CAAC;IAE5B,MAAM,OAAO,GACT,MAAM,IAAI,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,CAC1B,MAAC,KAAK,IAAC,SAAS,EAAE,cAAc,aAC5B,KAAC,KAAK,IAAC,IAAI,EAAE,IAAI,KAAM,SAAS,GAAI,EACnC,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE;gBAClB,MAAM,UAAU,GAAG,eAAe,CAAC,KAAK,CAAC,CAAC;gBAE1C,kDAAkD;gBAClD,OAAO,CACH,KAAC,KAAK,IAEF,IAAI,EAAE,KAAK,KACP,SAAS,IAFR,gBAAgB,CAAC,UAAU,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,CAG3D,CACL,CAAC;YACN,CAAC,CAAC,IACE,CACX,CAAC,CAAC,CAAC,CACA,KAAC,KAAK,IAAC,IAAI,EAAE,IAAI,KAAM,SAAS,GAAI,CACvC,CAAC;IAEN,OAAO,cAAK,SAAS,EAAE,SAAS,YAAG,OAAO,GAAO,CAAC;AACtD,CAAC"}
|
@@ -87,7 +87,7 @@ export const VDiskPopup = ({ data, nodes, ...props }) => {
|
|
87
87
|
const isFullData = isFullVDiskData(data);
|
88
88
|
const vdiskInfo = React.useMemo(() => (isFullData ? prepareVDiskData(data) : prepareUnavailableVDiskData(data)), [data, isFullData]);
|
89
89
|
const pdiskInfo = React.useMemo(() => isFullData && data.PDisk && preparePDiskData(data.PDisk, nodes), [data, nodes, isFullData]);
|
90
|
-
return (_jsxs(Popup, { contentClassName: b(), placement: ['top', 'bottom'],
|
90
|
+
return (_jsxs(Popup, { contentClassName: b(), placement: ['top', 'bottom'], hasArrow: true,
|
91
91
|
// bigger offset for easier switching to neighbour nodes
|
92
92
|
// matches the default offset for popup with arrow out of a sense of beauty
|
93
93
|
offset: [0, 12], ...props, children: [data.DonorMode && _jsx(Label, { className: b('donor-label'), children: "Donor" }), _jsx(InfoViewer, { title: "VDisk", info: vdiskInfo, size: "s" }), pdiskInfo && _jsx(InfoViewer, { title: "PDisk", info: pdiskInfo, size: "s" })] }));
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"VDiskPopup.js","sourceRoot":"","sources":["../../../src/components/VDiskPopup/VDiskPopup.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,EAAC,KAAK,EAAE,KAAK,EAAC,MAAM,mBAAmB,CAAC;AAE/C,OAAO,EAAC,KAAK,EAAC,MAAM,uBAAuB,CAAC;AAG5C,OAAO,EAAC,EAAE,EAAC,MAAM,gBAAgB,CAAC;AAClC,OAAO,EAAC,sBAAsB,EAAC,MAAM,uBAAuB,CAAC;AAC7D,OAAO,EAAC,gBAAgB,EAAC,MAAM,2CAA2C,CAAC;AAC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AE,KAAK,EAAE,GAAG,KAAK,EAAkB,EAAE,EAAE;IACnE,MAAM,UAAU,GAAG,eAAe,CAAC,IAAI,CAAC,CAAC;IAEzC,MAAM,SAAS,GAAG,KAAK,CAAC,OAAO,CAC3B,GAAG,EAAE,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,gBAAgB,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,2BAA2B,CAAC,IAAI,CAAC,CAAC,EAC/E,CAAC,IAAI,EAAE,UAAU,CAAC,CACrB,CAAC;IACF,MAAM,SAAS,GAAG,KAAK,CAAC,OAAO,CAC3B,GAAG,EAAE,CAAC,UAAU,IAAI,IAAI,CAAC,KAAK,IAAI,gBAAgB,CAAC,IAAI,CAAC,KAAK,EAAE,KAAK,CAAC,EACrE,CAAC,IAAI,EAAE,KAAK,EAAE,UAAU,CAAC,CAC5B,CAAC;IAEF,OAAO,CACH,MAAC,KAAK,IACF,gBAAgB,EAAE,CAAC,EAAE,EACrB,SAAS,EAAE,CAAC,KAAK,EAAE,QAAQ,CAAC,EAC5B,QAAQ;QACR,wDAAwD;QACxD,2EAA2E;QAC3E,MAAM,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,KACX,KAAK,aAER,IAAI,CAAC,SAAS,IAAI,KAAC,KAAK,IAAC,SAAS,EAAE,CAAC,CAAC,aAAa,CAAC,sBAAe,EACpE,KAAC,UAAU,IAAC,KAAK,EAAC,OAAO,EAAC,IAAI,EAAE,SAAS,EAAE,IAAI,EAAC,GAAG,GAAG,EACrD,SAAS,IAAI,KAAC,UAAU,IAAC,KAAK,EAAC,OAAO,EAAC,IAAI,EAAE,SAAS,EAAE,IAAI,EAAC,GAAG,GAAG,IAChE,CACX,CAAC;AACN,CAAC,CAAC"}
|
@@ -0,0 +1,11 @@
|
|
1
|
+
import type { EDecommitStatus } from '../../../types/api/pdisk';
|
2
|
+
import './DecommissionButton.scss';
|
3
|
+
interface DecommissionButtonProps {
|
4
|
+
decommission?: EDecommitStatus;
|
5
|
+
onConfirmAction: (newDecommissionStatus?: EDecommitStatus, isRetry?: boolean) => Promise<void>;
|
6
|
+
onConfirmActionSuccess: (() => Promise<void>) | VoidFunction;
|
7
|
+
buttonDisabled?: boolean;
|
8
|
+
popoverDisabled?: boolean;
|
9
|
+
}
|
10
|
+
export declare function DecommissionButton({ decommission, onConfirmAction, onConfirmActionSuccess, buttonDisabled, popoverDisabled, }: DecommissionButtonProps): import("react/jsx-runtime").JSX.Element;
|
11
|
+
export {};
|
@@ -0,0 +1,91 @@
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
2
|
+
import React from 'react';
|
3
|
+
import { ChevronDown } from '@gravity-ui/icons';
|
4
|
+
import { Button, DropdownMenu, Icon, Popover } from '@gravity-ui/uikit';
|
5
|
+
import { CriticalActionDialog } from '../../../components/CriticalActionDialog/CriticalActionDialog';
|
6
|
+
import { isErrorWithRetry } from '../../../components/CriticalActionDialog/utils';
|
7
|
+
import { wait } from '../../../utils';
|
8
|
+
import { cn } from '../../../utils/cn';
|
9
|
+
import { pDiskPageKeyset } from '../i18n';
|
10
|
+
import decommissionIcon from '../../../assets/icons/decommission.svg';
|
11
|
+
import './DecommissionButton.scss';
|
12
|
+
const b = cn('ydb-pdisk-decommission-button');
|
13
|
+
function getDecommissionWarningText(decommission) {
|
14
|
+
if (decommission === 'DECOMMIT_IMMINENT') {
|
15
|
+
return pDiskPageKeyset('decommission-dialog-imminent-warning');
|
16
|
+
}
|
17
|
+
if (decommission === 'DECOMMIT_PENDING') {
|
18
|
+
return pDiskPageKeyset('decommission-dialog-pending-warning');
|
19
|
+
}
|
20
|
+
if (decommission === 'DECOMMIT_REJECTED') {
|
21
|
+
return pDiskPageKeyset('decommission-dialog-rejected-warning');
|
22
|
+
}
|
23
|
+
if (decommission === 'DECOMMIT_NONE') {
|
24
|
+
return pDiskPageKeyset('decommission-dialog-none-warning');
|
25
|
+
}
|
26
|
+
return undefined;
|
27
|
+
}
|
28
|
+
function getDecommissionButtonItems(decommission, setNewDecommission) {
|
29
|
+
return [
|
30
|
+
{
|
31
|
+
text: pDiskPageKeyset('decommission-none'),
|
32
|
+
action: () => setNewDecommission('DECOMMIT_NONE'),
|
33
|
+
hidden: !decommission ||
|
34
|
+
decommission === 'DECOMMIT_NONE' ||
|
35
|
+
decommission === 'DECOMMIT_UNSET',
|
36
|
+
},
|
37
|
+
{
|
38
|
+
text: pDiskPageKeyset('decommission-pending'),
|
39
|
+
action: () => setNewDecommission('DECOMMIT_PENDING'),
|
40
|
+
hidden: decommission === 'DECOMMIT_PENDING',
|
41
|
+
},
|
42
|
+
{
|
43
|
+
text: pDiskPageKeyset('decommission-rejected'),
|
44
|
+
action: () => setNewDecommission('DECOMMIT_REJECTED'),
|
45
|
+
hidden: decommission === 'DECOMMIT_REJECTED',
|
46
|
+
},
|
47
|
+
{
|
48
|
+
text: pDiskPageKeyset('decommission-imminent'),
|
49
|
+
theme: 'danger',
|
50
|
+
action: () => setNewDecommission('DECOMMIT_IMMINENT'),
|
51
|
+
hidden: decommission === 'DECOMMIT_IMMINENT',
|
52
|
+
},
|
53
|
+
];
|
54
|
+
}
|
55
|
+
export function DecommissionButton({ decommission, onConfirmAction, onConfirmActionSuccess, buttonDisabled, popoverDisabled, }) {
|
56
|
+
const [newDecommission, setNewDecommission] = React.useState();
|
57
|
+
const [buttonLoading, setButtonLoading] = React.useState(false);
|
58
|
+
const [withRetry, setWithRetry] = React.useState(false);
|
59
|
+
const handleConfirmAction = async (isRetry) => {
|
60
|
+
setButtonLoading(true);
|
61
|
+
await onConfirmAction(newDecommission, isRetry);
|
62
|
+
};
|
63
|
+
const handleConfirmActionSuccess = async () => {
|
64
|
+
setWithRetry(false);
|
65
|
+
// Decommission needs some time to change
|
66
|
+
// Wait for some time to send request for updated data
|
67
|
+
await wait(5000);
|
68
|
+
try {
|
69
|
+
await onConfirmActionSuccess();
|
70
|
+
}
|
71
|
+
finally {
|
72
|
+
setButtonLoading(false);
|
73
|
+
}
|
74
|
+
};
|
75
|
+
const handleConfirmActionError = (error) => {
|
76
|
+
setWithRetry(isErrorWithRetry(error));
|
77
|
+
setButtonLoading(false);
|
78
|
+
};
|
79
|
+
const handleClose = () => {
|
80
|
+
setNewDecommission(undefined);
|
81
|
+
};
|
82
|
+
const items = getDecommissionButtonItems(decommission, setNewDecommission);
|
83
|
+
const renderSwitcher = (props) => {
|
84
|
+
return (_jsx(DecommissionButtonSwitcher, { popoverDisabled: popoverDisabled, loading: buttonLoading, disabled: buttonDisabled, ...props }));
|
85
|
+
};
|
86
|
+
return (_jsxs(React.Fragment, { children: [_jsx(DropdownMenu, { renderSwitcher: renderSwitcher, items: items, popupProps: { className: b('popup') } }), _jsx(CriticalActionDialog, { visible: Boolean(newDecommission), header: pDiskPageKeyset('decommission-dialog-title'), text: getDecommissionWarningText(newDecommission), withRetry: withRetry, retryButtonText: pDiskPageKeyset('decommission-dialog-force-change'), onConfirm: handleConfirmAction, onConfirmActionSuccess: handleConfirmActionSuccess, onConfirmActionError: handleConfirmActionError, onClose: handleClose })] }));
|
87
|
+
}
|
88
|
+
function DecommissionButtonSwitcher({ popoverDisabled, ...restProps }) {
|
89
|
+
return (_jsx(Popover, { content: pDiskPageKeyset('decommission-change-not-allowed'), placement: 'right', disabled: popoverDisabled, children: _jsxs(Button, { view: 'normal', className: b('button'), ...restProps, children: [_jsx(Icon, { data: decommissionIcon }), pDiskPageKeyset('decommission-button'), _jsx(Icon, { data: ChevronDown })] }) }));
|
90
|
+
}
|
91
|
+
//# sourceMappingURL=DecommissionButton.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"DecommissionButton.js","sourceRoot":"","sources":["../../../../src/containers/PDiskPage/DecommissionButton/DecommissionButton.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAC,WAAW,EAAC,MAAM,mBAAmB,CAAC;AAE9C,OAAO,EAAC,MAAM,EAAE,YAAY,EAAE,IAA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eAAe,CAAC,iCAAiC,CAAC,EAC3D,SAAS,EAAE,OAAO,EAClB,QAAQ,EAAE,eAAe,YAEzB,MAAC,MAAM,IAAC,IAAI,EAAE,QAAQ,EAAE,SAAS,EAAE,CAAC,CAAC,QAAQ,CAAC,KAAM,SAAS,aACzD,KAAC,IAAI,IAAC,IAAI,EAAE,gBAAgB,GAAI,EAC/B,eAAe,CAAC,qBAAqB,CAAC,EACvC,KAAC,IAAI,IAAC,IAAI,EAAE,WAAW,GAAI,IACtB,GACH,CACb,CAAC;AACN,CAAC"}
|
@@ -0,0 +1,6 @@
|
|
1
|
+
import type { EDecommitStatus } from '../../../types/api/pdisk';
|
2
|
+
interface DecommissionLabelProps {
|
3
|
+
decommission?: EDecommitStatus;
|
4
|
+
}
|
5
|
+
export declare function DecommissionLabel({ decommission }: DecommissionLabelProps): import("react/jsx-runtime").JSX.Element | null;
|
6
|
+
export {};
|
@@ -0,0 +1,20 @@
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
2
|
+
import { Label } from '@gravity-ui/uikit';
|
3
|
+
import { pDiskPageKeyset } from '../i18n';
|
4
|
+
function getDecommissionLabelText(decommission) {
|
5
|
+
return pDiskPageKeyset('decommission-label', { decommission });
|
6
|
+
}
|
7
|
+
export function DecommissionLabel({ decommission }) {
|
8
|
+
if (decommission === 'DECOMMIT_IMMINENT') {
|
9
|
+
return (_jsx(Label, { theme: "danger", size: "m", children: getDecommissionLabelText(pDiskPageKeyset('decommission-imminent')) }));
|
10
|
+
}
|
11
|
+
if (decommission === 'DECOMMIT_PENDING') {
|
12
|
+
return (_jsx(Label, { theme: "warning", size: "m", children: getDecommissionLabelText(pDiskPageKeyset('decommission-pending')) }));
|
13
|
+
}
|
14
|
+
if (decommission === 'DECOMMIT_REJECTED') {
|
15
|
+
return (_jsx(Label, { theme: "normal", size: "m", children: getDecommissionLabelText(pDiskPageKeyset('decommission-rejected')) }));
|
16
|
+
}
|
17
|
+
// Don't display status for undefined, NONE or UNSET decommission
|
18
|
+
return null;
|
19
|
+
}
|
20
|
+
//# sourceMappingURL=DecommissionLabel.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"DecommissionLabel.js","sourceRoot":"","sources":["../../../../src/containers/PDiskPage/DecommissionLabel/DecommissionLabel.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAC,KAAK,EAAC,MAAM,mBAAmB,CAAC;AAGxC,OAAO,EAAC,eAAe,EAAC,MAAM,SAAS,CAAC;AAMxC,SAAS,wBAAwB,CAAC,YAAoB;IAClD,OAAO,eAAe,CAAC,oBAAoB,EAAE,EAAC,YAAY,EAAC,CAAC,CAAC;AACjE,CAAC;AAED,MAAM,UAAU,iBAAiB,CAAC,EAAC,YAAY,EAAyB;IACpE,IAAI,YAAY,KAAK,mBAAmB,EAAE,CAAC;QACvC,OAAO,CACH,KAAC,KAAK,IAAC,KAAK,EAAC,QAAQ,EAAC,IAAI,EAAC,GAAG,YACzB,wBAAwB,CAAC,eAAe,CAAC,uBAAuB,CAAC,CAAC,GAC/D,CACX,CAAC;IACN,CAAC;IACD,IAAI,YAAY,KAAK,kBAAkB,EAAE,CAAC;QACtC,OAAO,CACH,KAAC,KAAK,IAAC,KAAK,EAAC,SAAS,EAAC,IAAI,EAAC,GAAG,YAC1B,wBAAwB,CAAC,eAAe,CAAC,sBAAsB,CAAC,CAAC,GAC9D,CACX,CAAC;IACN,CAAC;IACD,IAAI,YAAY,KAAK,mBAAmB,EAAE,CAAC;QACvC,OAAO,CACH,KAAC,KAAK,IAAC,KAAK,EAAC,QAAQ,EAAC,IAAI,EAAC,GAAG,YACzB,wBAAwB,CAAC,eAAe,CAAC,uBAAuB,CAAC,CAAC,GAC/D,CACX,CAAC;IACN,CAAC;IAED,iEAAiE;IACjE,OAAO,IAAI,CAAC;AAChB,CAAC"}
|
@@ -1,22 +1,18 @@
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
2
|
-
import React from 'react';
|
3
2
|
import { ResizeableDataTable } from '../../../components/ResizeableDataTable/ResizeableDataTable';
|
4
3
|
import { TableSkeleton } from '../../../components/TableSkeleton/TableSkeleton';
|
5
|
-
import { selectNodesMap } from '../../../store/reducers/nodesList';
|
6
4
|
import { pDiskApi } from '../../../store/reducers/pdisk/pdisk';
|
7
5
|
import { DEFAULT_TABLE_SETTINGS } from '../../../utils/constants';
|
8
|
-
import { useAutoRefreshInterval
|
9
|
-
import { STORAGE_GROUPS_COLUMNS_WIDTH_LS_KEY
|
6
|
+
import { useAutoRefreshInterval } from '../../../utils/hooks';
|
7
|
+
import { STORAGE_GROUPS_COLUMNS_WIDTH_LS_KEY } from '../../Storage/StorageGroups/columns/getStorageGroupsColumns';
|
8
|
+
import { useGetDiskStorageColumns } from '../../Storage/StorageGroups/columns/hooks';
|
10
9
|
export function PDiskGroups({ pDiskId, nodeId }) {
|
11
10
|
var _a;
|
12
|
-
const nodesMap = useTypedSelector(selectNodesMap);
|
13
11
|
const [autoRefreshInterval] = useAutoRefreshInterval();
|
14
12
|
const pDiskStorageQuery = pDiskApi.useGetStorageInfoQuery({ pDiskId, nodeId }, { pollingInterval: autoRefreshInterval });
|
15
13
|
const loading = pDiskStorageQuery.isFetching && pDiskStorageQuery.currentData === undefined;
|
16
14
|
const data = (_a = pDiskStorageQuery.currentData) !== null && _a !== void 0 ? _a : [];
|
17
|
-
const pDiskStorageColumns =
|
18
|
-
return getDiskPageStorageColumns(nodesMap);
|
19
|
-
}, [nodesMap]);
|
15
|
+
const pDiskStorageColumns = useGetDiskStorageColumns();
|
20
16
|
if (loading) {
|
21
17
|
return _jsx(TableSkeleton, {});
|
22
18
|
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"PDiskGroups.js","sourceRoot":"","sources":["../../../../src/containers/PDiskPage/PDiskGroups/PDiskGroups.tsx"],"names":[],"mappings":";AAAA,OAAO,
|
1
|
+
{"version":3,"file":"PDiskGroups.js","sourceRoot":"","sources":["../../../../src/containers/PDiskPage/PDiskGroups/PDiskGroups.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAC,mBAAmB,EAAC,MAAM,6DAA6D,CAAC;AAChG,OAAO,EAAC,aAAa,EAAC,MAAM,iDAAiD,CAAC;AAC9E,OAAO,EAAC,QAAQ,EAAC,MAAM,qCAAqC,CAAC;AAC7D,OAAO,EAAC,sBAAsB,EAAC,MAAM,0BAA0B,CAAC;AAChE,OAAO,EAAC,sBAAsB,EAAC,MAAM,sBAAsB,CAAC;AAC5D,OAAO,EAAC,mCAAmC,EAAC,MAAM,6DAA6D,CAAC;AAChH,OAAO,EAAC,wBAAwB,EAAC,MAAM,2CAA2C,CAAC;AAOnF,MAAM,UAAU,WAAW,CAAC,EAAC,OAAO,EAAE,MAAM,EAAmB;;IAC3D,MAAM,CAAC,mBAAmB,CAAC,GAAG,sBAAsB,EAAE,CAAC;IAEvD,MAAM,iBAAiB,GAAG,QAAQ,CAAC,sBAAsB,CACrD,EAAC,OAAO,EAAE,MAAM,EAAC,EACjB,EAAC,eAAe,EAAE,mBAAmB,EAAC,CACzC,CAAC;IACF,MAAM,OAAO,GAAG,iBAAiB,CAAC,UAAU,IAAI,iBAAiB,CAAC,WAAW,KAAK,SAAS,CAAC;IAC5F,MAAM,IAAI,GAAG,MAAA,iBAAiB,CAAC,WAAW,mCAAI,EAAE,CAAC;IAEjD,MAAM,mBAAmB,GAAG,wBAAwB,EAAE,CAAC;IAEvD,IAAI,OAAO,EAAE,CAAC;QACV,OAAO,KAAC,aAAa,KAAG,CAAC;IAC7B,CAAC;IAED,OAAO,CACH,KAAC,mBAAmB,IAChB,iBAAiB,EAAE,mCAAmC,EACtD,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,mBAAmB,EAC5B,QAAQ,EAAE,sBAAsB,GAClC,CACL,CAAC;AACN,CAAC"}
|