ydb-embedded-ui 6.26.1 → 6.27.1
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/components/DiagnosticCard/DiagnosticCard.d.ts +4 -3
- package/dist/components/DiagnosticCard/DiagnosticCard.js +2 -2
- package/dist/components/DiagnosticCard/DiagnosticCard.js.map +1 -1
- package/dist/components/DiagnosticCard/DiagnosticCard.scss +17 -4
- package/dist/components/DoughnutMetrics/DoughnutMetrics.d.ts +20 -0
- package/dist/components/DoughnutMetrics/DoughnutMetrics.js +26 -0
- package/dist/components/DoughnutMetrics/DoughnutMetrics.js.map +1 -0
- package/dist/components/DoughnutMetrics/DoughnutMetrics.scss +58 -0
- package/dist/components/PaginatedTable/TableChunk.js +2 -0
- package/dist/components/PaginatedTable/TableChunk.js.map +1 -1
- package/dist/components/PaginatedTable/types.d.ts +1 -0
- package/dist/components/ProgressViewer/ProgressViewer.js +10 -11
- package/dist/components/ProgressViewer/ProgressViewer.js.map +1 -1
- package/dist/components/ProgressViewer/ProgressViewer.scss +1 -1
- package/dist/components/TableWithControlsLayout/TableWithControlsLayout.scss +4 -2
- package/dist/components/Tag/Tag.scss +1 -2
- package/dist/components/Tags/Tags.d.ts +3 -2
- package/dist/components/Tags/Tags.js +3 -5
- package/dist/components/Tags/Tags.js.map +1 -1
- package/dist/components/nodesColumns/columns.d.ts +2 -1
- package/dist/components/nodesColumns/columns.js.map +1 -1
- package/dist/components/nodesColumns/constants.d.ts +4 -0
- package/dist/components/nodesColumns/constants.js +25 -0
- package/dist/components/nodesColumns/constants.js.map +1 -1
- package/dist/components/nodesColumns/i18n/en.json +2 -1
- package/dist/components/nodesColumns/i18n/index.d.ts +1 -1
- package/dist/components/nodesColumns/types.d.ts +0 -3
- package/dist/containers/Cluster/Cluster.js +4 -3
- package/dist/containers/Cluster/Cluster.js.map +1 -1
- package/dist/containers/Cluster/Cluster.scss +35 -8
- package/dist/containers/Cluster/ClusterDashboard/ClusterDashboard.d.ts +10 -0
- package/dist/containers/Cluster/ClusterDashboard/ClusterDashboard.js +66 -0
- package/dist/containers/Cluster/ClusterDashboard/ClusterDashboard.js.map +1 -0
- package/dist/containers/Cluster/ClusterDashboard/ClusterDashboard.scss +46 -0
- package/dist/containers/Cluster/ClusterDashboard/components/ClusterMetricsCard.d.ts +17 -0
- package/dist/containers/Cluster/ClusterDashboard/components/ClusterMetricsCard.js +20 -0
- package/dist/containers/Cluster/ClusterDashboard/components/ClusterMetricsCard.js.map +1 -0
- package/dist/containers/Cluster/ClusterDashboard/components/ClusterMetricsCores.d.ts +5 -0
- package/dist/containers/Cluster/ClusterDashboard/components/ClusterMetricsCores.js +19 -0
- package/dist/containers/Cluster/ClusterDashboard/components/ClusterMetricsCores.js.map +1 -0
- package/dist/containers/Cluster/ClusterDashboard/components/ClusterMetricsMemory.d.ts +5 -0
- package/dist/containers/Cluster/ClusterDashboard/components/ClusterMetricsMemory.js +20 -0
- package/dist/containers/Cluster/ClusterDashboard/components/ClusterMetricsMemory.js.map +1 -0
- package/dist/containers/Cluster/ClusterDashboard/components/ClusterMetricsStorage.d.ts +5 -0
- package/dist/containers/Cluster/ClusterDashboard/components/ClusterMetricsStorage.js +20 -0
- package/dist/containers/Cluster/ClusterDashboard/components/ClusterMetricsStorage.js.map +1 -0
- package/dist/containers/Cluster/ClusterDashboard/shared.d.ts +9 -0
- package/dist/containers/Cluster/ClusterDashboard/shared.js +3 -0
- package/dist/containers/Cluster/ClusterDashboard/shared.js.map +1 -0
- package/dist/containers/Cluster/ClusterDashboard/utils.d.ts +19 -0
- package/dist/containers/Cluster/ClusterDashboard/utils.js +63 -0
- package/dist/containers/Cluster/ClusterDashboard/utils.js.map +1 -0
- package/dist/containers/Cluster/ClusterInfo/ClusterInfo.d.ts +1 -3
- package/dist/containers/Cluster/ClusterInfo/ClusterInfo.js +3 -15
- package/dist/containers/Cluster/ClusterInfo/ClusterInfo.js.map +1 -1
- package/dist/containers/Cluster/ClusterInfo/ClusterInfo.scss +1 -18
- package/dist/containers/Cluster/ClusterInfo/components/DiskGroupsStatsBars/DiskGroupsStatsBars.d.ts +4 -3
- package/dist/containers/Cluster/ClusterInfo/components/DiskGroupsStatsBars/DiskGroupsStatsBars.js +14 -15
- package/dist/containers/Cluster/ClusterInfo/components/DiskGroupsStatsBars/DiskGroupsStatsBars.js.map +1 -1
- package/dist/containers/Cluster/ClusterInfo/components/DiskGroupsStatsBars/DiskGroupsStatsBars.scss +1 -6
- package/dist/containers/Cluster/ClusterInfo/components/NodesState/NodesState.scss +3 -2
- package/dist/containers/Cluster/ClusterInfo/utils.d.ts +1 -4
- package/dist/containers/Cluster/ClusterInfo/utils.js +20 -107
- package/dist/containers/Cluster/ClusterInfo/utils.js.map +1 -1
- package/dist/containers/Cluster/i18n/en.json +11 -12
- package/dist/containers/Cluster/i18n/index.d.ts +1 -1
- package/dist/containers/Nodes/columns/columns.d.ts +2 -1
- package/dist/containers/Nodes/columns/columns.js.map +1 -1
- package/dist/containers/Nodes/columns/hooks.d.ts +1 -1
- package/dist/containers/Nodes/getNodes.js +5 -1
- package/dist/containers/Nodes/getNodes.js.map +1 -1
- package/dist/containers/Operations/Operations.d.ts +5 -0
- package/dist/containers/Operations/Operations.js +33 -0
- package/dist/containers/Operations/Operations.js.map +1 -0
- package/dist/containers/Operations/OperationsControls.d.ts +12 -0
- package/dist/containers/Operations/OperationsControls.js +12 -0
- package/dist/containers/Operations/OperationsControls.js.map +1 -0
- package/dist/containers/Operations/columns.d.ts +3 -0
- package/dist/containers/Operations/columns.js +103 -0
- package/dist/containers/Operations/columns.js.map +1 -0
- package/dist/containers/Operations/constants.d.ts +23 -0
- package/dist/containers/Operations/constants.js +32 -0
- package/dist/containers/Operations/constants.js.map +1 -0
- package/dist/containers/Operations/i18n/en.json +16 -0
- package/dist/containers/Operations/i18n/index.d.ts +2 -0
- package/dist/containers/Operations/i18n/index.js +5 -0
- package/dist/containers/Operations/i18n/index.js.map +1 -0
- package/dist/containers/Operations/index.d.ts +1 -0
- package/dist/containers/Operations/index.js +2 -0
- package/dist/containers/Operations/index.js.map +1 -0
- package/dist/containers/Operations/shared.d.ts +1 -0
- package/dist/containers/Operations/shared.js +3 -0
- package/dist/containers/Operations/shared.js.map +1 -0
- package/dist/containers/Operations/useOperationsQueryParams.d.ts +11 -0
- package/dist/containers/Operations/useOperationsQueryParams.js +39 -0
- package/dist/containers/Operations/useOperationsQueryParams.js.map +1 -0
- package/dist/containers/Storage/StorageGroups/columns/constants.d.ts +3 -3
- package/dist/containers/Storage/StorageGroups/columns/constants.js +25 -0
- package/dist/containers/Storage/StorageGroups/columns/constants.js.map +1 -1
- package/dist/containers/Storage/StorageGroups/columns/types.d.ts +2 -3
- package/dist/containers/Storage/StorageGroups/getGroups.js +5 -1
- package/dist/containers/Storage/StorageGroups/getGroups.js.map +1 -1
- package/dist/containers/Storage/StorageNodes/columns/columns.js +3 -3
- package/dist/containers/Storage/StorageNodes/columns/columns.js.map +1 -1
- package/dist/containers/Storage/StorageNodes/columns/constants.d.ts +3 -43
- package/dist/containers/Storage/StorageNodes/columns/constants.js +2 -15
- package/dist/containers/Storage/StorageNodes/columns/constants.js.map +1 -1
- package/dist/containers/Storage/StorageNodes/columns/hooks.js +4 -3
- package/dist/containers/Storage/StorageNodes/columns/hooks.js.map +1 -1
- package/dist/containers/Storage/StorageNodes/columns/types.d.ts +1 -1
- package/dist/containers/Storage/StorageNodes/getNodes.js +5 -1
- package/dist/containers/Storage/StorageNodes/getNodes.js.map +1 -1
- package/dist/containers/Tenant/Diagnostics/Diagnostics.js +4 -0
- package/dist/containers/Tenant/Diagnostics/Diagnostics.js.map +1 -1
- package/dist/containers/Tenant/Diagnostics/DiagnosticsPages.d.ts +6 -0
- package/dist/containers/Tenant/Diagnostics/DiagnosticsPages.js +5 -0
- package/dist/containers/Tenant/Diagnostics/DiagnosticsPages.js.map +1 -1
- package/dist/containers/Tenant/Diagnostics/TenantOverview/TenantCpu/TopNodesByLoad.js.map +1 -1
- package/dist/containers/Tenant/Query/Preview/Preview.js +1 -3
- package/dist/containers/Tenant/Query/Preview/Preview.js.map +1 -1
- package/dist/containers/Tenant/utils/schemaQueryTemplates.d.ts +1 -1
- package/dist/containers/Tenant/utils/schemaQueryTemplates.js +2 -2
- package/dist/containers/Tenant/utils/schemaQueryTemplates.js.map +1 -1
- package/dist/containers/UserSettings/UserSettings.js +2 -2
- package/dist/containers/UserSettings/UserSettings.js.map +1 -1
- package/dist/containers/UserSettings/settings.d.ts +1 -0
- package/dist/containers/UserSettings/settings.js +3 -0
- package/dist/containers/UserSettings/settings.js.map +1 -1
- package/dist/services/api.d.ts +2 -0
- package/dist/services/api.js +7 -0
- package/dist/services/api.js.map +1 -1
- package/dist/store/reducers/operationList.d.ts +4 -0
- package/dist/store/reducers/operationList.js +19 -0
- package/dist/store/reducers/operationList.js.map +1 -0
- package/dist/store/reducers/overview/overview.js +2 -2
- package/dist/store/reducers/overview/overview.js.map +1 -1
- package/dist/store/reducers/tableData.d.ts +1 -0
- package/dist/store/reducers/tableData.js +2 -1
- package/dist/store/reducers/tableData.js.map +1 -1
- package/dist/store/reducers/tenant/constants.d.ts +1 -0
- package/dist/store/reducers/tenant/constants.js +1 -0
- package/dist/store/reducers/tenant/constants.js.map +1 -1
- package/dist/store/reducers/topic.js +1 -1
- package/dist/store/reducers/topic.js.map +1 -1
- package/dist/types/api/cluster.d.ts +3 -0
- package/dist/types/api/cluster.js.map +1 -1
- package/dist/types/api/operationList.d.ts +114 -0
- package/dist/types/api/operationList.js +42 -0
- package/dist/types/api/operationList.js.map +1 -0
- package/dist/types/api/storage.d.ts +6 -1
- package/dist/utils/bytesParsers/__test__/formatBytes.test.js +23 -22
- package/dist/utils/bytesParsers/__test__/formatBytes.test.js.map +1 -1
- package/dist/utils/bytesParsers/formatBytes.d.ts +2 -1
- package/dist/utils/bytesParsers/formatBytes.js +5 -5
- package/dist/utils/bytesParsers/formatBytes.js.map +1 -1
- package/dist/utils/dataFormatters/__test__/formatStorageValues.test.d.ts +1 -0
- package/dist/utils/dataFormatters/__test__/formatStorageValues.test.js +37 -0
- package/dist/utils/dataFormatters/__test__/formatStorageValues.test.js.map +1 -0
- package/dist/utils/dataFormatters/dataFormatters.d.ts +3 -1
- package/dist/utils/dataFormatters/dataFormatters.js +33 -3
- package/dist/utils/dataFormatters/dataFormatters.js.map +1 -1
- package/dist/utils/numeral.js +2 -1
- package/dist/utils/numeral.js.map +1 -1
- package/dist/utils/progress.d.ts +10 -0
- package/dist/utils/progress.js +13 -0
- package/dist/utils/progress.js.map +1 -0
- package/dist/utils/tableUtils/getRequiredDataFields.d.ts +1 -0
- package/dist/utils/tableUtils/getRequiredDataFields.js +11 -0
- package/dist/utils/tableUtils/getRequiredDataFields.js.map +1 -0
- package/dist/utils/tableUtils/types.d.ts +3 -0
- package/dist/utils/tableUtils/types.js +2 -0
- package/dist/utils/tableUtils/types.js.map +1 -0
- package/dist/utils/utils.d.ts +1 -0
- package/dist/utils/utils.js +1 -0
- package/dist/utils/utils.js.map +1 -1
- package/package.json +1 -1
- package/dist/containers/Storage/StorageNodes/columns/i18n/en.json +0 -3
- package/dist/containers/Storage/StorageNodes/columns/i18n/index.d.ts +0 -2
- package/dist/containers/Storage/StorageNodes/columns/i18n/index.js +0 -5
- package/dist/containers/Storage/StorageNodes/columns/i18n/index.js.map +0 -1
@@ -1,6 +1,6 @@
|
|
1
1
|
@import '../../styles/mixins.scss';
|
2
2
|
|
3
|
-
.cluster {
|
3
|
+
.ydb-cluster {
|
4
4
|
position: relative;
|
5
5
|
|
6
6
|
overflow: auto;
|
@@ -27,28 +27,55 @@
|
|
27
27
|
height: var(--g-text-header-1-line-height);
|
28
28
|
}
|
29
29
|
|
30
|
-
&__tabs {
|
31
|
-
|
32
|
-
left: 0;
|
30
|
+
&__tabs-sticky-wrapper {
|
31
|
+
z-index: 3;
|
33
32
|
|
33
|
+
margin-top: 20px;
|
34
|
+
margin-right: -20px;
|
35
|
+
padding-right: 20px;
|
36
|
+
@include sticky-top();
|
37
|
+
}
|
38
|
+
&__tabs {
|
34
39
|
display: flex;
|
35
|
-
justify-content: space-between;
|
36
|
-
align-items: center;
|
37
40
|
@include tabs-wrapper-styles();
|
38
41
|
}
|
39
42
|
|
40
43
|
&__sticky-wrapper {
|
41
44
|
position: sticky;
|
42
45
|
z-index: 4;
|
43
|
-
top:
|
46
|
+
top: 66px;
|
44
47
|
left: 0;
|
45
48
|
}
|
46
49
|
|
47
50
|
&__auto-refresh-control {
|
48
51
|
float: right;
|
49
52
|
|
50
|
-
margin-top: -
|
53
|
+
margin-top: -46px;
|
54
|
+
|
55
|
+
background-color: var(--g-color-base-background);
|
56
|
+
}
|
57
|
+
.ydb-table-with-controls-layout__controls-wrapper {
|
58
|
+
top: 40px;
|
59
|
+
}
|
60
|
+
|
61
|
+
&__tablets {
|
62
|
+
.data-table__sticky_moving {
|
63
|
+
// Place table head right after controls
|
64
|
+
top: 60px !important;
|
65
|
+
}
|
66
|
+
}
|
67
|
+
|
68
|
+
&__fake-block {
|
69
|
+
position: sticky;
|
70
|
+
z-index: 3;
|
71
|
+
top: 40px;
|
72
|
+
|
73
|
+
height: 20px;
|
51
74
|
|
52
75
|
background-color: var(--g-color-base-background);
|
53
76
|
}
|
77
|
+
|
78
|
+
.ydb-table-with-controls-layout {
|
79
|
+
--data-table-sticky-top-offset: 102px;
|
80
|
+
}
|
54
81
|
}
|
@@ -0,0 +1,10 @@
|
|
1
|
+
import type { ClusterGroupsStats } from '../../../store/reducers/cluster/types';
|
2
|
+
import type { TClusterInfo } from '../../../types/api/cluster';
|
3
|
+
import './ClusterDashboard.scss';
|
4
|
+
interface ClusterDashboardProps {
|
5
|
+
cluster: TClusterInfo;
|
6
|
+
groupStats?: ClusterGroupsStats;
|
7
|
+
loading?: boolean;
|
8
|
+
}
|
9
|
+
export declare function ClusterDashboard(props: ClusterDashboardProps): import("react/jsx-runtime").JSX.Element;
|
10
|
+
export {};
|
@@ -0,0 +1,66 @@
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
2
|
+
import { Flex, Text } from '@gravity-ui/uikit';
|
3
|
+
import { Tags } from '../../../components/Tags';
|
4
|
+
import { isClusterInfoV2 } from '../../../types/api/cluster';
|
5
|
+
import { valueIsDefined } from '../../../utils';
|
6
|
+
import { formatNumber } from '../../../utils/dataFormatters/dataFormatters';
|
7
|
+
import i18n from '../i18n';
|
8
|
+
import { ClusterDashboardSkeleton, ClusterMetricsCard } from './components/ClusterMetricsCard';
|
9
|
+
import { ClusterMetricsCores } from './components/ClusterMetricsCores';
|
10
|
+
import { ClusterMetricsMemory } from './components/ClusterMetricsMemory';
|
11
|
+
import { ClusterMetricsStorage } from './components/ClusterMetricsStorage';
|
12
|
+
import { b } from './shared';
|
13
|
+
import { getDCInfo, getNodesRolesInfo, getStorageGroupStats, getTotalStorageGroupsUsed, } from './utils';
|
14
|
+
import './ClusterDashboard.scss';
|
15
|
+
function Amount({ value }) {
|
16
|
+
if (!valueIsDefined(value)) {
|
17
|
+
return null;
|
18
|
+
}
|
19
|
+
return (_jsx(Text, { variant: "subheader-3", color: "secondary", children: formatNumber(value) }));
|
20
|
+
}
|
21
|
+
export function ClusterDashboard(props) {
|
22
|
+
return (_jsx("div", { className: b(), children: _jsxs(Flex, { gap: 4, wrap: true, children: [_jsx(Flex, { gap: 4, wrap: "nowrap", children: _jsx(ClusterDoughnuts, { ...props }) }), _jsx("div", { className: b('cards-container'), children: _jsx(ClusterDashboardCards, { ...props }) })] }) }));
|
23
|
+
}
|
24
|
+
function ClusterDoughnuts({ cluster, loading }) {
|
25
|
+
if (loading) {
|
26
|
+
return _jsx(ClusterDashboardSkeleton, {});
|
27
|
+
}
|
28
|
+
const metricsCards = [];
|
29
|
+
if (isClusterInfoV2(cluster)) {
|
30
|
+
const { CoresUsed, NumberOfCpus } = cluster;
|
31
|
+
if (valueIsDefined(CoresUsed) && valueIsDefined(NumberOfCpus)) {
|
32
|
+
metricsCards.push(_jsx(ClusterMetricsCores, { value: CoresUsed, capacity: NumberOfCpus }, "cores"));
|
33
|
+
}
|
34
|
+
}
|
35
|
+
const { StorageTotal, StorageUsed } = cluster;
|
36
|
+
if (valueIsDefined(StorageTotal) && valueIsDefined(StorageUsed)) {
|
37
|
+
metricsCards.push(_jsx(ClusterMetricsStorage, { value: StorageUsed, capacity: StorageTotal }, "storage"));
|
38
|
+
}
|
39
|
+
const { MemoryTotal, MemoryUsed } = cluster;
|
40
|
+
if (valueIsDefined(MemoryTotal) && valueIsDefined(MemoryUsed)) {
|
41
|
+
metricsCards.push(_jsx(ClusterMetricsMemory, { value: MemoryUsed, capacity: MemoryTotal }, "memory"));
|
42
|
+
}
|
43
|
+
return metricsCards;
|
44
|
+
}
|
45
|
+
function ClusterDashboardCards({ cluster, groupStats = {}, loading }) {
|
46
|
+
if (loading) {
|
47
|
+
return null;
|
48
|
+
}
|
49
|
+
const cards = [];
|
50
|
+
const nodesRoles = getNodesRolesInfo(cluster);
|
51
|
+
cards.push(_jsx(ClusterMetricsCard, { size: "l", title: i18n('label_nodes'), children: _jsxs(Flex, { gap: 2, direction: "column", children: [_jsx(Amount, { value: cluster === null || cluster === void 0 ? void 0 : cluster.NodesAlive }), (nodesRoles === null || nodesRoles === void 0 ? void 0 : nodesRoles.length) ? _jsx(Tags, { tags: nodesRoles, gap: 3 }) : null] }) }, 'roles'));
|
52
|
+
if (Object.keys(groupStats).length) {
|
53
|
+
const tags = getStorageGroupStats(groupStats);
|
54
|
+
const total = getTotalStorageGroupsUsed(groupStats);
|
55
|
+
cards.push(_jsx(ClusterMetricsCard, { size: "l", title: i18n('label_storage-groups'), children: _jsxs(Flex, { gap: 2, direction: "column", children: [_jsx(Amount, { value: total }), _jsx(Tags, { tags: tags, gap: 3 })] }) }, 'groups'));
|
56
|
+
}
|
57
|
+
const dataCenters = getDCInfo(cluster);
|
58
|
+
if (dataCenters === null || dataCenters === void 0 ? void 0 : dataCenters.length) {
|
59
|
+
cards.push(_jsx(ClusterMetricsCard, { size: "l", title: i18n('label_hosts'), children: _jsxs(Flex, { gap: 2, direction: "column", children: [_jsx(Amount, { value: cluster === null || cluster === void 0 ? void 0 : cluster.Hosts }), _jsx(Tags, { tags: dataCenters, gap: 3 })] }) }, 'hosts'));
|
60
|
+
}
|
61
|
+
if (cluster.Tenants) {
|
62
|
+
cards.push(_jsx(ClusterMetricsCard, { size: "l", title: i18n('label_databases'), children: _jsx(Amount, { value: cluster === null || cluster === void 0 ? void 0 : cluster.Tenants }) }, "tenants"));
|
63
|
+
}
|
64
|
+
return cards;
|
65
|
+
}
|
66
|
+
//# sourceMappingURL=ClusterDashboard.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"ClusterDashboard.js","sourceRoot":"","sources":["../../../../src/containers/Cluster/ClusterDashboard/ClusterDashboard.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAC,IAAI,EAAE,IAAI,EAAC,MAAM,mBAAmB,CAAC;AAE7C,OAAO,EAAC,IAAI,EAAC,MAAM,0BAA0B,CAAC;AAE9C,OAAO,EAAC,eAAe,EAAC,MAAM,4BAA4B,CAAC;AAE3D,OAAO,EAAC,cAAc,EAAC,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAC,YAAY,EAAC,MAAM,8CAA8C,CAAC;AAC1E,OAAO,IAAI,MAAM,SAAS,CAAC;AAE3B,OAAO,EAAC,wBAAwB,EAAE,kBAAkB,EAAC,MAAM,iCAAiC,CAAC;AAC7F,OAAO,EAAC,mBAAmB,EAAC,MAAM,kCAAkC,CAAC;AACrE,OAAO,EAAC,oBAAoB,EAAC,MAAM,mCAAmC,CAAC;AACvE,OAAO,EAAC,qBAAqB,EAAC,MAAM,oCAAoC,CAAC;AACzE,OAAO,EAAC,CAAC,EAAC,MAAM,UAAU,CAAC;AAC3B,OAAO,EACH,SAAS,EACT,iBAAiB,EACjB,oBAAoB,EACpB,yBAAyB,GAC5B,MAAM,SAAS,CAAC;AAEjB,OAAO,yBAAyB,CAAC;AAMjC,SAAS,MAAM,CAAC,EAAC,KAAK,EAAc;IAChC,IAA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CAAC;IACN,CAAC;IACD,OAAO,KAAK,CAAC;AACjB,CAAC"}
|
@@ -0,0 +1,46 @@
|
|
1
|
+
.ydb-cluster-dashboard {
|
2
|
+
position: sticky;
|
3
|
+
left: 0;
|
4
|
+
|
5
|
+
padding-top: 16px;
|
6
|
+
&__card {
|
7
|
+
display: flex;
|
8
|
+
flex-direction: column;
|
9
|
+
|
10
|
+
height: 252px;
|
11
|
+
}
|
12
|
+
&__card_size_s {
|
13
|
+
height: unset;
|
14
|
+
}
|
15
|
+
&__card_size_l {
|
16
|
+
width: 100%;
|
17
|
+
height: unset;
|
18
|
+
}
|
19
|
+
&__skeleton-wrapper {
|
20
|
+
padding: unset;
|
21
|
+
|
22
|
+
border: unset;
|
23
|
+
}
|
24
|
+
&__doughnut {
|
25
|
+
margin-top: auto;
|
26
|
+
}
|
27
|
+
&__cards {
|
28
|
+
display: flex;
|
29
|
+
}
|
30
|
+
&__card-title {
|
31
|
+
margin-bottom: var(--g-spacing-2);
|
32
|
+
}
|
33
|
+
&__skeleton {
|
34
|
+
height: 100%;
|
35
|
+
}
|
36
|
+
&__cards-container {
|
37
|
+
display: grid;
|
38
|
+
grid-template-columns: repeat(2, max-content);
|
39
|
+
grid-template-rows: repeat(2, 118px);
|
40
|
+
grid-auto-flow: column dense;
|
41
|
+
gap: var(--g-spacing-4);
|
42
|
+
}
|
43
|
+
&__double-height {
|
44
|
+
grid-row: span 2;
|
45
|
+
}
|
46
|
+
}
|
@@ -0,0 +1,17 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import type { DiagnosticCardProps } from '../../../../components/DiagnosticCard/DiagnosticCard';
|
3
|
+
import type { ProgressStatus } from '../../../../utils/progress';
|
4
|
+
interface ClusterMetricsDougnutCardProps extends ClusterMetricsCommonCardProps {
|
5
|
+
status: ProgressStatus;
|
6
|
+
fillWidth: number;
|
7
|
+
}
|
8
|
+
interface ClusterMetricsCommonCardProps {
|
9
|
+
children?: React.ReactNode;
|
10
|
+
title?: string;
|
11
|
+
size?: DiagnosticCardProps['size'];
|
12
|
+
className?: string;
|
13
|
+
}
|
14
|
+
export declare function ClusterMetricsCard({ children, title, size, className, }: ClusterMetricsCommonCardProps): import("react/jsx-runtime").JSX.Element;
|
15
|
+
export declare function ClusterMetricsCardDoughnut({ title, children, size, ...rest }: ClusterMetricsDougnutCardProps): import("react/jsx-runtime").JSX.Element;
|
16
|
+
export declare function ClusterDashboardSkeleton(): import("react/jsx-runtime").JSX.Element;
|
17
|
+
export {};
|
@@ -0,0 +1,20 @@
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
2
|
+
import React from 'react';
|
3
|
+
import { Text } from '@gravity-ui/uikit';
|
4
|
+
import { DiagnosticCard } from '../../../../components/DiagnosticCard/DiagnosticCard';
|
5
|
+
import { DoughnutMetrics } from '../../../../components/DoughnutMetrics/DoughnutMetrics';
|
6
|
+
import { Skeleton } from '../../../../components/Skeleton/Skeleton';
|
7
|
+
import { b } from '../shared';
|
8
|
+
export function ClusterMetricsCard({ children, title, size, className, }) {
|
9
|
+
return (_jsxs(DiagnosticCard, { className: b('card', { size }, className), size: size, interactive: false, children: [title ? (_jsx(Text, { variant: "subheader-3", className: b('card-title'), children: title })) : null, children] }));
|
10
|
+
}
|
11
|
+
export function ClusterMetricsCardDoughnut({ title, children, size, ...rest }) {
|
12
|
+
return (_jsx(ClusterMetricsCard, { title: title, size: size, children: _jsx(DoughnutMetrics, { ...rest, className: b('doughnut'), children: children }) }));
|
13
|
+
}
|
14
|
+
function ClusterMetricsCardSkeleton() {
|
15
|
+
return (_jsx(ClusterMetricsCard, { className: b('skeleton-wrapper'), children: _jsx(Skeleton, { className: b('skeleton') }) }));
|
16
|
+
}
|
17
|
+
export function ClusterDashboardSkeleton() {
|
18
|
+
return (_jsxs(React.Fragment, { children: [_jsx(ClusterMetricsCardSkeleton, {}), _jsx(ClusterMetricsCardSkeleton, {}), _jsx(ClusterMetricsCardSkeleton, {})] }));
|
19
|
+
}
|
20
|
+
//# sourceMappingURL=ClusterMetricsCard.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"ClusterMetricsCard.js","sourceRoot":"","sources":["../../../../../src/containers/Cluster/ClusterDashboard/components/ClusterMetricsCard.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAC,IAAI,EAAC,MAAM,mBAAmB,CAAC;AAGvC,OAAO,EAAC,cAAc,EAAC,MAAM,sDAAsD,CAAC;AACpF,OAAO,EAAC,eAAe,EAAC,MAAM,wDAAwD,CAAC;AACvF,OAAO,EAAC,QAAQ,EAAC,MAAM,0CAA0C,CAAC;AAElE,OAAO,EAAC,CAAC,EAAC,MAAM,WAAW,CAAC;AAc5B,MAAM,UAAU,kBAAkB,CAAC,EAC/B,QAAQ,EACR,KAAK,EACL,IAAI,EACJ,SAAS,GACmB;IAC5B,OAAO,CACH,MAAC,cAAc,IAAC,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,EAAC,IAAI,EAAC,EAAE,SAAS,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,WAAW,EAAE,KAAK,aAClF,KAAK,CAAC,CAAC,CAAC,CACL,KAAC,IAAI,IAAC,OAAO,EAAC,aAAa,EAAC,SAAS,EAAE,CAAC,CAAC,YAAY,CAAC,YACjD,KAAK,GACH,CACV,CAAC,CAAC,CAAC,IAAI,EACP,QAAQ,IACI,CACpB,CAAC;AACN,CAAC;AAED,MAAM,UAAU,0BAA0B,CAAC,EACvC,KAAK,EACL,QAAQ,EACR,IAAI,EACJ,GAAG,IAAI,EACsB;IAC7B,OAAO,CACH,KAAC,kBAAkB,IAAC,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,YACxC,KAAC,eAAe,OAAK,IAAI,EAAE,SAAS,EAAE,CAAC,CAAC,UAAU,CAAC,YAC9C,QAAQ,GACK,GACD,CACxB,CAAC;AACN,CAAC;AAED,SAAS,0BAA0B;IAC/B,OAAO,CACH,KAAC,kBAAkB,IAAC,SAAS,EAAE,CAAC,CAAC,kBAAkB,CAAC,YAChD,KAAC,QAAQ,IAAC,SAAS,EAAE,CAAC,CAAC,UAAU,CAAC,GAAI,GACrB,CACxB,CAAC;AACN,CAAC;AAED,MAAM,UAAU,wBAAwB;IACpC,OAAO,CACH,MAAC,KAAK,CAAC,QAAQ,eACX,KAAC,0BAA0B,KAAG,EAC9B,KAAC,0BAA0B,KAAG,EAC9B,KAAC,0BAA0B,KAAG,IACjB,CACpB,CAAC;AACN,CAAC"}
|
@@ -0,0 +1,5 @@
|
|
1
|
+
import type { ClusterMetricsCommonProps } from '../shared';
|
2
|
+
interface ClusterMetricsCoresProps extends ClusterMetricsCommonProps {
|
3
|
+
}
|
4
|
+
export declare function ClusterMetricsCores({ value, capacity, ...rest }: ClusterMetricsCoresProps): import("react/jsx-runtime").JSX.Element;
|
5
|
+
export {};
|
@@ -0,0 +1,19 @@
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
2
|
+
import { DoughnutMetrics } from '../../../../components/DoughnutMetrics/DoughnutMetrics';
|
3
|
+
import { formatNumberCustom } from '../../../../utils/dataFormatters/dataFormatters';
|
4
|
+
import i18n from '../../i18n';
|
5
|
+
import { useDiagramValues } from '../utils';
|
6
|
+
import { ClusterMetricsCardDoughnut } from './ClusterMetricsCard';
|
7
|
+
function formatCoresLegend({ value, capacity }) {
|
8
|
+
return `${formatNumberCustom(value)} / ${formatNumberCustom(capacity)}\n${i18n('context_cores')}`;
|
9
|
+
}
|
10
|
+
export function ClusterMetricsCores({ value, capacity, ...rest }) {
|
11
|
+
const { status, percents, legend, fill } = useDiagramValues({
|
12
|
+
value,
|
13
|
+
capacity,
|
14
|
+
legendFormatter: formatCoresLegend,
|
15
|
+
...rest,
|
16
|
+
});
|
17
|
+
return (_jsxs(ClusterMetricsCardDoughnut, { status: status, fillWidth: fill, title: i18n('title_cpu'), children: [_jsx(DoughnutMetrics.Legend, { children: legend }), _jsx(DoughnutMetrics.Value, { children: percents })] }));
|
18
|
+
}
|
19
|
+
//# sourceMappingURL=ClusterMetricsCores.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"ClusterMetricsCores.js","sourceRoot":"","sources":["../../../../../src/containers/Cluster/ClusterDashboard/components/ClusterMetricsCores.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAC,eAAe,EAAC,MAAM,wDAAwD,CAAC;AACvF,OAAO,EAAC,kBAAkB,EAAC,MAAM,iDAAiD,CAAC;AACnF,OAAO,IAAI,MAAM,YAAY,CAAC;AAE9B,OAAO,EAAC,gBAAgB,EAAC,MAAM,UAAU,CAAC;AAE1C,OAAO,EAAC,0BAA0B,EAAC,MAAM,sBAAsB,CAAC;AAIhE,SAAS,iBAAiB,CAAC,EAAC,KAAK,EAAE,QAAQ,EAAoC;IAC3E,OAAO,GAAG,kBAAkB,CAAC,KAAK,CAAC,MAAM,kBAAkB,CAAC,QAAQ,CAAC,KAAK,IAAI,CAAC,eAAe,CAAC,EAAE,CAAC;AACtG,CAAC;AAED,MAAM,UAAU,mBAAmB,CAAC,EAAC,KAAK,EAAE,QAAQ,EAAE,GAAG,IAAI,EAA2B;IACpF,MAAM,EAAC,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAC,GAAG,gBAAgB,CAAC;QACtD,KAAK;QACL,QAAQ;QACR,eAAe,EAAE,iBAAiB;QAClC,GAAG,IAAI;KACV,CAAC,CAAC;IACH,OAAO,CACH,MAAC,0BAA0B,IAAC,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,CAAC,WAAW,CAAC,aACjF,KAAC,eAAe,CAAC,MAAM,cAAE,MAAM,GAA0B,EACzD,KAAC,eAAe,CAAC,KAAK,cAAE,QAAQ,GAAyB,IAChC,CAChC,CAAC;AACN,CAAC"}
|
@@ -0,0 +1,5 @@
|
|
1
|
+
import type { ClusterMetricsCommonProps } from '../shared';
|
2
|
+
interface ClusterMetricsMemoryProps extends ClusterMetricsCommonProps {
|
3
|
+
}
|
4
|
+
export declare function ClusterMetricsMemory({ value, capacity, ...rest }: ClusterMetricsMemoryProps): import("react/jsx-runtime").JSX.Element;
|
5
|
+
export {};
|
@@ -0,0 +1,20 @@
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
2
|
+
import { DoughnutMetrics } from '../../../../components/DoughnutMetrics/DoughnutMetrics';
|
3
|
+
import { formatStorageValues } from '../../../../utils/dataFormatters/dataFormatters';
|
4
|
+
import i18n from '../../i18n';
|
5
|
+
import { useDiagramValues } from '../utils';
|
6
|
+
import { ClusterMetricsCardDoughnut } from './ClusterMetricsCard';
|
7
|
+
function formatStorageLegend({ value, capacity }) {
|
8
|
+
const formatted = formatStorageValues(value, capacity, undefined, '\n');
|
9
|
+
return `${formatted[0]} / ${formatted[1]}`;
|
10
|
+
}
|
11
|
+
export function ClusterMetricsMemory({ value, capacity, ...rest }) {
|
12
|
+
const { status, percents, legend, fill } = useDiagramValues({
|
13
|
+
value,
|
14
|
+
capacity,
|
15
|
+
legendFormatter: formatStorageLegend,
|
16
|
+
...rest,
|
17
|
+
});
|
18
|
+
return (_jsxs(ClusterMetricsCardDoughnut, { status: status, fillWidth: fill, title: i18n('title_memory'), children: [_jsx(DoughnutMetrics.Legend, { children: legend }), _jsx(DoughnutMetrics.Value, { children: percents })] }));
|
19
|
+
}
|
20
|
+
//# sourceMappingURL=ClusterMetricsMemory.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"ClusterMetricsMemory.js","sourceRoot":"","sources":["../../../../../src/containers/Cluster/ClusterDashboard/components/ClusterMetricsMemory.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAC,eAAe,EAAC,MAAM,wDAAwD,CAAC;AACvF,OAAO,EAAC,mBAAmB,EAAC,MAAM,iDAAiD,CAAC;AACpF,OAAO,IAAI,MAAM,YAAY,CAAC;AAE9B,OAAO,EAAC,gBAAgB,EAAC,MAAM,UAAU,CAAC;AAE1C,OAAO,EAAC,0BAA0B,EAAC,MAAM,sBAAsB,CAAC;AAIhE,SAAS,mBAAmB,CAAC,EAAC,KAAK,EAAE,QAAQ,EAAoC;IAC7E,MAAM,SAAS,GAAG,mBAAmB,CAAC,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,IAAI,CAAC,CAAC;IACxE,OAAO,GAAG,SAAS,CAAC,CAAC,CAAC,MAAM,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC;AAC/C,CAAC;AAED,MAAM,UAAU,oBAAoB,CAAC,EAAC,KAAK,EAAE,QAAQ,EAAE,GAAG,IAAI,EAA4B;IACtF,MAAM,EAAC,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAC,GAAG,gBAAgB,CAAC;QACtD,KAAK;QACL,QAAQ;QACR,eAAe,EAAE,mBAAmB;QACpC,GAAG,IAAI;KACV,CAAC,CAAC;IAEH,OAAO,CACH,MAAC,0BAA0B,IAAC,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,CAAC,cAAc,CAAC,aACpF,KAAC,eAAe,CAAC,MAAM,cAAE,MAAM,GAA0B,EACzD,KAAC,eAAe,CAAC,KAAK,cAAE,QAAQ,GAAyB,IAChC,CAChC,CAAC;AACN,CAAC"}
|
@@ -0,0 +1,5 @@
|
|
1
|
+
import type { ClusterMetricsCommonProps } from '../shared';
|
2
|
+
interface ClusterMetricsStorageProps extends ClusterMetricsCommonProps {
|
3
|
+
}
|
4
|
+
export declare function ClusterMetricsStorage({ value, capacity, ...rest }: ClusterMetricsStorageProps): import("react/jsx-runtime").JSX.Element;
|
5
|
+
export {};
|
@@ -0,0 +1,20 @@
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
2
|
+
import { DoughnutMetrics } from '../../../../components/DoughnutMetrics/DoughnutMetrics';
|
3
|
+
import { formatStorageValues } from '../../../../utils/dataFormatters/dataFormatters';
|
4
|
+
import i18n from '../../i18n';
|
5
|
+
import { useDiagramValues } from '../utils';
|
6
|
+
import { ClusterMetricsCardDoughnut } from './ClusterMetricsCard';
|
7
|
+
function formatStorageLegend({ value, capacity }) {
|
8
|
+
const formatted = formatStorageValues(value, capacity, undefined, '\n');
|
9
|
+
return `${formatted[0]} / ${formatted[1]}`;
|
10
|
+
}
|
11
|
+
export function ClusterMetricsStorage({ value, capacity, ...rest }) {
|
12
|
+
const { status, percents, legend, fill } = useDiagramValues({
|
13
|
+
value,
|
14
|
+
capacity,
|
15
|
+
legendFormatter: formatStorageLegend,
|
16
|
+
...rest,
|
17
|
+
});
|
18
|
+
return (_jsxs(ClusterMetricsCardDoughnut, { status: status, fillWidth: fill, title: i18n('title_storage'), children: [_jsx(DoughnutMetrics.Legend, { children: legend }), _jsx(DoughnutMetrics.Value, { children: percents })] }));
|
19
|
+
}
|
20
|
+
//# sourceMappingURL=ClusterMetricsStorage.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"ClusterMetricsStorage.js","sourceRoot":"","sources":["../../../../../src/containers/Cluster/ClusterDashboard/components/ClusterMetricsStorage.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAC,eAAe,EAAC,MAAM,wDAAwD,CAAC;AACvF,OAAO,EAAC,mBAAmB,EAAC,MAAM,iDAAiD,CAAC;AACpF,OAAO,IAAI,MAAM,YAAY,CAAC;AAE9B,OAAO,EAAC,gBAAgB,EAAC,MAAM,UAAU,CAAC;AAE1C,OAAO,EAAC,0BAA0B,EAAC,MAAM,sBAAsB,CAAC;AAIhE,SAAS,mBAAmB,CAAC,EAAC,KAAK,EAAE,QAAQ,EAAoC;IAC7E,MAAM,SAAS,GAAG,mBAAmB,CAAC,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,IAAI,CAAC,CAAC;IACxE,OAAO,GAAG,SAAS,CAAC,CAAC,CAAC,MAAM,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC;AAC/C,CAAC;AAED,MAAM,UAAU,qBAAqB,CAAC,EAAC,KAAK,EAAE,QAAQ,EAAE,GAAG,IAAI,EAA6B;IACxF,MAAM,EAAC,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAC,GAAG,gBAAgB,CAAC;QACtD,KAAK;QACL,QAAQ;QACR,eAAe,EAAE,mBAAmB;QACpC,GAAG,IAAI;KACV,CAAC,CAAC;IAEH,OAAO,CACH,MAAC,0BAA0B,IAAC,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,CAAC,eAAe,CAAC,aACrF,KAAC,eAAe,CAAC,MAAM,cAAE,MAAM,GAA0B,EACzD,KAAC,eAAe,CAAC,KAAK,cAAE,QAAQ,GAAyB,IAChC,CAChC,CAAC;AACN,CAAC"}
|
@@ -0,0 +1,9 @@
|
|
1
|
+
export declare const b: import("@bem-react/classname").ClassNameFormatter;
|
2
|
+
export interface ClusterMetricsCommonProps {
|
3
|
+
value: number | string;
|
4
|
+
capacity: number | string;
|
5
|
+
colorizeProgress?: boolean;
|
6
|
+
inverseColorize?: boolean;
|
7
|
+
warningThreshold?: number;
|
8
|
+
dangerThreshold?: number;
|
9
|
+
}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"shared.js","sourceRoot":"","sources":["../../../../src/containers/Cluster/ClusterDashboard/shared.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,EAAE,EAAC,MAAM,mBAAmB,CAAC;AACrC,MAAM,CAAC,MAAM,CAAC,GAAG,EAAE,CAAC,uBAAuB,CAAC,CAAC"}
|
@@ -0,0 +1,19 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import type { ClusterGroupsStats } from '../../../store/reducers/cluster/types';
|
3
|
+
import type { TClusterInfo } from '../../../types/api/cluster';
|
4
|
+
import type { ClusterMetricsCommonProps } from './shared';
|
5
|
+
export declare function useDiagramValues({ value, capacity, colorizeProgress, warningThreshold, dangerThreshold, inverseColorize, legendFormatter, }: ClusterMetricsCommonProps & {
|
6
|
+
legendFormatter: (params: {
|
7
|
+
value: number;
|
8
|
+
capacity: number;
|
9
|
+
}) => string;
|
10
|
+
}): {
|
11
|
+
status: import("../../../utils/progress").ProgressStatus;
|
12
|
+
percents: string;
|
13
|
+
legend: string;
|
14
|
+
fill: number;
|
15
|
+
};
|
16
|
+
export declare function getDCInfo(cluster: TClusterInfo): string[] | undefined;
|
17
|
+
export declare function getNodesRolesInfo(cluster: TClusterInfo): React.ReactNode[];
|
18
|
+
export declare function getStorageGroupStats(groupStats: ClusterGroupsStats): React.ReactNode[];
|
19
|
+
export declare const getTotalStorageGroupsUsed: (groupStats: ClusterGroupsStats) => number;
|
@@ -0,0 +1,63 @@
|
|
1
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
2
|
+
import React from 'react';
|
3
|
+
import { isClusterInfoV2 } from '../../../types/api/cluster';
|
4
|
+
import { formatNumber, formatPercent } from '../../../utils/dataFormatters/dataFormatters';
|
5
|
+
import { calculateProgressStatus } from '../../../utils/progress';
|
6
|
+
import { DiskGroupsErasureStats } from '../ClusterInfo/components/DiskGroupsStatsBars/DiskGroupsStatsBars';
|
7
|
+
export function useDiagramValues({ value, capacity, colorizeProgress = true, warningThreshold = 60, dangerThreshold = 80, inverseColorize = false, legendFormatter, }) {
|
8
|
+
const parsedValue = parseFloat(String(value));
|
9
|
+
const parsedCapacity = parseFloat(String(capacity));
|
10
|
+
let fillWidth = (parsedValue / parsedCapacity) * 100 || 0;
|
11
|
+
fillWidth = fillWidth > 100 ? 100 : fillWidth;
|
12
|
+
const normalizedFillWidth = fillWidth < 1 ? 0.5 : fillWidth;
|
13
|
+
const status = calculateProgressStatus({
|
14
|
+
fillWidth,
|
15
|
+
warningThreshold,
|
16
|
+
dangerThreshold,
|
17
|
+
colorizeProgress,
|
18
|
+
inverseColorize,
|
19
|
+
});
|
20
|
+
const percents = formatPercent(fillWidth / 100);
|
21
|
+
const legend = legendFormatter({
|
22
|
+
value: parsedValue,
|
23
|
+
capacity: parsedCapacity,
|
24
|
+
});
|
25
|
+
return { status, percents, legend, fill: normalizedFillWidth };
|
26
|
+
}
|
27
|
+
export function getDCInfo(cluster) {
|
28
|
+
var _a;
|
29
|
+
if (isClusterInfoV2(cluster) && cluster.MapDataCenters) {
|
30
|
+
return Object.keys(cluster.MapDataCenters);
|
31
|
+
}
|
32
|
+
return (_a = cluster.DataCenters) === null || _a === void 0 ? void 0 : _a.filter(Boolean);
|
33
|
+
}
|
34
|
+
const rolesToShow = ['storage', 'tenant'];
|
35
|
+
export function getNodesRolesInfo(cluster) {
|
36
|
+
const nodesRoles = [];
|
37
|
+
if (isClusterInfoV2(cluster) && cluster.MapNodeRoles) {
|
38
|
+
for (const [role, count] of Object.entries(cluster.MapNodeRoles)) {
|
39
|
+
if (rolesToShow.includes(role.toLowerCase())) {
|
40
|
+
nodesRoles.push(_jsxs(React.Fragment, { children: [role, ": ", formatNumber(count)] }, role));
|
41
|
+
}
|
42
|
+
}
|
43
|
+
}
|
44
|
+
return nodesRoles;
|
45
|
+
}
|
46
|
+
export function getStorageGroupStats(groupStats) {
|
47
|
+
const result = [];
|
48
|
+
Object.entries(groupStats).forEach(([storageType, stats]) => {
|
49
|
+
Object.values(stats).forEach((erasureStats) => {
|
50
|
+
result.push(_jsxs(DiskGroupsErasureStats, { stats: erasureStats, children: [storageType, ": ", formatNumber(erasureStats.createdGroups), " /", ' ', formatNumber(erasureStats.totalGroups)] }, `${storageType}|${erasureStats.erasure}`));
|
51
|
+
});
|
52
|
+
});
|
53
|
+
return result;
|
54
|
+
}
|
55
|
+
export const getTotalStorageGroupsUsed = (groupStats) => {
|
56
|
+
return Object.values(groupStats).reduce((acc, data) => {
|
57
|
+
Object.values(data).forEach((erasureStats) => {
|
58
|
+
acc += erasureStats.createdGroups;
|
59
|
+
});
|
60
|
+
return acc;
|
61
|
+
}, 0);
|
62
|
+
};
|
63
|
+
//# sourceMapping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,KAAK,CAAC,CAAC,OAAO,CAAC,CAAC,YAAY,EAAE,EAAE;YAC1C,MAAM,CAAC,IAAI,CACP,MAAC,sBAAsB,IACnB,KAAK,EAAE,YAAY,aAGlB,WAAW,QAAI,YAAY,CAAC,YAAY,CAAC,aAAa,CAAC,QAAI,GAAG,EAC9D,YAAY,CAAC,YAAY,CAAC,WAAW,CAAC,KAHlC,GAAG,WAAW,IAAI,YAAY,CAAC,OAAO,EAAE,CAIxB,CAC5B,CAAC;QACN,CAAC,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;IACH,OAAO,MAAM,CAAC;AAClB,CAAC;AAED,MAAM,CAAC,MAAM,yBAAyB,GAAG,CAAC,UAA8B,EAAE,EAAE;IACxE,OAAO,MAAM,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,IAAI,EAAE,EAAE;QAClD,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,CAAC,YAAY,EAAE,EAAE;YACzC,GAAG,IAAI,YAAY,CAAC,aAAa,CAAC;QACtC,CAAC,CAAC,CAAC;QAEH,OAAO,GAAG,CAAC;IACf,CAAC,EAAE,CAAC,CAAC,CAAC;AACV,CAAC,CAAC"}
|
@@ -1,4 +1,3 @@
|
|
1
|
-
import type { ClusterGroupsStats } from '../../../store/reducers/cluster/types';
|
2
1
|
import type { AdditionalClusterProps } from '../../../types/additionalProps';
|
3
2
|
import type { TClusterInfo } from '../../../types/api/cluster';
|
4
3
|
import type { IResponseError } from '../../../types/api/error';
|
@@ -7,10 +6,9 @@ import './ClusterInfo.scss';
|
|
7
6
|
interface ClusterInfoProps {
|
8
7
|
cluster?: TClusterInfo;
|
9
8
|
versionToColor?: VersionToColorMap;
|
10
|
-
groupsStats?: ClusterGroupsStats;
|
11
9
|
loading?: boolean;
|
12
10
|
error?: IResponseError;
|
13
11
|
additionalClusterProps?: AdditionalClusterProps;
|
14
12
|
}
|
15
|
-
export declare const ClusterInfo: ({ cluster,
|
13
|
+
export declare const ClusterInfo: ({ cluster, loading, error, additionalClusterProps, }: ClusterInfoProps) => import("react/jsx-runtime").JSX.Element;
|
16
14
|
export {};
|
@@ -2,24 +2,12 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { ResponseError } from '../../../components/Errors/ResponseError';
|
3
3
|
import { InfoViewer } from '../../../components/InfoViewer/InfoViewer';
|
4
4
|
import { InfoViewerSkeleton } from '../../../components/InfoViewerSkeleton/InfoViewerSkeleton';
|
5
|
-
import { backend, customBackend } from '../../../store';
|
6
|
-
import { DEVELOPER_UI_TITLE } from '../../../utils/constants';
|
7
|
-
import { useTypedSelector } from '../../../utils/hooks';
|
8
5
|
import { b } from './shared';
|
9
|
-
import { getInfo
|
6
|
+
import { getInfo } from './utils';
|
10
7
|
import './ClusterInfo.scss';
|
11
|
-
export const ClusterInfo = ({ cluster,
|
12
|
-
const singleClusterMode = useTypedSelector((state) => state.singleClusterMode);
|
13
|
-
const versionsValues = useGetVersionValues(cluster, versionToColor);
|
14
|
-
let internalLink = backend + '/internal';
|
15
|
-
if (singleClusterMode && !customBackend) {
|
16
|
-
internalLink = `/internal`;
|
17
|
-
}
|
8
|
+
export const ClusterInfo = ({ cluster, loading, error, additionalClusterProps = {}, }) => {
|
18
9
|
const { info = [], links = [] } = additionalClusterProps;
|
19
|
-
const clusterInfo = getInfo(cluster !== null && cluster !== void 0 ? cluster : {},
|
20
|
-
{ title: DEVELOPER_UI_TITLE, url: internalLink },
|
21
|
-
...links,
|
22
|
-
]);
|
10
|
+
const clusterInfo = getInfo(cluster !== null && cluster !== void 0 ? cluster : {}, info, links);
|
23
11
|
const getContent = () => {
|
24
12
|
if (loading) {
|
25
13
|
return _jsx(InfoViewerSkeleton, { className: b('skeleton'), rows: 9 });
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"ClusterInfo.js","sourceRoot":"","sources":["../../../../src/containers/Cluster/ClusterInfo/ClusterInfo.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAC,aAAa,EAAC,MAAM,0CAA0C,CAAC;AACvE,OAAO,EAAC,UAAU,EAAC,MAAM,2CAA2C,CAAC;AACrE,OAAO,EAAC,kBAAkB,EAAC,MAAM,2DAA2D,CAAC;
|
1
|
+
{"version":3,"file":"ClusterInfo.js","sourceRoot":"","sources":["../../../../src/containers/Cluster/ClusterInfo/ClusterInfo.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAC,aAAa,EAAC,MAAM,0CAA0C,CAAC;AACvE,OAAO,EAAC,UAAU,EAAC,MAAM,2CAA2C,CAAC;AACrE,OAAO,EAAC,kBAAkB,EAAC,MAAM,2DAA2D,CAAC;AAM7F,OAAO,EAAC,CAAC,EAAC,MAAM,UAAU,CAAC;AAC3B,OAAO,EAAC,OAAO,EAAC,MAAM,SAAS,CAAC;AAEhC,OAAO,oBAAoB,CAAC;AAU5B,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,EACxB,OAAO,EACP,OAAO,EACP,KAAK,EACL,sBAAsB,GAAG,EAAE,GACZ,EAAE,EAAE;IACnB,MAAM,EAAC,IAAI,GAAG,EAAE,EAAE,KAAK,GAAG,EAAE,EAAC,GAAG,sBAAsB,CAAC;IAEvD,MAAM,WAAW,GAAG,OAAO,CAAC,OAAO,aAAP,OAAO,cAAP,OAAO,GAAI,EAAE,EAAE,IAAI,EAAE,KAAK,CAAC,CAAC;IAExD,MAAM,UAAU,GAAG,GAAG,EAAE;QACpB,IAAI,OAAO,EAAE,CAAC;YACV,OAAO,KAAC,kBAAkB,IAAC,SAAS,EAAE,CAAC,CAAC,UAAU,CAAC,EAAE,IAAI,EAAE,CAAC,GAAI,CAAC;QACrE,CAAC;QAED,IAAI,KAAK,IAAI,CAAC,OAAO,EAAE,CAAC;YACpB,OAAO,IAAI,CAAC;QAChB,CAAC;QAED,OAAO,KAAC,UAAU,IAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,WAAW,GAAI,CAAC;IACzD,CAAC,CAAC;IAEF,OAAO,CACH,eAAK,SAAS,EAAE,CAAC,EAAE,aACd,KAAK,CAAC,CAAC,CAAC,KAAC,aAAa,IAAC,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC,CAAC,OAAO,CAAC,GAAI,CAAC,CAAC,CAAC,IAAI,EACtE,cAAK,SAAS,EAAE,CAAC,CAAC,MAAM,CAAC,YAAG,UAAU,EAAE,GAAO,IAC7C,CACT,CAAC;AACN,CAAC,CAAC"}
|
@@ -1,7 +1,7 @@
|
|
1
1
|
@import '../../../styles/mixins';
|
2
2
|
|
3
3
|
.cluster-info {
|
4
|
-
padding
|
4
|
+
padding: 20px 0;
|
5
5
|
|
6
6
|
&__skeleton {
|
7
7
|
margin-top: 5px;
|
@@ -11,16 +11,6 @@
|
|
11
11
|
@include body-2-typography();
|
12
12
|
}
|
13
13
|
|
14
|
-
&__system-tablets {
|
15
|
-
display: flex;
|
16
|
-
flex-wrap: wrap;
|
17
|
-
align-items: center;
|
18
|
-
|
19
|
-
& .tablet {
|
20
|
-
margin-top: 2px;
|
21
|
-
}
|
22
|
-
}
|
23
|
-
|
24
14
|
&__metrics {
|
25
15
|
margin: 0 -15px;
|
26
16
|
padding: 0 15px !important;
|
@@ -53,11 +43,4 @@
|
|
53
43
|
|
54
44
|
margin-left: 5px;
|
55
45
|
}
|
56
|
-
&__dc-count {
|
57
|
-
text-transform: lowercase;
|
58
|
-
}
|
59
|
-
&__nodes-states {
|
60
|
-
display: flex;
|
61
|
-
gap: var(--g-spacing-half);
|
62
|
-
}
|
63
46
|
}
|
package/dist/containers/Cluster/ClusterInfo/components/DiskGroupsStatsBars/DiskGroupsStatsBars.d.ts
CHANGED
@@ -1,7 +1,8 @@
|
|
1
|
-
import type {
|
1
|
+
import type { DiskErasureGroupsStats } from '../../../../../store/reducers/cluster/types';
|
2
2
|
import './DiskGroupsStatsBars.scss';
|
3
3
|
interface DiskGroupsStatsProps {
|
4
|
-
stats:
|
4
|
+
stats: DiskErasureGroupsStats;
|
5
|
+
children: React.ReactNode;
|
5
6
|
}
|
6
|
-
export declare const
|
7
|
+
export declare const DiskGroupsErasureStats: ({ stats, children }: DiskGroupsStatsProps) => import("react/jsx-runtime").JSX.Element;
|
7
8
|
export {};
|
package/dist/containers/Cluster/ClusterInfo/components/DiskGroupsStatsBars/DiskGroupsStatsBars.js
CHANGED
@@ -1,14 +1,13 @@
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
2
|
+
import { DefinitionList } from '@gravity-ui/components';
|
2
3
|
import { ContentWithPopup } from '../../../../../components/ContentWithPopup/ContentWithPopup';
|
3
|
-
import { InfoViewer } from '../../../../../components/InfoViewer';
|
4
|
-
import { ProgressViewer } from '../../../../../components/ProgressViewer/ProgressViewer';
|
5
4
|
import { formatBytes, getSizeWithSignificantDigits } from '../../../../../utils/bytesParsers';
|
6
5
|
import { cn } from '../../../../../utils/cn';
|
7
6
|
import i18n from '../../../i18n';
|
8
7
|
import './DiskGroupsStatsBars.scss';
|
9
8
|
const b = cn('ydb-disk-groups-stats');
|
10
|
-
export const
|
11
|
-
return (_jsx("div", { className: b(), children:
|
9
|
+
export const DiskGroupsErasureStats = ({ stats, children }) => {
|
10
|
+
return (_jsx("div", { className: b(), children: _jsx(ContentWithPopup, { placement: ['right'], pinOnClick: true, content: _jsx(GroupsStatsPopupContent, { stats: stats }), children: children }) }));
|
12
11
|
};
|
13
12
|
function GroupsStatsPopupContent({ stats }) {
|
14
13
|
const { diskType, erasure, allocatedSize, availableSize } = stats;
|
@@ -18,26 +17,26 @@ function GroupsStatsPopupContent({ stats }) {
|
|
18
17
|
const usage = Math.round((allocatedSize / (allocatedSize + availableSize)) * 100);
|
19
18
|
const info = [
|
20
19
|
{
|
21
|
-
|
22
|
-
|
20
|
+
name: i18n('disk-type'),
|
21
|
+
content: diskType,
|
23
22
|
},
|
24
23
|
{
|
25
|
-
|
26
|
-
|
24
|
+
name: i18n('erasure'),
|
25
|
+
content: erasure,
|
27
26
|
},
|
28
27
|
{
|
29
|
-
|
30
|
-
|
28
|
+
name: i18n('allocated'),
|
29
|
+
content: convertedAllocatedSize,
|
31
30
|
},
|
32
31
|
{
|
33
|
-
|
34
|
-
|
32
|
+
name: i18n('available'),
|
33
|
+
content: convertedAvailableSize,
|
35
34
|
},
|
36
35
|
{
|
37
|
-
|
38
|
-
|
36
|
+
name: i18n('usage'),
|
37
|
+
content: usage + '%',
|
39
38
|
},
|
40
39
|
];
|
41
|
-
return _jsx(
|
40
|
+
return _jsx(DefinitionList, { items: info, className: b('popup-content'), responsive: true });
|
42
41
|
}
|
43
42
|
//# sourceMappingURL=DiskGroupsStatsBars.js.map
|