ydb-embedded-ui 0.1.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.md +24 -0
- package/LICENSE +21 -0
- package/README.md +3 -3
- 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 +175 -0
- package/dist/containers/Tenant/ObjectSummary/ObjectSummary.tsx +319 -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 +95 -0
- package/dist/containers/Tenant/QueryEditor/QueryEditor.js +319 -268
- package/dist/containers/Tenant/QueryEditor/QueryEditor.scss +47 -18
- package/dist/containers/Tenant/QueryEditor/QueryExplain/QueryExplain.js +190 -75
- 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/executeQuery.js +36 -2
- 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 +26 -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
@@ -0,0 +1,126 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import {Button} from '@yandex-cloud/uikit';
|
3
|
+
import cn from 'bem-cn-lite';
|
4
|
+
//@ts-ignore
|
5
|
+
import Icon from '../../../components/Icon/Icon';
|
6
|
+
|
7
|
+
import './ToggleButton.scss';
|
8
|
+
|
9
|
+
export interface InitialPaneState {
|
10
|
+
triggerExpand: boolean;
|
11
|
+
triggerCollapse: boolean;
|
12
|
+
collapsed: boolean;
|
13
|
+
}
|
14
|
+
|
15
|
+
export enum PaneVisibilityActionTypes {
|
16
|
+
triggerCollapse = 'triggerCollapse',
|
17
|
+
triggerExpand = 'triggerExpand',
|
18
|
+
clear = 'clear',
|
19
|
+
}
|
20
|
+
|
21
|
+
const setInitialIsPaneCollapsed = (key: string) => {
|
22
|
+
localStorage.setItem(key, 'true');
|
23
|
+
};
|
24
|
+
|
25
|
+
const deleteInitialIsPaneCollapsed = (key: string) => {
|
26
|
+
localStorage.removeItem(key);
|
27
|
+
};
|
28
|
+
|
29
|
+
export function paneVisibilityToggleReducerCreator(isPaneCollapsedKey: string) {
|
30
|
+
return function paneVisibilityToggleReducer(
|
31
|
+
state: InitialPaneState,
|
32
|
+
action: PaneVisibilityActionTypes,
|
33
|
+
) {
|
34
|
+
switch (action) {
|
35
|
+
case PaneVisibilityActionTypes.triggerCollapse: {
|
36
|
+
setInitialIsPaneCollapsed(isPaneCollapsedKey);
|
37
|
+
return {
|
38
|
+
...state,
|
39
|
+
triggerCollapse: true,
|
40
|
+
triggerExpand: false,
|
41
|
+
collapsed: true,
|
42
|
+
};
|
43
|
+
}
|
44
|
+
case PaneVisibilityActionTypes.triggerExpand: {
|
45
|
+
deleteInitialIsPaneCollapsed(isPaneCollapsedKey);
|
46
|
+
return {
|
47
|
+
...state,
|
48
|
+
triggerCollapse: false,
|
49
|
+
triggerExpand: true,
|
50
|
+
collapsed: false,
|
51
|
+
};
|
52
|
+
}
|
53
|
+
case PaneVisibilityActionTypes.clear: {
|
54
|
+
deleteInitialIsPaneCollapsed(isPaneCollapsedKey);
|
55
|
+
return {
|
56
|
+
triggerCollapse: false,
|
57
|
+
triggerExpand: false,
|
58
|
+
collapsed: false,
|
59
|
+
};
|
60
|
+
}
|
61
|
+
default:
|
62
|
+
return state;
|
63
|
+
}
|
64
|
+
};
|
65
|
+
}
|
66
|
+
|
67
|
+
interface ToggleButtonProps {
|
68
|
+
onCollapse: VoidFunction;
|
69
|
+
onExpand: VoidFunction;
|
70
|
+
isCollapsed: boolean;
|
71
|
+
initialDirection?: 'right' | 'left' | 'top' | 'bottom';
|
72
|
+
className?: string;
|
73
|
+
}
|
74
|
+
|
75
|
+
const b = cn('kv-pane-visibility-button');
|
76
|
+
|
77
|
+
export function PaneVisibilityToggleButtons({
|
78
|
+
onCollapse,
|
79
|
+
onExpand,
|
80
|
+
isCollapsed,
|
81
|
+
initialDirection = 'top',
|
82
|
+
className,
|
83
|
+
}: ToggleButtonProps) {
|
84
|
+
return (
|
85
|
+
<React.Fragment>
|
86
|
+
<Button
|
87
|
+
view="flat-secondary"
|
88
|
+
onClick={onCollapse}
|
89
|
+
className={b(
|
90
|
+
{
|
91
|
+
hidden: isCollapsed,
|
92
|
+
},
|
93
|
+
className,
|
94
|
+
)}
|
95
|
+
title="Collapse"
|
96
|
+
>
|
97
|
+
<Icon
|
98
|
+
name="collapse"
|
99
|
+
viewBox="0 0 384 512"
|
100
|
+
width={14}
|
101
|
+
height={14}
|
102
|
+
className={b({[initialDirection]: true})}
|
103
|
+
/>
|
104
|
+
</Button>
|
105
|
+
<Button
|
106
|
+
view="flat-secondary"
|
107
|
+
onClick={onExpand}
|
108
|
+
className={b(
|
109
|
+
{
|
110
|
+
hidden: !isCollapsed,
|
111
|
+
},
|
112
|
+
className,
|
113
|
+
)}
|
114
|
+
title="Expand"
|
115
|
+
>
|
116
|
+
<Icon
|
117
|
+
name="collapse"
|
118
|
+
viewBox="0 0 384 512"
|
119
|
+
width={14}
|
120
|
+
height={14}
|
121
|
+
className={b({[initialDirection]: true}, 'rotate')}
|
122
|
+
/>
|
123
|
+
</Button>
|
124
|
+
</React.Fragment>
|
125
|
+
);
|
126
|
+
}
|
@@ -5,35 +5,30 @@ import {connect} from 'react-redux';
|
|
5
5
|
import _ from 'lodash';
|
6
6
|
|
7
7
|
import DataTable from '@yandex-cloud/react-data-table';
|
8
|
-
import {Loader,
|
8
|
+
import {Loader, TextInput, Button} from '@yandex-cloud/uikit';
|
9
9
|
|
10
10
|
import EntityStatus from '../../components/EntityStatus/EntityStatus';
|
11
11
|
import PoolsGraph from '../../components/PoolsGraph/PoolsGraph';
|
12
12
|
import TabletsStatistic from '../../components/TabletsStatistic/TabletsStatistic';
|
13
13
|
import ProblemFilter, {problemFilterType} from '../../components/ProblemFilter/ProblemFilter';
|
14
|
-
import {AutoFetcher} from '
|
14
|
+
import {AutoFetcher} from '../../utils/autofetcher';
|
15
15
|
|
16
|
-
import routes, {createHref} from '../../routes';
|
17
|
-
import {formatCPU,
|
16
|
+
import routes, {CLUSTER_PAGES, createHref} from '../../routes';
|
17
|
+
import {formatCPU, formatBytesToGigabyte} from '../../utils';
|
18
18
|
import {hideTooltip, showTooltip} from '../../store/reducers/tooltip';
|
19
19
|
import {withSearch} from '../../HOCS';
|
20
|
-
import {ALL} from '../../utils/constants';
|
20
|
+
import {ALL, DEFAULT_TABLE_SETTINGS} from '../../utils/constants';
|
21
21
|
import {getTenantsInfo} from '../../store/reducers/tenants';
|
22
22
|
import {changeFilter} from '../../store/reducers/settings';
|
23
|
+
import {setHeader} from '../../store/reducers/header';
|
24
|
+
|
23
25
|
import {clusterName} from '../../store';
|
24
|
-
import {
|
26
|
+
import {TenantTabsGroups, TENANT_GENERAL_TABS, TENANT_INFO_TABS} from '../Tenant/TenantPages';
|
25
27
|
|
26
28
|
import './Tenants.scss';
|
27
29
|
|
28
30
|
const b = cn('tenants');
|
29
31
|
|
30
|
-
const tableSettings = {
|
31
|
-
displayIndices: false,
|
32
|
-
stickyHead: DataTable.MOVING,
|
33
|
-
syncHeadOnResize: true,
|
34
|
-
dynamicRender: true,
|
35
|
-
};
|
36
|
-
|
37
32
|
class Tenants extends React.Component {
|
38
33
|
static renderLoader() {
|
39
34
|
return (
|
@@ -53,6 +48,7 @@ class Tenants extends React.Component {
|
|
53
48
|
hideTooltip: PropTypes.func,
|
54
49
|
searchQuery: PropTypes.string,
|
55
50
|
handleSearchQuery: PropTypes.func,
|
51
|
+
setHeader: PropTypes.func,
|
56
52
|
filter: problemFilterType,
|
57
53
|
changeFilter: PropTypes.func,
|
58
54
|
cluster: PropTypes.object,
|
@@ -74,42 +70,35 @@ class Tenants extends React.Component {
|
|
74
70
|
});
|
75
71
|
}
|
76
72
|
|
77
|
-
state = {
|
78
|
-
formatValues: false,
|
79
|
-
};
|
80
|
-
|
81
73
|
componentDidMount() {
|
82
74
|
this.autofetcher = new AutoFetcher();
|
83
75
|
this.props.getTenantsInfo(clusterName);
|
84
76
|
this.autofetcher.fetch(() => this.props.getTenantsInfo(clusterName));
|
77
|
+
this.props.setHeader([
|
78
|
+
{
|
79
|
+
text: CLUSTER_PAGES.tenants.title,
|
80
|
+
link: createHref(routes.cluster, {activeTab: CLUSTER_PAGES.tenants.id}),
|
81
|
+
},
|
82
|
+
]);
|
85
83
|
}
|
86
84
|
|
87
85
|
componentWillUnmount() {
|
88
86
|
this.autofetcher.stop();
|
89
87
|
}
|
90
88
|
|
91
|
-
handleFormatChange = () => {
|
92
|
-
this.setState({formatValues: !this.state.formatValues});
|
93
|
-
};
|
94
|
-
|
95
89
|
renderControls() {
|
96
90
|
const {searchQuery, handleSearchQuery, filter, changeFilter} = this.props;
|
97
|
-
const {formatValues} = this.state;
|
98
91
|
|
99
92
|
return (
|
100
93
|
<div className={b('controls')}>
|
101
|
-
<
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
<ProblemFilter value={filter} onChange={changeFilter} />
|
110
|
-
</div>
|
111
|
-
|
112
|
-
<Switch onUpdate={this.handleFormatChange} checked={formatValues} content="raw" />
|
94
|
+
<TextInput
|
95
|
+
className={b('search')}
|
96
|
+
placeholder="Database name"
|
97
|
+
text={searchQuery}
|
98
|
+
onUpdate={handleSearchQuery}
|
99
|
+
hasClear
|
100
|
+
/>
|
101
|
+
<ProblemFilter value={filter} onChange={changeFilter} />
|
113
102
|
</div>
|
114
103
|
);
|
115
104
|
}
|
@@ -131,7 +120,6 @@ class Tenants extends React.Component {
|
|
131
120
|
handleSearchQuery,
|
132
121
|
additionalTenantsInfo = {},
|
133
122
|
} = this.props;
|
134
|
-
const {formatValues} = this.state;
|
135
123
|
|
136
124
|
const filteredTenantsBySearch = tenants.filter(
|
137
125
|
(item) =>
|
@@ -146,25 +134,25 @@ class Tenants extends React.Component {
|
|
146
134
|
name: 'Name',
|
147
135
|
header: 'Database',
|
148
136
|
render: ({value, row}) => {
|
137
|
+
const backend = row.MonitoringEndpoint ?? row.backend;
|
149
138
|
const tenantBackend = additionalTenantsInfo.tenantBackend
|
150
|
-
? additionalTenantsInfo.tenantBackend(
|
139
|
+
? additionalTenantsInfo.tenantBackend(backend)
|
151
140
|
: undefined;
|
141
|
+
const isExternalLink = Boolean(backend);
|
152
142
|
return (
|
153
143
|
<React.Fragment>
|
154
144
|
<EntityStatus
|
155
|
-
externalLink={
|
145
|
+
externalLink={isExternalLink}
|
156
146
|
className={b('name')}
|
157
147
|
name={value || 'unknown database'}
|
158
148
|
status={row.Overall}
|
159
149
|
hasClipboardButton
|
160
|
-
path={createHref(
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
},
|
167
|
-
)}
|
150
|
+
path={createHref(routes.tenant, undefined, {
|
151
|
+
name: value,
|
152
|
+
backend: tenantBackend,
|
153
|
+
[TenantTabsGroups.info]: TENANT_INFO_TABS[0].id,
|
154
|
+
[TenantTabsGroups.general]: TENANT_GENERAL_TABS[0].id,
|
155
|
+
})}
|
168
156
|
/>
|
169
157
|
{additionalTenantsInfo.name && additionalTenantsInfo.name(value, row)}
|
170
158
|
</React.Fragment>
|
@@ -244,8 +232,7 @@ class Tenants extends React.Component {
|
|
244
232
|
const memory = MemoryUsed ?? Metrics.Memory;
|
245
233
|
return isNaN(Number(memory)) ? 0 : Number(memory);
|
246
234
|
},
|
247
|
-
render: ({value}) =>
|
248
|
-
value ? (formatValues ? formatNumber(value) : formatBytes(value)) : '—',
|
235
|
+
render: ({value}) => (value ? formatBytesToGigabyte(value) : '—'),
|
249
236
|
align: DataTable.RIGHT,
|
250
237
|
defaultOrder: DataTable.DESCENDING,
|
251
238
|
},
|
@@ -262,8 +249,7 @@ class Tenants extends React.Component {
|
|
262
249
|
const storage = StorageAllocatedSize ?? Metrics.Storage;
|
263
250
|
return isNaN(Number(storage)) ? 0 : Number(storage);
|
264
251
|
},
|
265
|
-
render: ({value}) =>
|
266
|
-
value ? (formatValues ? formatNumber(value) : formatBytes(value)) : '—',
|
252
|
+
render: ({value}) => (value ? formatBytesToGigabyte(value) : '—'),
|
267
253
|
align: DataTable.RIGHT,
|
268
254
|
defaultOrder: DataTable.DESCENDING,
|
269
255
|
},
|
@@ -298,7 +284,7 @@ class Tenants extends React.Component {
|
|
298
284
|
name: 'Tablets',
|
299
285
|
header: 'Tablets States',
|
300
286
|
sortable: false,
|
301
|
-
width:
|
287
|
+
width: 430,
|
302
288
|
render: ({value, row}) =>
|
303
289
|
value ? (
|
304
290
|
<TabletsStatistic path={row.Name} tablets={value} nodeIds={row.NodeIds} />
|
@@ -308,9 +294,7 @@ class Tenants extends React.Component {
|
|
308
294
|
},
|
309
295
|
];
|
310
296
|
|
311
|
-
if (filteredTenants.length === 0 && filter
|
312
|
-
return <div className="error"> no tenants data</div>;
|
313
|
-
} else if (filteredTenants.length === 0) {
|
297
|
+
if (filteredTenants.length === 0 && filter !== ALL) {
|
314
298
|
return <div className="no-problem" />;
|
315
299
|
}
|
316
300
|
|
@@ -318,11 +302,12 @@ class Tenants extends React.Component {
|
|
318
302
|
<div className={b('table-wrapper')}>
|
319
303
|
<div className={b('table-content')}>
|
320
304
|
<DataTable
|
321
|
-
theme="
|
305
|
+
theme="yandex-cloud"
|
322
306
|
data={filteredTenants}
|
323
307
|
columns={columns}
|
324
|
-
settings={
|
308
|
+
settings={DEFAULT_TABLE_SETTINGS}
|
325
309
|
dynamicRender={true}
|
310
|
+
emptyDataMessage="No such tenants"
|
326
311
|
/>
|
327
312
|
</div>
|
328
313
|
</div>
|
@@ -370,6 +355,7 @@ const mapDispatchToProps = {
|
|
370
355
|
hideTooltip,
|
371
356
|
showTooltip,
|
372
357
|
changeFilter,
|
358
|
+
setHeader,
|
373
359
|
};
|
374
360
|
|
375
361
|
export default withSearch(connect(mapStateToProps, mapDispatchToProps)(Tenants));
|
@@ -1,8 +1,8 @@
|
|
1
1
|
@import '../../styles/mixins.scss';
|
2
2
|
|
3
3
|
.tenants {
|
4
|
-
@include flex-container();
|
5
4
|
overflow: auto;
|
5
|
+
@include flex-container();
|
6
6
|
|
7
7
|
&__format-label {
|
8
8
|
margin-right: 15px;
|
@@ -17,8 +17,7 @@
|
|
17
17
|
}
|
18
18
|
|
19
19
|
&__search {
|
20
|
-
|
21
|
-
margin: 0 15px 0 0;
|
20
|
+
@include search();
|
22
21
|
}
|
23
22
|
|
24
23
|
&__tablets {
|
@@ -30,30 +29,18 @@
|
|
30
29
|
}
|
31
30
|
|
32
31
|
&__controls {
|
33
|
-
|
34
|
-
justify-content: space-between;
|
35
|
-
margin: 17px 0;
|
36
|
-
}
|
37
|
-
|
38
|
-
&__controls-left {
|
39
|
-
display: flex;
|
40
|
-
align-items: center;
|
41
|
-
|
42
|
-
& > * {
|
43
|
-
margin-right: 25px;
|
44
|
-
}
|
32
|
+
@include controls();
|
45
33
|
}
|
46
34
|
|
47
35
|
&__table-wrapper {
|
48
|
-
@include flex-container();
|
49
36
|
overflow: auto;
|
37
|
+
@include flex-container();
|
50
38
|
}
|
51
39
|
|
52
40
|
&__table-content {
|
53
41
|
@include freeze-nth-column(1);
|
54
42
|
|
55
43
|
@include table-styles;
|
56
|
-
@include table-sticky-styles;
|
57
44
|
}
|
58
45
|
|
59
46
|
&__type-value {
|
@@ -1,8 +1,8 @@
|
|
1
1
|
@import '../../styles/mixins.scss';
|
2
2
|
|
3
3
|
.vdisk {
|
4
|
-
@include container-fluid();
|
5
4
|
padding: 20px;
|
5
|
+
@include container-fluid();
|
6
6
|
|
7
7
|
.info-viewer__items {
|
8
8
|
grid-template-columns: max-content;
|
@@ -18,11 +18,12 @@
|
|
18
18
|
}
|
19
19
|
|
20
20
|
&__title {
|
21
|
+
margin-right: 16px;
|
22
|
+
|
21
23
|
font-size: var(--yc-text-body2-font-size);
|
22
|
-
line-height: var(--yc-text-body2-line-height);
|
23
24
|
font-weight: 500;
|
25
|
+
line-height: var(--yc-text-body2-line-height);
|
24
26
|
text-transform: uppercase;
|
25
|
-
margin-right: 16px;
|
26
27
|
}
|
27
28
|
|
28
29
|
&__section {
|
@@ -34,7 +35,8 @@
|
|
34
35
|
}
|
35
36
|
|
36
37
|
&__link {
|
37
|
-
color: var(--yc-color-base-special);
|
38
38
|
text-decoration: none;
|
39
|
+
|
40
|
+
color: var(--yc-color-base-special);
|
39
41
|
}
|
40
42
|
}
|
@@ -11,7 +11,7 @@ import InfoViewer from '../../components/InfoViewer/InfoViewer';
|
|
11
11
|
import EntityStatus from '../../components/EntityStatus/EntityStatus';
|
12
12
|
import ProgressViewer from '../../components/ProgressViewer/ProgressViewer';
|
13
13
|
import PoolsGraph from '../../components/PoolsGraph/PoolsGraph';
|
14
|
-
import {AutoFetcher} from '
|
14
|
+
import {AutoFetcher} from '../../utils/autofetcher';
|
15
15
|
|
16
16
|
import {getVdiskInfo, clearStore as clearStoreVDisk} from '../../store/reducers/vdisk';
|
17
17
|
import {getPdiskInfo, clearStore as clearStorePDisk} from '../../store/reducers/pdisk';
|
@@ -2,10 +2,12 @@
|
|
2
2
|
|
3
3
|
.vdisk-pdisk-node {
|
4
4
|
display: grid;
|
5
|
-
grid-template-columns: repeat(auto-fill, minmax(450px, 1fr));
|
6
5
|
grid-gap: 20px;
|
7
6
|
|
7
|
+
grid-template-columns: repeat(auto-fill, minmax(450px, 1fr));
|
8
|
+
|
8
9
|
padding: 20px;
|
10
|
+
@include container-fluid();
|
9
11
|
|
10
12
|
.info-viewer__items {
|
11
13
|
grid-template-columns: max-content;
|
@@ -25,11 +27,10 @@
|
|
25
27
|
&__title {
|
26
28
|
margin-right: 16px;
|
27
29
|
|
28
|
-
text-transform: uppercase;
|
29
|
-
|
30
30
|
font-size: var(--yc-text-body2-font-size);
|
31
31
|
font-weight: 500;
|
32
32
|
line-height: var(--yc-text-body2-line-height);
|
33
|
+
text-transform: uppercase;
|
33
34
|
}
|
34
35
|
|
35
36
|
&__section {
|
@@ -47,8 +48,8 @@
|
|
47
48
|
}
|
48
49
|
&__loader {
|
49
50
|
display: flex;
|
50
|
-
align-items: center;
|
51
51
|
justify-content: center;
|
52
|
+
align-items: center;
|
52
53
|
|
53
54
|
width: 100%;
|
54
55
|
margin-top: 50px;
|
@@ -56,5 +57,4 @@
|
|
56
57
|
.info-viewer__row {
|
57
58
|
align-items: flex-end;
|
58
59
|
}
|
59
|
-
@include container-fluid();
|
60
60
|
}
|
@@ -1,13 +1,12 @@
|
|
1
1
|
import qs from 'qs';
|
2
2
|
import {compile} from 'path-to-regexp';
|
3
3
|
import isEmpty from 'lodash/isEmpty';
|
4
|
+
//@ts-ignore
|
4
5
|
import {backend, clusterName, webVersion} from './store';
|
5
6
|
|
6
7
|
const routes = {
|
7
|
-
viewer: '/viewer',
|
8
8
|
cluster: '/cluster/:activeTab?',
|
9
|
-
tenant: '/tenant
|
10
|
-
tenantInfo: '/tenantInfo',
|
9
|
+
tenant: '/tenant',
|
11
10
|
node: '/node/:id/:activeTab?',
|
12
11
|
pdisk: '/pdisk/:id',
|
13
12
|
group: '/group/:id',
|
@@ -19,7 +18,18 @@ const routes = {
|
|
19
18
|
clusterPage: '/clusters/:name',
|
20
19
|
};
|
21
20
|
|
22
|
-
export
|
21
|
+
export const CLUSTER_PAGES = {
|
22
|
+
tenants: {id: 'tenants', name: 'Databases', title: 'Database list'},
|
23
|
+
nodes: {id: 'nodes', name: 'Nodes', title: 'Nodes'},
|
24
|
+
storage: {id: 'storage', name: 'Storage', title: 'Storage'},
|
25
|
+
cluster: {id: 'cluster', name: 'Cluster', title: 'Cluster'},
|
26
|
+
};
|
27
|
+
|
28
|
+
export function createHref(
|
29
|
+
route: string,
|
30
|
+
params?: object,
|
31
|
+
query: Record<string | number, string | number> = {},
|
32
|
+
) {
|
23
33
|
let extendedQuery = query;
|
24
34
|
|
25
35
|
const isBackendInQuery = Boolean(query.backend);
|
@@ -1,5 +1,9 @@
|
|
1
1
|
import {createRequestActionTypes, createApiRequest} from '../utils';
|
2
2
|
import '../../services/api';
|
3
|
+
import {getValueFromLS, parseJson} from '../../utils/utils';
|
4
|
+
import {QUERIES_HISTORY_KEY} from '../../utils/constants';
|
5
|
+
|
6
|
+
const MAXIMUM_QUERIES_IN_HISTORY = 20;
|
3
7
|
|
4
8
|
const SEND_QUERY = createRequestActionTypes('query', 'SEND_QUERY');
|
5
9
|
const CHANGE_USER_INPUT = 'query/CHANGE_USER_INPUT';
|
@@ -7,20 +11,33 @@ const SAVE_QUERY_TO_HISTORY = 'query/SAVE_QUERY_TO_HISTORY';
|
|
7
11
|
const GO_TO_PREVIOUS_QUERY = 'query/GO_TO_PREVIOUS_QUERY';
|
8
12
|
const GO_TO_NEXT_QUERY = 'query/GO_TO_NEXT_QUERY';
|
9
13
|
const SELECT_RUN_ACTION = 'query/SELECT_RUN_ACTION';
|
14
|
+
const MONACO_HOT_KEY = 'query/MONACO_HOT_KEY';
|
15
|
+
|
16
|
+
const queriesHistoryInitial = parseJson(getValueFromLS(QUERIES_HISTORY_KEY, []));
|
17
|
+
|
18
|
+
const sliceLimit = queriesHistoryInitial.length - MAXIMUM_QUERIES_IN_HISTORY;
|
10
19
|
|
11
20
|
export const RUN_ACTIONS_VALUES = {
|
12
21
|
script: 'execute-script',
|
13
22
|
scan: 'execute-scan',
|
14
23
|
};
|
15
24
|
|
25
|
+
export const MONACO_HOT_KEY_ACTIONS = {
|
26
|
+
sendQuery: 'sendQuery',
|
27
|
+
goPrev: 'goPrev',
|
28
|
+
goNext: 'goNext',
|
29
|
+
getExplain: 'getExplain',
|
30
|
+
};
|
31
|
+
|
16
32
|
const initialState = {
|
17
33
|
loading: false,
|
18
34
|
input: '',
|
19
35
|
history: {
|
20
|
-
queries:
|
36
|
+
queries: queriesHistoryInitial.slice(sliceLimit < 0 ? 0 : sliceLimit),
|
21
37
|
currentIndex: -1,
|
22
38
|
},
|
23
39
|
runAction: RUN_ACTIONS_VALUES.script,
|
40
|
+
monacoHotKey: null,
|
24
41
|
};
|
25
42
|
|
26
43
|
const executeQuery = (state = initialState, action) => {
|
@@ -67,7 +84,10 @@ const executeQuery = (state = initialState, action) => {
|
|
67
84
|
|
68
85
|
case SAVE_QUERY_TO_HISTORY: {
|
69
86
|
const query = action.data;
|
70
|
-
const newQueries = [...state.history.queries, query]
|
87
|
+
const newQueries = [...state.history.queries, query].slice(
|
88
|
+
state.history.queries.length >= MAXIMUM_QUERIES_IN_HISTORY ? 1 : 0,
|
89
|
+
);
|
90
|
+
window.localStorage.setItem(QUERIES_HISTORY_KEY, JSON.stringify(newQueries));
|
71
91
|
const currentIndex = newQueries.length - 1;
|
72
92
|
|
73
93
|
return {
|
@@ -104,6 +124,13 @@ const executeQuery = (state = initialState, action) => {
|
|
104
124
|
};
|
105
125
|
}
|
106
126
|
|
127
|
+
case MONACO_HOT_KEY: {
|
128
|
+
return {
|
129
|
+
...state,
|
130
|
+
monacoHotKey: action.data,
|
131
|
+
};
|
132
|
+
}
|
133
|
+
|
107
134
|
default:
|
108
135
|
return state;
|
109
136
|
}
|
@@ -155,4 +182,11 @@ export const changeUserInput = ({input}) => {
|
|
155
182
|
};
|
156
183
|
};
|
157
184
|
|
185
|
+
export const setMonacoHotKey = (value) => {
|
186
|
+
return {
|
187
|
+
type: MONACO_HOT_KEY,
|
188
|
+
data: value,
|
189
|
+
};
|
190
|
+
};
|
191
|
+
|
158
192
|
export default executeQuery;
|
@@ -0,0 +1,31 @@
|
|
1
|
+
const ENABLE_FULLSCREEN_MODE = 'ENABLE_FULLSCREEN_MODE';
|
2
|
+
const DISABLE_FULLSCREEN_MODE = 'DISABLE_FULLSCREEN_MODE';
|
3
|
+
|
4
|
+
const initialState = false;
|
5
|
+
|
6
|
+
const fullscreen = function (
|
7
|
+
state = initialState,
|
8
|
+
action: ReturnType<typeof enableFullscreen> | ReturnType<typeof disableFullscreen>,
|
9
|
+
) {
|
10
|
+
switch (action.type) {
|
11
|
+
case DISABLE_FULLSCREEN_MODE:
|
12
|
+
return false;
|
13
|
+
case ENABLE_FULLSCREEN_MODE:
|
14
|
+
return true;
|
15
|
+
default:
|
16
|
+
return state;
|
17
|
+
}
|
18
|
+
};
|
19
|
+
|
20
|
+
export function enableFullscreen() {
|
21
|
+
return {
|
22
|
+
type: ENABLE_FULLSCREEN_MODE,
|
23
|
+
} as const;
|
24
|
+
}
|
25
|
+
export function disableFullscreen() {
|
26
|
+
return {
|
27
|
+
type: DISABLE_FULLSCREEN_MODE,
|
28
|
+
} as const;
|
29
|
+
}
|
30
|
+
|
31
|
+
export default fullscreen;
|
@@ -0,0 +1,23 @@
|
|
1
|
+
const SET_HEADER = 'SET_HEADER';
|
2
|
+
|
3
|
+
export type HeaderItemType = {text: string; link: string};
|
4
|
+
|
5
|
+
const initialState: HeaderItemType[] = [];
|
6
|
+
|
7
|
+
const header = function (state = initialState, action: ReturnType<typeof setHeader>) {
|
8
|
+
switch (action.type) {
|
9
|
+
case SET_HEADER:
|
10
|
+
return action.data;
|
11
|
+
default:
|
12
|
+
return state;
|
13
|
+
}
|
14
|
+
};
|
15
|
+
|
16
|
+
export function setHeader(headerItems: HeaderItemType[]) {
|
17
|
+
return {
|
18
|
+
type: SET_HEADER,
|
19
|
+
data: headerItems,
|
20
|
+
} as const;
|
21
|
+
}
|
22
|
+
|
23
|
+
export default header;
|
@@ -2,7 +2,7 @@ import {createRequestActionTypes, createApiRequest} from '../utils';
|
|
2
2
|
import '../../services/api';
|
3
3
|
|
4
4
|
const FETCH_HOT_KEYS = createRequestActionTypes('hot_keys', 'FETCH_HOT_KEYS');
|
5
|
-
const SET_HOT_KEYS_OPTIONS =
|
5
|
+
const SET_HOT_KEYS_OPTIONS = 'hot_keys/SET_HOT_KEYS_OPTIONS';
|
6
6
|
|
7
7
|
const initialState = {loading: true, data: {}, wasLoaded: false};
|
8
8
|
|