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
@@ -5,65 +5,66 @@ import _ from 'lodash';
|
|
5
5
|
import {connect} from 'react-redux';
|
6
6
|
import {Loader} from '@yandex-cloud/uikit';
|
7
7
|
import DataTable from '@yandex-cloud/react-data-table';
|
8
|
+
import {DEFAULT_TABLE_SETTINGS} from '../../../utils/constants';
|
8
9
|
|
9
10
|
import './Acl.scss';
|
10
11
|
|
11
12
|
const b = cn('kv-acl');
|
12
13
|
|
13
|
-
const TABLE_SETTINGS = {
|
14
|
-
displayIndices: false,
|
15
|
-
syncHeadOnResize: true,
|
16
|
-
stickyHead: DataTable.MOVING,
|
17
|
-
};
|
18
14
|
const COLUMN_WIDTH = 140;
|
19
|
-
const COLUMNS = [
|
20
|
-
{
|
21
|
-
name: 'AccessType',
|
22
|
-
header: 'Access Type',
|
23
|
-
sortable: false,
|
24
|
-
width: COLUMN_WIDTH,
|
25
|
-
},
|
26
|
-
{
|
27
|
-
name: 'AccessRights',
|
28
|
-
header: 'Access Rights',
|
29
|
-
render: ({value}) => {
|
30
|
-
return _.map(value, (item, index) => {
|
31
|
-
return <div key={index}>{item}</div>;
|
32
|
-
});
|
33
|
-
},
|
34
|
-
width: COLUMN_WIDTH,
|
35
|
-
sortable: false,
|
36
|
-
},
|
37
|
-
{
|
38
|
-
name: 'Subject',
|
39
|
-
sortable: false,
|
40
|
-
// eslint-disable-next-line react/display-name
|
41
|
-
render: ({value}) => {
|
42
|
-
return Acl.prepareLogin(value);
|
43
|
-
},
|
44
|
-
width: COLUMN_WIDTH,
|
45
|
-
},
|
46
|
-
{
|
47
|
-
name: 'InheritanceType',
|
48
|
-
header: 'Inheritance Type',
|
49
|
-
render: ({value}) => {
|
50
|
-
return _.map(value, (item, index) => {
|
51
|
-
return <div key={index}>{item}</div>;
|
52
|
-
});
|
53
|
-
},
|
54
|
-
width: COLUMN_WIDTH,
|
55
|
-
sortable: false,
|
56
|
-
},
|
57
|
-
];
|
58
15
|
|
59
16
|
class Acl extends React.Component {
|
60
17
|
static propTypes = {
|
61
18
|
error: PropTypes.string,
|
62
19
|
acl: PropTypes.array,
|
63
20
|
loading: PropTypes.bool,
|
21
|
+
additionalTenantInfo: PropTypes.object,
|
64
22
|
};
|
65
23
|
|
66
|
-
|
24
|
+
COLUMNS = [
|
25
|
+
{
|
26
|
+
name: 'AccessType',
|
27
|
+
header: 'Access Type',
|
28
|
+
sortable: false,
|
29
|
+
width: COLUMN_WIDTH,
|
30
|
+
},
|
31
|
+
{
|
32
|
+
name: 'AccessRights',
|
33
|
+
header: 'Access Rights',
|
34
|
+
render: ({value}) => {
|
35
|
+
return _.map(value, (item, index) => {
|
36
|
+
return <div key={index}>{item}</div>;
|
37
|
+
});
|
38
|
+
},
|
39
|
+
width: COLUMN_WIDTH,
|
40
|
+
sortable: false,
|
41
|
+
},
|
42
|
+
{
|
43
|
+
name: 'Subject',
|
44
|
+
sortable: false,
|
45
|
+
// eslint-disable-next-line react/display-name
|
46
|
+
render: ({value}) => {
|
47
|
+
return this.prepareLogin(value);
|
48
|
+
},
|
49
|
+
width: COLUMN_WIDTH,
|
50
|
+
},
|
51
|
+
{
|
52
|
+
name: 'InheritanceType',
|
53
|
+
header: 'Inheritance Type',
|
54
|
+
render: ({value}) => {
|
55
|
+
return _.map(value, (item, index) => {
|
56
|
+
return <div key={index}>{item}</div>;
|
57
|
+
});
|
58
|
+
},
|
59
|
+
width: COLUMN_WIDTH,
|
60
|
+
sortable: false,
|
61
|
+
},
|
62
|
+
];
|
63
|
+
|
64
|
+
prepareLogin = (value) => {
|
65
|
+
if (this.props.prepareLogin) {
|
66
|
+
return this.props.additionalTenantInfo?.prepareLogin(value);
|
67
|
+
}
|
67
68
|
if (value && value.endsWith('@staff') && !value.startsWith('svc_')) {
|
68
69
|
const login = value.split('@')[0];
|
69
70
|
return login;
|
@@ -79,7 +80,13 @@ class Acl extends React.Component {
|
|
79
80
|
return null;
|
80
81
|
}
|
81
82
|
|
82
|
-
return
|
83
|
+
return (
|
84
|
+
<DataTable
|
85
|
+
columns={this.COLUMNS}
|
86
|
+
data={acl}
|
87
|
+
settings={{...DEFAULT_TABLE_SETTINGS, stickyTop: 36}}
|
88
|
+
/>
|
89
|
+
);
|
83
90
|
};
|
84
91
|
|
85
92
|
renderOwner = () => {
|
@@ -92,7 +99,7 @@ class Acl extends React.Component {
|
|
92
99
|
return (
|
93
100
|
<div className={b('owner-container')}>
|
94
101
|
<span className={b('owner-label')}>Owner: </span>
|
95
|
-
{
|
102
|
+
{this.prepareLogin(owner)}
|
96
103
|
</div>
|
97
104
|
);
|
98
105
|
};
|
@@ -1,22 +1,32 @@
|
|
1
1
|
@import '../../../styles/mixins.scss';
|
2
2
|
|
3
3
|
.kv-acl {
|
4
|
+
display: flex;
|
5
|
+
overflow: auto;
|
6
|
+
flex-grow: 1;
|
7
|
+
|
8
|
+
padding: 0 12px 16px;
|
9
|
+
@include query-data-table;
|
4
10
|
&__message-container {
|
5
|
-
padding:
|
11
|
+
padding: 0 12px 16px;
|
6
12
|
}
|
7
13
|
|
8
14
|
&__loader-container {
|
9
15
|
display: flex;
|
10
16
|
justify-content: center;
|
11
17
|
align-items: center;
|
18
|
+
|
12
19
|
height: 100%;
|
13
20
|
}
|
14
21
|
|
15
|
-
@include query-data-table;
|
16
|
-
|
17
22
|
&__owner-container {
|
18
|
-
|
23
|
+
position: sticky;
|
24
|
+
z-index: 2;
|
25
|
+
top: 0;
|
26
|
+
|
27
|
+
padding-bottom: 16px;
|
19
28
|
|
29
|
+
background-color: var(--yc-color-base-background);
|
20
30
|
.yc-staff-card {
|
21
31
|
display: inline-block;
|
22
32
|
}
|
@@ -25,6 +35,7 @@
|
|
25
35
|
&__text {
|
26
36
|
font-size: var(--yc-text-body-font-size);
|
27
37
|
line-height: var(--yc-text-body-line-height);
|
38
|
+
|
28
39
|
color: var(--yc-color-text-primary);
|
29
40
|
|
30
41
|
&::first-letter {
|
@@ -7,14 +7,14 @@ import qs from 'qs';
|
|
7
7
|
|
8
8
|
import {Loader} from '@yandex-cloud/uikit';
|
9
9
|
|
10
|
-
import NodesViewer from '
|
10
|
+
import NodesViewer from '../../../../components/NodesViewer/NodesViewer';
|
11
11
|
|
12
|
-
import {backend} from '
|
13
|
-
import {hideTooltip, showTooltip} from '
|
14
|
-
import {getNodes, clearNodes} from '
|
15
|
-
import {AUTO_RELOAD_INTERVAL} from '../../../utils/constants';
|
12
|
+
import {backend} from '../../../../store';
|
13
|
+
import {hideTooltip, showTooltip} from '../../../../store/reducers/tooltip';
|
14
|
+
import {getNodes, clearNodes} from '../../../../store/reducers/nodes';
|
16
15
|
|
17
16
|
import './Compute.scss';
|
17
|
+
import {AutoFetcher} from '../../../../utils/autofetcher';
|
18
18
|
|
19
19
|
const b = cn('compute');
|
20
20
|
|
@@ -25,6 +25,7 @@ class Compute extends React.Component {
|
|
25
25
|
tenantName: PropTypes.string,
|
26
26
|
nodes: PropTypes.object,
|
27
27
|
loading: PropTypes.bool,
|
28
|
+
autorefresh: PropTypes.bool,
|
28
29
|
error: PropTypes.object,
|
29
30
|
wasLoaded: PropTypes.bool,
|
30
31
|
getNodes: PropTypes.func,
|
@@ -33,30 +34,50 @@ class Compute extends React.Component {
|
|
33
34
|
timeoutForRequest: PropTypes.number,
|
34
35
|
};
|
35
36
|
|
37
|
+
autofetcher;
|
38
|
+
|
36
39
|
componentDidMount() {
|
37
|
-
const {getNodes, tenantName} = this.props;
|
40
|
+
const {getNodes, tenantName, autorefresh} = this.props;
|
41
|
+
|
42
|
+
this.autofetcher = new AutoFetcher();
|
38
43
|
|
39
44
|
if (tenantName) {
|
40
45
|
getNodes(tenantName);
|
41
|
-
|
46
|
+
if (autorefresh) {
|
47
|
+
this.autofetcher.start();
|
48
|
+
this.autofetcher.fetch(() => getNodes(tenantName));
|
49
|
+
}
|
50
|
+
}
|
51
|
+
}
|
52
|
+
|
53
|
+
componentDidUpdate(prevProps) {
|
54
|
+
const {autorefresh, getNodes, tenantName} = this.props;
|
55
|
+
|
56
|
+
if (autorefresh && !prevProps.autorefresh) {
|
57
|
+
getNodes(tenantName);
|
58
|
+
this.autofetcher.start();
|
59
|
+
this.autofetcher.fetch(() => getNodes(tenantName));
|
60
|
+
}
|
61
|
+
if (!autorefresh && prevProps.autorefresh) {
|
62
|
+
this.autofetcher.stop();
|
42
63
|
}
|
43
64
|
}
|
44
65
|
|
45
66
|
componentWillUnmount() {
|
46
67
|
this.props.clearNodes();
|
47
|
-
|
68
|
+
this.autofetcher.stop();
|
48
69
|
}
|
49
70
|
|
50
71
|
renderLoader() {
|
51
72
|
return (
|
52
|
-
<div className=
|
53
|
-
<Loader size="
|
73
|
+
<div className={b('loader')}>
|
74
|
+
<Loader size="m" />
|
54
75
|
</div>
|
55
76
|
);
|
56
77
|
}
|
57
78
|
|
58
79
|
render() {
|
59
|
-
const {nodes,
|
80
|
+
const {nodes, error, tenantName, wasLoaded, loading} = this.props;
|
60
81
|
if (!tenantName) {
|
61
82
|
return <div className="error">no tenant name in the query string</div>;
|
62
83
|
} else if (loading && !wasLoaded) {
|
@@ -82,12 +103,13 @@ class Compute extends React.Component {
|
|
82
103
|
|
83
104
|
function mapStateToProps(state, ownProps) {
|
84
105
|
const {data, loading, wasLoaded, error, timeoutForRequest} = state.nodes;
|
106
|
+
const {autorefresh} = state.schema;
|
85
107
|
const {search} = ownProps.location;
|
86
108
|
const queryParams = qs.parse(search, {
|
87
109
|
ignoreQueryPrefix: true,
|
88
110
|
});
|
89
111
|
const {name: tenantName} = queryParams;
|
90
|
-
const nodes = (data && data.Tenants && data.Tenants[0] && data.Tenants[0].Nodes) ||
|
112
|
+
const nodes = (data && data.Tenants && data.Tenants[0] && data.Tenants[0].Nodes) || [];
|
91
113
|
return {
|
92
114
|
nodes,
|
93
115
|
tenantName,
|
@@ -95,6 +117,7 @@ function mapStateToProps(state, ownProps) {
|
|
95
117
|
loading,
|
96
118
|
wasLoaded,
|
97
119
|
error,
|
120
|
+
autorefresh,
|
98
121
|
};
|
99
122
|
}
|
100
123
|
|
@@ -5,8 +5,11 @@ import {connect} from 'react-redux';
|
|
5
5
|
import {Loader} from '@yandex-cloud/uikit';
|
6
6
|
import JSONTree from 'react-json-inspector';
|
7
7
|
|
8
|
+
import {getDescribe} from '../../../../store/reducers/describe';
|
9
|
+
|
8
10
|
import './Describe.scss';
|
9
11
|
import 'react-json-inspector/json-inspector.css';
|
12
|
+
import {AutoFetcher} from '../../../../utils/autofetcher';
|
10
13
|
|
11
14
|
const b = cn('kv-describe');
|
12
15
|
|
@@ -17,8 +20,47 @@ class Describe extends React.Component {
|
|
17
20
|
error: PropTypes.string,
|
18
21
|
data: PropTypes.array,
|
19
22
|
loading: PropTypes.bool,
|
23
|
+
wasLoaded: PropTypes.bool,
|
24
|
+
autorefresh: PropTypes.bool,
|
25
|
+
tenant: PropTypes.string,
|
20
26
|
};
|
21
27
|
|
28
|
+
autofetcher;
|
29
|
+
|
30
|
+
componentDidMount() {
|
31
|
+
const {autorefresh} = this.props;
|
32
|
+
this.autofetcher = new AutoFetcher();
|
33
|
+
this.fetchData();
|
34
|
+
if (autorefresh) {
|
35
|
+
this.autofetcher.start();
|
36
|
+
this.autofetcher.fetch(() => this.fetchData);
|
37
|
+
}
|
38
|
+
}
|
39
|
+
|
40
|
+
componentDidUpdate(prevProps) {
|
41
|
+
const {autorefresh} = this.props;
|
42
|
+
|
43
|
+
if (autorefresh && !prevProps.autorefresh) {
|
44
|
+
this.fetchData();
|
45
|
+
this.autofetcher.stop();
|
46
|
+
this.autofetcher.start();
|
47
|
+
this.autofetcher.fetch(() => this.fetchData());
|
48
|
+
}
|
49
|
+
if (!autorefresh && prevProps.autorefresh) {
|
50
|
+
this.autofetcher.stop();
|
51
|
+
}
|
52
|
+
}
|
53
|
+
|
54
|
+
componentWillUnmount() {
|
55
|
+
this.autofetcher.stop();
|
56
|
+
}
|
57
|
+
|
58
|
+
fetchData() {
|
59
|
+
const {getDescribe, tenant, currentSchemaPath} = this.props;
|
60
|
+
const path = currentSchemaPath || tenant;
|
61
|
+
getDescribe({path});
|
62
|
+
}
|
63
|
+
|
22
64
|
renderDescribeJson = () => {
|
23
65
|
const {data} = this.props;
|
24
66
|
|
@@ -69,13 +111,20 @@ class Describe extends React.Component {
|
|
69
111
|
|
70
112
|
const mapStateToProps = (state) => {
|
71
113
|
const {loading, error, currentDescribe, wasLoaded} = state.describe;
|
114
|
+
const {autorefresh, currentSchemaPath} = state.schema;
|
72
115
|
|
73
116
|
return {
|
74
117
|
data: currentDescribe,
|
75
118
|
loading,
|
76
119
|
error,
|
77
120
|
wasLoaded,
|
121
|
+
autorefresh,
|
122
|
+
currentSchemaPath,
|
78
123
|
};
|
79
124
|
};
|
80
125
|
|
81
|
-
|
126
|
+
const mapDispatchToProps = {
|
127
|
+
getDescribe,
|
128
|
+
};
|
129
|
+
|
130
|
+
export default connect(mapStateToProps, mapDispatchToProps)(Describe);
|
@@ -1,4 +1,4 @@
|
|
1
|
-
@import '
|
1
|
+
@import '../../../../styles/mixins.scss';
|
2
2
|
|
3
3
|
.kv-describe {
|
4
4
|
&__message-container {
|
@@ -6,16 +6,18 @@
|
|
6
6
|
}
|
7
7
|
|
8
8
|
&__result {
|
9
|
-
padding: 10px 20px 20px 0;
|
10
9
|
display: flex;
|
11
|
-
flex: 0 0 auto;
|
12
10
|
overflow: auto;
|
11
|
+
flex: 0 0 auto;
|
12
|
+
|
13
|
+
padding: 10px 20px 20px 0;
|
13
14
|
}
|
14
15
|
|
15
16
|
&__loader-container {
|
16
17
|
display: flex;
|
17
18
|
justify-content: center;
|
18
19
|
align-items: center;
|
20
|
+
|
19
21
|
height: 100%;
|
20
22
|
}
|
21
23
|
|
@@ -0,0 +1,27 @@
|
|
1
|
+
.kv-detailed-overview {
|
2
|
+
display: flex;
|
3
|
+
gap: 10px;
|
4
|
+
&__section {
|
5
|
+
display: flex;
|
6
|
+
flex: 0 0 50%;
|
7
|
+
flex-direction: column;
|
8
|
+
}
|
9
|
+
|
10
|
+
&__modal {
|
11
|
+
& .yc-modal__content {
|
12
|
+
position: relative;
|
13
|
+
}
|
14
|
+
}
|
15
|
+
|
16
|
+
&__close-modal-button {
|
17
|
+
position: absolute;
|
18
|
+
top: 10px;
|
19
|
+
right: 10px;
|
20
|
+
|
21
|
+
& .yc-button__text {
|
22
|
+
display: flex;
|
23
|
+
|
24
|
+
margin: 0 4px;
|
25
|
+
}
|
26
|
+
}
|
27
|
+
}
|
@@ -0,0 +1,88 @@
|
|
1
|
+
import React, {useState} from 'react';
|
2
|
+
import {useSelector} from 'react-redux';
|
3
|
+
import cn from 'bem-cn-lite';
|
4
|
+
|
5
|
+
import {Button, Modal} from '@yandex-cloud/uikit';
|
6
|
+
//@ts-ignore
|
7
|
+
import Icon from '../../../../components/Icon/Icon';
|
8
|
+
import Overview from '../Overview/Overview';
|
9
|
+
//@ts-ignore
|
10
|
+
import Healthcheck from '../Healthcheck/Healthcheck';
|
11
|
+
//@ts-ignore
|
12
|
+
import TenantOverview from '../TenantOverview/TenantOverview';
|
13
|
+
|
14
|
+
import './DetailedOverview.scss';
|
15
|
+
|
16
|
+
interface DetailedOverviewProps {
|
17
|
+
type: string;
|
18
|
+
className?: string;
|
19
|
+
tenantName: string;
|
20
|
+
additionalTenantInfo?: any;
|
21
|
+
}
|
22
|
+
|
23
|
+
const b = cn('kv-detailed-overview');
|
24
|
+
|
25
|
+
function DetailedOverview(props: DetailedOverviewProps) {
|
26
|
+
const [isModalVisible, setIsModalVisible] = useState(false);
|
27
|
+
|
28
|
+
const {
|
29
|
+
currentSchemaPath,
|
30
|
+
} = useSelector((state: any) => state.schema);
|
31
|
+
|
32
|
+
const openModalHandler = () => {
|
33
|
+
setIsModalVisible(true);
|
34
|
+
};
|
35
|
+
|
36
|
+
const closeModalHandler = () => {
|
37
|
+
setIsModalVisible(false);
|
38
|
+
};
|
39
|
+
|
40
|
+
const renderModal = () => {
|
41
|
+
return (
|
42
|
+
<Modal open={isModalVisible} onClose={closeModalHandler} className={b('modal')}>
|
43
|
+
<Healthcheck tenant={props.tenantName} />
|
44
|
+
<Button
|
45
|
+
className={b('close-modal-button')}
|
46
|
+
onClick={closeModalHandler}
|
47
|
+
view="flat-secondary"
|
48
|
+
title='Close'
|
49
|
+
>
|
50
|
+
<Icon name="close" viewBox={'0 0 16 16 '} height={20} width={20} />
|
51
|
+
</Button>
|
52
|
+
</Modal>
|
53
|
+
);
|
54
|
+
};
|
55
|
+
|
56
|
+
const renderContent = () => {
|
57
|
+
const {type, tenantName, additionalTenantInfo} = props;
|
58
|
+
const isTenant = tenantName === currentSchemaPath;
|
59
|
+
return (
|
60
|
+
<div className={b()}>
|
61
|
+
<div className={b('section')}>
|
62
|
+
{!isTenant && (
|
63
|
+
<Overview type={type} tenantName={tenantName} />
|
64
|
+
)}
|
65
|
+
{isTenant && <TenantOverview tenantName={tenantName} additionalTenantInfo={additionalTenantInfo}/>}
|
66
|
+
</div>
|
67
|
+
{isTenant && (
|
68
|
+
<div className={b('section')}>
|
69
|
+
<Healthcheck
|
70
|
+
tenant={tenantName}
|
71
|
+
preview={true}
|
72
|
+
showMoreHandler={openModalHandler}
|
73
|
+
/>
|
74
|
+
</div>
|
75
|
+
)}
|
76
|
+
</div>
|
77
|
+
);
|
78
|
+
};
|
79
|
+
|
80
|
+
return (
|
81
|
+
<React.Fragment>
|
82
|
+
{renderContent()}
|
83
|
+
{renderModal()}
|
84
|
+
</React.Fragment>
|
85
|
+
);
|
86
|
+
}
|
87
|
+
|
88
|
+
export default DetailedOverview;
|
@@ -0,0 +1,50 @@
|
|
1
|
+
.kv-tenant-diagnostics {
|
2
|
+
overflow: hidden;
|
3
|
+
|
4
|
+
height: 100%;
|
5
|
+
&__header-wrapper {
|
6
|
+
position: sticky;
|
7
|
+
z-index: 2;
|
8
|
+
top: 0;
|
9
|
+
left: 0;
|
10
|
+
|
11
|
+
padding: 13px 20px 16px;
|
12
|
+
|
13
|
+
background-color: var(--yc-color-base-background);
|
14
|
+
}
|
15
|
+
|
16
|
+
&__tabs {
|
17
|
+
display: flex;
|
18
|
+
justify-content: space-between;
|
19
|
+
align-items: center;
|
20
|
+
|
21
|
+
box-shadow: inset 0 -1px 0 0 var(--yc-color-line-generic);
|
22
|
+
& .yc-tabs_direction_horizontal {
|
23
|
+
box-shadow: unset;
|
24
|
+
}
|
25
|
+
}
|
26
|
+
|
27
|
+
&__tab {
|
28
|
+
margin-right: 40px;
|
29
|
+
|
30
|
+
text-decoration: none;
|
31
|
+
|
32
|
+
&:first-letter {
|
33
|
+
text-transform: uppercase;
|
34
|
+
}
|
35
|
+
}
|
36
|
+
|
37
|
+
&__page-wrapper {
|
38
|
+
overflow: auto;
|
39
|
+
|
40
|
+
width: 100%;
|
41
|
+
height: calc(100% - 69px);
|
42
|
+
padding: 0 20px;
|
43
|
+
|
44
|
+
& .global-storage {
|
45
|
+
height: calc(100% + 16px);
|
46
|
+
max-height: calc(100% + 16px);
|
47
|
+
margin-top: -16px;
|
48
|
+
}
|
49
|
+
}
|
50
|
+
}
|