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,52 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import cn from 'bem-cn-lite';
|
3
|
+
import PropTypes from 'prop-types';
|
4
|
+
|
5
|
+
import './PoolBar.scss';
|
6
|
+
|
7
|
+
const b = cn('pool-bar');
|
8
|
+
|
9
|
+
const getBarType = (usage) => {
|
10
|
+
if (usage >= 75) {
|
11
|
+
return 'danger';
|
12
|
+
} else if (usage >= 50 && usage < 75) {
|
13
|
+
return 'warning';
|
14
|
+
} else {
|
15
|
+
return 'normal';
|
16
|
+
}
|
17
|
+
};
|
18
|
+
|
19
|
+
class PoolBar extends React.Component {
|
20
|
+
static propTypes = {
|
21
|
+
data: PropTypes.object,
|
22
|
+
onMouseEnter: PropTypes.func,
|
23
|
+
onMouseLeave: PropTypes.func,
|
24
|
+
};
|
25
|
+
|
26
|
+
bar = React.createRef();
|
27
|
+
|
28
|
+
_onBarHover = () => {
|
29
|
+
this.props.onMouseEnter(this.bar.current, this.props.data, 'pool');
|
30
|
+
};
|
31
|
+
_onBarLeave = () => {
|
32
|
+
this.props.onMouseLeave();
|
33
|
+
};
|
34
|
+
render() {
|
35
|
+
const {Usage: usage = 0} = this.props.data;
|
36
|
+
const usagePercents = Math.min(usage * 100, 100);
|
37
|
+
const type = getBarType(usagePercents);
|
38
|
+
|
39
|
+
return (
|
40
|
+
<div
|
41
|
+
ref={this.bar}
|
42
|
+
className={b({type})}
|
43
|
+
onMouseEnter={this._onBarHover}
|
44
|
+
onMouseLeave={this._onBarLeave}
|
45
|
+
>
|
46
|
+
<div style={{height: `${usagePercents}%`}} className={b('value', {type})} />
|
47
|
+
</div>
|
48
|
+
);
|
49
|
+
}
|
50
|
+
}
|
51
|
+
|
52
|
+
export default PoolBar;
|
@@ -0,0 +1,40 @@
|
|
1
|
+
.pool-bar {
|
2
|
+
position: relative;
|
3
|
+
width: 7px;
|
4
|
+
height: 20px;
|
5
|
+
margin-right: 3px;
|
6
|
+
border-radius: 2px;
|
7
|
+
border: 1px solid;
|
8
|
+
cursor: pointer;
|
9
|
+
|
10
|
+
&:last-child {
|
11
|
+
margin-right: 0;
|
12
|
+
}
|
13
|
+
|
14
|
+
&_type_normal {
|
15
|
+
border-color: var(--yc-color-base-positive-heavy);
|
16
|
+
}
|
17
|
+
&_type_warning {
|
18
|
+
border-color: var(--yc-color-text-warning-heavy);
|
19
|
+
}
|
20
|
+
&_type_danger {
|
21
|
+
border-color: var(--yc-color-base-danger-heavy);
|
22
|
+
}
|
23
|
+
|
24
|
+
&__value {
|
25
|
+
position: absolute;
|
26
|
+
bottom: 0;
|
27
|
+
width: 100%;
|
28
|
+
min-height: 1px;
|
29
|
+
|
30
|
+
&_type_normal {
|
31
|
+
background-color: var(--yc-color-base-positive-heavy);
|
32
|
+
}
|
33
|
+
&_type_warning {
|
34
|
+
background-color: var(--yc-color-text-warning-heavy);
|
35
|
+
}
|
36
|
+
&_type_danger {
|
37
|
+
background-color: var(--yc-color-base-danger-heavy);
|
38
|
+
}
|
39
|
+
}
|
40
|
+
}
|
@@ -0,0 +1,54 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import cn from 'bem-cn-lite';
|
3
|
+
import './PoolUsage.scss';
|
4
|
+
import PropTypes from 'prop-types';
|
5
|
+
const b = cn('pool-usage');
|
6
|
+
|
7
|
+
const formatUsage = (usage) => (typeof usage === 'undefined' ? '' : Math.floor(usage * 100));
|
8
|
+
const getLineType = (fillWidth) => {
|
9
|
+
let fillColor = 'green';
|
10
|
+
if (fillWidth > 60 && fillWidth <= 80) {
|
11
|
+
fillColor = 'yellow';
|
12
|
+
} else if (fillWidth > 80) {
|
13
|
+
fillColor = 'red';
|
14
|
+
}
|
15
|
+
|
16
|
+
return fillColor;
|
17
|
+
};
|
18
|
+
export class PoolUsage extends React.Component {
|
19
|
+
static propTypes = {
|
20
|
+
data: PropTypes.object.isRequired,
|
21
|
+
};
|
22
|
+
|
23
|
+
render() {
|
24
|
+
const {data: pool = {}} = this.props;
|
25
|
+
|
26
|
+
const {Threads, Name = 'Unknown', Usage} = pool;
|
27
|
+
const dataExist = Usage && Threads;
|
28
|
+
|
29
|
+
const value = formatUsage(pool.Usage);
|
30
|
+
const fillWidth = value > 100 ? 100 : value;
|
31
|
+
|
32
|
+
return (
|
33
|
+
<div className={b()}>
|
34
|
+
<div className={b('info')}>
|
35
|
+
<div className={b('pool-name')}>{Name}</div>
|
36
|
+
{dataExist && (
|
37
|
+
<div className={b('value')}>
|
38
|
+
<div className={b('percents')}>{value < 1 ? '<1' : value}%</div>
|
39
|
+
<div className={b('threads')}>(×{Threads})</div>
|
40
|
+
</div>
|
41
|
+
)}
|
42
|
+
</div>
|
43
|
+
<div className={b('visual')}>
|
44
|
+
<div
|
45
|
+
className={b('usage-line', {type: getLineType(fillWidth)})}
|
46
|
+
style={{width: `${fillWidth}%`}}
|
47
|
+
/>
|
48
|
+
</div>
|
49
|
+
</div>
|
50
|
+
);
|
51
|
+
}
|
52
|
+
}
|
53
|
+
|
54
|
+
export default PoolUsage;
|
@@ -0,0 +1,65 @@
|
|
1
|
+
.pool-usage {
|
2
|
+
font-size: var(--yc-text-body2-font-size);
|
3
|
+
line-height: var(--yc-text-body2-line-height);
|
4
|
+
&__info {
|
5
|
+
display: flex;
|
6
|
+
align-items: center;
|
7
|
+
justify-content: space-between;
|
8
|
+
}
|
9
|
+
|
10
|
+
&__pool-name {
|
11
|
+
color: var(--yc-color-text-primary);
|
12
|
+
}
|
13
|
+
|
14
|
+
&__value {
|
15
|
+
display: flex;
|
16
|
+
align-items: center;
|
17
|
+
}
|
18
|
+
|
19
|
+
&__threads {
|
20
|
+
font-size: var(--yc-text-body-font-size);
|
21
|
+
color: var(--yc-color-text-hint);
|
22
|
+
|
23
|
+
.yc-root_theme_dark & {
|
24
|
+
color: var(--yc-color-text-hint);
|
25
|
+
}
|
26
|
+
}
|
27
|
+
|
28
|
+
&__percents {
|
29
|
+
color: var(--yc-color-text-primary);
|
30
|
+
font-size: var(--yc-text-body-font-size);
|
31
|
+
margin-right: 2px;
|
32
|
+
}
|
33
|
+
|
34
|
+
&__visual {
|
35
|
+
height: 6px;
|
36
|
+
font-size: var(--yc-text-body2-font-size);
|
37
|
+
display: flex;
|
38
|
+
align-items: center;
|
39
|
+
justify-content: center;
|
40
|
+
border-radius: 4px;
|
41
|
+
position: relative;
|
42
|
+
overflow: hidden;
|
43
|
+
background-color: var(--yc-color-base-generic-accent);
|
44
|
+
}
|
45
|
+
|
46
|
+
&__usage-line {
|
47
|
+
position: absolute;
|
48
|
+
left: 0;
|
49
|
+
top: 0;
|
50
|
+
height: 100%;
|
51
|
+
|
52
|
+
&_type_green {
|
53
|
+
background-color: var(--yc-color-base-positive-heavy);
|
54
|
+
}
|
55
|
+
&_type_blue {
|
56
|
+
background-color: var(--yc-color-base-info-heavy);
|
57
|
+
}
|
58
|
+
&_type_yellow {
|
59
|
+
background-color: var(--yc-color-text-warning-heavy);
|
60
|
+
}
|
61
|
+
&_type_red {
|
62
|
+
background-color: var(--yc-color-base-danger-heavy);
|
63
|
+
}
|
64
|
+
}
|
65
|
+
}
|
@@ -0,0 +1,33 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import PropTypes from 'prop-types';
|
3
|
+
import cn from 'bem-cn-lite';
|
4
|
+
|
5
|
+
import PoolBar from '../PoolBar/PoolBar';
|
6
|
+
|
7
|
+
import './PoolsGraph.scss';
|
8
|
+
|
9
|
+
const b = cn('pools-graph');
|
10
|
+
|
11
|
+
class PoolsGraph extends React.Component {
|
12
|
+
static propTypes = {
|
13
|
+
pools: PropTypes.arrayOf(PropTypes.object).isRequired,
|
14
|
+
onMouseLeave: PropTypes.func,
|
15
|
+
onMouseEnter: PropTypes.func,
|
16
|
+
};
|
17
|
+
static defaultProps = {
|
18
|
+
pools: [],
|
19
|
+
};
|
20
|
+
render() {
|
21
|
+
const {pools} = this.props;
|
22
|
+
|
23
|
+
return (
|
24
|
+
<div className={b()}>
|
25
|
+
{pools.map((item, index) => (
|
26
|
+
<PoolBar key={index} data={item} {...this.props} />
|
27
|
+
))}
|
28
|
+
</div>
|
29
|
+
);
|
30
|
+
}
|
31
|
+
}
|
32
|
+
|
33
|
+
export default PoolsGraph;
|
@@ -0,0 +1,24 @@
|
|
1
|
+
import PropTypes from 'prop-types';
|
2
|
+
|
3
|
+
import {RadioButton} from '@yandex-cloud/uikit';
|
4
|
+
|
5
|
+
import {ALL, PROBLEMS} from '../../utils/constants';
|
6
|
+
|
7
|
+
export default function ProblemFilter(props) {
|
8
|
+
const {value, onChange, className} = props;
|
9
|
+
|
10
|
+
return (
|
11
|
+
<RadioButton value={value} onUpdate={(value) => onChange(value)} className={className}>
|
12
|
+
<RadioButton.Option value={ALL}>{ALL}</RadioButton.Option>
|
13
|
+
<RadioButton.Option value={PROBLEMS}>{PROBLEMS}</RadioButton.Option>
|
14
|
+
</RadioButton>
|
15
|
+
);
|
16
|
+
}
|
17
|
+
|
18
|
+
export const problemFilterType = PropTypes.oneOf([ALL, PROBLEMS]);
|
19
|
+
|
20
|
+
ProblemFilter.propTypes = {
|
21
|
+
value: problemFilterType,
|
22
|
+
onChange: PropTypes.func,
|
23
|
+
className: PropTypes.string,
|
24
|
+
};
|
@@ -0,0 +1,92 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import cn from 'bem-cn-lite';
|
3
|
+
import './ProgressViewer.scss';
|
4
|
+
import PropTypes from 'prop-types';
|
5
|
+
const b = cn('progress-viewer');
|
6
|
+
/*
|
7
|
+
|
8
|
+
Описание props:
|
9
|
+
1) value - величина прогресса
|
10
|
+
2) capacity - предельно возможный прогресс
|
11
|
+
3) formatValues - функция форматирования value и capacity
|
12
|
+
4) percents - отображать ли заполненость в виде процентов
|
13
|
+
5) className - кастомный класс
|
14
|
+
6) colorizeProgress - менять ли цвет полосы прогресса в зависимости от его величины
|
15
|
+
7) inverseColorize - инвертировать ли цвета при разукрашивании прогресса
|
16
|
+
*/
|
17
|
+
export class ProgressViewer extends React.Component {
|
18
|
+
static propTypes = {
|
19
|
+
value: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).isRequired,
|
20
|
+
capacity: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).isRequired,
|
21
|
+
formatValues: PropTypes.func,
|
22
|
+
percents: PropTypes.bool,
|
23
|
+
className: PropTypes.string,
|
24
|
+
size: PropTypes.oneOf(['xs', 's', 'ns', 'm', 'n', 'l', 'head']),
|
25
|
+
colorizeProgress: PropTypes.bool,
|
26
|
+
inverseColorize: PropTypes.bool,
|
27
|
+
};
|
28
|
+
|
29
|
+
static defaultProps = {
|
30
|
+
size: 'ns',
|
31
|
+
colorizeProgress: false,
|
32
|
+
capacity: 100,
|
33
|
+
inverseColorize: false,
|
34
|
+
};
|
35
|
+
|
36
|
+
render() {
|
37
|
+
const {
|
38
|
+
value,
|
39
|
+
capacity,
|
40
|
+
formatValues,
|
41
|
+
percents,
|
42
|
+
size,
|
43
|
+
className,
|
44
|
+
colorizeProgress,
|
45
|
+
inverseColorize,
|
46
|
+
} = this.props;
|
47
|
+
|
48
|
+
let fillWidth = Math.round((parseFloat(value) / parseFloat(capacity)) * 100);
|
49
|
+
fillWidth = fillWidth > 100 ? 100 : fillWidth;
|
50
|
+
|
51
|
+
let valueText = Math.round(value),
|
52
|
+
capacityText = capacity,
|
53
|
+
divider = '/';
|
54
|
+
if (formatValues) {
|
55
|
+
[valueText, capacityText] = formatValues(value, capacity);
|
56
|
+
} else if (percents) {
|
57
|
+
valueText = fillWidth + '%';
|
58
|
+
capacityText = '';
|
59
|
+
divider = '';
|
60
|
+
}
|
61
|
+
|
62
|
+
let bg = inverseColorize ? 'scarlet' : 'apple';
|
63
|
+
if (colorizeProgress) {
|
64
|
+
if (fillWidth > 60 && fillWidth <= 80) {
|
65
|
+
bg = 'saffron';
|
66
|
+
} else if (fillWidth > 80) {
|
67
|
+
bg = inverseColorize ? 'apple' : 'scarlet';
|
68
|
+
}
|
69
|
+
}
|
70
|
+
|
71
|
+
const lineStyle = {
|
72
|
+
width: fillWidth + '%',
|
73
|
+
};
|
74
|
+
|
75
|
+
const text = fillWidth > 60 ? 'contrast0' : 'contrast70';
|
76
|
+
|
77
|
+
if (!isNaN(fillWidth)) {
|
78
|
+
return (
|
79
|
+
<div className={b({size})}>
|
80
|
+
<div className={b('line', {bg})} style={lineStyle}></div>
|
81
|
+
<span className={b('text', {text})}>
|
82
|
+
{`${valueText} ${divider} ${capacityText}`}
|
83
|
+
</span>
|
84
|
+
</div>
|
85
|
+
);
|
86
|
+
}
|
87
|
+
|
88
|
+
return <div className={`${b({size})} ${className} error`}>no data</div>;
|
89
|
+
}
|
90
|
+
}
|
91
|
+
|
92
|
+
export default ProgressViewer;
|
@@ -0,0 +1,84 @@
|
|
1
|
+
.progress-viewer {
|
2
|
+
min-width: 120px;
|
3
|
+
padding: 0 4px;
|
4
|
+
height: 23px;
|
5
|
+
font-size: var(--yc-text-body2-font-size);
|
6
|
+
display: flex;
|
7
|
+
align-items: center;
|
8
|
+
justify-content: center;
|
9
|
+
color: var(--yc-color-text-light-primary);
|
10
|
+
background: var(--yc-color-base-generic-accent);
|
11
|
+
position: relative;
|
12
|
+
overflow: hidden;
|
13
|
+
border-radius: 4px;
|
14
|
+
white-space: nowrap;
|
15
|
+
|
16
|
+
&__line {
|
17
|
+
position: absolute;
|
18
|
+
height: 100%;
|
19
|
+
left: 0;
|
20
|
+
top: 0;
|
21
|
+
|
22
|
+
&_bg_scarlet {
|
23
|
+
background: var(--yc-color-base-danger-heavy);
|
24
|
+
}
|
25
|
+
&_bg_apple {
|
26
|
+
background: var(--yc-color-base-positive-heavy);
|
27
|
+
}
|
28
|
+
&_bg_saffron {
|
29
|
+
background: var(--yc-color-base-warning-heavy);
|
30
|
+
}
|
31
|
+
}
|
32
|
+
|
33
|
+
&__text {
|
34
|
+
position: relative;
|
35
|
+
z-index: 1;
|
36
|
+
&_text_contrast0 {
|
37
|
+
color: var(--yc-color-text-light-primary);
|
38
|
+
}
|
39
|
+
&_text_contrast70 {
|
40
|
+
color: var(--yc-color-text-complementary);
|
41
|
+
}
|
42
|
+
}
|
43
|
+
|
44
|
+
&_size_xs {
|
45
|
+
height: 18px;
|
46
|
+
font-size: 10px;
|
47
|
+
line-height: var(--yc-text-lead-line-height);
|
48
|
+
}
|
49
|
+
|
50
|
+
&_size_s {
|
51
|
+
height: 28px;
|
52
|
+
font-size: var(--yc-text-body-font-size);
|
53
|
+
line-height: 28px;
|
54
|
+
}
|
55
|
+
&_size_m {
|
56
|
+
height: 32px;
|
57
|
+
font-size: var(--yc-text-body2-font-size);
|
58
|
+
line-height: 32px;
|
59
|
+
}
|
60
|
+
|
61
|
+
&_size_ns {
|
62
|
+
height: 24px;
|
63
|
+
font-size: 13px;
|
64
|
+
line-height: var(--yc-text-lead-line-height);
|
65
|
+
}
|
66
|
+
|
67
|
+
&_size_n {
|
68
|
+
height: 36px;
|
69
|
+
font-size: var(--yc-text-body-font-size);
|
70
|
+
line-height: 36px;
|
71
|
+
}
|
72
|
+
|
73
|
+
&_size_l {
|
74
|
+
height: 38px;
|
75
|
+
font-size: var(--yc-text-lead-font-size);
|
76
|
+
line-height: var(--yc-text-lead-line-height);
|
77
|
+
line-height: 38px;
|
78
|
+
}
|
79
|
+
|
80
|
+
&_size_head {
|
81
|
+
font-size: var(--yc-text-body-font-size);
|
82
|
+
line-height: 36px;
|
83
|
+
}
|
84
|
+
}
|