ydb-embedded-ui 0.1.0 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.md +7 -0
- package/LICENSE +21 -0
- package/README.md +2 -2
- package/dist/assets/icons/cluster.svg +1 -0
- package/dist/assets/icons/hide.svg +1 -0
- package/dist/assets/icons/show.svg +1 -0
- package/dist/assets/icons/user-check.svg +1 -1
- package/dist/assets/icons/user-secret.svg +1 -1
- package/dist/components/AsideNavigation/AsideHeader.scss +1 -2
- package/dist/components/AsideNavigation/AsideHeaderFooterItem/AsideHeaderFooterItem.scss +7 -7
- package/dist/components/AsideNavigation/AsideHeaderTooltip/AsideHeaderTooltip.scss +2 -2
- package/dist/components/AsideNavigation/CompositeBar/CompositeBar.scss +6 -6
- package/dist/components/AsideNavigation/Drawer/Drawer.scss +5 -5
- package/dist/components/AsideNavigation/Logo/Logo.scss +3 -4
- package/dist/components/AsideNavigation/Settings/Settings.scss +27 -12
- package/dist/components/AsideNavigation/Settings/SettingsMenu/SettingsMenu.scss +14 -6
- package/dist/components/Breadcrumbs/Breadcrumbs.scss +2 -1
- package/dist/components/ClusterInfo/ClusterInfo.scss +19 -12
- package/dist/components/ClusterInfo/ClusterInfo.tsx +110 -10
- package/dist/components/CopyToClipboard/CopyToClipboard.tsx +39 -0
- package/dist/components/CriticalActionDialog/CriticalActionDialog.scss +5 -4
- package/dist/components/Divider/Divider.scss +7 -0
- package/dist/components/Divider/Divider.tsx +11 -0
- package/dist/components/EmptyState/EmptyState.scss +14 -10
- package/dist/components/EnableFullscreenButton/EnableFullscreenButton.tsx +22 -0
- package/dist/components/EntityStatus/EntityStatus.js +5 -3
- package/dist/components/EntityStatus/EntityStatus.scss +35 -13
- package/dist/components/FullGroupViewer/FullGroupViewer.js +2 -4
- package/dist/components/FullGroupViewer/FullGroupViewer.scss +6 -3
- package/dist/components/FullNodeViewer/FullNodeViewer.scss +19 -11
- package/dist/components/Fullscreen/Fullscreen.scss +28 -0
- package/dist/components/Fullscreen/Fullscreen.tsx +81 -0
- package/dist/components/GroupTreeViewer/GroupTreeViewer.scss +1 -0
- package/dist/components/GroupViewer/GroupViewer.scss +8 -4
- package/dist/components/Icon/Icon.js +2 -0
- package/dist/components/InfoViewer/InfoViewer.scss +22 -16
- package/dist/components/NodesViewer/NodesViewer.js +25 -35
- package/dist/components/NodesViewer/NodesViewer.scss +15 -11
- package/dist/components/PDiskViewer/PDiskViewer.scss +10 -4
- package/dist/components/Pagination/Pagination.scss +6 -3
- package/dist/components/PoolBar/PoolBar.scss +14 -10
- package/dist/components/PoolUsage/PoolUsage.scss +17 -9
- package/dist/components/ProgressViewer/ProgressViewer.js +1 -1
- package/dist/components/ProgressViewer/ProgressViewer.scss +28 -18
- package/dist/components/QueryExecutionStatus/QueryExecutionStatus.scss +14 -0
- package/dist/components/QueryExecutionStatus/QueryExecutionStatus.tsx +29 -0
- package/dist/components/SplitPane/SplitPane.scss +33 -40
- package/dist/components/SplitPane/SplitPane.tsx +94 -0
- package/dist/components/Tablet/Tablet.scss +9 -6
- package/dist/components/TabletsOverall/TabletsOverall.scss +19 -0
- package/dist/components/TabletsOverall/TabletsOverall.tsx +105 -0
- package/dist/components/TabletsStatistic/TabletsStatistic.scss +24 -18
- package/dist/components/TabletsViewer/TabletsViewer.scss +12 -9
- package/dist/components/Tag/Tag.scss +6 -4
- package/dist/components/Tags/Tags.scss +1 -1
- package/dist/components/TreeView/TreeView.js +1 -1
- package/dist/components/TreeView/TreeView.scss +9 -0
- package/dist/components/TruncatedQuery/TruncatedQuery.scss +4 -3
- package/dist/containers/App/App.js +1 -0
- package/dist/containers/App/App.scss +50 -31
- package/dist/containers/App/Content.js +2 -2
- package/dist/containers/App/NodesTable.scss +25 -0
- package/dist/containers/App/TipPopup/TipPopup.scss +10 -6
- package/dist/containers/AppIcons/AppIcons.js +46 -22
- package/dist/containers/AsideNavigation/AsideNavigation.scss +1 -1
- package/dist/containers/AsideNavigation/AsideNavigation.tsx +12 -5
- package/dist/containers/Authentication/Authentication.scss +63 -14
- package/dist/containers/Authentication/Authentication.tsx +42 -9
- package/dist/containers/Cluster/Cluster.scss +5 -3
- package/dist/containers/Cluster/Cluster.tsx +49 -0
- package/dist/containers/Group/Group.scss +1 -1
- package/dist/containers/Header/Header.scss +15 -59
- package/dist/containers/Header/Header.tsx +75 -0
- package/dist/containers/Header/Host/Host.scss +10 -3
- package/dist/containers/Heatmap/Heatmap.js +1 -1
- package/dist/containers/Heatmap/Heatmap.scss +16 -7
- package/dist/containers/Heatmap/HeatmapCanvas/HeatmapCanvas.js +3 -3
- package/dist/containers/Heatmap/Histogram/Histogram.scss +21 -9
- package/dist/containers/Node/Node.js +1 -1
- package/dist/containers/Node/Node.scss +6 -4
- package/dist/containers/Nodes/Nodes.js +28 -27
- package/dist/containers/Nodes/Nodes.scss +5 -17
- package/dist/containers/Pdisk/Pdisk.scss +6 -4
- package/dist/containers/Pool/Pool.scss +7 -4
- package/dist/containers/ReduxTooltip/ReduxTooltip.scss +5 -1
- package/dist/containers/Storage/DiskStateProgressBar/DiskStateProgressBar.scss +77 -0
- package/dist/containers/{StorageV2 → Storage}/DiskStateProgressBar/DiskStateProgressBar.tsx +1 -1
- package/dist/containers/{StorageV2 → Storage}/Pdisk/Pdisk.scss +6 -4
- package/dist/containers/{StorageV2 → Storage}/Pdisk/Pdisk.tsx +1 -2
- package/dist/containers/{StorageV2 → Storage}/Storage.js +72 -34
- package/dist/containers/{StorageV2 → Storage}/Storage.scss +12 -14
- package/dist/containers/{StorageV2 → Storage}/StorageFilter/StorageFilter.js +1 -9
- package/dist/containers/{StorageV2 → Storage}/StorageGroups/StorageGroups.scss +2 -0
- package/dist/containers/{StorageV2 → Storage}/StorageGroups/StorageGroups.tsx +1 -1
- package/dist/containers/{StorageV2 → Storage}/StorageNodes/StorageNodes.scss +2 -0
- package/dist/containers/{StorageV2 → Storage}/StorageNodes/StorageNodes.tsx +1 -1
- package/dist/containers/{StorageV2 → Storage}/Vdisk/Vdisk.js +0 -0
- package/dist/containers/{StorageV2 → Storage}/Vdisk/Vdisk.scss +6 -4
- package/dist/containers/Tablet/Tablet.scss +13 -9
- package/dist/containers/Tablets/Tablets.js +21 -90
- package/dist/containers/Tablets/Tablets.scss +9 -35
- package/dist/containers/TabletsFilters/TabletsFilters.js +2 -75
- package/dist/containers/TabletsFilters/TabletsFilters.scss +15 -35
- package/dist/containers/Tenant/Acl/Acl.js +54 -47
- package/dist/containers/Tenant/Acl/Acl.scss +15 -4
- package/dist/containers/Tenant/{Compute → Diagnostics/Compute}/Compute.js +35 -12
- package/dist/containers/Tenant/Diagnostics/Compute/Compute.scss +14 -0
- package/dist/containers/Tenant/{Describe → Diagnostics/Describe}/Describe.js +50 -1
- package/dist/containers/Tenant/{Describe → Diagnostics/Describe}/Describe.scss +5 -3
- package/dist/containers/Tenant/Diagnostics/DetailedOverview/DetailedOverview.scss +27 -0
- package/dist/containers/Tenant/Diagnostics/DetailedOverview/DetailedOverview.tsx +88 -0
- package/dist/containers/Tenant/Diagnostics/Diagnostics.scss +50 -0
- package/dist/containers/Tenant/Diagnostics/Diagnostics.tsx +208 -0
- package/dist/containers/Tenant/Diagnostics/DiagnosticsPages.ts +75 -0
- package/dist/containers/Tenant/Diagnostics/Healthcheck/Healthcheck.js +191 -0
- package/dist/containers/Tenant/Diagnostics/Healthcheck/Healthcheck.scss +79 -0
- package/dist/containers/Tenant/{Healthcheck → Diagnostics/Healthcheck}/IssuesViewer/IssueViewer.scss +25 -13
- package/dist/containers/Tenant/{Healthcheck → Diagnostics/Healthcheck}/IssuesViewer/IssuesViewer.js +2 -2
- package/dist/containers/Tenant/{Schema → Diagnostics}/HotKeys/HotKeys.js +14 -8
- package/dist/containers/Tenant/{Schema → Diagnostics}/HotKeys/HotKeys.scss +7 -5
- package/dist/containers/Tenant/{Network → Diagnostics/Network}/Network.js +39 -9
- package/dist/containers/Tenant/{Network → Diagnostics/Network}/Network.scss +35 -36
- package/dist/containers/Tenant/{Network → Diagnostics/Network}/NodeNetwork/NodeNetwork.js +0 -0
- package/dist/containers/Tenant/{Network → Diagnostics/Network}/NodeNetwork/NodeNetwork.scss +11 -9
- package/dist/containers/Tenant/Diagnostics/Overview/Overview.scss +13 -0
- package/dist/containers/Tenant/Diagnostics/Overview/Overview.tsx +123 -0
- package/dist/containers/Tenant/Diagnostics/TenantOverview/TenantOverview.js +200 -0
- package/dist/{components → containers/Tenant/Diagnostics}/TenantOverview/TenantOverview.scss +24 -17
- package/dist/containers/Tenant/{TopQueries → Diagnostics/TopQueries}/TopQueries.js +32 -30
- package/dist/containers/Tenant/{TopQueries → Diagnostics/TopQueries}/TopQueries.scss +10 -9
- package/dist/containers/Tenant/{TopShards → Diagnostics/TopShards}/TopShards.js +25 -29
- package/dist/containers/Tenant/{TopShards → Diagnostics/TopShards}/TopShards.scss +1 -13
- package/dist/containers/Tenant/ObjectGeneral/ObjectGeneral.scss +38 -0
- package/dist/containers/Tenant/ObjectGeneral/ObjectGeneral.tsx +104 -0
- package/dist/containers/Tenant/ObjectSummary/ObjectSummary.scss +165 -0
- package/dist/containers/Tenant/ObjectSummary/ObjectSummary.tsx +310 -0
- package/dist/containers/Tenant/Preview/Preview.js +50 -12
- package/dist/containers/Tenant/Preview/Preview.scss +45 -3
- package/dist/containers/Tenant/QueryEditor/QueriesHistory/QueriesHistory.scss +85 -0
- package/dist/containers/Tenant/QueryEditor/QueriesHistory/QueriesHistory.tsx +94 -0
- package/dist/containers/Tenant/QueryEditor/QueryEditor.js +291 -264
- package/dist/containers/Tenant/QueryEditor/QueryEditor.scss +47 -18
- package/dist/containers/Tenant/QueryEditor/QueryExplain/QueryExplain.js +132 -32
- package/dist/containers/Tenant/QueryEditor/QueryExplain/QueryExplain.scss +47 -11
- package/dist/containers/Tenant/QueryEditor/QueryResult/QueryResult.js +89 -20
- package/dist/containers/Tenant/QueryEditor/QueryResult/QueryResult.scss +60 -6
- package/dist/containers/Tenant/QueryEditor/SaveQuery/SaveQuery.js +10 -23
- package/dist/containers/Tenant/QueryEditor/SaveQuery/SaveQuery.scss +15 -7
- package/dist/containers/Tenant/QueryEditor/SavedQueries/SavedQueries.js +7 -3
- package/dist/containers/Tenant/QueryEditor/SavedQueries/SavedQueries.scss +28 -17
- package/dist/containers/Tenant/Schema/SchemaInfoViewer/SchemaInfoViewer.js +7 -7
- package/dist/containers/Tenant/Schema/SchemaInfoViewer/SchemaInfoViewer.scss +1 -11
- package/dist/containers/Tenant/Schema/SchemaNode/SchemaNode.js +37 -17
- package/dist/containers/Tenant/Schema/SchemaNode/SchemaNode.scss +33 -12
- package/dist/containers/Tenant/Schema/SchemaNodeActions/SchemaNodeActions.scss +17 -0
- package/dist/containers/Tenant/Schema/SchemaNodeActions/SchemaNodeActions.tsx +125 -0
- package/dist/containers/Tenant/Schema/SchemaTree/SchemaTree.js +5 -4
- package/dist/containers/Tenant/Schema/SchemaTree/SchemaTree.scss +6 -2
- package/dist/containers/Tenant/Schema/SchemaViewer/SchemaViewer.js +53 -34
- package/dist/containers/Tenant/Schema/SchemaViewer/SchemaViewer.scss +1 -22
- package/dist/containers/Tenant/Tenant.scss +3 -32
- package/dist/containers/Tenant/Tenant.tsx +161 -0
- package/dist/containers/Tenant/TenantPages.tsx +48 -0
- package/dist/containers/Tenant/utils/ToggleButton.scss +26 -0
- package/dist/containers/Tenant/utils/paneVisibilityToggleHelpers.tsx +126 -0
- package/dist/containers/Tenants/Tenants.js +41 -55
- package/dist/containers/Tenants/Tenants.scss +4 -17
- package/dist/containers/UserSettings/UserSettings.tsx +0 -2
- package/dist/containers/Vdisk/Vdisk.scss +6 -4
- package/dist/containers/VdiskPdiskNode/VdiskPdiskNode.js +1 -1
- package/dist/containers/VdiskPdiskNode/VdiskPdiskNode.scss +5 -5
- package/dist/{routes.js → routes.ts} +14 -4
- package/dist/store/reducers/clusterNodes.js +1 -1
- package/dist/store/reducers/fullscreen.ts +31 -0
- package/dist/store/reducers/header.ts +23 -0
- package/dist/store/reducers/hotKeys.js +1 -1
- package/dist/store/reducers/index.js +6 -0
- package/dist/store/reducers/saveQuery.ts +33 -0
- package/dist/store/reducers/schema.js +14 -0
- package/dist/store/reducers/shardsWorkload.js +1 -1
- package/dist/store/state-url-mapping.js +1 -1
- package/dist/store/utils.js +2 -6
- package/dist/styles/mixins.scss +49 -34
- package/dist/utils/autofetcher.ts +51 -0
- package/dist/utils/constants.js +25 -7
- package/dist/utils/createToast.tsx +23 -0
- package/dist/utils/getNodesColumns.js +25 -28
- package/dist/utils/index.js +6 -2
- package/package.json +8 -4
- package/dist/components/SplitPane/SplitPane.js +0 -368
- package/dist/components/TenantOverview/TenantOverview.js +0 -148
- package/dist/containers/Cluster/Cluster.js +0 -168
- package/dist/containers/Header/Header.js +0 -88
- package/dist/containers/StorageV2/DiskStateProgressBar/DiskStateProgressBar.scss +0 -81
- package/dist/containers/Tenant/Compute/Compute.scss +0 -6
- package/dist/containers/Tenant/Healthcheck/Healthcheck.js +0 -116
- package/dist/containers/Tenant/Healthcheck/Healthcheck.scss +0 -64
- package/dist/containers/Tenant/Schema/Info/Info.js +0 -84
- package/dist/containers/Tenant/Schema/Info/Info.scss +0 -3
- package/dist/containers/Tenant/Schema/SchemaMain/SchemaMain.js +0 -439
- package/dist/containers/Tenant/Schema/SchemaMain/SchemaMain.scss +0 -90
- package/dist/containers/Tenant/Schema/SchemaPages.js +0 -56
- package/dist/containers/Tenant/Tenant.js +0 -199
- package/dist/containers/Tenant/TenantPages.js +0 -35
@@ -1,49 +1,29 @@
|
|
1
|
-
.split {
|
2
|
-
position: absolute;
|
1
|
+
.kv-split {
|
3
2
|
z-index: 0;
|
3
|
+
|
4
4
|
display: flex;
|
5
|
+
|
5
6
|
height: 100%;
|
6
|
-
|
7
|
+
|
7
8
|
user-select: text;
|
8
9
|
|
9
|
-
|
10
|
-
|
11
|
-
|
10
|
+
outline: none;
|
11
|
+
|
12
|
+
&.horizontal {
|
12
13
|
flex-direction: row;
|
13
14
|
}
|
14
15
|
|
15
|
-
&.
|
16
|
-
top: 0;
|
17
|
-
bottom: 0;
|
16
|
+
&.vertical {
|
18
17
|
flex-direction: column;
|
18
|
+
|
19
19
|
width: 100%;
|
20
20
|
min-height: 100%;
|
21
21
|
}
|
22
22
|
|
23
|
-
|
24
|
-
position: relative;
|
25
|
-
outline: none;
|
26
|
-
|
27
|
-
&_secondary {
|
28
|
-
flex: 1;
|
29
|
-
|
30
|
-
&.vertical {
|
31
|
-
min-width: 0;
|
32
|
-
}
|
33
|
-
|
34
|
-
&.horizontal {
|
35
|
-
min-height: 0;
|
36
|
-
}
|
37
|
-
}
|
38
|
-
|
39
|
-
&_hide {
|
40
|
-
overflow: hidden;
|
41
|
-
}
|
42
|
-
}
|
43
|
-
|
44
|
-
&__resizer {
|
23
|
+
.gutter {
|
45
24
|
position: relative;
|
46
25
|
z-index: 10;
|
26
|
+
|
47
27
|
background: var(--yc-color-base-background);
|
48
28
|
|
49
29
|
&::after {
|
@@ -52,13 +32,16 @@
|
|
52
32
|
right: 0;
|
53
33
|
bottom: 0;
|
54
34
|
left: 0;
|
55
|
-
|
35
|
+
|
56
36
|
content: '';
|
37
|
+
|
38
|
+
background-color: var(--yc-color-base-generic-ultralight);
|
57
39
|
}
|
58
40
|
|
59
41
|
&.active::after,
|
60
42
|
&:hover::after {
|
61
43
|
background-color: var(--yc-color-line-generic-hover);
|
44
|
+
|
62
45
|
transition: background-color 1s ease;
|
63
46
|
}
|
64
47
|
|
@@ -66,41 +49,51 @@
|
|
66
49
|
display: none;
|
67
50
|
}
|
68
51
|
|
69
|
-
&.
|
52
|
+
&.gutter-vertical {
|
70
53
|
width: 100%;
|
71
54
|
height: 8px;
|
55
|
+
|
72
56
|
cursor: row-resize;
|
73
57
|
|
74
58
|
&::before {
|
75
59
|
position: absolute;
|
76
60
|
top: 50%;
|
77
61
|
left: 50%;
|
62
|
+
|
78
63
|
width: 16px;
|
79
64
|
height: 4px;
|
80
|
-
|
81
|
-
|
65
|
+
|
66
|
+
content: '';
|
67
|
+
|
82
68
|
border-width: 1px 0;
|
69
|
+
border-style: solid;
|
70
|
+
border-color: var(--yc-color-base-generic-hover);
|
71
|
+
|
83
72
|
transform: translate(-50%, -50%);
|
84
|
-
content: '';
|
85
73
|
}
|
86
74
|
}
|
87
75
|
|
88
|
-
&.
|
76
|
+
&.gutter-horizontal {
|
89
77
|
width: 8px;
|
90
78
|
height: 100%;
|
79
|
+
|
91
80
|
cursor: col-resize;
|
92
81
|
|
93
82
|
&::before {
|
94
83
|
position: absolute;
|
95
84
|
top: 50%;
|
96
85
|
left: 50%;
|
86
|
+
|
97
87
|
width: 4px;
|
98
88
|
height: 16px;
|
99
|
-
|
100
|
-
|
89
|
+
|
90
|
+
content: '';
|
91
|
+
|
101
92
|
border-width: 0 1px;
|
93
|
+
border-style: solid;
|
94
|
+
border-color: var(--yc-color-base-generic-hover);
|
95
|
+
|
102
96
|
transform: translate(-50%, -50%);
|
103
|
-
content: '';
|
104
97
|
}
|
105
98
|
}
|
106
99
|
}
|
@@ -0,0 +1,94 @@
|
|
1
|
+
import cn from 'bem-cn-lite';
|
2
|
+
import _ from 'lodash';
|
3
|
+
import React, {useEffect, useState} from 'react';
|
4
|
+
|
5
|
+
import SplitPaneLib, {SplitProps} from 'react-split';
|
6
|
+
|
7
|
+
import './SplitPane.scss';
|
8
|
+
|
9
|
+
const b = cn('kv-split');
|
10
|
+
|
11
|
+
interface SplitPaneProps {
|
12
|
+
children: React.ReactNode;
|
13
|
+
defaultSizePaneKey: string;
|
14
|
+
direction?: SplitProps['direction'];
|
15
|
+
defaultSizes?: SplitProps['sizes'];
|
16
|
+
initialSizes?: SplitProps['sizes'];
|
17
|
+
collapsedSizes?: SplitProps['sizes'];
|
18
|
+
minSize?: number[];
|
19
|
+
triggerCollapse?: boolean;
|
20
|
+
triggerExpand?: boolean;
|
21
|
+
onSplitStartDrugAdditional?: VoidFunction;
|
22
|
+
onSplitDrugAdditional?: VoidFunction;
|
23
|
+
}
|
24
|
+
|
25
|
+
const minSizeDefaultInner = [0, 100];
|
26
|
+
const sizesDefaultInner = [50, 50];
|
27
|
+
|
28
|
+
function SplitPane(props: SplitPaneProps) {
|
29
|
+
const [innerSizes, setInnerSizes] = useState<number[]>();
|
30
|
+
|
31
|
+
const getDefaultSizePane = () => {
|
32
|
+
const {defaultSizePaneKey, defaultSizes = sizesDefaultInner, initialSizes} = props;
|
33
|
+
if (initialSizes) {
|
34
|
+
return initialSizes;
|
35
|
+
}
|
36
|
+
const sizes = localStorage.getItem(defaultSizePaneKey)?.split(',').map(Number);
|
37
|
+
return sizes || defaultSizes;
|
38
|
+
};
|
39
|
+
const setDefaultSizePane = (sizes: number[]) => {
|
40
|
+
const {defaultSizePaneKey} = props;
|
41
|
+
localStorage.setItem(defaultSizePaneKey, sizes.join(','));
|
42
|
+
};
|
43
|
+
const onDragHandler = (sizes: number[]) => {
|
44
|
+
const {onSplitDrugAdditional} = props;
|
45
|
+
if (onSplitDrugAdditional) {
|
46
|
+
onSplitDrugAdditional();
|
47
|
+
}
|
48
|
+
setDefaultSizePane(sizes);
|
49
|
+
};
|
50
|
+
|
51
|
+
const onDragStartHandler = () => {
|
52
|
+
const {onSplitStartDrugAdditional} = props;
|
53
|
+
if (onSplitStartDrugAdditional) {
|
54
|
+
onSplitStartDrugAdditional();
|
55
|
+
}
|
56
|
+
setInnerSizes(undefined);
|
57
|
+
};
|
58
|
+
|
59
|
+
useEffect(() => {
|
60
|
+
const {collapsedSizes, triggerCollapse} = props;
|
61
|
+
if (triggerCollapse) {
|
62
|
+
const newSizes = collapsedSizes || minSizeDefaultInner;
|
63
|
+
setDefaultSizePane(newSizes);
|
64
|
+
setInnerSizes(newSizes);
|
65
|
+
}
|
66
|
+
}, [props.triggerCollapse]);
|
67
|
+
|
68
|
+
useEffect(() => {
|
69
|
+
const {triggerExpand, defaultSizes} = props;
|
70
|
+
const newSizes = defaultSizes || sizesDefaultInner;
|
71
|
+
if (triggerExpand) {
|
72
|
+
setDefaultSizePane(newSizes);
|
73
|
+
setInnerSizes(newSizes);
|
74
|
+
}
|
75
|
+
}, [props.triggerExpand]);
|
76
|
+
return (
|
77
|
+
<React.Fragment>
|
78
|
+
<SplitPaneLib
|
79
|
+
direction={props.direction || 'horizontal'}
|
80
|
+
sizes={innerSizes || getDefaultSizePane()}
|
81
|
+
minSize={props.minSize || [0, 0]}
|
82
|
+
onDrag={onDragHandler}
|
83
|
+
className={b(null, props.direction || 'horizontal')}
|
84
|
+
gutterSize={8}
|
85
|
+
onDragStart={onDragStartHandler}
|
86
|
+
expandToMin
|
87
|
+
>
|
88
|
+
{props.children}
|
89
|
+
</SplitPaneLib>
|
90
|
+
</React.Fragment>
|
91
|
+
);
|
92
|
+
}
|
93
|
+
|
94
|
+
export default SplitPane;
|
@@ -1,16 +1,18 @@
|
|
1
1
|
.tablet {
|
2
|
-
width: 18px;
|
3
|
-
height: 18px;
|
4
|
-
border-radius: 4px;
|
5
2
|
display: flex;
|
6
|
-
align-items: center;
|
7
3
|
justify-content: center;
|
8
|
-
|
9
|
-
|
4
|
+
align-items: center;
|
5
|
+
|
6
|
+
width: 18px;
|
7
|
+
height: 18px;
|
8
|
+
|
10
9
|
font-size: 10px;
|
11
10
|
cursor: pointer;
|
11
|
+
text-transform: uppercase;
|
12
12
|
|
13
|
+
color: var(--yc-color-text-complementary);
|
13
14
|
border: 1px solid var(--yc-color-base-generic-medium-hover);
|
15
|
+
border-radius: 4px;
|
14
16
|
|
15
17
|
&__wrapper {
|
16
18
|
margin-right: 2px;
|
@@ -22,6 +24,7 @@
|
|
22
24
|
|
23
25
|
&__type {
|
24
26
|
line-height: 17px;
|
27
|
+
|
25
28
|
color: var(--yc-color-text-complementary);
|
26
29
|
}
|
27
30
|
|
@@ -0,0 +1,105 @@
|
|
1
|
+
import {useDispatch} from 'react-redux';
|
2
|
+
import cn from 'bem-cn-lite';
|
3
|
+
|
4
|
+
import {Progress} from '@yandex-cloud/uikit';
|
5
|
+
|
6
|
+
import {hideTooltip, showTooltip} from '../../store/reducers/tooltip';
|
7
|
+
import {COLORS_PRIORITY} from '../../utils/constants';
|
8
|
+
|
9
|
+
import './TabletsOverall.scss';
|
10
|
+
|
11
|
+
// to be able to see problem places with very small percentage, we'll set minimum percentage to 3.
|
12
|
+
const minOverallPercentValue = 3;
|
13
|
+
|
14
|
+
const colors = {
|
15
|
+
grey: 'var(--yc-color-base-misc-heavy)',
|
16
|
+
green: 'var(--yc-color-base-positive-heavy)',
|
17
|
+
yellow: ' var(--yc-color-base-warning-heavy)',
|
18
|
+
orange: 'var( --yc-color-base-warning-orange)',
|
19
|
+
red: 'var(--yc-color-base-danger-heavy)',
|
20
|
+
blue: 'var(--yc-color-base-info-heavy)',
|
21
|
+
};
|
22
|
+
|
23
|
+
const b = cn('kv-tablets-overall');
|
24
|
+
|
25
|
+
type Color = keyof typeof colors;
|
26
|
+
|
27
|
+
interface TabletsOverallProps {
|
28
|
+
tablets: {Overall: string}[];
|
29
|
+
}
|
30
|
+
|
31
|
+
function TabletsOverall({tablets}: TabletsOverallProps) {
|
32
|
+
const dispatch = useDispatch();
|
33
|
+
|
34
|
+
const tabletsCount = tablets.length;
|
35
|
+
|
36
|
+
const substractPercentsFromMaxPercents = (
|
37
|
+
statesForOverallProgress: Record<Color, number>,
|
38
|
+
substractValue: number,
|
39
|
+
) => {
|
40
|
+
Object.keys(statesForOverallProgress).some((key) => {
|
41
|
+
if (statesForOverallProgress[key as Color] > 10) {
|
42
|
+
statesForOverallProgress[key as Color] -= minOverallPercentValue - substractValue;
|
43
|
+
return true;
|
44
|
+
}
|
45
|
+
return false;
|
46
|
+
});
|
47
|
+
};
|
48
|
+
|
49
|
+
// determine how many tablets of what color are in "tablets"
|
50
|
+
const statesForOverallProgress: Record<string, number> = tablets.reduce((acc, tablet) => {
|
51
|
+
const color = tablet.Overall.toLowerCase();
|
52
|
+
if (!acc[color]) {
|
53
|
+
acc[color] = 1;
|
54
|
+
} else {
|
55
|
+
acc[color]++;
|
56
|
+
}
|
57
|
+
|
58
|
+
return acc;
|
59
|
+
}, {} as Record<string, number>);
|
60
|
+
|
61
|
+
const tooltipData: {color: string; percents: number; value: number; total: number}[] = [];
|
62
|
+
|
63
|
+
// determine how many percents is every color in statesForOverallProgress and by the way generate information for tooltip
|
64
|
+
Object.keys(statesForOverallProgress).forEach((key) => {
|
65
|
+
const percents = (statesForOverallProgress[key] / tabletsCount) * 100;
|
66
|
+
const value = statesForOverallProgress[key];
|
67
|
+
statesForOverallProgress[key] = percents;
|
68
|
+
tooltipData.push({color: key, percents, value, total: tablets.length});
|
69
|
+
});
|
70
|
+
|
71
|
+
// replace percents which are smaller then 3 to 3.
|
72
|
+
Object.keys(statesForOverallProgress).forEach((key) => {
|
73
|
+
if (statesForOverallProgress[key] < minOverallPercentValue) {
|
74
|
+
substractPercentsFromMaxPercents(
|
75
|
+
statesForOverallProgress,
|
76
|
+
statesForOverallProgress[key],
|
77
|
+
);
|
78
|
+
statesForOverallProgress[key] = minOverallPercentValue;
|
79
|
+
}
|
80
|
+
});
|
81
|
+
|
82
|
+
const memoryProgress = 100;
|
83
|
+
const stack = Object.keys(statesForOverallProgress).map((key) => ({
|
84
|
+
color: colors[key as Color],
|
85
|
+
colorKey: key as Color,
|
86
|
+
value: statesForOverallProgress[key],
|
87
|
+
}));
|
88
|
+
|
89
|
+
// sort stack to achieve order "green, orange, yellow, red, blue, gray"
|
90
|
+
stack.sort((a, b) => COLORS_PRIORITY[b.colorKey] - COLORS_PRIORITY[a.colorKey]);
|
91
|
+
|
92
|
+
return (
|
93
|
+
<div className={b('row', {overall: true})}>
|
94
|
+
<span className={b('label', {overall: true})}>Overall:</span>
|
95
|
+
<div
|
96
|
+
onMouseLeave={dispatch(hideTooltip)}
|
97
|
+
onMouseEnter={(e) => dispatch(showTooltip(e.target, tooltipData, 'tabletsOverall'))}
|
98
|
+
>
|
99
|
+
<Progress value={memoryProgress} stack={stack} />
|
100
|
+
</div>
|
101
|
+
</div>
|
102
|
+
);
|
103
|
+
}
|
104
|
+
|
105
|
+
export default TabletsOverall;
|
@@ -1,41 +1,47 @@
|
|
1
1
|
.tablets-statistic {
|
2
2
|
display: flex;
|
3
3
|
align-items: center;
|
4
|
+
gap: 2px;
|
4
5
|
|
5
6
|
&__tablet {
|
6
|
-
// min-width: 20px;
|
7
|
-
padding: 2px 4px;
|
8
|
-
height: 20px;
|
9
7
|
display: inline-block;
|
10
|
-
|
8
|
+
|
9
|
+
height: 20px;
|
10
|
+
padding: 0 4px;
|
11
|
+
|
12
|
+
font-size: 11px;
|
13
|
+
line-height: 20px;
|
11
14
|
text-align: center;
|
12
|
-
line-height: 14px;
|
13
|
-
color: var(--yc-color-text-complementary);
|
14
|
-
text-transform: uppercase;
|
15
|
-
font-size: 10px;
|
16
|
-
margin-right: 4px;
|
17
15
|
text-decoration: none;
|
18
|
-
|
16
|
+
text-transform: uppercase;
|
17
|
+
|
18
|
+
color: var(--yc-color-text-secondary);
|
19
|
+
border: 1px solid;
|
20
|
+
border-radius: 2px;
|
19
21
|
|
20
22
|
&_state_green {
|
21
|
-
|
23
|
+
color: var(--yc-color-text-positive);
|
24
|
+
background-color: var(--yc-color-base-positive);
|
22
25
|
}
|
23
26
|
&_state_yellow {
|
24
|
-
|
27
|
+
color: var(--yc-color-text-warning-medium);
|
28
|
+
background-color: var(--yc-color-base-warning);
|
25
29
|
}
|
26
30
|
&_state_blue {
|
27
|
-
|
31
|
+
color: var(--yc-color-text-info);
|
32
|
+
background-color: var(--yc-color-base-info);
|
28
33
|
}
|
29
34
|
&_state_orange {
|
30
|
-
|
35
|
+
color: var(--yc-color-text-warning-heavy);
|
36
|
+
background-color: var(--yc-color-infographics-warning-light);
|
31
37
|
}
|
32
38
|
&_state_red {
|
33
|
-
|
34
|
-
|
39
|
+
color: var(--yc-color-text-danger);
|
40
|
+
background: var(--yc-color-base-danger);
|
35
41
|
}
|
36
42
|
&_state_gray {
|
37
|
-
|
38
|
-
|
43
|
+
color: var(--yc-color-text-secondary);
|
44
|
+
border: 1px solid var(--yc-color-line-generic-hover);
|
39
45
|
}
|
40
46
|
}
|
41
47
|
}
|
@@ -1,37 +1,40 @@
|
|
1
1
|
.tablets-viewer {
|
2
2
|
&__grid {
|
3
3
|
display: grid;
|
4
|
-
grid-template-columns: repeat(auto-fill, 125px);
|
5
4
|
grid-gap: 8px;
|
5
|
+
|
6
|
+
grid-template-columns: repeat(auto-fill, 125px);
|
6
7
|
}
|
7
8
|
|
8
9
|
&__row {
|
9
10
|
display: flex;
|
10
11
|
align-items: center;
|
12
|
+
|
11
13
|
margin: 0;
|
12
14
|
}
|
13
15
|
|
14
16
|
&__tablet-label {
|
15
|
-
|
16
|
-
font-size: var(--yc-text-body-font-size);
|
17
|
+
min-width: 60px;
|
17
18
|
margin-right: 20px;
|
19
|
+
|
20
|
+
font-size: var(--yc-text-body-font-size);
|
18
21
|
line-height: 18px;
|
19
22
|
white-space: nowrap;
|
20
|
-
min-width: 60px;
|
21
23
|
text-transform: capitalize;
|
22
24
|
|
25
|
+
color: var(--yc-color-text-hint);
|
26
|
+
|
23
27
|
.yc-root_theme_dark & {
|
24
28
|
color: var(--yc-color-text-hint);
|
25
29
|
}
|
26
30
|
}
|
27
31
|
|
28
32
|
&__title {
|
29
|
-
font-size: var(--yc-text-body2-font-size);
|
30
|
-
line-height: var(--yc-text-body2-line-height);
|
31
|
-
font-weight: 500;
|
32
|
-
line-height: 20px;
|
33
|
-
font-weight: bold;
|
34
33
|
margin: 0;
|
35
34
|
margin-bottom: 16px;
|
35
|
+
|
36
|
+
font-size: var(--yc-text-body2-font-size);
|
37
|
+
font-weight: bold;
|
38
|
+
line-height: 20px;
|
36
39
|
}
|
37
40
|
}
|
@@ -1,11 +1,13 @@
|
|
1
1
|
.tag {
|
2
|
+
margin-right: 5px;
|
2
3
|
padding: 2px 5px;
|
3
|
-
|
4
|
-
background: var(--yc-color-base-generic);
|
5
|
-
border-radius: 3px;
|
4
|
+
|
6
5
|
font-size: 12px;
|
6
|
+
text-transform: uppercase;
|
7
|
+
|
7
8
|
color: var(--yc-color-text-primary);
|
8
|
-
|
9
|
+
border-radius: 3px;
|
10
|
+
background: var(--yc-color-base-generic);
|
9
11
|
|
10
12
|
&:last-child {
|
11
13
|
margin-right: 0;
|
@@ -29,7 +29,7 @@ const TreeView = (props) => {
|
|
29
29
|
className={b('arrow-icon', {extended: !collapsed})}
|
30
30
|
onClick={clickableLabel ? undefined : onClick}
|
31
31
|
>
|
32
|
-
<Icon name="arrow-right" viewBox="0 0 6 11" width=
|
32
|
+
<Icon name="arrow-right" viewBox="0 0 6 11" width={6} height={11} />
|
33
33
|
</span>
|
34
34
|
) : null}
|
35
35
|
{nodeLabel}
|
@@ -5,8 +5,11 @@
|
|
5
5
|
|
6
6
|
&__node-wrapper {
|
7
7
|
display: flex;
|
8
|
+
overflow: hidden;
|
8
9
|
align-items: center;
|
9
10
|
|
11
|
+
width: 100%;
|
12
|
+
|
10
13
|
&_clickable {
|
11
14
|
cursor: pointer;
|
12
15
|
}
|
@@ -15,8 +18,10 @@
|
|
15
18
|
&__arrow-icon {
|
16
19
|
display: flex;
|
17
20
|
justify-content: center;
|
21
|
+
|
18
22
|
width: 11px;
|
19
23
|
margin-right: 8px;
|
24
|
+
|
20
25
|
cursor: pointer;
|
21
26
|
|
22
27
|
&_extended {
|
@@ -27,4 +32,8 @@
|
|
27
32
|
vertical-align: middle;
|
28
33
|
}
|
29
34
|
}
|
35
|
+
.yc-icon {
|
36
|
+
display: flex;
|
37
|
+
flex-shrink: 0;
|
38
|
+
}
|
30
39
|
}
|