ydb-embedded-ui 6.31.0 → 6.32.0
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/components/AutoRefreshControl/AutoRefreshControl.js +1 -1
- package/dist/components/AutoRefreshControl/AutoRefreshControl.js.map +1 -1
- package/dist/components/BasicNodeViewer/BasicNodeViewer.js +9 -5
- package/dist/components/BasicNodeViewer/BasicNodeViewer.js.map +1 -1
- package/dist/components/NodeHostWrapper/NodeHostWrapper.js +9 -5
- package/dist/components/NodeHostWrapper/NodeHostWrapper.js.map +1 -1
- package/dist/components/PDiskPopup/PDiskPopup.js +9 -9
- package/dist/components/PDiskPopup/PDiskPopup.js.map +1 -1
- package/dist/components/PaginatedTable/types.d.ts +1 -1
- package/dist/components/Search/Search.d.ts +3 -1
- package/dist/components/Search/Search.js +2 -2
- package/dist/components/Search/Search.js.map +1 -1
- package/dist/components/TabletNameWrapper/TabletNameWrapper.js +1 -1
- package/dist/components/TabletNameWrapper/TabletNameWrapper.js.map +1 -1
- package/dist/components/TenantNameWrapper/TenantNameWrapper.js +1 -1
- package/dist/components/TenantNameWrapper/TenantNameWrapper.js.map +1 -1
- package/dist/components/TooltipsContent/NodeEndpointsTooltipContent/NodeEndpointsTooltipContent.js +10 -10
- package/dist/components/TooltipsContent/NodeEndpointsTooltipContent/NodeEndpointsTooltipContent.js.map +1 -1
- package/dist/components/VDiskInfo/i18n/index.d.ts +1 -1
- package/dist/components/VDiskPopup/VDiskPopup.js +1 -9
- package/dist/components/VDiskPopup/VDiskPopup.js.map +1 -1
- package/dist/components/nodesColumns/constants.d.ts +4 -0
- package/dist/components/nodesColumns/constants.js +10 -0
- package/dist/components/nodesColumns/constants.js.map +1 -1
- package/dist/components/nodesColumns/i18n/en.json +2 -0
- package/dist/components/nodesColumns/i18n/index.d.ts +1 -1
- package/dist/containers/Clusters/i18n/index.d.ts +1 -1
- package/dist/containers/Header/Header.js +2 -9
- package/dist/containers/Header/Header.js.map +1 -1
- package/dist/containers/Nodes/Nodes.js +11 -33
- package/dist/containers/Nodes/Nodes.js.map +1 -1
- package/dist/containers/Nodes/Nodes.scss +4 -0
- package/dist/containers/Nodes/NodesControls/NodesControls.d.ts +11 -0
- package/dist/containers/Nodes/NodesControls/NodesControls.js +24 -0
- package/dist/containers/Nodes/NodesControls/NodesControls.js.map +1 -0
- package/dist/containers/Nodes/PaginatedNodes.d.ts +2 -2
- package/dist/containers/Nodes/PaginatedNodes.js +78 -54
- package/dist/containers/Nodes/PaginatedNodes.js.map +1 -1
- package/dist/containers/Nodes/PaginatedNodesTable.d.ts +22 -0
- package/dist/containers/Nodes/PaginatedNodesTable.js +30 -0
- package/dist/containers/Nodes/PaginatedNodesTable.js.map +1 -0
- package/dist/containers/Nodes/columns/constants.d.ts +4 -0
- package/dist/containers/Nodes/columns/constants.js +30 -0
- package/dist/containers/Nodes/columns/constants.js.map +1 -1
- package/dist/containers/Nodes/getNodes.js +4 -5
- package/dist/containers/Nodes/getNodes.js.map +1 -1
- package/dist/containers/Nodes/i18n/en.json +5 -1
- package/dist/containers/Nodes/i18n/index.d.ts +1 -1
- package/dist/containers/Nodes/i18n/index.js +1 -2
- package/dist/containers/Nodes/i18n/index.js.map +1 -1
- package/dist/containers/Nodes/shared.d.ts +5 -0
- package/dist/containers/Nodes/shared.js +16 -0
- package/dist/containers/Nodes/shared.js.map +1 -0
- package/dist/containers/Nodes/useNodesPageQueryParams.d.ts +9 -0
- package/dist/containers/Nodes/useNodesPageQueryParams.js +34 -0
- package/dist/containers/Nodes/useNodesPageQueryParams.js.map +1 -0
- package/dist/containers/Storage/Disks/Disks.js +1 -2
- package/dist/containers/Storage/Disks/Disks.js.map +1 -1
- package/dist/containers/Storage/PaginatedStorageNodes.js +1 -2
- package/dist/containers/Storage/PaginatedStorageNodes.js.map +1 -1
- package/dist/containers/Storage/i18n/index.d.ts +1 -1
- package/dist/containers/Storage/utils/index.d.ts +1 -1
- package/dist/containers/Tenant/ObjectSummary/SchemaTree/RefreshTreeButton.js +2 -2
- package/dist/containers/Tenant/Query/NewSQL/i18n/en.json +1 -1
- package/dist/containers/Tenant/i18n/en.json +1 -0
- package/dist/containers/Tenant/i18n/index.d.ts +1 -1
- package/dist/containers/Tenant/utils/schemaActions.js +5 -1
- package/dist/containers/Tenant/utils/schemaActions.js.map +1 -1
- package/dist/containers/Tenant/utils/schemaQueryTemplates.js +5 -1
- package/dist/containers/Tenant/utils/schemaQueryTemplates.js.map +1 -1
- package/dist/store/reducers/capabilities/hooks.d.ts +1 -0
- package/dist/store/reducers/capabilities/hooks.js +3 -0
- package/dist/store/reducers/capabilities/hooks.js.map +1 -1
- package/dist/store/reducers/node/selectors.js +5 -5
- package/dist/store/reducers/node/selectors.js.map +1 -1
- package/dist/store/reducers/node/types.d.ts +3 -4
- package/dist/store/reducers/nodes/types.d.ts +3 -1
- package/dist/store/reducers/nodes/utils.d.ts +1 -1
- package/dist/store/reducers/nodes/utils.js +9 -4
- package/dist/store/reducers/nodes/utils.js.map +1 -1
- package/dist/store/reducers/pdisk/utils.js +6 -3
- package/dist/store/reducers/pdisk/utils.js.map +1 -1
- package/dist/store/reducers/settings/hooks.d.ts +5 -0
- package/dist/store/reducers/settings/hooks.js +14 -0
- package/dist/store/reducers/settings/hooks.js.map +1 -0
- package/dist/store/reducers/storage/__test__/prepareGroupsDisks.test.d.ts +1 -0
- package/dist/store/reducers/storage/__test__/prepareGroupsDisks.test.js +354 -0
- package/dist/store/reducers/storage/__test__/prepareGroupsDisks.test.js.map +1 -0
- package/dist/store/reducers/storage/prepareGroupsDisks.d.ts +37 -0
- package/dist/store/reducers/storage/prepareGroupsDisks.js +72 -0
- package/dist/store/reducers/storage/prepareGroupsDisks.js.map +1 -0
- package/dist/store/reducers/storage/utils.js +7 -28
- package/dist/store/reducers/storage/utils.js.map +1 -1
- package/dist/store/reducers/tenantOverview/topShards/utils.d.ts +1 -1
- package/dist/store/reducers/vdisk/utils.js +3 -3
- package/dist/store/reducers/vdisk/utils.js.map +1 -1
- package/dist/types/api/nodes.d.ts +1 -1
- package/dist/types/api/pdisk.d.ts +1 -1
- package/dist/types/api/storage.d.ts +2 -2
- package/dist/utils/developerUI/__test__/developerUI.test.js +21 -1
- package/dist/utils/developerUI/__test__/developerUI.test.js.map +1 -1
- package/dist/utils/developerUI/developerUI.d.ts +1 -0
- package/dist/utils/developerUI/developerUI.js +3 -0
- package/dist/utils/developerUI/developerUI.js.map +1 -1
- package/dist/utils/disks/__test__/calculatePDiskSeverity.test.js +10 -7
- package/dist/utils/disks/__test__/calculatePDiskSeverity.test.js.map +1 -1
- package/dist/utils/disks/__test__/calculateVDiskSeverity.test.js +8 -23
- package/dist/utils/disks/__test__/calculateVDiskSeverity.test.js.map +1 -1
- package/dist/utils/disks/__test__/prepareDisks.test.d.ts +1 -0
- package/dist/utils/disks/__test__/prepareDisks.test.js +200 -0
- package/dist/utils/disks/__test__/prepareDisks.test.js.map +1 -0
- package/dist/utils/disks/calculatePDiskSeverity.d.ts +5 -2
- package/dist/utils/disks/calculatePDiskSeverity.js +2 -2
- package/dist/utils/disks/calculatePDiskSeverity.js.map +1 -1
- package/dist/utils/disks/calculateVDiskSeverity.d.ts +8 -2
- package/dist/utils/disks/calculateVDiskSeverity.js +0 -4
- package/dist/utils/disks/calculateVDiskSeverity.js.map +1 -1
- package/dist/utils/disks/helpers.d.ts +2 -1
- package/dist/utils/disks/helpers.js.map +1 -1
- package/dist/utils/disks/prepareDisks.d.ts +22 -4
- package/dist/utils/disks/prepareDisks.js +75 -28
- package/dist/utils/disks/prepareDisks.js.map +1 -1
- package/dist/utils/disks/types.d.ts +9 -2
- package/dist/utils/storage.d.ts +1 -1
- package/package.json +3 -2
- package/dist/containers/Nodes/i18n/ru.json +0 -3
@@ -1,40 +1,28 @@
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
2
2
|
import React from 'react';
|
3
3
|
import { ASCENDING } from '@gravity-ui/react-data-table/build/esm/lib/constants';
|
4
|
-
import { TableColumnSetup } from '@gravity-ui/uikit';
|
5
|
-
import { StringParam, useQueryParams } from 'use-query-params';
|
6
|
-
import { EntitiesCount } from '../../components/EntitiesCount';
|
7
4
|
import { AccessDenied } from '../../components/Errors/403';
|
8
5
|
import { isAccessError } from '../../components/Errors/PageError/PageError';
|
9
6
|
import { ResponseError } from '../../components/Errors/ResponseError';
|
10
7
|
import { Illustration } from '../../components/Illustration';
|
11
|
-
import { ProblemFilter } from '../../components/ProblemFilter';
|
12
8
|
import { ResizeableDataTable } from '../../components/ResizeableDataTable/ResizeableDataTable';
|
13
|
-
import { Search } from '../../components/Search';
|
14
9
|
import { TableWithControlsLayout } from '../../components/TableWithControlsLayout/TableWithControlsLayout';
|
15
|
-
import { UptimeFilter } from '../../components/UptimeFIlter';
|
16
10
|
import { NODES_COLUMNS_WIDTH_LS_KEY } from '../../components/nodesColumns/constants';
|
17
11
|
import { nodesApi } from '../../store/reducers/nodes/nodes';
|
18
12
|
import { filterNodes } from '../../store/reducers/nodes/selectors';
|
19
|
-
import {
|
20
|
-
import { cn } from '../../utils/cn';
|
13
|
+
import { useProblemFilter } from '../../store/reducers/settings/hooks';
|
21
14
|
import { DEFAULT_TABLE_SETTINGS } from '../../utils/constants';
|
22
|
-
import { useAutoRefreshInterval, useTableSort
|
23
|
-
import { NodesUptimeFilterValues
|
15
|
+
import { useAutoRefreshInterval, useTableSort } from '../../utils/hooks';
|
16
|
+
import { NodesUptimeFilterValues } from '../../utils/nodes';
|
17
|
+
import { NodesControls } from './NodesControls/NodesControls';
|
24
18
|
import { useNodesSelectedColumns } from './columns/hooks';
|
25
19
|
import i18n from './i18n';
|
20
|
+
import { getRowClassName } from './shared';
|
21
|
+
import { useNodesPageQueryParams } from './useNodesPageQueryParams';
|
26
22
|
import './Nodes.scss';
|
27
|
-
const b = cn('ydb-nodes');
|
28
23
|
export const Nodes = ({ path, database, additionalNodesProps = {} }) => {
|
29
|
-
|
30
|
-
const
|
31
|
-
uptimeFilter: StringParam,
|
32
|
-
search: StringParam,
|
33
|
-
});
|
34
|
-
const uptimeFilter = nodesUptimeFilterValuesSchema.parse(queryParams.uptimeFilter);
|
35
|
-
const searchValue = (_a = queryParams.search) !== null && _a !== void 0 ? _a : '';
|
36
|
-
const dispatch = useTypedDispatch();
|
37
|
-
const problemFilter = useTypedSelector(selectProblemFilter);
|
24
|
+
const { searchValue, uptimeFilter } = useNodesPageQueryParams();
|
25
|
+
const { problemFilter } = useProblemFilter();
|
38
26
|
const [autoRefreshInterval] = useAutoRefreshInterval();
|
39
27
|
const { columnsToShow, columnsToSelect, setColumns } = useNodesSelectedColumns({
|
40
28
|
getNodeRef: additionalNodesProps.getNodeRef,
|
@@ -48,30 +36,20 @@ export const Nodes = ({ path, database, additionalNodesProps = {} }) => {
|
|
48
36
|
const [sort, handleSort] = useTableSort(sortValue, (sortParams) => {
|
49
37
|
setSortValue(sortParams);
|
50
38
|
});
|
51
|
-
const handleSearchQueryChange = (value) => {
|
52
|
-
setQueryParams({ search: value || undefined }, 'replaceIn');
|
53
|
-
};
|
54
|
-
const handleProblemFilterChange = (value) => {
|
55
|
-
dispatch(changeFilter(value));
|
56
|
-
};
|
57
|
-
const handleUptimeFilterChange = (value) => {
|
58
|
-
setQueryParams({ uptimeFilter: value }, 'replaceIn');
|
59
|
-
};
|
60
39
|
const nodes = React.useMemo(() => {
|
61
40
|
return filterNodes(data === null || data === void 0 ? void 0 : data.Nodes, { searchValue, uptimeFilter, problemFilter });
|
62
41
|
}, [data, searchValue, uptimeFilter, problemFilter]);
|
63
42
|
const totalNodes = (data === null || data === void 0 ? void 0 : data.TotalNodes) || 0;
|
64
43
|
const renderControls = () => {
|
65
|
-
return (
|
44
|
+
return (_jsx(NodesControls, { columnsToSelect: columnsToSelect, handleSelectedColumnsUpdate: setColumns, entitiesCountCurrent: nodes.length, entitiesCountTotal: totalNodes, entitiesLoading: isLoading }));
|
66
45
|
};
|
67
46
|
const renderTable = () => {
|
68
47
|
if (nodes.length === 0) {
|
69
|
-
if (problemFilter !==
|
70
|
-
uptimeFilter !== NodesUptimeFilterValues.All) {
|
48
|
+
if (problemFilter !== 'All' || uptimeFilter !== NodesUptimeFilterValues.All) {
|
71
49
|
return _jsx(Illustration, { name: "thumbsUp", width: "200" });
|
72
50
|
}
|
73
51
|
}
|
74
|
-
return (_jsx(ResizeableDataTable, { columnsWidthLSKey: NODES_COLUMNS_WIDTH_LS_KEY, data: nodes || [], columns: columnsToShow, settings: DEFAULT_TABLE_SETTINGS, sortOrder: sort, onSort: handleSort, emptyDataMessage: i18n('empty.default'), rowClassName:
|
52
|
+
return (_jsx(ResizeableDataTable, { columnsWidthLSKey: NODES_COLUMNS_WIDTH_LS_KEY, data: nodes || [], columns: columnsToShow, settings: DEFAULT_TABLE_SETTINGS, sortOrder: sort, onSort: handleSort, emptyDataMessage: i18n('empty.default'), rowClassName: getRowClassName }));
|
75
53
|
};
|
76
54
|
if (isAccessError(error)) {
|
77
55
|
return _jsx(AccessDenied, {});
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Nodes.js","sourceRoot":"","sources":["../../../src/containers/Nodes/Nodes.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAC,SAAS,EAAC,MAAM,sDAAsD,CAAC;
|
1
|
+
{"version":3,"file":"Nodes.js","sourceRoot":"","sources":["../../../src/containers/Nodes/Nodes.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAC,SAAS,EAAC,MAAM,sDAAsD,CAAC;AAE/E,OAAO,EAAC,YAAY,EAAC,MAAM,6BAA6B,CAAC;AACzD,OAAO,EAAC,aAAa,EAAC,MAAM,6CAA6C,CAAC;AAC1E,OAAO,EAAC,aAAa,EAAC,MAAM,uCAAuC,CAAC;AACpE,OAAO,EAAC,YAAY,EAAC,MAAM,+BAA+B,CAAC;AAC3D,OAAO,EAAC,mBAAmB,EAAC,MAAM,0DAA0D,CAAC;AAC7F,OAAO,EAAC,uBAAuB,EAAC,M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YACxD,CAAC;QACL,CAAC;QAED,OAAO,CACH,KAAC,mBAAmB,IAChB,iBAAiB,EAAE,0BAA0B,EAC7C,IAAI,EAAE,KAAK,IAAI,EAAE,EACjB,OAAO,EAAE,aAAa,EACtB,QAAQ,EAAE,sBAAsB,EAChC,SAAS,EAAE,IAAI,EACf,MAAM,EAAE,UAAU,EAClB,gBAAgB,EAAE,IAAI,CAAC,eAAe,CAAC,EACvC,YAAY,EAAE,eAAe,GAC/B,CACL,CAAC;IACN,CAAC,CAAC;IAEF,IAAI,aAAa,CAAC,KAAK,CAAC,EAAE,CAAC;QACvB,OAAO,KAAC,YAAY,KAAG,CAAC;IAC5B,CAAC;IAED,OAAO,CACH,MAAC,uBAAuB,eACpB,KAAC,uBAAuB,CAAC,QAAQ,cAAE,cAAc,EAAE,GAAoC,EACtF,KAAK,CAAC,CAAC,CAAC,KAAC,aAAa,IAAC,KAAK,EAAE,KAAK,GAAI,CAAC,CAAC,CAAC,IAAI,EAC/C,KAAC,uBAAuB,CAAC,KAAK,IAAC,OAAO,EAAE,SAAS,YAC5C,IAAI,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,IAAI,GACA,IACV,CAC7B,CAAC;AACN,CAAC,CAAC"}
|
@@ -0,0 +1,11 @@
|
|
1
|
+
import type { TableColumnSetupItem } from '@gravity-ui/uikit';
|
2
|
+
interface NodesControlsProps {
|
3
|
+
withGroupBySelect?: boolean;
|
4
|
+
columnsToSelect: TableColumnSetupItem[];
|
5
|
+
handleSelectedColumnsUpdate: (updated: TableColumnSetupItem[]) => void;
|
6
|
+
entitiesCountCurrent: number;
|
7
|
+
entitiesCountTotal?: number;
|
8
|
+
entitiesLoading: boolean;
|
9
|
+
}
|
10
|
+
export declare function NodesControls({ withGroupBySelect, columnsToSelect, handleSelectedColumnsUpdate, entitiesCountCurrent, entitiesCountTotal, entitiesLoading, }: NodesControlsProps): import("react/jsx-runtime").JSX.Element;
|
11
|
+
export {};
|
@@ -0,0 +1,24 @@
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
2
|
+
import React from 'react';
|
3
|
+
import { Select, TableColumnSetup, Text } from '@gravity-ui/uikit';
|
4
|
+
import { EntitiesCount } from '../../../components/EntitiesCount';
|
5
|
+
import { ProblemFilter } from '../../../components/ProblemFilter';
|
6
|
+
import { Search } from '../../../components/Search';
|
7
|
+
import { UptimeFilter } from '../../../components/UptimeFIlter';
|
8
|
+
import { useViewerNodesHandlerHasGroupingBySystemState } from '../../../store/reducers/capabilities/hooks';
|
9
|
+
import { useProblemFilter } from '../../../store/reducers/settings/hooks';
|
10
|
+
import { getNodesGroupByOptions } from '../columns/constants';
|
11
|
+
import i18n from '../i18n';
|
12
|
+
import { b } from '../shared';
|
13
|
+
import { useNodesPageQueryParams } from '../useNodesPageQueryParams';
|
14
|
+
export function NodesControls({ withGroupBySelect, columnsToSelect, handleSelectedColumnsUpdate, entitiesCountCurrent, entitiesCountTotal, entitiesLoading, }) {
|
15
|
+
const { searchValue, uptimeFilter, groupByParam, handleSearchQueryChange, handleUptimeFilterChange, handleGroupByParamChange, } = useNodesPageQueryParams();
|
16
|
+
const { problemFilter, handleProblemFilterChange } = useProblemFilter();
|
17
|
+
const systemStateGroupingAvailable = useViewerNodesHandlerHasGroupingBySystemState();
|
18
|
+
const groupByoptions = getNodesGroupByOptions(systemStateGroupingAvailable);
|
19
|
+
const handleGroupBySelectUpdate = (value) => {
|
20
|
+
handleGroupByParamChange(value[0]);
|
21
|
+
};
|
22
|
+
return (_jsxs(React.Fragment, { children: [_jsx(Search, { onChange: handleSearchQueryChange, placeholder: i18n('controls_search-placeholder'), width: 238, value: searchValue }), systemStateGroupingAvailable && withGroupBySelect ? null : (_jsx(ProblemFilter, { value: problemFilter, onChange: handleProblemFilterChange })), withGroupBySelect ? null : (_jsx(UptimeFilter, { value: uptimeFilter, onChange: handleUptimeFilterChange })), _jsx(TableColumnSetup, { popupWidth: 200, items: columnsToSelect, showStatus: true, onUpdate: handleSelectedColumnsUpdate, sortable: false }), withGroupBySelect ? (_jsxs(React.Fragment, { children: [_jsx(Text, { variant: "body-2", children: i18n('controls_group-by-placeholder') }), _jsx(Select, { hasClear: true, placeholder: '-', width: 150, defaultValue: groupByParam ? [groupByParam] : undefined, onUpdate: handleGroupBySelectUpdate, options: groupByoptions, className: b('group-by-select'), popupClassName: b('group-by-popup') })] })) : null, _jsx(EntitiesCount, { current: entitiesCountCurrent, total: entitiesCountTotal, label: i18n('nodes'), loading: entitiesLoading })] }));
|
23
|
+
}
|
24
|
+
//# sourceMappingURL=NodesControls.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"NodesControls.js","sourceRoot":"","sources":["../../../../src/containers/Nodes/NodesControls/NodesControls.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,EAAC,MAAM,EAAE,gBAAgB,EAAE,IAAI,EAAC,MAAM,mBAAmB,CAAC;AAEjE,OAAO,EAAC,aAAa,EAAC,MAAM,mCAAmC,CAAC;AAChE,OAAO,EAAC,aAAa,EAAC,MAAM,mCAAmC,CAAC;AAChE,OAAO,EAAC,MAAM,EAAC,MAAM,4BAA4B,CAAC;AAClD,OAAO,EAAC,YAAY,EAAC,MAAM,kCAAkC,CAAC;AAC9D,OAAO,EAAC,6CAA6C,EAAC,MAAM,4CAA4C,CAAC;AACzG,OAAO,EAAC,gBAAgB,EAAC,MAAM,wCAAwC,CAAC;AACxE,OAAO,EAAC,sBAAsB,EAAC,MAAM,sBAAsB,CAAC;AAC5D,OAAO,IAAI,MAAM,SAAS,CAAC;AAC3B,OAAO,EAAC,CAAC,EAAC,MAAM,WAAW,CAAC;AAC5B,OAAO,EAAC,uBAAuB,EAAC,MAAM,4BAA4B,CAAC;AAanE,MAAM,UAAU,aAAa,CAAC,EAC1B,iBAAiB,EAEjB,eAAe,EACf,2BAA2B,EAE3B,oBAAoB,EACpB,kBAAkB,EAClB,eAAe,G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,GAAG,EAChB,KAAK,EAAE,GAAG,EACV,YAAY,EAAE,YAAY,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,SAAS,EACvD,QAAQ,EAAE,yBAAyB,EACnC,OAAO,EAAE,cAAc,EACvB,SAAS,EAAE,CAAC,CAAC,iBAAiB,CAAC,EAC/B,cAAc,EAAE,CAAC,CAAC,gBAAgB,CAAC,GACrC,IACW,CACpB,CAAC,CAAC,CAAC,IAAI,EACR,KAAC,aAAa,IACV,OAAO,EAAE,oBAAoB,EAC7B,KAAK,EAAE,kBAAkB,EACzB,KAAK,EAAE,IAAI,CAAC,OAAO,CAAC,EACpB,OAAO,EAAE,eAAe,GAC1B,IACW,CACpB,CAAC;AACN,CAAC"}
|
@@ -1,11 +1,11 @@
|
|
1
1
|
import React from 'react';
|
2
2
|
import type { AdditionalNodesProps } from '../../types/additionalProps';
|
3
3
|
import './Nodes.scss';
|
4
|
-
interface
|
4
|
+
interface PaginatedNodesProps {
|
5
5
|
path?: string;
|
6
6
|
database?: string;
|
7
7
|
parentRef: React.RefObject<HTMLElement>;
|
8
8
|
additionalNodesProps?: AdditionalNodesProps;
|
9
9
|
}
|
10
|
-
export declare
|
10
|
+
export declare function PaginatedNodes(props: PaginatedNodesProps): import("react/jsx-runtime").JSX.Element;
|
11
11
|
export {};
|
@@ -1,70 +1,94 @@
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
2
2
|
import React from 'react';
|
3
|
-
import { TableColumnSetup } from '@gravity-ui/uikit';
|
4
|
-
import { StringParam, useQueryParams } from 'use-query-params';
|
5
|
-
import { EntitiesCount } from '../../components/EntitiesCount';
|
6
|
-
import { AccessDenied } from '../../components/Errors/403';
|
7
3
|
import { ResponseError } from '../../components/Errors/ResponseError';
|
8
|
-
import {
|
9
|
-
import {
|
10
|
-
import {
|
11
|
-
import {
|
12
|
-
import {
|
13
|
-
import {
|
14
|
-
import {
|
15
|
-
import {
|
16
|
-
import {
|
17
|
-
import {
|
4
|
+
import { LoaderWrapper } from '../../components/LoaderWrapper/LoaderWrapper';
|
5
|
+
import { TableWithControlsLayout } from '../../components/TableWithControlsLayout/TableWithControlsLayout';
|
6
|
+
import { useCapabilitiesLoaded, useViewerNodesHandlerHasGrouping, } from '../../store/reducers/capabilities/hooks';
|
7
|
+
import { nodesApi } from '../../store/reducers/nodes/nodes';
|
8
|
+
import { useProblemFilter } from '../../store/reducers/settings/hooks';
|
9
|
+
import { useAutoRefreshInterval } from '../../utils/hooks';
|
10
|
+
import { NodesUptimeFilterValues } from '../../utils/nodes';
|
11
|
+
import { TableGroup } from '../Storage/TableGroup/TableGroup';
|
12
|
+
import { useExpandedGroups } from '../Storage/TableGroup/useExpandedTableGroups';
|
13
|
+
import { NodesControls } from './NodesControls/NodesControls';
|
14
|
+
import { PaginatedNodesTable } from './PaginatedNodesTable';
|
18
15
|
import { useNodesSelectedColumns } from './columns/hooks';
|
19
|
-
import { getNodes } from './getNodes';
|
20
16
|
import i18n from './i18n';
|
17
|
+
import { b } from './shared';
|
18
|
+
import { useNodesPageQueryParams } from './useNodesPageQueryParams';
|
21
19
|
import './Nodes.scss';
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
const
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
}, [
|
20
|
+
export function PaginatedNodes(props) {
|
21
|
+
const { uptimeFilter, groupByParam, handleUptimeFilterChange } = useNodesPageQueryParams();
|
22
|
+
const { problemFilter, handleProblemFilterChange } = useProblemFilter();
|
23
|
+
const capabilitiesLoaded = useCapabilitiesLoaded();
|
24
|
+
const viewerNodesHandlerHasGrouping = useViewerNodesHandlerHasGrouping();
|
25
|
+
// Other filters do not fit with grouping
|
26
|
+
// Reset them if grouping available
|
27
|
+
React.useEffect(() => {
|
28
|
+
if (viewerNodesHandlerHasGrouping &&
|
29
|
+
(problemFilter !== 'All' || uptimeFilter !== NodesUptimeFilterValues.All)) {
|
30
|
+
handleProblemFilterChange('All');
|
31
|
+
handleUptimeFilterChange(NodesUptimeFilterValues.All);
|
32
|
+
}
|
33
|
+
}, [
|
34
|
+
handleProblemFilterChange,
|
35
|
+
handleUptimeFilterChange,
|
36
|
+
problemFilter,
|
37
|
+
uptimeFilter,
|
38
|
+
viewerNodesHandlerHasGrouping,
|
39
|
+
]);
|
40
|
+
const renderContent = () => {
|
41
|
+
if (viewerNodesHandlerHasGrouping && groupByParam) {
|
42
|
+
return _jsx(GroupedNodesComponent, { ...props });
|
43
|
+
}
|
44
|
+
return _jsx(NodesComponent, { ...props });
|
45
|
+
};
|
46
|
+
return _jsx(LoaderWrapper, { loading: !capabilitiesLoaded, children: renderContent() });
|
47
|
+
}
|
48
|
+
function NodesComponent({ path, database, parentRef, additionalNodesProps }) {
|
49
|
+
const { searchValue, uptimeFilter } = useNodesPageQueryParams();
|
50
|
+
const { problemFilter } = useProblemFilter();
|
51
|
+
const viewerNodesHandlerHasGrouping = useViewerNodesHandlerHasGrouping();
|
36
52
|
const { columnsToShow, columnsToSelect, setColumns } = useNodesSelectedColumns({
|
37
53
|
getNodeRef: additionalNodesProps === null || additionalNodesProps === void 0 ? void 0 : additionalNodesProps.getNodeRef,
|
38
54
|
database,
|
39
55
|
});
|
40
|
-
const getRowClassName = (row) => {
|
41
|
-
return b('node', { unavailable: isUnavailableNode(row) });
|
42
|
-
};
|
43
56
|
const renderControls = ({ totalEntities, foundEntities, inited }) => {
|
44
|
-
|
45
|
-
setQueryParams({ search: value || undefined }, 'replaceIn');
|
46
|
-
};
|
47
|
-
const handleProblemFilterChange = (value) => {
|
48
|
-
dispatch(changeFilter(value));
|
49
|
-
};
|
50
|
-
const handleUptimeFilterChange = (value) => {
|
51
|
-
setQueryParams({ uptimeFilter: value }, 'replaceIn');
|
52
|
-
};
|
53
|
-
return (_jsxs(React.Fragment, { children: [_jsx(Search, { onChange: handleSearchQueryChange, placeholder: "Host name", className: b('search'), value: searchValue }), _jsx(ProblemFilter, { value: problemFilter, onChange: handleProblemFilterChange }), _jsx(UptimeFilter, { value: uptimeFilter, onChange: handleUptimeFilterChange }), _jsx(TableColumnSetup, { popupWidth: 200, items: columnsToSelect, showStatus: true, onUpdate: setColumns, sortable: false }), _jsx(EntitiesCount, { total: totalEntities, current: foundEntities, label: 'Nodes', loading: !inited })] }));
|
57
|
+
return (_jsx(NodesControls, { withGroupBySelect: viewerNodesHandlerHasGrouping, columnsToSelect: columnsToSelect, handleSelectedColumnsUpdate: setColumns, entitiesCountCurrent: foundEntities, entitiesCountTotal: totalEntities, entitiesLoading: !inited }));
|
54
58
|
};
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
59
|
+
return (_jsx(PaginatedNodesTable, { path: path, database: database, searchValue: searchValue, problemFilter: problemFilter, uptimeFilter: uptimeFilter, columns: columnsToShow, parentRef: parentRef, renderControls: renderControls }));
|
60
|
+
}
|
61
|
+
function GroupedNodesComponent({ path, database, parentRef, additionalNodesProps, }) {
|
62
|
+
const { searchValue, groupByParam } = useNodesPageQueryParams();
|
63
|
+
const [autoRefreshInterval] = useAutoRefreshInterval();
|
64
|
+
const { columnsToShow, columnsToSelect, setColumns } = useNodesSelectedColumns({
|
65
|
+
getNodeRef: additionalNodesProps === null || additionalNodesProps === void 0 ? void 0 : additionalNodesProps.getNodeRef,
|
66
|
+
database,
|
67
|
+
});
|
68
|
+
const { currentData, isFetching, error } = nodesApi.useGetNodesQuery({
|
69
|
+
path,
|
70
|
+
database,
|
71
|
+
filter: searchValue,
|
72
|
+
group: groupByParam,
|
73
|
+
limit: 0,
|
74
|
+
}, {
|
75
|
+
pollingInterval: autoRefreshInterval,
|
76
|
+
});
|
77
|
+
const isLoading = currentData === undefined && isFetching;
|
78
|
+
const { NodeGroups: tableGroups, FoundNodes: found = 0, TotalNodes: total = 0, } = currentData || {};
|
79
|
+
const { expandedGroups, setIsGroupExpanded } = useExpandedGroups(tableGroups);
|
80
|
+
const renderControls = () => {
|
81
|
+
return (_jsx(NodesControls, { withGroupBySelect: true, columnsToSelect: columnsToSelect, handleSelectedColumnsUpdate: setColumns, entitiesCountCurrent: found, entitiesCountTotal: total, entitiesLoading: isLoading }));
|
61
82
|
};
|
62
|
-
const
|
63
|
-
if (
|
64
|
-
return
|
83
|
+
const renderGroups = () => {
|
84
|
+
if (tableGroups === null || tableGroups === void 0 ? void 0 : tableGroups.length) {
|
85
|
+
return tableGroups.map(({ name, count }) => {
|
86
|
+
const isExpanded = expandedGroups[name];
|
87
|
+
return (_jsx(TableGroup, { title: name, count: count, entityName: i18n('nodes'), expanded: isExpanded, onIsExpandedChange: setIsGroupExpanded, children: _jsx(PaginatedNodesTable, { path: path, database: database, searchValue: searchValue, problemFilter: 'All', uptimeFilter: NodesUptimeFilterValues.All, filterGroup: name, filterGroupBy: groupByParam, initialEntitiesCount: count, columns: columnsToShow, parentRef: parentRef }) }, name));
|
88
|
+
});
|
65
89
|
}
|
66
|
-
return
|
90
|
+
return i18n('no-nodes-groups');
|
67
91
|
};
|
68
|
-
return (
|
69
|
-
}
|
92
|
+
return (_jsxs(TableWithControlsLayout, { children: [_jsx(TableWithControlsLayout.Controls, { children: renderControls() }), error ? _jsx(ResponseError, { error: error }) : null, _jsx(TableWithControlsLayout.Table, { loading: isLoading, className: b('groups-wrapper'), children: renderGroups() })] }));
|
93
|
+
}
|
70
94
|
//# sourceMappingURL=PaginatedNodes.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"PaginatedNodes.js","sourceRoot":"","sources":["../../../src/containers/Nodes/PaginatedNodes.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAC,
|
1
|
+
{"version":3,"file":"PaginatedNodes.js","sourceRoot":"","sources":["../../../src/containers/Nodes/PaginatedNodes.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO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AAC,CAAC,KAAC,aAAa,IAAC,KAAK,EAAE,KAAK,GAAI,CAAC,CAAC,CAAC,IAAI,EAC/C,KAAC,uBAAuB,CAAC,KAAK,IAAC,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,CAAC,CAAC,gBAAgB,CAAC,YAC5E,YAAY,EAAE,GACa,IACV,CAC7B,CAAC;AACN,CAAC"}
|
@@ -0,0 +1,22 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import type { RenderControls } from '../../components/PaginatedTable';
|
3
|
+
import type { NodesPreparedEntity } from '../../store/reducers/nodes/types';
|
4
|
+
import type { ProblemFilterValue } from '../../store/reducers/settings/types';
|
5
|
+
import type { NodesGroupByField } from '../../types/api/nodes';
|
6
|
+
import { NodesUptimeFilterValues } from '../../utils/nodes';
|
7
|
+
import type { Column } from '../../utils/tableUtils/types';
|
8
|
+
interface PaginatedNodesTableProps {
|
9
|
+
path?: string;
|
10
|
+
database?: string;
|
11
|
+
searchValue: string;
|
12
|
+
problemFilter: ProblemFilterValue;
|
13
|
+
uptimeFilter: NodesUptimeFilterValues;
|
14
|
+
filterGroup?: string;
|
15
|
+
filterGroupBy?: NodesGroupByField;
|
16
|
+
columns: Column<NodesPreparedEntity>[];
|
17
|
+
parentRef: React.RefObject<HTMLElement>;
|
18
|
+
renderControls?: RenderControls;
|
19
|
+
initialEntitiesCount?: number;
|
20
|
+
}
|
21
|
+
export declare function PaginatedNodesTable({ path, database, searchValue, problemFilter, uptimeFilter, filterGroup, filterGroupBy, columns, parentRef, renderControls, initialEntitiesCount, }: PaginatedNodesTableProps): import("react/jsx-runtime").JSX.Element;
|
22
|
+
export {};
|
@@ -0,0 +1,30 @@
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
2
|
+
import React from 'react';
|
3
|
+
import { Illustration } from '../../components/Illustration';
|
4
|
+
import { ResizeablePaginatedTable } from '../../components/PaginatedTable';
|
5
|
+
import { NODES_COLUMNS_WIDTH_LS_KEY } from '../../components/nodesColumns/constants';
|
6
|
+
import { NodesUptimeFilterValues } from '../../utils/nodes';
|
7
|
+
import { getNodes } from './getNodes';
|
8
|
+
import i18n from './i18n';
|
9
|
+
import { getRowClassName, renderPaginatedTableErrorMessage } from './shared';
|
10
|
+
export function PaginatedNodesTable({ path, database, searchValue, problemFilter, uptimeFilter, filterGroup, filterGroupBy, columns, parentRef, renderControls, initialEntitiesCount, }) {
|
11
|
+
const tableFilters = React.useMemo(() => {
|
12
|
+
return {
|
13
|
+
path,
|
14
|
+
database,
|
15
|
+
searchValue,
|
16
|
+
problemFilter,
|
17
|
+
uptimeFilter,
|
18
|
+
filterGroup,
|
19
|
+
filterGroupBy,
|
20
|
+
};
|
21
|
+
}, [path, database, searchValue, problemFilter, uptimeFilter, filterGroup, filterGroupBy]);
|
22
|
+
const renderEmptyDataMessage = () => {
|
23
|
+
if (problemFilter !== 'All' || uptimeFilter !== NodesUptimeFilterValues.All) {
|
24
|
+
return _jsx(Illustration, { name: "thumbsUp", width: "200" });
|
25
|
+
}
|
26
|
+
return i18n('empty.default');
|
27
|
+
};
|
28
|
+
return (_jsx(ResizeablePaginatedTable, { columnsWidthLSKey: NODES_COLUMNS_WIDTH_LS_KEY, parentRef: parentRef, columns: columns, fetchData: getNodes, limit: 50, initialEntitiesCount: initialEntitiesCount, renderControls: renderControls, renderErrorMessage: renderPaginatedTableErrorMessage, renderEmptyDataMessage: renderEmptyDataMessage, getRowClassName: getRowClassName, filters: tableFilters, tableName: "nodes" }));
|
29
|
+
}
|
30
|
+
//# sourceMappingURL=PaginatedNodesTable.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"PaginatedNodesTable.js","sourceRoot":"","sources":["../../../src/containers/Nodes/PaginatedNodesTable.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAC,YAAY,EAAC,MAAM,+BAA+B,CAAC;AAE3D,OAAO,EAAC,wBAAwB,EAAC,MAAM,iCAAiC,C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ACpD,sBAAsB,EAAE,sBAAsB,EAC9C,eAAe,EAAE,eAAe,EAChC,OAAO,EAAE,YAAY,EACrB,SAAS,EAAC,OAAO,GACnB,CACL,CAAC;AACN,CAAC"}
|
@@ -1,4 +1,8 @@
|
|
1
|
+
import type { SelectOption } from '@gravity-ui/uikit';
|
1
2
|
import type { NodesColumnId } from '../../../components/nodesColumns/constants';
|
3
|
+
import type { NodesGroupByField } from '../../../types/api/nodes';
|
2
4
|
export declare const NODES_TABLE_SELECTED_COLUMNS_LS_KEY = "nodesTableSelectedColumns";
|
3
5
|
export declare const DEFAULT_NODES_COLUMNS: NodesColumnId[];
|
4
6
|
export declare const REQUIRED_NODES_COLUMNS: NodesColumnId[];
|
7
|
+
export declare function getNodesGroupByOptions(withSystemStateGroupBy?: boolean): SelectOption[];
|
8
|
+
export declare function parseNodesGroupByParam(paramToParse: unknown, withSystemStateGroupBy?: boolean): NodesGroupByField | undefined;
|
@@ -1,3 +1,4 @@
|
|
1
|
+
import { NODES_COLUMNS_TITLES } from '../../../components/nodesColumns/constants';
|
1
2
|
export const NODES_TABLE_SELECTED_COLUMNS_LS_KEY = 'nodesTableSelectedColumns';
|
2
3
|
export const DEFAULT_NODES_COLUMNS = [
|
3
4
|
'NodeId',
|
@@ -12,4 +13,33 @@ export const DEFAULT_NODES_COLUMNS = [
|
|
12
13
|
'Tablets',
|
13
14
|
];
|
14
15
|
export const REQUIRED_NODES_COLUMNS = ['NodeId'];
|
16
|
+
const ALL_NODES_GROUP_BY_PARAMS = [
|
17
|
+
'SystemState',
|
18
|
+
'Host',
|
19
|
+
'DC',
|
20
|
+
'Rack',
|
21
|
+
'Database',
|
22
|
+
'Version',
|
23
|
+
'Uptime',
|
24
|
+
'Missing',
|
25
|
+
'DiskSpaceUsage',
|
26
|
+
];
|
27
|
+
function getAvailableNodesGroupByParams(withSystemStateGroupBy) {
|
28
|
+
if (!withSystemStateGroupBy) {
|
29
|
+
return ALL_NODES_GROUP_BY_PARAMS.filter((param) => param !== 'SystemState');
|
30
|
+
}
|
31
|
+
return ALL_NODES_GROUP_BY_PARAMS;
|
32
|
+
}
|
33
|
+
export function getNodesGroupByOptions(withSystemStateGroupBy) {
|
34
|
+
return getAvailableNodesGroupByParams(withSystemStateGroupBy).map((param) => {
|
35
|
+
return {
|
36
|
+
value: param,
|
37
|
+
content: NODES_COLUMNS_TITLES[param],
|
38
|
+
};
|
39
|
+
});
|
40
|
+
}
|
41
|
+
export function parseNodesGroupByParam(paramToParse, withSystemStateGroupBy) {
|
42
|
+
const availableParams = getAvailableNodesGroupByParams(withSystemStateGroupBy);
|
43
|
+
return availableParams.find((groupByField) => groupByField === paramToParse);
|
44
|
+
}
|
15
45
|
//# sourceMappingURL=constants.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../src/containers/Nodes/columns/constants.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,mCAAmC,GAAG,2BAA2B,CAAC;AAE/E,MAAM,CAAC,MAAM,qBAAqB,GAAoB;IAClD,QAAQ;IACR,MAAM;IACN,IAAI;IACJ,MAAM;IACN,SAAS;IACT,QAAQ;IACR,QAAQ;IACR,OAAO;IACP,aAAa;IACb,SAAS;CACZ,CAAC;AAEF,MAAM,CAAC,MAAM,sBAAsB,GAAoB,CAAC,QAAQ,CAAC,CAAC"}
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../src/containers/Nodes/columns/constants.ts"],"names":[],"mappings":"AAEA,OAAO,EAAC,oBAAoB,EAAC,MAAM,4CAA4C,CAAC;AAIhF,MAAM,CAAC,MAAM,mCAAmC,GAAG,2BAA2B,CAAC;AAE/E,MAAM,CAAC,MAAM,qBAAqB,GAAoB;IAClD,QAAQ;IACR,MAAM;IACN,IAAI;IACJ,MAAM;IACN,SAAS;IACT,QAAQ;IACR,QAAQ;IACR,OAAO;IACP,aAAa;IACb,SAAS;CACZ,CAAC;AAEF,MAAM,CAAC,MAAM,sBAAsB,GAAoB,CAAC,QAAQ,CAAC,CAAC;AAElE,MAAM,yBAAyB,GAAG;IAC9B,aAAa;IACb,MAAM;IACN,IAAI;IACJ,MAAM;IACN,UAAU;IACV,SAAS;IACT,QAAQ;IACR,SAAS;IACT,gBAAgB;CACoB,CAAC;AAEzC,SAAS,8BAA8B,CAAC,sBAAgC;IACpE,IAAI,CAAC,sBAAsB,EAAE,CAAC;QAC1B,OAAO,yBAAyB,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,KAAK,aAAa,CAAC,CAAC;IAChF,CAAC;IAED,OAAO,yBAAyB,CAAC;AACrC,CAAC;AAED,MAAM,UAAU,sBAAsB,CAAC,sBAAgC;IACnE,OAAO,8BAA8B,CAAC,sBAAsB,CAAC,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE;QACxE,OAAO;YACH,KAAK,EAAE,KAAK;YACZ,OAAO,EAAE,oBAAoB,CAAC,KAAK,CAAC;SACvC,CAAC;IACN,CAAC,CAAC,CAAC;AACP,CAAC;AAED,MAAM,UAAU,sBAAsB,CAClC,YAAqB,EACrB,sBAAgC;IAEhC,MAAM,eAAe,GAAG,8BAA8B,CAAC,sBAAsB,CAAC,CAAC;IAE/E,OAAO,eAAe,CAAC,IAAI,CAAC,CAAC,YAAY,EAAE,EAAE,CAAC,YAAY,KAAK,YAAY,CAAC,CAAC;AACjF,CAAC"}
|
@@ -3,13 +3,10 @@ import { prepareNodesData } from '../../store/reducers/nodes/utils';
|
|
3
3
|
import { prepareSortValue } from '../../utils/filters';
|
4
4
|
import { NODES_SORT_VALUE_TO_FIELD, getProblemParamValue, getUptimeParamValue, isSortableNodesProperty, } from '../../utils/nodes';
|
5
5
|
import { getRequiredDataFields } from '../../utils/tableUtils/getRequiredDataFields';
|
6
|
-
const getConcurrentId = (limit, offset) => {
|
7
|
-
return `getNodes|offset${offset}|limit${limit}`;
|
8
|
-
};
|
9
6
|
export const getNodes = async (params) => {
|
10
7
|
const { type = 'any', storage = false, tablets = true, limit, offset, sortParams, filters, columnsIds, } = params;
|
11
8
|
const { sortOrder, columnId } = sortParams !== null && sortParams !== void 0 ? sortParams : {};
|
12
|
-
const { path, database, searchValue, problemFilter, uptimeFilter } = filters !== null && filters !== void 0 ? filters : {};
|
9
|
+
const { path, database, searchValue, problemFilter, uptimeFilter, filterGroup, filterGroupBy } = filters !== null && filters !== void 0 ? filters : {};
|
13
10
|
const sort = isSortableNodesProperty(columnId)
|
14
11
|
? prepareSortValue(NODES_SORT_VALUE_TO_FIELD[columnId], sortOrder)
|
15
12
|
: undefined;
|
@@ -26,8 +23,10 @@ export const getNodes = async (params) => {
|
|
26
23
|
filter: searchValue,
|
27
24
|
problems_only: getProblemParamValue(problemFilter),
|
28
25
|
uptime: getUptimeParamValue(uptimeFilter),
|
26
|
+
filter_group: filterGroup,
|
27
|
+
filter_group_by: filterGroupBy,
|
29
28
|
fieldsRequired: dataFieldsRequired,
|
30
|
-
}
|
29
|
+
});
|
31
30
|
const preparedResponse = prepareNodesData(response);
|
32
31
|
return {
|
33
32
|
data: preparedResponse.Nodes || [],
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"getNodes.js","sourceRoot":"","sources":["../../../src/containers/Nodes/getNodes.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,4BAA4B,EAAC,MAAM,yCAAyC,CAAC;AAErF,OAAO,EAAC,gBAAgB,EAAC,MAAM,kCAAkC,CAAC;AAElE,OAAO,EAAC,gBAAgB,EAAC,MAAM,qBAAqB,CAAC;AACrD,OAAO,EACH,yBAAyB,EACzB,oBAAoB,EACpB,mBAAmB,EACnB,uBAAuB,GAC1B,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAC,qBAAqB,EAAC,MAAM,8CAA8C,CAAC;AAEnF,MAAM,
|
1
|
+
{"version":3,"file":"getNodes.js","sourceRoot":"","sources":["../../../src/containers/Nodes/getNodes.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,4BAA4B,E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QAClD,MAAM,EAAE,mBAAmB,CAAC,YAAY,CAAC;QACzC,YAAY,EAAE,WAAW;QACzB,eAAe,EAAE,aAAa;QAC9B,cAAc,EAAE,kBAAkB;KACrC,CAAC,CAAC;IACH,MAAM,gBAAgB,GAAG,gBAAgB,CAAC,QAAQ,CAAC,CAAC;IAEpD,OAAO;QACH,IAAI,EAAE,gBAAgB,CAAC,KAAK,IAAI,EAAE;QAClC,KAAK,EAAE,gBAAgB,CAAC,UAAU,IAAI,CAAC;QACvC,KAAK,EAAE,gBAAgB,CAAC,UAAU,IAAI,CAAC;KAC1C,CAAC;AACN,CAAC,CAAC"}
|
@@ -1,2 +1,2 @@
|
|
1
|
-
declare const _default: (key: "empty.default", params?: import("@gravity-ui/i18n").Params) => string;
|
1
|
+
declare const _default: (key: "nodes" | "empty.default" | "no-nodes-groups" | "controls_search-placeholder" | "controls_group-by-placeholder", params?: import("@gravity-ui/i18n").Params) => string;
|
2
2
|
export default _default;
|
@@ -1,6 +1,5 @@
|
|
1
1
|
import { registerKeysets } from '../../../utils/i18n';
|
2
2
|
import en from './en.json';
|
3
|
-
import ru from './ru.json';
|
4
3
|
const COMPONENT = 'ydb-nodes';
|
5
|
-
export default registerKeysets(COMPONENT, {
|
4
|
+
export default registerKeysets(COMPONENT, { en });
|
6
5
|
//# sourceMappingURL=index.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/containers/Nodes/i18n/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,eAAe,EAAC,MAAM,qBAAqB,CAAC;AAEpD,OAAO,EAAE,MAAM,WAAW,CAAC;
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/containers/Nodes/i18n/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,eAAe,EAAC,MAAM,qBAAqB,CAAC;AAEpD,OAAO,EAAE,MAAM,WAAW,CAAC;AAE3B,MAAM,SAAS,GAAG,WAAW,CAAC;AAE9B,eAAe,eAAe,CAAC,SAAS,EAAE,EAAC,EAAE,EAAC,CAAC,CAAC"}
|
@@ -0,0 +1,5 @@
|
|
1
|
+
import type { GetRowClassName, RenderErrorMessage } from '../../components/PaginatedTable';
|
2
|
+
import type { NodesPreparedEntity } from '../../store/reducers/nodes/types';
|
3
|
+
export declare const b: import("@bem-react/classname").ClassNameFormatter;
|
4
|
+
export declare const getRowClassName: GetRowClassName<NodesPreparedEntity>;
|
5
|
+
export declare const renderPaginatedTableErrorMessage: RenderErrorMessage;
|
@@ -0,0 +1,16 @@
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
2
|
+
import { AccessDenied } from '../../components/Errors/403';
|
3
|
+
import { ResponseError } from '../../components/Errors/ResponseError';
|
4
|
+
import { cn } from '../../utils/cn';
|
5
|
+
import { isUnavailableNode } from '../../utils/nodes';
|
6
|
+
export const b = cn('ydb-nodes');
|
7
|
+
export const getRowClassName = (row) => {
|
8
|
+
return b('node', { unavailable: isUnavailableNode(row) });
|
9
|
+
};
|
10
|
+
export const renderPaginatedTableErrorMessage = (error) => {
|
11
|
+
if (error && error.status === 403) {
|
12
|
+
return _jsx(AccessDenied, { position: "left" });
|
13
|
+
}
|
14
|
+
return _jsx(ResponseError, { error: error });
|
15
|
+
};
|
16
|
+
//# sourceMappingURL=shared.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"shared.js","sourceRoot":"","sources":["../../../src/containers/Nodes/shared.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAC,YAAY,EAAC,MAAM,6BAA6B,CAAC;AACzD,OAAO,EAAC,aAAa,EAAC,MAAM,uCAAuC,CAAC;AAGpE,OAAO,EAAC,EAAE,EAAC,MAAM,gBAAgB,CAAC;AAClC,OAAO,EAAC,iBAAiB,EAAC,MAAM,mBAAmB,CAAC;AAEpD,MAAM,CAAC,MAAM,CAAC,GAAG,EAAE,CAAC,WAAW,CAAC,CAAC;AAEjC,MAAM,CAAC,MAAM,eAAe,GAAyC,CAAC,GAAG,EAAE,EAAE;IACzE,OAAO,CAAC,CAAC,MAAM,EAAE,EAAC,WAAW,EAAE,iBAAiB,CAAC,GAAG,CAAC,EAAC,CAAC,CAAC;AAC5D,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,gCAAgC,GAAuB,CAAC,KAAK,EAAE,EAAE;IAC1E,IAAI,KAAK,IAAI,KAAK,CAAC,MAAM,KAAK,GAAG,EAAE,CAAC;QAChC,OAAO,KAAC,YAAY,IAAC,QAAQ,EAAC,MAAM,GAAG,CAAC;IAC5C,CAAC;IAED,OAAO,KAAC,aAAa,IAAC,KAAK,EAAE,KAAK,GAAI,CAAC;AAC3C,CAAC,CAAC"}
|
@@ -0,0 +1,9 @@
|
|
1
|
+
import type { NodesUptimeFilterValues } from '../../utils/nodes';
|
2
|
+
export declare function useNodesPageQueryParams(): {
|
3
|
+
uptimeFilter: NodesUptimeFilterValues;
|
4
|
+
searchValue: string;
|
5
|
+
groupByParam: import("../../types/api/nodes").NodesGroupByField | undefined;
|
6
|
+
handleSearchQueryChange: (value: string) => void;
|
7
|
+
handleUptimeFilterChange: (value: NodesUptimeFilterValues) => void;
|
8
|
+
handleGroupByParamChange: (value: string) => void;
|
9
|
+
};
|