ydb-embedded-ui 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.md +8 -0
- package/README.md +28 -0
- package/dist/HOCS/WithSearch/WithSearch.js +26 -0
- package/dist/HOCS/index.js +1 -0
- package/dist/assets/icons/bug.svg +1 -0
- package/dist/assets/icons/close.svg +1 -0
- package/dist/assets/icons/control-menu-button.svg +1 -0
- package/dist/assets/icons/databases.svg +3 -0
- package/dist/assets/icons/dots.svg +1 -0
- package/dist/assets/icons/server.svg +1 -0
- package/dist/assets/icons/settings-with-dot.svg +1 -0
- package/dist/assets/icons/settings.svg +1 -0
- package/dist/assets/icons/signIn.svg +1 -0
- package/dist/assets/icons/signOut.svg +1 -0
- package/dist/assets/icons/star.svg +1 -0
- package/dist/assets/icons/storage.svg +1 -0
- package/dist/assets/icons/support.svg +1 -0
- package/dist/assets/icons/user-check.svg +1 -0
- package/dist/assets/icons/user-secret.svg +1 -0
- package/dist/assets/icons/ydb.svg +4 -0
- package/dist/components/AsideNavigation/AsideHeader.scss +148 -0
- package/dist/components/AsideNavigation/AsideHeader.tsx +388 -0
- package/dist/components/AsideNavigation/AsideHeaderFooterItem/AsideHeaderFooterItem.scss +82 -0
- package/dist/components/AsideNavigation/AsideHeaderFooterItem/AsideHeaderFooterItem.tsx +138 -0
- package/dist/components/AsideNavigation/AsideHeaderFooterSlot/AsideHeaderFooterSlot.tsx +33 -0
- package/dist/components/AsideNavigation/AsideHeaderFooterSlot/SlotsContext.tsx +49 -0
- package/dist/components/AsideNavigation/AsideHeaderTooltip/AsideHeaderTooltip.scss +16 -0
- package/dist/components/AsideNavigation/AsideHeaderTooltip/AsideHeaderTooltip.tsx +37 -0
- package/dist/components/AsideNavigation/CompositeBar/CompositeBar.scss +108 -0
- package/dist/components/AsideNavigation/CompositeBar/CompositeBar.tsx +282 -0
- package/dist/components/AsideNavigation/Content/Content.tsx +35 -0
- package/dist/components/AsideNavigation/Drawer/Drawer.scss +76 -0
- package/dist/components/AsideNavigation/Drawer/Drawer.tsx +134 -0
- package/dist/components/AsideNavigation/Drawer/index.ts +1 -0
- package/dist/components/AsideNavigation/Logo/Logo.scss +44 -0
- package/dist/components/AsideNavigation/Logo/Logo.tsx +82 -0
- package/dist/components/AsideNavigation/Settings/README.md +92 -0
- package/dist/components/AsideNavigation/Settings/Settings.scss +113 -0
- package/dist/components/AsideNavigation/Settings/Settings.tsx +270 -0
- package/dist/components/AsideNavigation/Settings/SettingsMenu/SettingsMenu.scss +70 -0
- package/dist/components/AsideNavigation/Settings/SettingsMenu/SettingsMenu.tsx +141 -0
- package/dist/components/AsideNavigation/Settings/SettingsSearch/SettingsSearch.tsx +57 -0
- package/dist/components/AsideNavigation/Settings/collect-settings.ts +156 -0
- package/dist/components/AsideNavigation/Settings/filter-settings.ts +38 -0
- package/dist/components/AsideNavigation/Settings/helpers.ts +39 -0
- package/dist/components/AsideNavigation/Settings/i18n/en.json +5 -0
- package/dist/components/AsideNavigation/Settings/i18n/index.ts +11 -0
- package/dist/components/AsideNavigation/Settings/i18n/ru.json +5 -0
- package/dist/components/AsideNavigation/Settings/index.ts +1 -0
- package/dist/components/AsideNavigation/constants.ts +28 -0
- package/dist/components/AsideNavigation/helpers.ts +34 -0
- package/dist/components/AsideNavigation/i18n/en.json +4 -0
- package/dist/components/AsideNavigation/i18n/index.ts +11 -0
- package/dist/components/AsideNavigation/i18n/ru.json +4 -0
- package/dist/components/AsideNavigation/icons.ts +32 -0
- package/dist/components/AsideNavigation/types.ts +23 -0
- package/dist/components/Breadcrumbs/Breadcrumbs.js +25 -0
- package/dist/components/Breadcrumbs/Breadcrumbs.scss +4 -0
- package/dist/components/ClusterInfo/ClusterInfo.scss +65 -0
- package/dist/components/ClusterInfo/ClusterInfo.tsx +157 -0
- package/dist/components/Collapse/Collapse.js +84 -0
- package/dist/components/Collapse/Collapse.scss +70 -0
- package/dist/components/CriticalActionDialog/CriticalActionDialog.js +53 -0
- package/dist/components/CriticalActionDialog/CriticalActionDialog.scss +31 -0
- package/dist/components/EmptyState/EmptyState.js +48 -0
- package/dist/components/EmptyState/EmptyState.scss +70 -0
- package/dist/components/EntityStatus/EntityStatus.js +96 -0
- package/dist/components/EntityStatus/EntityStatus.scss +81 -0
- package/dist/components/FullGroupViewer/FullGroupViewer.js +149 -0
- package/dist/components/FullGroupViewer/FullGroupViewer.scss +32 -0
- package/dist/components/FullNodeViewer/FullNodeViewer.js +108 -0
- package/dist/components/FullNodeViewer/FullNodeViewer.scss +78 -0
- package/dist/components/GroupTreeViewer/GroupTreeViewer.js +86 -0
- package/dist/components/GroupTreeViewer/GroupTreeViewer.scss +17 -0
- package/dist/components/GroupViewer/GroupViewer.js +100 -0
- package/dist/components/GroupViewer/GroupViewer.scss +41 -0
- package/dist/components/Hotkey/Hotkey.js +102 -0
- package/dist/components/Icon/Icon.js +26 -0
- package/dist/components/InfoViewer/InfoViewer.js +47 -0
- package/dist/components/InfoViewer/InfoViewer.scss +48 -0
- package/dist/components/InternalLink/InternalLink.js +15 -0
- package/dist/components/NodesViewer/NodesViewer.js +183 -0
- package/dist/components/NodesViewer/NodesViewer.scss +66 -0
- package/dist/components/PDiskViewer/PDiskViewer.js +80 -0
- package/dist/components/PDiskViewer/PDiskViewer.scss +40 -0
- package/dist/components/Pagination/Pagination.js +63 -0
- package/dist/components/Pagination/Pagination.scss +25 -0
- package/dist/components/PoolBar/PoolBar.js +52 -0
- package/dist/components/PoolBar/PoolBar.scss +40 -0
- package/dist/components/PoolUsage/PoolUsage.js +54 -0
- package/dist/components/PoolUsage/PoolUsage.scss +65 -0
- package/dist/components/PoolsGraph/PoolsGraph.js +33 -0
- package/dist/components/PoolsGraph/PoolsGraph.scss +3 -0
- package/dist/components/ProblemFilter/ProblemFilter.js +24 -0
- package/dist/components/ProgressViewer/ProgressViewer.js +92 -0
- package/dist/components/ProgressViewer/ProgressViewer.scss +84 -0
- package/dist/components/SplitPane/SplitPane.js +368 -0
- package/dist/components/SplitPane/SplitPane.scss +107 -0
- package/dist/components/SplitPane/index.js +3 -0
- package/dist/components/Tablet/Tablet.js +61 -0
- package/dist/components/Tablet/Tablet.scss +49 -0
- package/dist/components/TabletsStatistic/TabletsStatistic.js +58 -0
- package/dist/components/TabletsStatistic/TabletsStatistic.scss +41 -0
- package/dist/components/TabletsViewer/TabletsViewer.js +44 -0
- package/dist/components/TabletsViewer/TabletsViewer.scss +37 -0
- package/dist/components/Tag/Tag.js +14 -0
- package/dist/components/Tag/Tag.scss +17 -0
- package/dist/components/Tags/Tags.js +36 -0
- package/dist/components/Tags/Tags.scss +5 -0
- package/dist/components/TenantOverview/TenantOverview.js +148 -0
- package/dist/components/TenantOverview/TenantOverview.scss +75 -0
- package/dist/components/TreeView/TreeView.js +60 -0
- package/dist/components/TreeView/TreeView.scss +30 -0
- package/dist/components/TruncatedQuery/TruncatedQuery.js +26 -0
- package/dist/components/TruncatedQuery/TruncatedQuery.scss +12 -0
- package/dist/containers/App/App.js +67 -0
- package/dist/containers/App/App.scss +154 -0
- package/dist/containers/App/Content.js +109 -0
- package/dist/containers/App/TipPopup/TipPopup.js +66 -0
- package/dist/containers/App/TipPopup/TipPopup.scss +42 -0
- package/dist/containers/AppIcons/AppIcons.js +477 -0
- package/dist/containers/AsideNavigation/AsideNavigation.scss +43 -0
- package/dist/containers/AsideNavigation/AsideNavigation.tsx +228 -0
- package/dist/containers/Authentication/Authentication.scss +37 -0
- package/dist/containers/Authentication/Authentication.tsx +89 -0
- package/dist/containers/Cluster/Cluster.js +168 -0
- package/dist/containers/Cluster/Cluster.scss +52 -0
- package/dist/containers/Group/Group.js +97 -0
- package/dist/containers/Group/Group.scss +6 -0
- package/dist/containers/Header/Header.js +88 -0
- package/dist/containers/Header/Header.scss +72 -0
- package/dist/containers/Header/Host/Host.js +66 -0
- package/dist/containers/Header/Host/Host.scss +43 -0
- package/dist/containers/Heatmap/Heatmap.js +246 -0
- package/dist/containers/Heatmap/Heatmap.scss +94 -0
- package/dist/containers/Heatmap/HeatmapCanvas/HeatmapCanvas.js +167 -0
- package/dist/containers/Heatmap/Histogram/Histogram.js +108 -0
- package/dist/containers/Heatmap/Histogram/Histogram.scss +49 -0
- package/dist/containers/Heatmap/util.js +110 -0
- package/dist/containers/Node/Node.js +184 -0
- package/dist/containers/Node/Node.scss +34 -0
- package/dist/containers/Node/NodePages.js +13 -0
- package/dist/containers/Nodes/Nodes.js +193 -0
- package/dist/containers/Nodes/Nodes.scss +50 -0
- package/dist/containers/Pdisk/Pdisk.js +159 -0
- package/dist/containers/Pdisk/Pdisk.scss +40 -0
- package/dist/containers/Pool/Pool.js +169 -0
- package/dist/containers/Pool/Pool.scss +32 -0
- package/dist/containers/ReduxTooltip/ReduxTooltip.js +108 -0
- package/dist/containers/ReduxTooltip/ReduxTooltip.scss +67 -0
- package/dist/containers/StorageV2/DiskStateProgressBar/DiskStateProgressBar.scss +81 -0
- package/dist/containers/StorageV2/DiskStateProgressBar/DiskStateProgressBar.tsx +56 -0
- package/dist/containers/StorageV2/Pdisk/Pdisk.scss +32 -0
- package/dist/containers/StorageV2/Pdisk/Pdisk.tsx +167 -0
- package/dist/containers/StorageV2/Storage.js +249 -0
- package/dist/containers/StorageV2/Storage.scss +57 -0
- package/dist/containers/StorageV2/StorageFilter/StorageFilter.js +39 -0
- package/dist/containers/StorageV2/StorageGroups/StorageGroups.scss +26 -0
- package/dist/containers/StorageV2/StorageGroups/StorageGroups.tsx +234 -0
- package/dist/containers/StorageV2/StorageNodes/StorageNodes.scss +30 -0
- package/dist/containers/StorageV2/StorageNodes/StorageNodes.tsx +135 -0
- package/dist/containers/StorageV2/Vdisk/Vdisk.js +250 -0
- package/dist/containers/StorageV2/Vdisk/Vdisk.scss +32 -0
- package/dist/containers/Tablet/Tablet.js +453 -0
- package/dist/containers/Tablet/Tablet.scss +88 -0
- package/dist/containers/Tablets/Tablets.js +306 -0
- package/dist/containers/Tablets/Tablets.scss +77 -0
- package/dist/containers/TabletsFilters/TabletsFilters.js +412 -0
- package/dist/containers/TabletsFilters/TabletsFilters.scss +104 -0
- package/dist/containers/Tenant/Acl/Acl.js +149 -0
- package/dist/containers/Tenant/Acl/Acl.scss +34 -0
- package/dist/containers/Tenant/Compute/Compute.js +110 -0
- package/dist/containers/Tenant/Compute/Compute.scss +6 -0
- package/dist/containers/Tenant/Describe/Describe.js +81 -0
- package/dist/containers/Tenant/Describe/Describe.scss +25 -0
- package/dist/containers/Tenant/Healthcheck/Healthcheck.js +116 -0
- package/dist/containers/Tenant/Healthcheck/Healthcheck.scss +64 -0
- package/dist/containers/Tenant/Healthcheck/IssuesViewer/IssueViewer.scss +164 -0
- package/dist/containers/Tenant/Healthcheck/IssuesViewer/IssuesViewer.js +185 -0
- package/dist/containers/Tenant/Network/Network.js +341 -0
- package/dist/containers/Tenant/Network/Network.scss +145 -0
- package/dist/containers/Tenant/Network/NodeNetwork/NodeNetwork.js +71 -0
- package/dist/containers/Tenant/Network/NodeNetwork/NodeNetwork.scss +52 -0
- package/dist/containers/Tenant/Preview/Preview.js +169 -0
- package/dist/containers/Tenant/Preview/Preview.scss +20 -0
- package/dist/containers/Tenant/QueryEditor/QueryEditor.js +649 -0
- package/dist/containers/Tenant/QueryEditor/QueryEditor.scss +71 -0
- package/dist/containers/Tenant/QueryEditor/QueryExplain/QueryExplain.js +168 -0
- package/dist/containers/Tenant/QueryEditor/QueryExplain/QueryExplain.scss +42 -0
- package/dist/containers/Tenant/QueryEditor/QueryResult/QueryResult.js +58 -0
- package/dist/containers/Tenant/QueryEditor/QueryResult/QueryResult.scss +24 -0
- package/dist/containers/Tenant/QueryEditor/SaveQuery/SaveQuery.js +171 -0
- package/dist/containers/Tenant/QueryEditor/SaveQuery/SaveQuery.scss +51 -0
- package/dist/containers/Tenant/QueryEditor/SavedQueries/SavedQueries.js +156 -0
- package/dist/containers/Tenant/QueryEditor/SavedQueries/SavedQueries.scss +82 -0
- package/dist/containers/Tenant/Schema/HotKeys/HotKeys.js +149 -0
- package/dist/containers/Tenant/Schema/HotKeys/HotKeys.scss +48 -0
- package/dist/containers/Tenant/Schema/Info/Info.js +84 -0
- package/dist/containers/Tenant/Schema/Info/Info.scss +3 -0
- package/dist/containers/Tenant/Schema/SchemaInfoViewer/SchemaInfoViewer.js +67 -0
- package/dist/containers/Tenant/Schema/SchemaInfoViewer/SchemaInfoViewer.scss +21 -0
- package/dist/containers/Tenant/Schema/SchemaMain/SchemaMain.js +439 -0
- package/dist/containers/Tenant/Schema/SchemaMain/SchemaMain.scss +90 -0
- package/dist/containers/Tenant/Schema/SchemaNode/SchemaNode.js +150 -0
- package/dist/containers/Tenant/Schema/SchemaNode/SchemaNode.scss +41 -0
- package/dist/containers/Tenant/Schema/SchemaPages.js +56 -0
- package/dist/containers/Tenant/Schema/SchemaTree/SchemaTree.js +115 -0
- package/dist/containers/Tenant/Schema/SchemaTree/SchemaTree.scss +13 -0
- package/dist/containers/Tenant/Schema/SchemaViewer/SchemaViewer.js +63 -0
- package/dist/containers/Tenant/Schema/SchemaViewer/SchemaViewer.scss +28 -0
- package/dist/containers/Tenant/Tenant.js +199 -0
- package/dist/containers/Tenant/Tenant.scss +94 -0
- package/dist/containers/Tenant/TenantPages.js +35 -0
- package/dist/containers/Tenant/TopQueries/TopQueries.js +184 -0
- package/dist/containers/Tenant/TopQueries/TopQueries.scss +53 -0
- package/dist/containers/Tenant/TopShards/TopShards.js +171 -0
- package/dist/containers/Tenant/TopShards/TopShards.scss +23 -0
- package/dist/containers/Tenants/Tenants.js +375 -0
- package/dist/containers/Tenants/Tenants.scss +73 -0
- package/dist/containers/UserSettings/UserSettings.tsx +57 -0
- package/dist/containers/Vdisk/Vdisk.js +160 -0
- package/dist/containers/Vdisk/Vdisk.scss +40 -0
- package/dist/containers/VdiskPdiskNode/VdiskPdiskNode.js +528 -0
- package/dist/containers/VdiskPdiskNode/VdiskPdiskNode.scss +60 -0
- package/dist/contexts/HistoryContext.ts +6 -0
- package/dist/index.css +11 -0
- package/dist/index.js +28 -0
- package/dist/index.test.js +5 -0
- package/dist/react-app-env.d.ts +1 -0
- package/dist/reportWebVitals.js +13 -0
- package/dist/routes.js +40 -0
- package/dist/services/api.js +224 -0
- package/dist/setupTests.js +5 -0
- package/dist/store/index.js +61 -0
- package/dist/store/reducers/authentication.js +77 -0
- package/dist/store/reducers/cluster.js +52 -0
- package/dist/store/reducers/clusterInfo.js +48 -0
- package/dist/store/reducers/clusterNodes.js +70 -0
- package/dist/store/reducers/describe.js +45 -0
- package/dist/store/reducers/executeQuery.js +158 -0
- package/dist/store/reducers/executeTopQueries.js +69 -0
- package/dist/store/reducers/explainQuery.js +174 -0
- package/dist/store/reducers/group.js +49 -0
- package/dist/store/reducers/healthcheckInfo.js +45 -0
- package/dist/store/reducers/heatmap.js +105 -0
- package/dist/store/reducers/host.js +44 -0
- package/dist/store/reducers/hotKeys.js +57 -0
- package/dist/store/reducers/index.js +78 -0
- package/dist/store/reducers/network.js +45 -0
- package/dist/store/reducers/node.js +42 -0
- package/dist/store/reducers/nodes.js +58 -0
- package/dist/store/reducers/olapStats.js +74 -0
- package/dist/store/reducers/pdisk.js +51 -0
- package/dist/store/reducers/pool.js +42 -0
- package/dist/store/reducers/preview.js +73 -0
- package/dist/store/reducers/schema.js +95 -0
- package/dist/store/reducers/schemaAcl.js +44 -0
- package/dist/store/reducers/settings.js +76 -0
- package/dist/store/reducers/shardsWorkload.js +75 -0
- package/dist/store/reducers/storage.js +280 -0
- package/dist/store/reducers/tablet.js +94 -0
- package/dist/store/reducers/tablets.js +90 -0
- package/dist/store/reducers/tabletsFilters.js +126 -0
- package/dist/store/reducers/tenant.js +76 -0
- package/dist/store/reducers/tenants.js +61 -0
- package/dist/store/reducers/tooltip.js +64 -0
- package/dist/store/reducers/vdisk.js +49 -0
- package/dist/store/state-url-mapping.js +133 -0
- package/dist/store/utils.js +55 -0
- package/dist/styles/mixins.scss +254 -0
- package/dist/styles/react-treeview.scss +45 -0
- package/dist/types/assets.d.ts +12 -0
- package/dist/types/react-list.d.ts +4 -0
- package/dist/types/window.d.ts +33 -0
- package/dist/utils/actionsConstants.js +4 -0
- package/dist/utils/constants.js +126 -0
- package/dist/utils/getNodesColumns.js +156 -0
- package/dist/utils/i18n/i18n.ts +7 -0
- package/dist/utils/i18n/index.ts +1 -0
- package/dist/utils/index.js +136 -0
- package/dist/utils/monaco.js +69 -0
- package/dist/utils/prepareQueryExplain.ts +101 -0
- package/dist/utils/tooltip.js +197 -0
- package/dist/utils/utils.js +75 -0
- package/package.json +89 -0
@@ -0,0 +1,44 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import cn from 'bem-cn-lite';
|
3
|
+
import PropTypes from 'prop-types';
|
4
|
+
import {formatNumber} from '../../utils';
|
5
|
+
import './TabletsViewer.scss';
|
6
|
+
|
7
|
+
import {TABLET_STATES} from '../../utils/constants';
|
8
|
+
|
9
|
+
const b = cn('tablets-viewer');
|
10
|
+
|
11
|
+
const prepareStates = (states) => {
|
12
|
+
return states.map((state) => {
|
13
|
+
return {
|
14
|
+
label: TABLET_STATES[state.VolatileState],
|
15
|
+
count: formatNumber(state.Count),
|
16
|
+
};
|
17
|
+
});
|
18
|
+
};
|
19
|
+
|
20
|
+
class TabletsViewer extends React.Component {
|
21
|
+
static propTypes = {
|
22
|
+
tablets: PropTypes.array,
|
23
|
+
};
|
24
|
+
renderTabletInfo = (item, index) => {
|
25
|
+
return (
|
26
|
+
<div key={index} className={b('row')}>
|
27
|
+
<div className={b('tablet-label')}>{item.label}</div>
|
28
|
+
<span>{item.count}</span>
|
29
|
+
</div>
|
30
|
+
);
|
31
|
+
};
|
32
|
+
render() {
|
33
|
+
const {tablets = []} = this.props;
|
34
|
+
const preparedStates = prepareStates(tablets);
|
35
|
+
|
36
|
+
return (
|
37
|
+
<div className={b()}>
|
38
|
+
<div className={b('grid')}>{preparedStates.map(this.renderTabletInfo)}</div>
|
39
|
+
</div>
|
40
|
+
);
|
41
|
+
}
|
42
|
+
}
|
43
|
+
|
44
|
+
export default TabletsViewer;
|
@@ -0,0 +1,37 @@
|
|
1
|
+
.tablets-viewer {
|
2
|
+
&__grid {
|
3
|
+
display: grid;
|
4
|
+
grid-template-columns: repeat(auto-fill, 125px);
|
5
|
+
grid-gap: 8px;
|
6
|
+
}
|
7
|
+
|
8
|
+
&__row {
|
9
|
+
display: flex;
|
10
|
+
align-items: center;
|
11
|
+
margin: 0;
|
12
|
+
}
|
13
|
+
|
14
|
+
&__tablet-label {
|
15
|
+
color: var(--yc-color-text-hint);
|
16
|
+
font-size: var(--yc-text-body-font-size);
|
17
|
+
margin-right: 20px;
|
18
|
+
line-height: 18px;
|
19
|
+
white-space: nowrap;
|
20
|
+
min-width: 60px;
|
21
|
+
text-transform: capitalize;
|
22
|
+
|
23
|
+
.yc-root_theme_dark & {
|
24
|
+
color: var(--yc-color-text-hint);
|
25
|
+
}
|
26
|
+
}
|
27
|
+
|
28
|
+
&__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
|
+
margin: 0;
|
35
|
+
margin-bottom: 16px;
|
36
|
+
}
|
37
|
+
}
|
@@ -0,0 +1,14 @@
|
|
1
|
+
import PropTypes from 'prop-types';
|
2
|
+
import cn from 'bem-cn-lite';
|
3
|
+
import './Tag.scss';
|
4
|
+
|
5
|
+
const b = cn('tag');
|
6
|
+
|
7
|
+
export const Tag = ({text, type}) => {
|
8
|
+
return <div className={b({type})}>{text}</div>;
|
9
|
+
};
|
10
|
+
|
11
|
+
Tag.propTypes = {
|
12
|
+
text: PropTypes.string,
|
13
|
+
type: PropTypes.string,
|
14
|
+
};
|
@@ -0,0 +1,17 @@
|
|
1
|
+
.tag {
|
2
|
+
padding: 2px 5px;
|
3
|
+
text-transform: uppercase;
|
4
|
+
background: var(--yc-color-base-generic);
|
5
|
+
border-radius: 3px;
|
6
|
+
font-size: 12px;
|
7
|
+
color: var(--yc-color-text-primary);
|
8
|
+
margin-right: 5px;
|
9
|
+
|
10
|
+
&:last-child {
|
11
|
+
margin-right: 0;
|
12
|
+
}
|
13
|
+
|
14
|
+
&_type_blue {
|
15
|
+
background-color: var(--yc-color-celestial-thunder);
|
16
|
+
}
|
17
|
+
}
|
@@ -0,0 +1,36 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import PropTypes from 'prop-types';
|
3
|
+
import cn from 'bem-cn-lite';
|
4
|
+
|
5
|
+
import {Tag} from '../Tag/Tag';
|
6
|
+
|
7
|
+
import './Tags.scss';
|
8
|
+
|
9
|
+
const b = cn('tags');
|
10
|
+
|
11
|
+
class Tags extends React.Component {
|
12
|
+
static propTypes = {
|
13
|
+
className: PropTypes.string,
|
14
|
+
tags: PropTypes.arrayOf(PropTypes.string).isRequired,
|
15
|
+
tagsType: PropTypes.string,
|
16
|
+
};
|
17
|
+
|
18
|
+
static defaultProps = {
|
19
|
+
className: '',
|
20
|
+
};
|
21
|
+
|
22
|
+
render() {
|
23
|
+
const {tags, className, tagsType} = this.props;
|
24
|
+
|
25
|
+
return (
|
26
|
+
<div className={`${b()} ${className}`}>
|
27
|
+
{tags &&
|
28
|
+
tags.map((tag, tagIndex) => (
|
29
|
+
<Tag text={tag} key={tagIndex} type={tagsType}></Tag>
|
30
|
+
))}
|
31
|
+
</div>
|
32
|
+
);
|
33
|
+
}
|
34
|
+
}
|
35
|
+
|
36
|
+
export default Tags;
|
@@ -0,0 +1,148 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import cn from 'bem-cn-lite';
|
3
|
+
import PropTypes from 'prop-types';
|
4
|
+
|
5
|
+
import {Collapse} from '../Collapse/Collapse';
|
6
|
+
import EntityStatus from '../EntityStatus/EntityStatus';
|
7
|
+
import InfoViewer from '../InfoViewer/InfoViewer';
|
8
|
+
import PoolUsage from '../PoolUsage/PoolUsage';
|
9
|
+
import Tablet from '../Tablet/Tablet';
|
10
|
+
import InternalLink from '../InternalLink/InternalLink';
|
11
|
+
|
12
|
+
import {TABLET_STATES} from '../../utils/constants';
|
13
|
+
import {formatCPU} from '../../utils';
|
14
|
+
import {bytesToGB} from '../../utils/utils';
|
15
|
+
import routes, {createHref} from '../../routes';
|
16
|
+
import {HEALTHCHECK} from '../../containers/Tenant/TenantPages';
|
17
|
+
|
18
|
+
import './TenantOverview.scss';
|
19
|
+
|
20
|
+
const b = cn('tenant-overview');
|
21
|
+
|
22
|
+
const renderName = (tenant) => {
|
23
|
+
if (tenant) {
|
24
|
+
const {Name} = tenant;
|
25
|
+
return (
|
26
|
+
<React.Fragment>
|
27
|
+
<InternalLink to={createHref(routes.tenant, {page: HEALTHCHECK}, {name: Name})}>
|
28
|
+
<EntityStatus status={tenant.State} />
|
29
|
+
</InternalLink>
|
30
|
+
<span>{Name}</span>
|
31
|
+
</React.Fragment>
|
32
|
+
);
|
33
|
+
}
|
34
|
+
|
35
|
+
return <div>no tenant data</div>;
|
36
|
+
};
|
37
|
+
|
38
|
+
class TenantOverview extends React.Component {
|
39
|
+
static propTypes = {
|
40
|
+
tenant: PropTypes.object,
|
41
|
+
hideTooltip: PropTypes.func,
|
42
|
+
showTooltip: PropTypes.func,
|
43
|
+
systemTablets: PropTypes.array,
|
44
|
+
additionalTenantInfo: PropTypes.func,
|
45
|
+
};
|
46
|
+
|
47
|
+
onChangeCollapseState = () => {
|
48
|
+
window.dispatchEvent(new Event('resize'));
|
49
|
+
};
|
50
|
+
|
51
|
+
render() {
|
52
|
+
const {tenant, systemTablets, hideTooltip, showTooltip} = this.props;
|
53
|
+
const {
|
54
|
+
Metrics = {},
|
55
|
+
PoolStats,
|
56
|
+
StateStats = [],
|
57
|
+
MemoryUsed,
|
58
|
+
CoresUsed,
|
59
|
+
StorageGroups,
|
60
|
+
StorageAllocatedSize,
|
61
|
+
Type,
|
62
|
+
} = tenant;
|
63
|
+
|
64
|
+
const memoryRaw = MemoryUsed ?? Metrics.Memory;
|
65
|
+
|
66
|
+
const memory = (memoryRaw && bytesToGB(memoryRaw)) || 'no data';
|
67
|
+
const storage = (Metrics.Storage && bytesToGB(Metrics.Storage)) || 'no data';
|
68
|
+
const storageGroups = StorageGroups ?? 'no data';
|
69
|
+
const blobStorage = (StorageAllocatedSize && bytesToGB(StorageAllocatedSize)) || 'no data';
|
70
|
+
const storageEfficiency =
|
71
|
+
Metrics.Storage && StorageAllocatedSize
|
72
|
+
? `${((Metrics.Storage * 100) / StorageAllocatedSize).toFixed(2)}%`
|
73
|
+
: 'no data';
|
74
|
+
|
75
|
+
const cpuRaw = CoresUsed !== undefined ? Number(CoresUsed) * 1_000_000 : Metrics.CPU;
|
76
|
+
|
77
|
+
const cpu = formatCPU(cpuRaw);
|
78
|
+
|
79
|
+
const metricsInfo = [
|
80
|
+
{label: 'Type', value: Type},
|
81
|
+
{label: 'Memory', value: memory},
|
82
|
+
{label: 'CPU', value: cpu},
|
83
|
+
{label: 'Tablet storage', value: storage},
|
84
|
+
{label: 'Storage groups', value: storageGroups},
|
85
|
+
{label: 'Blob storage', value: blobStorage},
|
86
|
+
{label: 'Storage efficiency', value: storageEfficiency},
|
87
|
+
];
|
88
|
+
|
89
|
+
const tabletsInfo = StateStats.map((info) => ({
|
90
|
+
label: TABLET_STATES[info.VolatileState],
|
91
|
+
value: info.Count,
|
92
|
+
}));
|
93
|
+
|
94
|
+
const collapseTitle = <span className={b('collapse-title')}>Database info</span>;
|
95
|
+
|
96
|
+
return (
|
97
|
+
<div className={b()}>
|
98
|
+
<div className={b('top')}>
|
99
|
+
<span className={b('top-label')}>database</span>
|
100
|
+
{renderName(tenant)}
|
101
|
+
{this.props.additionalTenantInfo &&
|
102
|
+
this.props.additionalTenantInfo(
|
103
|
+
this.props.tenant.Name,
|
104
|
+
this.props.tenant.Type,
|
105
|
+
)}
|
106
|
+
<div className={b('system-tablets')}>
|
107
|
+
{systemTablets &&
|
108
|
+
systemTablets.map((tablet, tabletIndex) => (
|
109
|
+
<Tablet
|
110
|
+
onMouseEnter={showTooltip}
|
111
|
+
onMouseLeave={hideTooltip}
|
112
|
+
key={tabletIndex}
|
113
|
+
tablet={tablet}
|
114
|
+
/>
|
115
|
+
))}
|
116
|
+
</div>
|
117
|
+
</div>
|
118
|
+
<Collapse title={collapseTitle} onChange={this.onChangeCollapseState} titleSize="m">
|
119
|
+
<div className={b('common-info')}>
|
120
|
+
{PoolStats ? (
|
121
|
+
<div>
|
122
|
+
<div className={b('section-title')}>Pools</div>
|
123
|
+
<div className={b('section', {pools: true})}>
|
124
|
+
{PoolStats.map((pool, poolIndex) => (
|
125
|
+
<PoolUsage key={poolIndex} data={pool} />
|
126
|
+
))}
|
127
|
+
</div>
|
128
|
+
</div>
|
129
|
+
) : (
|
130
|
+
<div className="error">no pools data</div>
|
131
|
+
)}
|
132
|
+
<InfoViewer
|
133
|
+
title="Metrics"
|
134
|
+
className={b('section', {metrics: true})}
|
135
|
+
info={metricsInfo}
|
136
|
+
/>
|
137
|
+
|
138
|
+
<div className={b('section')}>
|
139
|
+
<InfoViewer info={tabletsInfo} title="Tablets" />
|
140
|
+
</div>
|
141
|
+
</div>
|
142
|
+
</Collapse>
|
143
|
+
</div>
|
144
|
+
);
|
145
|
+
}
|
146
|
+
}
|
147
|
+
|
148
|
+
export default TenantOverview;
|
@@ -0,0 +1,75 @@
|
|
1
|
+
.tenant-overview {
|
2
|
+
padding: 15px;
|
3
|
+
|
4
|
+
&__top {
|
5
|
+
display: flex;
|
6
|
+
align-items: center;
|
7
|
+
|
8
|
+
margin-bottom: 10px;
|
9
|
+
}
|
10
|
+
|
11
|
+
&__top-label {
|
12
|
+
margin-right: 16px;
|
13
|
+
|
14
|
+
text-transform: uppercase;
|
15
|
+
|
16
|
+
font-size: var(--yc-text-body2-font-size);
|
17
|
+
font-weight: 500;
|
18
|
+
line-height: var(--yc-text-body2-line-height);
|
19
|
+
}
|
20
|
+
|
21
|
+
&__common-info {
|
22
|
+
display: flex;
|
23
|
+
align-items: stretch;
|
24
|
+
justify-content: flex-start;
|
25
|
+
|
26
|
+
padding-left: 12px;
|
27
|
+
}
|
28
|
+
|
29
|
+
&__system-tablets {
|
30
|
+
display: flex;
|
31
|
+
align-items: center;
|
32
|
+
flex-wrap: wrap;
|
33
|
+
|
34
|
+
margin-left: 15px;
|
35
|
+
}
|
36
|
+
|
37
|
+
&__collapse-title {
|
38
|
+
font-size: var(--yc-text-body2-font-size);
|
39
|
+
font-weight: 500;
|
40
|
+
line-height: var(--yc-text-body2-line-height);
|
41
|
+
//text-transform: uppercase;
|
42
|
+
}
|
43
|
+
|
44
|
+
&__section {
|
45
|
+
margin-right: 20px;
|
46
|
+
padding: 0 15px 0 0;
|
47
|
+
|
48
|
+
border-radius: 10px;
|
49
|
+
|
50
|
+
&_metrics {
|
51
|
+
.info-viewer__label {
|
52
|
+
min-width: 150px;
|
53
|
+
}
|
54
|
+
.info-viewer__value {
|
55
|
+
min-width: 100px;
|
56
|
+
}
|
57
|
+
}
|
58
|
+
|
59
|
+
&_pools {
|
60
|
+
display: grid;
|
61
|
+
|
62
|
+
padding: 15px 15px 0 0;
|
63
|
+
grid-template-columns: 110px 110px;
|
64
|
+
grid-gap: 7px 20px;
|
65
|
+
}
|
66
|
+
}
|
67
|
+
|
68
|
+
&__section-title {
|
69
|
+
margin: 0;
|
70
|
+
|
71
|
+
font-size: var(--yc-text-body2-font-size);
|
72
|
+
font-weight: 500;
|
73
|
+
line-height: var(--yc-text-body2-line-height);
|
74
|
+
}
|
75
|
+
}
|
@@ -0,0 +1,60 @@
|
|
1
|
+
import PropTypes from 'prop-types';
|
2
|
+
import cn from 'bem-cn-lite';
|
3
|
+
import TreeViewBase from 'react-treeview';
|
4
|
+
import Icon from '../Icon/Icon';
|
5
|
+
|
6
|
+
import './TreeView.scss';
|
7
|
+
|
8
|
+
const b = cn('km-tree-view');
|
9
|
+
|
10
|
+
const TreeView = (props) => {
|
11
|
+
const {
|
12
|
+
children,
|
13
|
+
nodeLabel,
|
14
|
+
onClick,
|
15
|
+
collapsed,
|
16
|
+
clickableLabel = false,
|
17
|
+
className,
|
18
|
+
hasArrow = true,
|
19
|
+
...rest
|
20
|
+
} = props;
|
21
|
+
|
22
|
+
const newNodeLabel = (
|
23
|
+
<div
|
24
|
+
className={b('node-wrapper', {clickable: clickableLabel})}
|
25
|
+
onClick={clickableLabel ? onClick : undefined}
|
26
|
+
>
|
27
|
+
{hasArrow ? (
|
28
|
+
<span
|
29
|
+
className={b('arrow-icon', {extended: !collapsed})}
|
30
|
+
onClick={clickableLabel ? undefined : onClick}
|
31
|
+
>
|
32
|
+
<Icon name="arrow-right" viewBox="0 0 6 11" width="6" height="11" />
|
33
|
+
</span>
|
34
|
+
) : null}
|
35
|
+
{nodeLabel}
|
36
|
+
</div>
|
37
|
+
);
|
38
|
+
|
39
|
+
return (
|
40
|
+
<TreeViewBase
|
41
|
+
{...rest}
|
42
|
+
treeViewClassName={b(null, className)}
|
43
|
+
nodeLabel={newNodeLabel}
|
44
|
+
collapsed={collapsed}
|
45
|
+
>
|
46
|
+
{children}
|
47
|
+
</TreeViewBase>
|
48
|
+
);
|
49
|
+
};
|
50
|
+
|
51
|
+
TreeView.propTypes = {
|
52
|
+
children: PropTypes.any,
|
53
|
+
nodeLabel: PropTypes.node,
|
54
|
+
onClick: PropTypes.func,
|
55
|
+
collapsed: PropTypes.bool,
|
56
|
+
clickableLabel: PropTypes.bool,
|
57
|
+
className: PropTypes.string,
|
58
|
+
};
|
59
|
+
|
60
|
+
export default TreeView;
|
@@ -0,0 +1,30 @@
|
|
1
|
+
.km-tree-view {
|
2
|
+
& .tree-view_arrow {
|
3
|
+
display: none;
|
4
|
+
}
|
5
|
+
|
6
|
+
&__node-wrapper {
|
7
|
+
display: flex;
|
8
|
+
align-items: center;
|
9
|
+
|
10
|
+
&_clickable {
|
11
|
+
cursor: pointer;
|
12
|
+
}
|
13
|
+
}
|
14
|
+
|
15
|
+
&__arrow-icon {
|
16
|
+
display: flex;
|
17
|
+
justify-content: center;
|
18
|
+
width: 11px;
|
19
|
+
margin-right: 8px;
|
20
|
+
cursor: pointer;
|
21
|
+
|
22
|
+
&_extended {
|
23
|
+
transform: rotate(90deg);
|
24
|
+
}
|
25
|
+
|
26
|
+
& .yc-icon {
|
27
|
+
vertical-align: middle;
|
28
|
+
}
|
29
|
+
}
|
30
|
+
}
|
@@ -0,0 +1,26 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import cn from 'bem-cn-lite';
|
3
|
+
|
4
|
+
import './TruncatedQuery.scss';
|
5
|
+
|
6
|
+
const b = cn('kv-truncated-query');
|
7
|
+
|
8
|
+
function TruncatedQuery({value, maxQueryHeight}) {
|
9
|
+
const lines = value.split('\n');
|
10
|
+
const truncated = lines.length > maxQueryHeight;
|
11
|
+
|
12
|
+
if (truncated) {
|
13
|
+
const content = lines.slice(0, maxQueryHeight).join('\n');
|
14
|
+
const message =
|
15
|
+
'\n...\nThe request was truncated. Click on the line to show the full query on the query tab';
|
16
|
+
return (
|
17
|
+
<React.Fragment>
|
18
|
+
<span className={b()}>{content}</span>
|
19
|
+
<span className={b({color: 'secondary'})}>{message}</span>
|
20
|
+
</React.Fragment>
|
21
|
+
);
|
22
|
+
}
|
23
|
+
return value;
|
24
|
+
}
|
25
|
+
|
26
|
+
export default TruncatedQuery;
|
@@ -0,0 +1,67 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import {connect} from 'react-redux';
|
3
|
+
import PropTypes from 'prop-types';
|
4
|
+
|
5
|
+
import {I18N, i18n} from '../../utils/i18n';
|
6
|
+
|
7
|
+
import ContentWrapper, {Content} from './Content';
|
8
|
+
import AsideNavigation from '../AsideNavigation/AsideNavigation';
|
9
|
+
|
10
|
+
import {getUser} from '../../store/reducers/authentication';
|
11
|
+
import {registerLanguages} from '../../utils/monaco';
|
12
|
+
|
13
|
+
import './App.scss';
|
14
|
+
|
15
|
+
registerLanguages();
|
16
|
+
|
17
|
+
class App extends React.Component {
|
18
|
+
static propTypes = {
|
19
|
+
isAuthenticated: PropTypes.bool,
|
20
|
+
children: PropTypes.node,
|
21
|
+
};
|
22
|
+
|
23
|
+
constructor(props) {
|
24
|
+
super(props);
|
25
|
+
i18n.setLang(I18N.LANGS.en);
|
26
|
+
}
|
27
|
+
|
28
|
+
componentDidMount() {
|
29
|
+
const {isAuthenticated, getUser} = this.props;
|
30
|
+
if (isAuthenticated) {
|
31
|
+
getUser();
|
32
|
+
}
|
33
|
+
}
|
34
|
+
|
35
|
+
componentDidUpdate(prevProps) {
|
36
|
+
const {isAuthenticated, getUser, internalUser} = this.props;
|
37
|
+
if (isAuthenticated && (!prevProps.isAuthenticated || !internalUser)) {
|
38
|
+
getUser();
|
39
|
+
}
|
40
|
+
}
|
41
|
+
|
42
|
+
renderContentWithNavigation() {
|
43
|
+
return (
|
44
|
+
<AsideNavigation>
|
45
|
+
<Content singleClusterMode={this.props.singleClusterMode} />
|
46
|
+
</AsideNavigation>
|
47
|
+
);
|
48
|
+
}
|
49
|
+
|
50
|
+
render() {
|
51
|
+
return <ContentWrapper>{this.renderContentWithNavigation()}</ContentWrapper>;
|
52
|
+
}
|
53
|
+
}
|
54
|
+
|
55
|
+
function mapStateToProps(state) {
|
56
|
+
return {
|
57
|
+
isAuthenticated: state.authentication.isAuthenticated,
|
58
|
+
internalUser: state.authentication.user,
|
59
|
+
singleClusterMode: state.singleClusterMode,
|
60
|
+
};
|
61
|
+
}
|
62
|
+
|
63
|
+
const mapDispatchToProps = {
|
64
|
+
getUser,
|
65
|
+
};
|
66
|
+
|
67
|
+
export default connect(mapStateToProps, mapDispatchToProps)(App);
|