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,76 @@
|
|
1
|
+
import {createRequestActionTypes, createApiRequest} from '../utils';
|
2
|
+
import '../../services/api';
|
3
|
+
import _ from 'lodash';
|
4
|
+
|
5
|
+
const FETCH_TENANT = createRequestActionTypes('tenant', 'FETCH_TENANT');
|
6
|
+
|
7
|
+
const tenantReducer = (state = {loading: false, tenant: {}}, action) => {
|
8
|
+
switch (action.type) {
|
9
|
+
case FETCH_TENANT.REQUEST: {
|
10
|
+
return {
|
11
|
+
...state,
|
12
|
+
loading: true,
|
13
|
+
};
|
14
|
+
}
|
15
|
+
|
16
|
+
case FETCH_TENANT.SUCCESS: {
|
17
|
+
const {tenant, tenantNodes} = action.data;
|
18
|
+
|
19
|
+
return {
|
20
|
+
...state,
|
21
|
+
tenant,
|
22
|
+
tenantNodes,
|
23
|
+
loading: false,
|
24
|
+
error: undefined,
|
25
|
+
};
|
26
|
+
}
|
27
|
+
|
28
|
+
case FETCH_TENANT.FAILURE: {
|
29
|
+
return {
|
30
|
+
...state,
|
31
|
+
data: action.error,
|
32
|
+
loading: false,
|
33
|
+
};
|
34
|
+
}
|
35
|
+
|
36
|
+
case 'CLEAR_TENANT': {
|
37
|
+
return {
|
38
|
+
...state,
|
39
|
+
tenant: {},
|
40
|
+
loading: true,
|
41
|
+
};
|
42
|
+
}
|
43
|
+
|
44
|
+
default:
|
45
|
+
return state;
|
46
|
+
}
|
47
|
+
};
|
48
|
+
|
49
|
+
export const clearTenant = () => {
|
50
|
+
return {type: 'CLEAR_TENANT'};
|
51
|
+
};
|
52
|
+
|
53
|
+
export const getTenantInfo = ({path}) => {
|
54
|
+
return createApiRequest({
|
55
|
+
request: Promise.all([window.api.getTenantInfo({path}), window.api.getNodes(path)]),
|
56
|
+
actions: FETCH_TENANT,
|
57
|
+
dataHandler: ([tenantData, nodesData]) => {
|
58
|
+
const tenant = tenantData.TenantInfo[0];
|
59
|
+
const tenantNodes = _.map(nodesData?.Tenants[0]?.Nodes, (item) => {
|
60
|
+
if (item.Host && item.Endpoints) {
|
61
|
+
const address = _.find(item.Endpoints, {Name: 'http-mon'})?.Address;
|
62
|
+
return {
|
63
|
+
id: item.NodeId,
|
64
|
+
backend: `${item.Host}${address ? address : ''}`,
|
65
|
+
};
|
66
|
+
}
|
67
|
+
|
68
|
+
return;
|
69
|
+
}).filter(Boolean);
|
70
|
+
|
71
|
+
return {tenant, tenantNodes};
|
72
|
+
},
|
73
|
+
});
|
74
|
+
};
|
75
|
+
|
76
|
+
export default tenantReducer;
|
@@ -0,0 +1,61 @@
|
|
1
|
+
import _ from 'lodash';
|
2
|
+
import {createRequestActionTypes, createApiRequest} from '../utils';
|
3
|
+
import '../../services/api';
|
4
|
+
|
5
|
+
const FETCH_TENANTS = createRequestActionTypes('tenants', 'FETCH_TENANTS');
|
6
|
+
|
7
|
+
const initialState = {loading: true, wasLoaded: false, data: {}};
|
8
|
+
|
9
|
+
const tenants = function (state = initialState, action) {
|
10
|
+
switch (action.type) {
|
11
|
+
case FETCH_TENANTS.REQUEST: {
|
12
|
+
return {
|
13
|
+
...state,
|
14
|
+
loading: true,
|
15
|
+
};
|
16
|
+
}
|
17
|
+
case FETCH_TENANTS.SUCCESS: {
|
18
|
+
return {
|
19
|
+
...state,
|
20
|
+
tenants: action.data,
|
21
|
+
loading: false,
|
22
|
+
wasLoaded: true,
|
23
|
+
error: undefined,
|
24
|
+
};
|
25
|
+
}
|
26
|
+
case FETCH_TENANTS.FAILURE: {
|
27
|
+
return {
|
28
|
+
...state,
|
29
|
+
error: action.error,
|
30
|
+
loading: false,
|
31
|
+
};
|
32
|
+
}
|
33
|
+
default:
|
34
|
+
return state;
|
35
|
+
}
|
36
|
+
};
|
37
|
+
|
38
|
+
export function getTenantsInfo(clusterName) {
|
39
|
+
return createApiRequest({
|
40
|
+
request: window.api.getTenants(clusterName),
|
41
|
+
actions: FETCH_TENANTS,
|
42
|
+
dataHandler: (response, getState) => {
|
43
|
+
const {singleClusterMode} = getState();
|
44
|
+
if (singleClusterMode) {
|
45
|
+
return response.TenantInfo;
|
46
|
+
} else {
|
47
|
+
return response.databases?.map((tenant) => {
|
48
|
+
const node = tenant.Nodes ? tenant.Nodes[0] : {};
|
49
|
+
const address =
|
50
|
+
node.Host && node.Endpoints
|
51
|
+
? _.find(node.Endpoints, {Name: 'http-mon'})?.Address
|
52
|
+
: undefined;
|
53
|
+
const backend = node.Host ? `${node.Host}${address ? address : ''}` : undefined;
|
54
|
+
return {...tenant, backend};
|
55
|
+
});
|
56
|
+
}
|
57
|
+
},
|
58
|
+
});
|
59
|
+
}
|
60
|
+
|
61
|
+
export default tenants;
|
@@ -0,0 +1,64 @@
|
|
1
|
+
import {toolTipConstants} from '../../utils/actionsConstants';
|
2
|
+
import {tooltipTemplates} from '../../utils/tooltip';
|
3
|
+
import _ from 'lodash';
|
4
|
+
|
5
|
+
const initialState = {
|
6
|
+
toolTipVisible: false,
|
7
|
+
currentHoveredRef: undefined,
|
8
|
+
data: undefined,
|
9
|
+
templateType: 'pool',
|
10
|
+
template: tooltipTemplates['pool'],
|
11
|
+
};
|
12
|
+
|
13
|
+
const tooltip = (state = initialState, action) => {
|
14
|
+
switch (action.type) {
|
15
|
+
case toolTipConstants.HIDE_TOOLTIP: {
|
16
|
+
return {
|
17
|
+
...state,
|
18
|
+
currentHoveredRef: undefined,
|
19
|
+
toolTipVisible: false,
|
20
|
+
};
|
21
|
+
}
|
22
|
+
|
23
|
+
case toolTipConstants.UPDATE_REF: {
|
24
|
+
if (action.templateType === 'cell' && _.isEqual(action.node, state.currentHoveredRef)) {
|
25
|
+
return {
|
26
|
+
...state,
|
27
|
+
currentHoveredRef: undefined,
|
28
|
+
toolTipVisible: false,
|
29
|
+
};
|
30
|
+
}
|
31
|
+
|
32
|
+
return {
|
33
|
+
...state,
|
34
|
+
toolTipVisible: true,
|
35
|
+
currentHoveredRef: action.node,
|
36
|
+
positions: action.positions,
|
37
|
+
data: action.data,
|
38
|
+
additionalData: action.additionalData,
|
39
|
+
type: action.templateType,
|
40
|
+
template: tooltipTemplates[action.templateType],
|
41
|
+
};
|
42
|
+
}
|
43
|
+
default: {
|
44
|
+
return state;
|
45
|
+
}
|
46
|
+
}
|
47
|
+
};
|
48
|
+
|
49
|
+
export const hideTooltip = () => {
|
50
|
+
return {type: toolTipConstants.HIDE_TOOLTIP};
|
51
|
+
};
|
52
|
+
|
53
|
+
export const showTooltip = (node, data, templateType, additionalData, positions) => {
|
54
|
+
return {
|
55
|
+
type: toolTipConstants.UPDATE_REF,
|
56
|
+
node,
|
57
|
+
data,
|
58
|
+
templateType,
|
59
|
+
additionalData,
|
60
|
+
positions,
|
61
|
+
};
|
62
|
+
};
|
63
|
+
|
64
|
+
export default tooltip;
|
@@ -0,0 +1,49 @@
|
|
1
|
+
import {createRequestActionTypes, createApiRequest} from '../utils';
|
2
|
+
import '../../services/api';
|
3
|
+
|
4
|
+
const FETCH_VDISK = createRequestActionTypes('VDISK', 'FETCH_VDISK');
|
5
|
+
|
6
|
+
const initialState = {loading: true, wasLoaded: false, data: undefined};
|
7
|
+
|
8
|
+
const vdisk = (state = initialState, action) => {
|
9
|
+
switch (action.type) {
|
10
|
+
case FETCH_VDISK.REQUEST: {
|
11
|
+
return {
|
12
|
+
...state,
|
13
|
+
loading: true,
|
14
|
+
};
|
15
|
+
}
|
16
|
+
case FETCH_VDISK.SUCCESS: {
|
17
|
+
return {
|
18
|
+
...state,
|
19
|
+
data: action.data,
|
20
|
+
loading: false,
|
21
|
+
wasLoaded: true,
|
22
|
+
error: undefined,
|
23
|
+
};
|
24
|
+
}
|
25
|
+
case FETCH_VDISK.FAILURE: {
|
26
|
+
return {
|
27
|
+
...state,
|
28
|
+
error: action.error,
|
29
|
+
loading: false,
|
30
|
+
};
|
31
|
+
}
|
32
|
+
case 'CLEAR_STORE': {
|
33
|
+
return initialState;
|
34
|
+
}
|
35
|
+
default:
|
36
|
+
return state;
|
37
|
+
}
|
38
|
+
};
|
39
|
+
|
40
|
+
export const clearStore = () => ({type: 'CLEAR_STORE'});
|
41
|
+
|
42
|
+
export const getVdiskInfo = ({vdiskId, pdiskId, nodeId}) => {
|
43
|
+
return createApiRequest({
|
44
|
+
request: window.api.getVdiskInfo({vdiskId, pdiskId, nodeId}),
|
45
|
+
actions: FETCH_VDISK,
|
46
|
+
});
|
47
|
+
};
|
48
|
+
|
49
|
+
export default vdisk;
|
@@ -0,0 +1,133 @@
|
|
1
|
+
import {createReduxLocationActions} from 'redux-location-state';
|
2
|
+
import qs from 'qs';
|
3
|
+
import _ from 'lodash';
|
4
|
+
import {stateToParams} from 'redux-location-state/lib/stateToParams';
|
5
|
+
import {parseQuery} from 'redux-location-state/lib/parseQuery';
|
6
|
+
import {LOCATION_PUSH, LOCATION_POP} from 'redux-location-state/lib/constants';
|
7
|
+
import {getMatchingDeclaredPath} from 'redux-location-state/lib/helpers';
|
8
|
+
|
9
|
+
import {initialState as initialSettingsState} from './reducers/settings';
|
10
|
+
import {initialState as initialHeatmapState} from './reducers/heatmap';
|
11
|
+
|
12
|
+
const paramSetup = {
|
13
|
+
global: {
|
14
|
+
problemFilter: {
|
15
|
+
stateKey: 'settings.problemFilter',
|
16
|
+
initialState: initialSettingsState.problemFilter,
|
17
|
+
},
|
18
|
+
},
|
19
|
+
'/tenant/schema': {
|
20
|
+
sort: {
|
21
|
+
stateKey: 'heatmap.sort',
|
22
|
+
initialState: initialHeatmapState.sort,
|
23
|
+
type: 'bool',
|
24
|
+
},
|
25
|
+
heatmap: {
|
26
|
+
stateKey: 'heatmap.heatmap',
|
27
|
+
initialState: initialHeatmapState.heatmap,
|
28
|
+
type: 'bool',
|
29
|
+
},
|
30
|
+
currentMetric: {
|
31
|
+
stateKey: 'heatmap.currentMetric',
|
32
|
+
initialState: initialHeatmapState.currentMetric,
|
33
|
+
},
|
34
|
+
schema: {
|
35
|
+
stateKey: 'schema.currentSchemaPath',
|
36
|
+
},
|
37
|
+
stateFilter: {
|
38
|
+
stateKey: 'tablets.stateFilter',
|
39
|
+
type: 'array',
|
40
|
+
},
|
41
|
+
typeFilter: {
|
42
|
+
stateKey: 'tablets.typeFilter',
|
43
|
+
type: 'array',
|
44
|
+
},
|
45
|
+
},
|
46
|
+
};
|
47
|
+
|
48
|
+
function mergeLocationToState(state, location) {
|
49
|
+
return _.merge({}, state, location.query);
|
50
|
+
}
|
51
|
+
|
52
|
+
function restoreUnknownParams(location, prevLocation) {
|
53
|
+
const {search, ...rest} = location;
|
54
|
+
const params = qs.parse(prevLocation.search.slice(1));
|
55
|
+
|
56
|
+
// figure out which path key inside paramSetup matches location.pathname
|
57
|
+
const declaredPath = getMatchingDeclaredPath(paramSetup, location);
|
58
|
+
const entries = declaredPath && paramSetup[declaredPath];
|
59
|
+
|
60
|
+
// remove params which are mapped for this page
|
61
|
+
_.each(_.keys(entries), (param) => {
|
62
|
+
delete params[param];
|
63
|
+
});
|
64
|
+
// and globally
|
65
|
+
_.each(_.keys(paramSetup.global || {}), (param) => {
|
66
|
+
delete params[param];
|
67
|
+
});
|
68
|
+
|
69
|
+
const restoredParams = qs.stringify(params, {encoder: encodeURIComponent});
|
70
|
+
const searchDelimiter = search.startsWith('?') ? '&' : '?';
|
71
|
+
|
72
|
+
return {search: `${search}${searchDelimiter}${restoredParams}`, ...rest};
|
73
|
+
}
|
74
|
+
|
75
|
+
let prevSearchStringFromState = '';
|
76
|
+
|
77
|
+
// Keep intact params that are not present in paramSetup
|
78
|
+
function overwriteLocationHandling(setupObject, nextState, prevLocation) {
|
79
|
+
const nextLocation = stateToParams(setupObject, nextState, prevLocation);
|
80
|
+
let {location} = nextLocation;
|
81
|
+
|
82
|
+
if (location.search !== prevSearchStringFromState) {
|
83
|
+
const searchRe = /\?\w+/;
|
84
|
+
prevSearchStringFromState = location.search;
|
85
|
+
|
86
|
+
if (searchRe.test(prevLocation.search)) {
|
87
|
+
location = restoreUnknownParams(location, prevLocation);
|
88
|
+
}
|
89
|
+
|
90
|
+
return {...nextLocation, location};
|
91
|
+
} else {
|
92
|
+
// nothing to do here, state parts represented in query params didn't change
|
93
|
+
return {location: prevLocation, shouldPush: false};
|
94
|
+
}
|
95
|
+
}
|
96
|
+
|
97
|
+
function makeReducersWithLocation(setupObject, mapLocationToState, rootReducer) {
|
98
|
+
const locationReducer = (state, action) => {
|
99
|
+
const {type, payload} = action;
|
100
|
+
if (!payload) {
|
101
|
+
return state;
|
102
|
+
}
|
103
|
+
if (LOCATION_POP === type || LOCATION_PUSH === type) {
|
104
|
+
payload.query = parseQuery(setupObject, payload);
|
105
|
+
return mapLocationToState(state, payload);
|
106
|
+
}
|
107
|
+
return state;
|
108
|
+
};
|
109
|
+
|
110
|
+
return (state, action) => {
|
111
|
+
const postReducerState = rootReducer(state, action);
|
112
|
+
const postLocationState = locationReducer(postReducerState, action);
|
113
|
+
const hasChanged = postLocationState !== state;
|
114
|
+
|
115
|
+
return hasChanged ? postLocationState : state;
|
116
|
+
};
|
117
|
+
}
|
118
|
+
|
119
|
+
export default function getLocationMiddleware(history, rootReducer) {
|
120
|
+
const {locationMiddleware} = createReduxLocationActions(
|
121
|
+
paramSetup,
|
122
|
+
mergeLocationToState,
|
123
|
+
history,
|
124
|
+
rootReducer,
|
125
|
+
overwriteLocationHandling,
|
126
|
+
);
|
127
|
+
const reducersWithLocation = makeReducersWithLocation(
|
128
|
+
paramSetup,
|
129
|
+
mergeLocationToState,
|
130
|
+
rootReducer,
|
131
|
+
);
|
132
|
+
return {locationMiddleware, reducersWithLocation};
|
133
|
+
}
|
@@ -0,0 +1,55 @@
|
|
1
|
+
import {Toaster} from '@yandex-cloud/uikit';
|
2
|
+
import {SET_UNAUTHENTICATED} from './reducers/authentication';
|
3
|
+
|
4
|
+
export const nop = (result) => result;
|
5
|
+
|
6
|
+
const toaster = new Toaster();
|
7
|
+
|
8
|
+
export function createRequestActionTypes(prefix, type) {
|
9
|
+
return {
|
10
|
+
REQUEST: `${prefix}/${type}_REQUEST`,
|
11
|
+
SUCCESS: `${prefix}/${type}_SUCCESS`,
|
12
|
+
FAILURE: `${prefix}/${type}_FAILURE`,
|
13
|
+
};
|
14
|
+
}
|
15
|
+
|
16
|
+
export function createApiRequest({actions, request, dataHandler = nop}) {
|
17
|
+
const doRequest = async function (dispatch, getState) {
|
18
|
+
dispatch({
|
19
|
+
type: actions.REQUEST,
|
20
|
+
});
|
21
|
+
|
22
|
+
try {
|
23
|
+
const result = await request;
|
24
|
+
const data = dataHandler(result, getState);
|
25
|
+
|
26
|
+
dispatch({
|
27
|
+
type: actions.SUCCESS,
|
28
|
+
data,
|
29
|
+
});
|
30
|
+
|
31
|
+
return data;
|
32
|
+
} catch (error) {
|
33
|
+
if (error && error.status === 401) {
|
34
|
+
dispatch({
|
35
|
+
type: SET_UNAUTHENTICATED.SUCCESS,
|
36
|
+
});
|
37
|
+
} else if (error && error.status && error.statusText) {
|
38
|
+
toaster.createToast({
|
39
|
+
name: 'Request failure',
|
40
|
+
title: 'Request failure',
|
41
|
+
type: 'error',
|
42
|
+
content: `${error.status} ${error.statusText}`,
|
43
|
+
isClosable: true,
|
44
|
+
allowAutoHiding: false,
|
45
|
+
});
|
46
|
+
}
|
47
|
+
dispatch({
|
48
|
+
type: actions.FAILURE,
|
49
|
+
error,
|
50
|
+
});
|
51
|
+
}
|
52
|
+
};
|
53
|
+
|
54
|
+
return doRequest;
|
55
|
+
}
|
@@ -0,0 +1,254 @@
|
|
1
|
+
@mixin container() {
|
2
|
+
max-width: 1170px;
|
3
|
+
margin: 0 auto;
|
4
|
+
padding: 0 15px;
|
5
|
+
}
|
6
|
+
|
7
|
+
@mixin container-fluid() {
|
8
|
+
max-width: 100%;
|
9
|
+
padding: 0 15px;
|
10
|
+
}
|
11
|
+
|
12
|
+
@mixin flex-container() {
|
13
|
+
display: flex;
|
14
|
+
flex: 1 1 auto;
|
15
|
+
flex-direction: column;
|
16
|
+
}
|
17
|
+
|
18
|
+
@mixin body-typography() {
|
19
|
+
font-size: var(--yc-text-body-font-size);
|
20
|
+
line-height: var(--yc-text-body-line-height);
|
21
|
+
}
|
22
|
+
@mixin body2-typography() {
|
23
|
+
font-size: var(--yc-text-body2-font-size);
|
24
|
+
line-height: var(--yc-text-body2-line-height);
|
25
|
+
}
|
26
|
+
@mixin lead-typography() {
|
27
|
+
font-size: var(--yc-text-lead-font-size);
|
28
|
+
line-height: var(--yc-text-lead-line-height);
|
29
|
+
}
|
30
|
+
|
31
|
+
@mixin loader() {
|
32
|
+
position: fixed;
|
33
|
+
z-index: 99999999;
|
34
|
+
top: 50%;
|
35
|
+
left: 50%;
|
36
|
+
|
37
|
+
display: flex;
|
38
|
+
align-items: center;
|
39
|
+
justify-content: center;
|
40
|
+
}
|
41
|
+
|
42
|
+
@mixin cell-container() {
|
43
|
+
display: inline-block;
|
44
|
+
overflow: hidden;
|
45
|
+
|
46
|
+
max-width: 600px;
|
47
|
+
|
48
|
+
cursor: pointer;
|
49
|
+
white-space: nowrap;
|
50
|
+
text-overflow: ellipsis;
|
51
|
+
}
|
52
|
+
|
53
|
+
@mixin query-data-table() {
|
54
|
+
& .data-table {
|
55
|
+
$_: &;
|
56
|
+
|
57
|
+
&__table {
|
58
|
+
border-spacing: 0;
|
59
|
+
|
60
|
+
border-collapse: separate;
|
61
|
+
}
|
62
|
+
|
63
|
+
&__th,
|
64
|
+
&__td {
|
65
|
+
vertical-align: middle;
|
66
|
+
|
67
|
+
border: none;
|
68
|
+
}
|
69
|
+
|
70
|
+
&__box {
|
71
|
+
.data-table__table-wrapper {
|
72
|
+
padding-bottom: 20px;
|
73
|
+
}
|
74
|
+
}
|
75
|
+
|
76
|
+
&__row,
|
77
|
+
&__sticky th {
|
78
|
+
height: 40px;
|
79
|
+
}
|
80
|
+
|
81
|
+
&__th {
|
82
|
+
box-shadow: inset 0 -1px 0 0 var(--yc-tabs-color-divider);
|
83
|
+
}
|
84
|
+
}
|
85
|
+
}
|
86
|
+
|
87
|
+
.link {
|
88
|
+
text-decoration: none;
|
89
|
+
|
90
|
+
color: var(--yc-color-text-link);
|
91
|
+
|
92
|
+
&_external {
|
93
|
+
margin-right: 10px;
|
94
|
+
}
|
95
|
+
|
96
|
+
&:hover {
|
97
|
+
color: var(--yc-color-text-link-hover);
|
98
|
+
}
|
99
|
+
}
|
100
|
+
|
101
|
+
@mixin freeze-nth-column($nth: 1, $left: 0) {
|
102
|
+
$border-width: 1px;
|
103
|
+
$clearance-width: 1px; /* Delete clearance and cancel column shadow for previous columns */
|
104
|
+
|
105
|
+
/* Freeze td */
|
106
|
+
& .data-table__td:nth-child(#{$nth}),
|
107
|
+
& .data-table__head-row:first-child .data-table__th:nth-child(#{$nth}) {
|
108
|
+
position: sticky;
|
109
|
+
z-index: 2000;
|
110
|
+
left: $left;
|
111
|
+
|
112
|
+
border-right: $border-width solid var(--yc-color-line-generic);
|
113
|
+
background-color: var(--yc-color-base-background);
|
114
|
+
}
|
115
|
+
|
116
|
+
@for $i from 0 through $nth {
|
117
|
+
& .data-table__td:nth-child(#{$i}),
|
118
|
+
& .data-table__head-row:first-child .data-table__th:nth-child(#{$i}) {
|
119
|
+
box-shadow: -$clearance-width 0 0 var(--yc-color-base-background);
|
120
|
+
|
121
|
+
@if $i < $nth {
|
122
|
+
border-right: $border-width solid var(--yc-color-base-background);
|
123
|
+
}
|
124
|
+
}
|
125
|
+
}
|
126
|
+
}
|
127
|
+
|
128
|
+
@mixin table-styles {
|
129
|
+
& .data-table {
|
130
|
+
width: 100%;
|
131
|
+
|
132
|
+
&__table {
|
133
|
+
width: 100%;
|
134
|
+
|
135
|
+
border-spacing: 0;
|
136
|
+
|
137
|
+
border-collapse: separate;
|
138
|
+
|
139
|
+
font-size: var(--yc-text-body2-font-size);
|
140
|
+
line-height: 18px;
|
141
|
+
}
|
142
|
+
|
143
|
+
&__th {
|
144
|
+
height: 40px;
|
145
|
+
}
|
146
|
+
|
147
|
+
&__box {
|
148
|
+
.data-table__table-wrapper {
|
149
|
+
padding-bottom: 20px;
|
150
|
+
}
|
151
|
+
}
|
152
|
+
}
|
153
|
+
}
|
154
|
+
|
155
|
+
@mixin table-sticky-styles {
|
156
|
+
& .data-table {
|
157
|
+
&__th {
|
158
|
+
height: auto;
|
159
|
+
}
|
160
|
+
}
|
161
|
+
|
162
|
+
& {
|
163
|
+
padding-bottom: 20px;
|
164
|
+
}
|
165
|
+
}
|
166
|
+
|
167
|
+
@mixin json-tree-styles {
|
168
|
+
// stylelint-disable
|
169
|
+
font-family: var(--yc-font-family-monospace) !important;
|
170
|
+
font-size: var(--yc-text-code-font-size) !important;
|
171
|
+
line-height: var(--yc-text-code-line-height) !important;
|
172
|
+
// stylelint-enable
|
173
|
+
|
174
|
+
.json-inspector__leaf_composite:before {
|
175
|
+
position: absolute;
|
176
|
+
left: 20px;
|
177
|
+
|
178
|
+
color: var(--yc-color-text-secondary);
|
179
|
+
|
180
|
+
font-size: 9px;
|
181
|
+
}
|
182
|
+
.json-inspector__leaf_composite.json-inspector__leaf_root:before {
|
183
|
+
left: 0;
|
184
|
+
}
|
185
|
+
:not(.json-inspector__leaf_expanded).json-inspector__leaf_composite:before {
|
186
|
+
content: '[+]';
|
187
|
+
}
|
188
|
+
.json-inspector__leaf_expanded.json-inspector__leaf_composite:before {
|
189
|
+
content: '[-]';
|
190
|
+
}
|
191
|
+
|
192
|
+
& .json-inspector {
|
193
|
+
&__key {
|
194
|
+
color: var(--yc-color-text-misc);
|
195
|
+
}
|
196
|
+
&__leaf {
|
197
|
+
position: relative;
|
198
|
+
|
199
|
+
padding-left: 20px;
|
200
|
+
}
|
201
|
+
&__leaf_root {
|
202
|
+
padding-left: 0;
|
203
|
+
}
|
204
|
+
&__line {
|
205
|
+
padding-left: 20px;
|
206
|
+
}
|
207
|
+
&__toolbar {
|
208
|
+
width: 300px;
|
209
|
+
|
210
|
+
margin-bottom: 10px;
|
211
|
+
|
212
|
+
border: 1px solid var(--yc-color-line-generic);
|
213
|
+
border-radius: 4px;
|
214
|
+
}
|
215
|
+
&__search {
|
216
|
+
box-sizing: border-box;
|
217
|
+
|
218
|
+
width: 300px;
|
219
|
+
height: 28px;
|
220
|
+
|
221
|
+
margin: 0;
|
222
|
+
|
223
|
+
padding: 0;
|
224
|
+
|
225
|
+
vertical-align: top;
|
226
|
+
|
227
|
+
color: var(--yc-color-text-primary);
|
228
|
+
|
229
|
+
border: 0 solid transparent;
|
230
|
+
border-width: 0 8px;
|
231
|
+
border-right-width: 22px;
|
232
|
+
outline: 0;
|
233
|
+
background: none;
|
234
|
+
|
235
|
+
font-family: var(--yc-font-family);
|
236
|
+
font-size: 13px;
|
237
|
+
}
|
238
|
+
&__value {
|
239
|
+
&_helper {
|
240
|
+
color: var(--yc-color-text-secondary);
|
241
|
+
}
|
242
|
+
}
|
243
|
+
&__line:hover:after {
|
244
|
+
background: var(--yc-color-base-simple-hover);
|
245
|
+
}
|
246
|
+
&__show-original:before {
|
247
|
+
color: var(--yc-color-text-secondary);
|
248
|
+
}
|
249
|
+
&__show-original:hover:after,
|
250
|
+
&__show-original:hover:before {
|
251
|
+
color: var(--yc-color-text-primary);
|
252
|
+
}
|
253
|
+
}
|
254
|
+
}
|