ydb-embedded-ui 5.3.0 → 5.5.0
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/components/DiskPageTitle/DiskPageTitle.d.ts +11 -0
- package/dist/components/DiskPageTitle/DiskPageTitle.js +8 -0
- package/dist/components/DiskPageTitle/DiskPageTitle.scss +17 -0
- package/dist/{containers/Storage → components}/DiskStateProgressBar/DiskStateProgressBar.js +3 -3
- package/dist/components/ErrorBoundary/ErrorBoundary.d.ts +1 -1
- package/dist/components/GroupInfo/GroupInfo.d.ts +8 -0
- package/dist/components/GroupInfo/GroupInfo.js +28 -0
- package/dist/components/GroupInfo/i18n/en.json +6 -0
- package/dist/components/GroupInfo/i18n/index.d.ts +1 -0
- package/dist/components/GroupInfo/i18n/index.js +4 -0
- package/dist/components/MetricChart/MetricChart.js +12 -5
- package/dist/components/MetricChart/colors.d.ts +2 -0
- package/dist/components/MetricChart/colors.js +21 -0
- package/dist/components/MetricChart/getDefaultDataFormatter.js +9 -0
- package/dist/components/MetricChart/types.d.ts +11 -2
- package/dist/components/MonacoEditor/MonacoEditor.d.ts +2 -0
- package/dist/components/MonacoEditor/MonacoEditor.js +7 -0
- package/dist/{containers/Storage → components}/PDiskPopup/PDiskPopup.d.ts +3 -3
- package/dist/{containers/Storage → components}/PDiskPopup/PDiskPopup.js +6 -5
- package/dist/components/PageMeta/PageMeta.d.ts +2 -1
- package/dist/components/PageMeta/PageMeta.js +9 -2
- package/dist/components/PageMeta/PageMeta.scss +9 -0
- package/dist/components/Stack/Stack.scss +2 -0
- package/dist/{containers/Storage → components}/VDisk/VDisk.d.ts +2 -2
- package/dist/{containers/Storage → components}/VDisk/VDisk.js +8 -8
- package/dist/{containers/Storage → components}/VDisk/VDisk.scss +1 -1
- package/dist/components/VDisk/VDiskWithDonorsStack.d.ts +12 -0
- package/dist/components/VDisk/VDiskWithDonorsStack.js +14 -0
- package/dist/components/VDiskInfo/VDiskInfo.d.ts +10 -0
- package/dist/components/VDiskInfo/VDiskInfo.js +113 -0
- package/dist/components/VDiskInfo/VDiskInfo.scss +8 -0
- package/dist/components/VDiskInfo/i18n/en.json +23 -0
- package/dist/components/VDiskInfo/i18n/index.d.ts +1 -0
- package/dist/components/VDiskInfo/i18n/index.js +4 -0
- package/dist/{containers/Storage → components}/VDiskPopup/VDiskPopup.d.ts +3 -3
- package/dist/{containers/Storage → components}/VDiskPopup/VDiskPopup.js +8 -7
- package/dist/components/VirtualTable/TableHead.d.ts +2 -1
- package/dist/components/VirtualTable/TableHead.js +6 -6
- package/dist/components/VirtualTable/constants.d.ts +1 -0
- package/dist/components/VirtualTable/constants.js +1 -0
- package/dist/containers/App/App.js +0 -2
- package/dist/containers/App/App.scss +3 -0
- package/dist/containers/App/Content.js +19 -5
- package/dist/containers/App/appSlots.d.ts +9 -3
- package/dist/containers/App/appSlots.js +2 -1
- package/dist/containers/Header/breadcrumbs.js +12 -0
- package/dist/containers/Header/i18n/en.json +1 -0
- package/dist/containers/Header/i18n/index.d.ts +1 -1
- package/dist/containers/Heatmap/HeatmapCanvas/HeatmapCanvas.js +2 -2
- package/dist/containers/Node/NodeStructure/NodeStructure.js +1 -1
- package/dist/containers/Node/NodeStructure/Pdisk.js +2 -2
- package/dist/containers/Node/NodeStructure/Vdisk.d.ts +6 -2
- package/dist/containers/Node/NodeStructure/Vdisk.js +5 -78
- package/dist/containers/Nodes/getNodesColumns.js +0 -1
- package/dist/containers/PDiskPage/PDiskPage.d.ts +3 -0
- package/dist/containers/{PDisk/PDisk.js → PDiskPage/PDiskPage.js} +30 -14
- package/dist/containers/{PDisk/PDisk.scss → PDiskPage/PDiskPage.scss} +1 -14
- package/dist/containers/PDiskPage/i18n/en.json +8 -0
- package/dist/containers/PDiskPage/i18n/index.d.ts +1 -0
- package/dist/containers/Storage/PDisk/PDisk.js +4 -10
- package/dist/containers/Storage/PDisk/PDisk.scss +0 -2
- package/dist/containers/Storage/Storage.js +1 -2
- package/dist/containers/Storage/StorageGroups/StorageGroups.scss +1 -7
- package/dist/containers/Storage/StorageGroups/getStorageGroupsColumns.d.ts +1 -1
- package/dist/containers/Storage/StorageGroups/getStorageGroupsColumns.js +9 -17
- package/dist/containers/Storage/VirtualStorage.js +3 -7
- package/dist/containers/Tablet/TabletControls/TabletControls.js +2 -1
- package/dist/containers/TabletsFilters/TabletsFilters.d.ts +2 -2
- package/dist/containers/TabletsFilters/TabletsFilters.js +7 -6
- package/dist/containers/Tenant/Diagnostics/Consumers/Consumers.js +1 -1
- package/dist/containers/Tenant/Diagnostics/Network/Network.js +2 -2
- package/dist/containers/Tenant/Diagnostics/Partitions/Partitions.js +1 -2
- package/dist/containers/Tenant/Diagnostics/Partitions/PartitionsControls/PartitionsControls.js +1 -1
- package/dist/containers/Tenant/Diagnostics/TenantOverview/TenantCpu/cpuDashboardConfig.js +14 -5
- package/dist/containers/Tenant/Diagnostics/TenantOverview/i18n/en.json +1 -1
- package/dist/containers/Tenant/Query/ExplainResult/ExplainResult.js +5 -3
- package/dist/containers/Tenant/Query/QueryEditor/QueryEditor.js +6 -4
- package/dist/containers/Tenant/Query/SaveQuery/SaveQuery.js +2 -2
- package/dist/containers/Tenant/Tenant.js +10 -5
- package/dist/containers/Tenants/Tenants.js +3 -2
- package/dist/containers/VDiskPage/VDiskPage.d.ts +3 -0
- package/dist/containers/VDiskPage/VDiskPage.js +109 -0
- package/dist/containers/VDiskPage/VDiskPage.scss +32 -0
- package/dist/containers/VDiskPage/i18n/en.json +9 -0
- package/dist/containers/VDiskPage/i18n/index.d.ts +1 -0
- package/dist/containers/VDiskPage/i18n/index.js +4 -0
- package/dist/containers/Versions/groupNodes.js +1 -1
- package/dist/routes.d.ts +3 -0
- package/dist/routes.js +5 -0
- package/dist/services/api.d.ts +12 -4
- package/dist/services/api.js +39 -4
- package/dist/store/configureStore.d.ts +4 -0
- package/dist/store/defaultStore.d.ts +2 -0
- package/dist/store/reducers/authentication/authentication.d.ts +3 -0
- package/dist/store/reducers/cluster/cluster.d.ts +1 -0
- package/dist/store/reducers/clusterNodes/clusterNodes.d.ts +1 -0
- package/dist/store/reducers/clusters/clusters.d.ts +1 -0
- package/dist/store/reducers/clusters/selectors.js +1 -1
- package/dist/store/reducers/describe.d.ts +2 -0
- package/dist/store/reducers/executeQuery.d.ts +1 -0
- package/dist/store/reducers/explainQuery.d.ts +2 -0
- package/dist/store/reducers/header/types.d.ts +4 -1
- package/dist/store/reducers/healthcheckInfo/healthcheckInfo.d.ts +1 -0
- package/dist/store/reducers/heatmap.d.ts +1 -0
- package/dist/store/reducers/host.d.ts +1 -0
- package/dist/store/reducers/index.d.ts +3 -0
- package/dist/store/reducers/index.js +2 -0
- package/dist/store/reducers/network/network.d.ts +1 -0
- package/dist/store/reducers/node/node.d.ts +2 -0
- package/dist/store/reducers/node/selectors.js +1 -1
- package/dist/store/reducers/nodes/nodes.d.ts +2 -0
- package/dist/store/reducers/nodesList.d.ts +1 -0
- package/dist/store/reducers/olapStats.d.ts +1 -0
- package/dist/store/reducers/overview/overview.d.ts +2 -0
- package/dist/store/reducers/partitions/partitions.d.ts +1 -0
- package/dist/store/reducers/pdisk/pdisk.d.ts +2 -0
- package/dist/store/reducers/pdisk/utils.js +1 -1
- package/dist/store/reducers/preview.d.ts +1 -0
- package/dist/store/reducers/schema/schema.d.ts +1 -0
- package/dist/store/reducers/schemaAcl/schemaAcl.d.ts +1 -0
- package/dist/store/reducers/shardsWorkload/shardsWorkload.d.ts +1 -0
- package/dist/store/reducers/storage/storage.d.ts +2 -0
- package/dist/store/reducers/storage/types.d.ts +3 -1
- package/dist/store/reducers/storage/utils.d.ts +1 -1
- package/dist/store/reducers/storage/utils.js +8 -9
- package/dist/store/reducers/tablet.d.ts +2 -0
- package/dist/store/reducers/tablets.d.ts +1 -0
- package/dist/store/reducers/tabletsFilters.d.ts +1 -0
- package/dist/store/reducers/tenant/tenant.d.ts +1 -0
- package/dist/store/reducers/tenantOverview/executeTopTables/executeTopTables.d.ts +1 -0
- package/dist/store/reducers/tenantOverview/topNodesByCpu/topNodesByCpu.d.ts +1 -0
- package/dist/store/reducers/tenantOverview/topNodesByLoad/topNodesByLoad.d.ts +1 -0
- package/dist/store/reducers/tenantOverview/topNodesByMemory/topNodesByMemory.d.ts +1 -0
- package/dist/store/reducers/tenantOverview/topQueries/tenantOverviewTopQueries.d.ts +1 -0
- package/dist/store/reducers/tenantOverview/topShards/tenantOverviewTopShards.d.ts +1 -0
- package/dist/store/reducers/tenantOverview/topStorageGroups/topStorageGroups.d.ts +1 -0
- package/dist/store/reducers/tenants/selectors.js +1 -1
- package/dist/store/reducers/tenants/tenants.d.ts +1 -0
- package/dist/store/reducers/topic.d.ts +1 -0
- package/dist/store/reducers/vdisk/types.d.ts +25 -0
- package/dist/store/reducers/vdisk/utils.d.ts +11 -0
- package/dist/store/reducers/vdisk/utils.js +33 -0
- package/dist/store/reducers/vdisk/vdisk.d.ts +100 -0
- package/dist/store/reducers/vdisk/vdisk.js +64 -0
- package/dist/store/state-url-mapping.js +6 -4
- package/dist/types/api/storage.d.ts +2 -0
- package/dist/utils/bytesParsers/__test__/formatBytes.test.js +7 -7
- package/dist/utils/clusterVersionColors.js +1 -1
- package/dist/utils/dataFormatters/dataFormatters.js +1 -0
- package/dist/utils/disks/constants.js +2 -2
- package/dist/utils/disks/types.d.ts +5 -1
- package/dist/utils/filters.js +1 -1
- package/dist/utils/hooks/useTableResize.d.ts +1 -1
- package/dist/utils/hooks/useTableResize.js +5 -3
- package/dist/utils/lazyComponent.d.ts +4 -0
- package/dist/utils/lazyComponent.js +25 -0
- package/dist/utils/monaco/index.d.ts +1 -0
- package/dist/utils/monaco/index.js +4 -0
- package/dist/utils/monaco/s-expression/constants.d.ts +1 -0
- package/dist/utils/monaco/s-expression/constants.js +1 -0
- package/dist/utils/monaco/s-expression/registerLanguage.d.ts +1 -0
- package/dist/utils/{monaco.js → monaco/s-expression/registerLanguage.js} +2 -19
- package/dist/utils/{yqlSuggestions → monaco/yqlSuggestions}/generateSuggestions.d.ts +2 -2
- package/dist/utils/{yqlSuggestions → monaco/yqlSuggestions}/generateSuggestions.js +40 -11
- package/dist/utils/monaco/yqlSuggestions/registerCompletionItemProvider.d.ts +1 -0
- package/dist/utils/monaco/yqlSuggestions/registerCompletionItemProvider.js +15 -0
- package/dist/utils/{yqlSuggestions → monaco/yqlSuggestions}/yqlSuggestions.js +1 -1
- package/dist/utils/numeral.js +7 -1
- package/dist/utils/storage.d.ts +1 -0
- package/dist/utils/storage.js +1 -0
- package/dist/utils/timeParsers/parsers.js +1 -1
- package/package.json +5 -2
- package/dist/containers/PDisk/PDisk.d.ts +0 -3
- package/dist/containers/PDisk/i18n/en.json +0 -6
- package/dist/containers/PDisk/i18n/index.d.ts +0 -1
- package/dist/containers/Storage/DiskStateProgressBar/index.d.ts +0 -1
- package/dist/containers/Storage/DiskStateProgressBar/index.js +0 -1
- package/dist/containers/Storage/PDiskPopup/index.d.ts +0 -1
- package/dist/containers/Storage/PDiskPopup/index.js +0 -1
- package/dist/containers/Storage/VDisk/index.d.ts +0 -1
- package/dist/containers/Storage/VDisk/index.js +0 -1
- package/dist/containers/Storage/VDiskPopup/index.d.ts +0 -1
- package/dist/containers/Storage/VDiskPopup/index.js +0 -1
- package/dist/containers/Storage/utils/types.d.ts +0 -5
- package/dist/utils/monaco.d.ts +0 -3
- /package/dist/{containers/Storage → components}/DiskStateProgressBar/DiskStateProgressBar.d.ts +0 -0
- /package/dist/{containers/Storage → components}/DiskStateProgressBar/DiskStateProgressBar.scss +0 -0
- /package/dist/{containers/Storage → components}/PDiskPopup/PDiskPopup.scss +0 -0
- /package/dist/{containers/Storage → components}/VDiskPopup/VDiskPopup.scss +0 -0
- /package/dist/containers/{PDisk → PDiskPage}/PDiskGroups.d.ts +0 -0
- /package/dist/containers/{PDisk → PDiskPage}/PDiskGroups.js +0 -0
- /package/dist/containers/{PDisk → PDiskPage}/i18n/index.js +0 -0
- /package/dist/containers/{PDisk → PDiskPage}/shared.d.ts +0 -0
- /package/dist/containers/{PDisk → PDiskPage}/shared.js +0 -0
- /package/dist/{containers/Storage/utils → store/reducers/vdisk}/types.js +0 -0
- /package/dist/utils/{yqlSuggestions → monaco/yqlSuggestions}/constants.d.ts +0 -0
- /package/dist/utils/{yqlSuggestions → monaco/yqlSuggestions}/constants.js +0 -0
- /package/dist/utils/{yqlSuggestions → monaco/yqlSuggestions}/yqlSuggestions.d.ts +0 -0
@@ -3,12 +3,13 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { useMemo } from 'react';
|
4
4
|
import cn from 'bem-cn-lite';
|
5
5
|
import { Label, Popup } from '@gravity-ui/uikit';
|
6
|
-
import {
|
7
|
-
import {
|
8
|
-
import {
|
9
|
-
import {
|
10
|
-
import {
|
11
|
-
import { preparePDiskData } from '../PDiskPopup';
|
6
|
+
import { EFlag } from '../../types/api/enums';
|
7
|
+
import { stringifyVdiskId } from '../../utils/dataFormatters/dataFormatters';
|
8
|
+
import { bytesToGB, bytesToSpeed } from '../../utils/utils';
|
9
|
+
import { isFullVDiskData } from '../../utils/disks/helpers';
|
10
|
+
import { EMPTY_DATA_PLACEHOLDER } from '../../utils/constants';
|
11
|
+
import { preparePDiskData } from '../PDiskPopup/PDiskPopup';
|
12
|
+
import { InfoViewer } from '../InfoViewer';
|
12
13
|
import './VDiskPopup.scss';
|
13
14
|
const b = cn('vdisk-storage-popup');
|
14
15
|
const prepareUnavailableVDiskData = (data) => {
|
@@ -17,7 +18,7 @@ const prepareUnavailableVDiskData = (data) => {
|
|
17
18
|
if (StoragePoolName) {
|
18
19
|
vdiskData.push({ label: 'StoragePool', value: StoragePoolName });
|
19
20
|
}
|
20
|
-
vdiskData.push({ label: 'NodeId', value: NodeId !== null && NodeId !== void 0 ? NodeId :
|
21
|
+
vdiskData.push({ label: 'NodeId', value: NodeId !== null && NodeId !== void 0 ? NodeId : EMPTY_DATA_PLACEHOLDER }, { label: 'PDiskId', value: PDiskId !== null && PDiskId !== void 0 ? PDiskId : EMPTY_DATA_PLACEHOLDER }, { label: 'VSlotId', value: VSlotId !== null && VSlotId !== void 0 ? VSlotId : EMPTY_DATA_PLACEHOLDER });
|
21
22
|
return vdiskData;
|
22
23
|
};
|
23
24
|
const prepareVDiskData = (data) => {
|
@@ -2,6 +2,7 @@ import type { HandleTableColumnsResize } from '../../utils/hooks/useTableResize'
|
|
2
2
|
import type { Column, OnSort, SortOrderType } from './types';
|
3
3
|
interface TableHeadCellProps<T> {
|
4
4
|
column: Column<T>;
|
5
|
+
resizeable?: boolean;
|
5
6
|
sortOrder?: SortOrderType;
|
6
7
|
defaultSortOrder: SortOrderType;
|
7
8
|
onSort?: (columnName: string) => void;
|
@@ -9,7 +10,7 @@ interface TableHeadCellProps<T> {
|
|
9
10
|
onCellMount?: (element: Element) => void;
|
10
11
|
onCellUnMount?: (element: Element) => void;
|
11
12
|
}
|
12
|
-
export declare const TableHeadCell: <T>({ column, sortOrder, defaultSortOrder, onSort, rowHeight, onCellMount, onCellUnMount, }: TableHeadCellProps<T>) => JSX.Element;
|
13
|
+
export declare const TableHeadCell: <T>({ column, resizeable, sortOrder, defaultSortOrder, onSort, rowHeight, onCellMount, onCellUnMount, }: TableHeadCellProps<T>) => JSX.Element;
|
13
14
|
interface TableHeadProps<T> {
|
14
15
|
columns: Column<T>[];
|
15
16
|
onSort?: OnSort;
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
2
2
|
import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
3
|
-
import { ASCENDING, DEFAULT_SORT_ORDER, DEFAULT_TABLE_ROW_HEIGHT, DESCENDING } from './constants';
|
3
|
+
import { ASCENDING, DEFAULT_RESIZEABLE, DEFAULT_SORT_ORDER, DEFAULT_TABLE_ROW_HEIGHT, DESCENDING, } from './constants';
|
4
4
|
import { b } from './shared';
|
5
5
|
const COLUMN_NAME_HTML_ATTRIBUTE = 'data-columnname';
|
6
6
|
// Icon similar to original DataTable icons to keep the same tables across diferent pages and tabs
|
@@ -15,7 +15,7 @@ const ColumnSortIcon = ({ sortOrder, sortable, defaultSortOrder }) => {
|
|
15
15
|
return null;
|
16
16
|
}
|
17
17
|
};
|
18
|
-
export const TableHeadCell = ({ column, sortOrder, defaultSortOrder, onSort, rowHeight, onCellMount, onCellUnMount, }) => {
|
18
|
+
export const TableHeadCell = ({ column, resizeable, sortOrder, defaultSortOrder, onSort, rowHeight, onCellMount, onCellUnMount, }) => {
|
19
19
|
var _a;
|
20
20
|
const cellWrapperRef = useRef(null);
|
21
21
|
useEffect(() => {
|
@@ -30,9 +30,7 @@ export const TableHeadCell = ({ column, sortOrder, defaultSortOrder, onSort, row
|
|
30
30
|
};
|
31
31
|
}, [onCellMount, onCellUnMount]);
|
32
32
|
const content = (_a = column.header) !== null && _a !== void 0 ? _a : column.name;
|
33
|
-
return (_jsx("th", { children: _jsx("div", Object.assign({ ref: cellWrapperRef, className: b('head-cell-wrapper', {
|
34
|
-
resizeable: column.resizeable,
|
35
|
-
}), style: {
|
33
|
+
return (_jsx("th", { children: _jsx("div", Object.assign({ ref: cellWrapperRef, className: b('head-cell-wrapper', { resizeable }), style: {
|
36
34
|
height: `${rowHeight}px`,
|
37
35
|
width: `${column.width}px`,
|
38
36
|
} }, {
|
@@ -101,8 +99,10 @@ export const TableHead = ({ columns, onSort, onColumnsResize, defaultSortOrder =
|
|
101
99
|
};
|
102
100
|
const renderTableHead = () => {
|
103
101
|
return (_jsx("thead", Object.assign({ className: b('head') }, { children: _jsx("tr", { children: columns.map((column) => {
|
102
|
+
var _a;
|
104
103
|
const sortOrder = sortParams.columnId === column.name ? sortParams.sortOrder : undefined;
|
105
|
-
|
104
|
+
const resizeable = onColumnsResize && ((_a = column.resizeable) !== null && _a !== void 0 ? _a : DEFAULT_RESIZEABLE);
|
105
|
+
return (_jsx(TableHeadCell, { column: column, resizeable: resizeable, sortOrder: sortOrder, defaultSortOrder: defaultSortOrder, onSort: handleSort, rowHeight: rowHeight, onCellMount: handleCellMount, onCellUnMount: handleCellUnMount }, column.name));
|
106
106
|
}) }) })));
|
107
107
|
};
|
108
108
|
return (_jsxs(_Fragment, { children: [renderTableColGroups(), renderTableHead()] }));
|
@@ -2,6 +2,7 @@ export declare const LEFT = "left";
|
|
2
2
|
export declare const CENTER = "center";
|
3
3
|
export declare const RIGHT = "right";
|
4
4
|
export declare const DEFAULT_ALIGN = "left";
|
5
|
+
export declare const DEFAULT_RESIZEABLE = true;
|
5
6
|
export declare const ASCENDING = 1;
|
6
7
|
export declare const DESCENDING = -1;
|
7
8
|
export declare const DEFAULT_SORT_ORDER = -1;
|
@@ -2,6 +2,7 @@ export const LEFT = 'left';
|
|
2
2
|
export const CENTER = 'center';
|
3
3
|
export const RIGHT = 'right';
|
4
4
|
export const DEFAULT_ALIGN = LEFT;
|
5
|
+
export const DEFAULT_RESIZEABLE = true;
|
5
6
|
export const ASCENDING = 1;
|
6
7
|
export const DESCENDING = -1;
|
7
8
|
export const DEFAULT_SORT_ORDER = DESCENDING;
|
@@ -5,12 +5,10 @@ import ContentWrapper, { Content } from './Content';
|
|
5
5
|
import ReduxTooltip from '../ReduxTooltip/ReduxTooltip';
|
6
6
|
import AppIcons from '../AppIcons/AppIcons';
|
7
7
|
import { Navigation } from '../AsideNavigation/Navigation';
|
8
|
-
import { registerLanguages } from '../../utils/monaco';
|
9
8
|
import { ErrorBoundary } from '../../components/ErrorBoundary/ErrorBoundary';
|
10
9
|
import { settings } from '../UserSettings/settings';
|
11
10
|
import { Providers } from './Providers';
|
12
11
|
import './App.scss';
|
13
|
-
registerLanguages();
|
14
12
|
function App({ store, history, singleClusterMode, children, userSettings = settings }) {
|
15
13
|
return (_jsxs(Providers, Object.assign({ store: store, history: history }, { children: [_jsx(Helmet, { defaultTitle: "YDB Monitoring", titleTemplate: "%s \u2014 YDB Monitoring" }), _jsx(ContentWrapper, { children: _jsx(Navigation, Object.assign({ userSettings: userSettings }, { children: _jsxs(ErrorBoundary, { children: [_jsx(Content, Object.assign({ singleClusterMode: singleClusterMode }, { children: children })), _jsx("div", { id: "fullscreen-root" })] }) })) }), _jsx(ReduxTooltip, {}), _jsx(AppIcons, {})] })));
|
16
14
|
}
|
@@ -8,16 +8,18 @@ import { Clusters } from '../Clusters/Clusters';
|
|
8
8
|
import Cluster from '../Cluster/Cluster';
|
9
9
|
import Tenant from '../Tenant/Tenant';
|
10
10
|
import Node from '../Node/Node';
|
11
|
-
import {
|
11
|
+
import { PDiskPage } from '../PDiskPage/PDiskPage';
|
12
|
+
import { VDiskPage } from '../VDiskPage/VDiskPage';
|
12
13
|
import { Tablet } from '../Tablet';
|
13
14
|
import TabletsFilters from '../TabletsFilters/TabletsFilters';
|
14
15
|
import Header from '../Header/Header';
|
15
16
|
import Authentication from '../Authentication/Authentication';
|
16
17
|
import { getUser } from '../../store/reducers/authentication/authentication';
|
18
|
+
import { getNodesList } from '../../store/reducers/nodesList';
|
17
19
|
import { getClusterPath } from '../Cluster/utils';
|
18
20
|
import { useSlots } from '../../components/slots';
|
19
21
|
import { useTypedSelector, useTypedDispatch } from '../../utils/hooks';
|
20
|
-
import { ClusterSlot, ClustersSlot, NodeSlot,
|
22
|
+
import { ClusterSlot, ClustersSlot, NodeSlot, PDiskPageSlot, VDiskPageSlot, RedirectSlot, RoutesSlot, TabletSlot, TabletsFiltersSlot, TenantSlot, } from './appSlots';
|
21
23
|
import i18n from './i18n';
|
22
24
|
import './App.scss';
|
23
25
|
const b = cn('app');
|
@@ -39,8 +41,13 @@ const routesSlots = [
|
|
39
41
|
},
|
40
42
|
{
|
41
43
|
path: routes.pDisk,
|
42
|
-
slot:
|
43
|
-
component:
|
44
|
+
slot: PDiskPageSlot,
|
45
|
+
component: PDiskPage,
|
46
|
+
},
|
47
|
+
{
|
48
|
+
path: routes.vDisk,
|
49
|
+
slot: VDiskPageSlot,
|
50
|
+
component: VDiskPage,
|
44
51
|
},
|
45
52
|
{
|
46
53
|
path: routes.tablet,
|
@@ -88,7 +95,7 @@ export function Content(props) {
|
|
88
95
|
exact: true,
|
89
96
|
component: Clusters,
|
90
97
|
slot: ClustersSlot,
|
91
|
-
}), additionalRoutes === null || additionalRoutes === void 0 ? void 0 : additionalRoutes.rendered, _jsxs(Route, { children: [_jsx(GetUser, {}), _jsx(Header, { mainPage: mainPage }), _jsxs(Switch, { children: [routesSlots.map((route) => {
|
98
|
+
}), additionalRoutes === null || additionalRoutes === void 0 ? void 0 : additionalRoutes.rendered, _jsxs(Route, { children: [_jsx(GetUser, {}), _jsx(GetNodesList, {}), _jsx(Header, { mainPage: mainPage }), _jsxs(Switch, { children: [routesSlots.map((route) => {
|
92
99
|
return renderRouteSlot(slots, route);
|
93
100
|
}), _jsx(Redirect, Object.assign({}, redirectProps))] })] }, "single-cluster")] }));
|
94
101
|
}
|
@@ -105,6 +112,13 @@ function GetUser() {
|
|
105
112
|
}, [dispatch, isAuthenticated, isInternalUser]);
|
106
113
|
return null;
|
107
114
|
}
|
115
|
+
function GetNodesList() {
|
116
|
+
const dispatch = useTypedDispatch();
|
117
|
+
React.useEffect(() => {
|
118
|
+
dispatch(getNodesList());
|
119
|
+
}, [dispatch]);
|
120
|
+
return null;
|
121
|
+
}
|
108
122
|
function ContentWrapper(props) {
|
109
123
|
const { singleClusterMode, isAuthenticated } = props;
|
110
124
|
return (_jsxs(Switch, { children: [_jsx(Route, Object.assign({ path: routes.auth }, { children: _jsx(Authentication, { closable: true }) })), _jsx(Route, { children: _jsx("div", Object.assign({ className: b({ embedded: singleClusterMode }) }, { children: isAuthenticated ? props.children : _jsx(Authentication, {}) })) })] }));
|
@@ -2,7 +2,8 @@ import type { RedirectProps, RouteComponentProps } from 'react-router';
|
|
2
2
|
import type Cluster from '../Cluster/Cluster';
|
3
3
|
import type { Clusters } from '../Clusters/Clusters';
|
4
4
|
import type Node from '../Node/Node';
|
5
|
-
import type {
|
5
|
+
import type { PDiskPage } from '../PDiskPage/PDiskPage';
|
6
|
+
import type { VDiskPage } from '../VDiskPage/VDiskPage';
|
6
7
|
import type { Tablet } from '../Tablet';
|
7
8
|
import type TabletsFilters from '../TabletsFilters/TabletsFilters';
|
8
9
|
import type Tenant from '../Tenant/Tenant';
|
@@ -26,9 +27,14 @@ export declare const NodeSlot: import("../../components/slots/types").SlotCompon
|
|
26
27
|
component: typeof Node;
|
27
28
|
} & RouteComponentProps) => React.ReactNode);
|
28
29
|
}, never>;
|
29
|
-
export declare const
|
30
|
+
export declare const PDiskPageSlot: import("../../components/slots/types").SlotComponent<{
|
30
31
|
children: import("react").ReactNode | ((props: {
|
31
|
-
component: typeof
|
32
|
+
component: typeof PDiskPage;
|
33
|
+
} & RouteComponentProps) => React.ReactNode);
|
34
|
+
}, never>;
|
35
|
+
export declare const VDiskPageSlot: import("../../components/slots/types").SlotComponent<{
|
36
|
+
children: import("react").ReactNode | ((props: {
|
37
|
+
component: typeof VDiskPage;
|
32
38
|
} & RouteComponentProps) => React.ReactNode);
|
33
39
|
}, never>;
|
34
40
|
export declare const TabletSlot: import("../../components/slots/types").SlotComponent<{
|
@@ -3,7 +3,8 @@ export const ClustersSlot = createSlot('clusters');
|
|
3
3
|
export const ClusterSlot = createSlot('cluster');
|
4
4
|
export const TenantSlot = createSlot('tenant');
|
5
5
|
export const NodeSlot = createSlot('node');
|
6
|
-
export const
|
6
|
+
export const PDiskPageSlot = createSlot('pDisk');
|
7
|
+
export const VDiskPageSlot = createSlot('vDisk');
|
7
8
|
export const TabletSlot = createSlot('tablet');
|
8
9
|
export const TabletsFiltersSlot = createSlot('tabletsFilters');
|
9
10
|
export const RoutesSlot = createSlot('routes');
|
@@ -68,6 +68,15 @@ const getPDiskBreadcrumbs = (options, query = {}) => {
|
|
68
68
|
});
|
69
69
|
return breadcrumbs;
|
70
70
|
};
|
71
|
+
const getVDiskBreadcrumbs = (options, query = {}) => {
|
72
|
+
const { vDiskSlotId } = options;
|
73
|
+
const breadcrumbs = getPDiskBreadcrumbs(options, query);
|
74
|
+
const text = vDiskSlotId
|
75
|
+
? `${headerKeyset('breadcrumbs.vDisk')} ${vDiskSlotId}`
|
76
|
+
: headerKeyset('breadcrumbs.vDisk');
|
77
|
+
breadcrumbs.push({ text });
|
78
|
+
return breadcrumbs;
|
79
|
+
};
|
71
80
|
const getTabletsBreadcrubms = (options, query = {}) => {
|
72
81
|
const { tenantName, nodeIds } = options;
|
73
82
|
const newQuery = Object.assign(Object.assign({}, query), { [TENANT_PAGE]: TENANT_PAGES_IDS.diagnostics, [TenantTabsGroups.diagnosticsTab]: TENANT_DIAGNOSTICS_TABS_IDS.tablets });
|
@@ -106,6 +115,9 @@ export const getBreadcrumbs = (page, options, rawBreadcrumbs = [], query = {}) =
|
|
106
115
|
case 'pDisk': {
|
107
116
|
return [...rawBreadcrumbs, ...getPDiskBreadcrumbs(options, query)];
|
108
117
|
}
|
118
|
+
case 'vDisk': {
|
119
|
+
return [...rawBreadcrumbs, ...getVDiskBreadcrumbs(options, query)];
|
120
|
+
}
|
109
121
|
case 'tablets': {
|
110
122
|
return [...rawBreadcrumbs, ...getTabletsBreadcrubms(options, query)];
|
111
123
|
}
|
@@ -1 +1 @@
|
|
1
|
-
export declare const headerKeyset: (key: "breadcrumbs.tenant" | "breadcrumbs.node" | "breadcrumbs.pDisk" | "breadcrumbs.tablet" | "breadcrumbs.tablets", params?: import("@gravity-ui/i18n").Params | undefined) => string;
|
1
|
+
export declare const headerKeyset: (key: "breadcrumbs.tenant" | "breadcrumbs.node" | "breadcrumbs.pDisk" | "breadcrumbs.vDisk" | "breadcrumbs.tablet" | "breadcrumbs.tablets", params?: import("@gravity-ui/i18n").Params | undefined) => string;
|
@@ -2,7 +2,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { useEffect, useLayoutEffect, useRef, useState } from 'react';
|
3
3
|
import PropTypes from 'prop-types';
|
4
4
|
import cn from 'bem-cn-lite';
|
5
|
-
import
|
5
|
+
import throttle from 'lodash/throttle';
|
6
6
|
import { basename as appBasename } from '../../../store/index';
|
7
7
|
import routes, { createHref } from '../../../routes';
|
8
8
|
const b = cn('heatmap');
|
@@ -100,7 +100,7 @@ export const HeatmapCanvas = (props) => {
|
|
100
100
|
props.hideTooltip();
|
101
101
|
}, 40);
|
102
102
|
};
|
103
|
-
const _onCanvasMouseMove =
|
103
|
+
const _onCanvasMouseMove = throttle((x, y) => {
|
104
104
|
//this is needed to force ReduxPopup rerender
|
105
105
|
const event = new CustomEvent('scroll');
|
106
106
|
window.dispatchEvent(event);
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
2
2
|
import { useEffect, useRef } from 'react';
|
3
3
|
import url from 'url';
|
4
|
-
import
|
4
|
+
import isEmpty from 'lodash/isEmpty';
|
5
5
|
import cn from 'bem-cn-lite';
|
6
6
|
import { Loader } from '../.././../components/Loader';
|
7
7
|
import { getNodeStructure } from '../../../store/reducers/node/node';
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
2
2
|
import { useState } from 'react';
|
3
3
|
import cn from 'bem-cn-lite';
|
4
|
-
import
|
4
|
+
import isEmpty from 'lodash/isEmpty';
|
5
5
|
import { ArrowToggle, Button, Popover } from '@gravity-ui/uikit';
|
6
6
|
import DataTable from '@gravity-ui/react-data-table';
|
7
7
|
import { EFlag } from '../../../types/api/enums';
|
@@ -78,7 +78,7 @@ function getColumns({ pDiskId, selectedVdiskId, nodeId, }) {
|
|
78
78
|
header: vDiskTableColumnsNames[VDiskTableColumnsIds.Info],
|
79
79
|
width: 70,
|
80
80
|
render: ({ row }) => {
|
81
|
-
return (_jsx(Popover, Object.assign({ placement: ['right'], content: _jsx(Vdisk,
|
81
|
+
return (_jsx(Popover, Object.assign({ placement: ['right'], content: _jsx(Vdisk, { data: row }), tooltipContentClassName: b('vdisk-details') }, { children: _jsx(Button, Object.assign({ view: "flat-secondary", className: b('vdisk-details-button', {
|
82
82
|
selected: row.id === selectedVdiskId,
|
83
83
|
}) }, { children: _jsx(Icon, { name: "information", viewBox: "0 0 512 512", height: 16, width: 16 }) })) })));
|
84
84
|
},
|
@@ -1,3 +1,7 @@
|
|
1
1
|
/// <reference types="react" />
|
2
|
-
import {
|
3
|
-
|
2
|
+
import type { PreparedStructureVDisk } from '../../../store/reducers/node/types';
|
3
|
+
interface VDiskProps {
|
4
|
+
data: PreparedStructureVDisk;
|
5
|
+
}
|
6
|
+
export declare function Vdisk({ data }: VDiskProps): JSX.Element;
|
7
|
+
export {};
|
@@ -3,84 +3,11 @@ import React from 'react';
|
|
3
3
|
import cn from 'bem-cn-lite';
|
4
4
|
import { EVDiskState } from '../../../types/api/vdisk';
|
5
5
|
import { EFlag } from '../../../types/api/enums';
|
6
|
-
import {
|
7
|
-
import { bytesToGB, bytesToSpeed } from '../../../utils/utils';
|
8
|
-
import { valueIsDefined } from '../../../utils';
|
6
|
+
import { stringifyVdiskId } from '../../../utils/dataFormatters/dataFormatters';
|
9
7
|
import { EntityStatus } from '../../../components/EntityStatus/EntityStatus';
|
10
|
-
import
|
11
|
-
import { ProgressViewer } from '../../../components/ProgressViewer/ProgressViewer';
|
8
|
+
import { VDiskInfo } from '../../../components/VDiskInfo/VDiskInfo';
|
12
9
|
const b = cn('kv-node-structure');
|
13
|
-
export function Vdisk({
|
14
|
-
|
15
|
-
|
16
|
-
if (valueIsDefined(VDiskSlotId)) {
|
17
|
-
vdiskInfo.push({ label: 'VDisk Slot Id', value: VDiskSlotId });
|
18
|
-
}
|
19
|
-
if (valueIsDefined(Guid)) {
|
20
|
-
vdiskInfo.push({ label: 'GUID', value: Guid });
|
21
|
-
}
|
22
|
-
if (valueIsDefined(Kind)) {
|
23
|
-
vdiskInfo.push({ label: 'Kind', value: Kind });
|
24
|
-
}
|
25
|
-
if (valueIsDefined(VDiskState)) {
|
26
|
-
vdiskInfo.push({
|
27
|
-
label: 'VDisk State',
|
28
|
-
value: VDiskState,
|
29
|
-
});
|
30
|
-
}
|
31
|
-
if (valueIsDefined(DiskSpace)) {
|
32
|
-
vdiskInfo.push({
|
33
|
-
label: 'Disk Space',
|
34
|
-
value: _jsx(EntityStatus, { status: DiskSpace }),
|
35
|
-
});
|
36
|
-
}
|
37
|
-
if (valueIsDefined((_a = SatisfactionRank === null || SatisfactionRank === void 0 ? void 0 : SatisfactionRank.FreshRank) === null || _a === void 0 ? void 0 : _a.Flag)) {
|
38
|
-
vdiskInfo.push({
|
39
|
-
label: 'Fresh Rank Satisfaction',
|
40
|
-
value: _jsx(EntityStatus, { status: (_b = SatisfactionRank === null || SatisfactionRank === void 0 ? void 0 : SatisfactionRank.FreshRank) === null || _b === void 0 ? void 0 : _b.Flag }),
|
41
|
-
});
|
42
|
-
}
|
43
|
-
if (valueIsDefined((_c = SatisfactionRank === null || SatisfactionRank === void 0 ? void 0 : SatisfactionRank.LevelRank) === null || _c === void 0 ? void 0 : _c.Flag)) {
|
44
|
-
vdiskInfo.push({
|
45
|
-
label: 'Level Rank Satisfaction',
|
46
|
-
value: _jsx(EntityStatus, { status: (_d = SatisfactionRank === null || SatisfactionRank === void 0 ? void 0 : SatisfactionRank.LevelRank) === null || _d === void 0 ? void 0 : _d.Flag }),
|
47
|
-
});
|
48
|
-
}
|
49
|
-
vdiskInfo.push({ label: 'Replicated', value: Replicated ? 'Yes' : 'No' });
|
50
|
-
vdiskInfo.push({ label: 'Allocated Size', value: bytesToGB(AllocatedSize) });
|
51
|
-
vdiskInfo.push({ label: 'Available Size', value: bytesToGB(AvailableSize) });
|
52
|
-
if (Number(AllocatedSize) >= 0 && Number(AvailableSize) >= 0) {
|
53
|
-
vdiskInfo.push({
|
54
|
-
label: 'Size',
|
55
|
-
value: (_jsx(ProgressViewer, { value: AllocatedSize, capacity: Number(AllocatedSize) + Number(AvailableSize), formatValues: formatStorageValuesToGb, colorizeProgress: true })),
|
56
|
-
});
|
57
|
-
}
|
58
|
-
vdiskInfo.push({
|
59
|
-
label: 'Has Unreadable Blobs',
|
60
|
-
value: HasUnreadableBlobs ? 'Yes' : 'No',
|
61
|
-
});
|
62
|
-
if (valueIsDefined(IncarnationGuid)) {
|
63
|
-
vdiskInfo.push({ label: 'Incarnation GUID', value: IncarnationGuid });
|
64
|
-
}
|
65
|
-
if (valueIsDefined(InstanceGuid)) {
|
66
|
-
vdiskInfo.push({ label: 'Instance GUID', value: InstanceGuid });
|
67
|
-
}
|
68
|
-
if (valueIsDefined(FrontQueues)) {
|
69
|
-
vdiskInfo.push({
|
70
|
-
label: 'Front Queues',
|
71
|
-
value: _jsx(EntityStatus, { status: FrontQueues }),
|
72
|
-
});
|
73
|
-
}
|
74
|
-
if (valueIsDefined(StoragePoolName)) {
|
75
|
-
vdiskInfo.push({ label: 'Storage Pool Name', value: StoragePoolName });
|
76
|
-
}
|
77
|
-
vdiskInfo.push({
|
78
|
-
label: 'Read Throughput',
|
79
|
-
value: bytesToSpeed(ReadThroughput),
|
80
|
-
});
|
81
|
-
vdiskInfo.push({
|
82
|
-
label: 'Write Throughput',
|
83
|
-
value: bytesToSpeed(WriteThroughput),
|
84
|
-
});
|
85
|
-
return (_jsxs(React.Fragment, { children: [_jsxs("div", Object.assign({ className: b('row') }, { children: [_jsx("span", Object.assign({ className: b('title') }, { children: "VDisk " })), _jsx(EntityStatus, { status: VDiskState === EVDiskState.OK ? EFlag.Green : EFlag.Red, name: stringifyVdiskId(VDiskId) })] })), _jsx("div", Object.assign({ className: b('column') }, { children: _jsx(InfoViewer, { className: b('section'), info: vdiskInfo }) }))] }));
|
10
|
+
export function Vdisk({ data }) {
|
11
|
+
const { VDiskState, VDiskId } = data;
|
12
|
+
return (_jsxs(React.Fragment, { children: [_jsxs("div", Object.assign({ className: b('row') }, { children: [_jsx("span", Object.assign({ className: b('title') }, { children: "VDisk " })), _jsx(EntityStatus, { status: VDiskState === EVDiskState.OK ? EFlag.Green : EFlag.Red, name: stringifyVdiskId(VDiskId) })] })), _jsx("div", Object.assign({ className: b('column') }, { children: _jsx(VDiskInfo, { className: b('section'), data: data }) }))] }));
|
86
13
|
}
|
@@ -2,20 +2,24 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useCallback, useEffect } from 'react';
|
3
3
|
import { StringParam, useQueryParams } from 'use-query-params';
|
4
4
|
import { Helmet } from 'react-helmet-async';
|
5
|
+
import { Icon } from '@gravity-ui/uikit';
|
6
|
+
import ArrowRotateLeftIcon from '@gravity-ui/icons/svgs/arrow-rotate-left.svg';
|
5
7
|
import { getPDiskData, getPDiskStorage, setPDiskDataWasNotLoaded, } from '../../store/reducers/pdisk/pdisk';
|
6
8
|
import { setHeaderBreadcrumbs } from '../../store/reducers/header/header';
|
7
|
-
import {
|
9
|
+
import { selectNodesMap } from '../../store/reducers/nodesList';
|
10
|
+
import { valueIsDefined } from '../../utils';
|
8
11
|
import { useAutofetcher, useTypedDispatch, useTypedSelector } from '../../utils/hooks';
|
9
12
|
import { getSeverityColor } from '../../utils/disks/helpers';
|
10
13
|
import { PageMeta } from '../../components/PageMeta/PageMeta';
|
11
|
-
import { StatusIcon } from '../../components/StatusIcon/StatusIcon';
|
12
14
|
import { PDiskInfo } from '../../components/PDiskInfo/PDiskInfo';
|
13
15
|
import { InfoViewerSkeleton } from '../../components/InfoViewerSkeleton/InfoViewerSkeleton';
|
16
|
+
import { DiskPageTitle } from '../../components/DiskPageTitle/DiskPageTitle';
|
17
|
+
import { ButtonWithConfirmDialog } from '../../components/ButtonWithConfirmDialog/ButtonWithConfirmDialog';
|
14
18
|
import { PDiskGroups } from './PDiskGroups';
|
15
19
|
import { pdiskPageCn } from './shared';
|
16
20
|
import { pDiskPageKeyset } from './i18n';
|
17
|
-
import './
|
18
|
-
export function
|
21
|
+
import './PDiskPage.scss';
|
22
|
+
export function PDiskPage() {
|
19
23
|
const dispatch = useTypedDispatch();
|
20
24
|
const nodesMap = useTypedSelector(selectNodesMap);
|
21
25
|
const { pDiskData, groupsData, pDiskLoading, pDiskWasLoaded, groupsLoading, groupsWasLoaded } = useTypedSelector((state) => state.pDisk);
|
@@ -27,19 +31,28 @@ export function PDisk() {
|
|
27
31
|
useEffect(() => {
|
28
32
|
dispatch(setHeaderBreadcrumbs('pDisk', { nodeId, pDiskId }));
|
29
33
|
}, [dispatch, nodeId, pDiskId]);
|
30
|
-
|
31
|
-
dispatch(getNodesList());
|
32
|
-
}, [dispatch]);
|
33
|
-
const fetchData = useCallback((isBackground) => {
|
34
|
+
const fetchData = useCallback(async (isBackground) => {
|
34
35
|
if (!isBackground) {
|
35
36
|
dispatch(setPDiskDataWasNotLoaded());
|
36
37
|
}
|
37
|
-
if (nodeId && pDiskId) {
|
38
|
-
|
39
|
-
|
38
|
+
if (valueIsDefined(nodeId) && valueIsDefined(pDiskId)) {
|
39
|
+
return Promise.all([
|
40
|
+
dispatch(getPDiskData({ nodeId, pDiskId })),
|
41
|
+
dispatch(getPDiskStorage({ nodeId, pDiskId })),
|
42
|
+
]);
|
40
43
|
}
|
44
|
+
return undefined;
|
41
45
|
}, [dispatch, nodeId, pDiskId]);
|
42
46
|
useAutofetcher(fetchData, [fetchData], true);
|
47
|
+
const handleRestart = async () => {
|
48
|
+
if (valueIsDefined(nodeId) && valueIsDefined(pDiskId)) {
|
49
|
+
return window.api.restartPDisk(nodeId, pDiskId);
|
50
|
+
}
|
51
|
+
return undefined;
|
52
|
+
};
|
53
|
+
const handleAfterRestart = async () => {
|
54
|
+
return fetchData(true);
|
55
|
+
};
|
43
56
|
const renderHelmet = () => {
|
44
57
|
const pDiskPagePart = pDiskId
|
45
58
|
? `${pDiskPageKeyset('pdisk')} ${pDiskId}`
|
@@ -50,10 +63,13 @@ export function PDisk() {
|
|
50
63
|
const renderPageMeta = () => {
|
51
64
|
const hostItem = NodeHost ? `${pDiskPageKeyset('fqdn')}: ${NodeHost}` : undefined;
|
52
65
|
const nodeIdItem = NodeId ? `${pDiskPageKeyset('node')}: ${NodeId}` : undefined;
|
53
|
-
return (_jsx(PageMeta, { className: pdiskPageCn('meta'), items: [hostItem, nodeIdItem, NodeType, NodeDC] }));
|
66
|
+
return (_jsx(PageMeta, { className: pdiskPageCn('meta'), loading: pDiskLoading && !pDiskWasLoaded, items: [hostItem, nodeIdItem, NodeType, NodeDC] }));
|
54
67
|
};
|
55
68
|
const renderPageTitle = () => {
|
56
|
-
return (
|
69
|
+
return (_jsx(DiskPageTitle, { entityName: pDiskPageKeyset('pdisk'), status: getSeverityColor(Severity), id: pDiskId, className: pdiskPageCn('title') }));
|
70
|
+
};
|
71
|
+
const renderControls = () => {
|
72
|
+
return (_jsx("div", Object.assign({ className: pdiskPageCn('controls') }, { children: _jsxs(ButtonWithConfirmDialog, Object.assign({ onConfirmAction: handleRestart, onConfirmActionSuccess: handleAfterRestart, buttonDisabled: !nodeId || !pDiskId, buttonView: "normal", dialogContent: pDiskPageKeyset('restart-pdisk-dialog') }, { children: [_jsx(Icon, { data: ArrowRotateLeftIcon }), pDiskPageKeyset('restart-pdisk-button')] })) })));
|
57
73
|
};
|
58
74
|
const renderInfo = () => {
|
59
75
|
if (pDiskLoading && !pDiskWasLoaded) {
|
@@ -64,5 +80,5 @@ export function PDisk() {
|
|
64
80
|
const renderGroupsTable = () => {
|
65
81
|
return (_jsx(PDiskGroups, { data: groupsData, nodesMap: nodesMap, loading: groupsLoading && !groupsWasLoaded }));
|
66
82
|
};
|
67
|
-
return (_jsxs("div", Object.assign({ className: pdiskPageCn(null) }, { children: [renderHelmet(), renderPageMeta(), renderPageTitle(), renderInfo(), renderGroupsTable()] })));
|
83
|
+
return (_jsxs("div", Object.assign({ className: pdiskPageCn(null) }, { children: [renderHelmet(), renderPageMeta(), renderPageTitle(), renderControls(), renderInfo(), renderGroupsTable()] })));
|
68
84
|
}
|
@@ -16,25 +16,12 @@
|
|
16
16
|
&__meta,
|
17
17
|
&__title,
|
18
18
|
&__info,
|
19
|
+
&__controls,
|
19
20
|
&__groups-title {
|
20
21
|
position: sticky;
|
21
22
|
left: 0;
|
22
23
|
}
|
23
24
|
|
24
|
-
&__title {
|
25
|
-
display: flex;
|
26
|
-
flex-flow: row nowrap;
|
27
|
-
align-items: baseline;
|
28
|
-
|
29
|
-
@include header-2-typography();
|
30
|
-
|
31
|
-
&__prefix {
|
32
|
-
margin-right: 6px;
|
33
|
-
|
34
|
-
color: var(--g-color-text-secondary);
|
35
|
-
}
|
36
|
-
}
|
37
|
-
|
38
25
|
&__groups-title {
|
39
26
|
@include header-1-typography();
|
40
27
|
}
|
@@ -0,0 +1 @@
|
|
1
|
+
export declare const pDiskPageKeyset: (key: "groups" | "node" | "pdisk" | "fqdn" | "restart-pdisk-button" | "restart-pdisk-dialog", params?: import("@gravity-ui/i18n").Params | undefined) => string;
|
@@ -2,14 +2,12 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import React, { useState, useRef } from 'react';
|
3
3
|
import cn from 'bem-cn-lite';
|
4
4
|
import { InternalLink } from '../../../components/InternalLink';
|
5
|
-
import {
|
5
|
+
import { VDiskWithDonorsStack } from '../../../components/VDisk/VDiskWithDonorsStack';
|
6
|
+
import { DiskStateProgressBar } from '../../../components/DiskStateProgressBar/DiskStateProgressBar';
|
7
|
+
import { PDiskPopup } from '../../../components/PDiskPopup/PDiskPopup';
|
6
8
|
import routes, { createHref } from '../../../routes';
|
7
9
|
import { stringifyVdiskId } from '../../../utils/dataFormatters/dataFormatters';
|
8
|
-
import { isFullVDiskData } from '../../../utils/disks/helpers';
|
9
10
|
import { STRUCTURE } from '../../Node/NodePages';
|
10
|
-
import { DiskStateProgressBar } from '../DiskStateProgressBar';
|
11
|
-
import { PDiskPopup } from '../PDiskPopup';
|
12
|
-
import { VDisk } from '../VDisk';
|
13
11
|
import './PDisk.scss';
|
14
12
|
const b = cn('pdisk-storage');
|
15
13
|
export const PDisk = ({ nodeId, data = {}, vDisks }) => {
|
@@ -26,15 +24,11 @@ export const PDisk = ({ nodeId, data = {}, vDisks }) => {
|
|
26
24
|
return null;
|
27
25
|
}
|
28
26
|
return (_jsx("div", Object.assign({ className: b('vdisks') }, { children: vDisks.map((vdisk) => {
|
29
|
-
const donors = vdisk.Donors;
|
30
27
|
return (_jsx("div", Object.assign({ className: b('vdisks-item'), style: {
|
31
28
|
// 1 is small enough for empty disks to be of the minimum width
|
32
29
|
// but if all of them are empty, `flex-grow: 1` would size them evenly
|
33
30
|
flexGrow: Number(vdisk.AllocatedSize) || 1,
|
34
|
-
} }, { children:
|
35
|
-
const isFullData = isFullVDiskData(donor);
|
36
|
-
return (_jsx(VDisk, { compact: true, data: donor }, stringifyVdiskId(isFullData ? donor.VDiskId : donor)));
|
37
|
-
})] }), stringifyVdiskId(vdisk.VDiskId))) : (_jsx(VDisk, { data: vdisk, compact: true })) }), stringifyVdiskId(vdisk.VDiskId)));
|
31
|
+
} }, { children: _jsx(VDiskWithDonorsStack, { data: vdisk, compact: true, stackClassName: b('donors-stack') }) }), stringifyVdiskId(vdisk.VDiskId)));
|
38
32
|
}) })));
|
39
33
|
};
|
40
34
|
return (_jsxs(React.Fragment, { children: [_jsx(PDiskPopup, { data: data, anchorRef: anchor, open: isPopupVisible }), _jsxs("div", Object.assign({ className: b(), ref: anchor }, { children: [renderVDisks(), _jsxs(InternalLink, Object.assign({ to: createHref(routes.node, { id: nodeId, activeTab: STRUCTURE }, { pdiskId: data.PDiskId || '' }), className: b('content'), onMouseEnter: showPopup, onMouseLeave: hidePopup }, { children: [_jsx(DiskStateProgressBar, { diskAllocatedPercent: data.AllocatedPercent, severity: data.Severity }), _jsx("div", Object.assign({ className: b('media-type') }, { children: data.Type }))] }))] }))] }));
|