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,224 @@
|
|
1
|
+
import AxiosWrapper from '@yandex-cloud/axios-wrapper';
|
2
|
+
|
3
|
+
import {backend as BACKEND} from '../store';
|
4
|
+
import {StorageTypes} from '../store/reducers/storage';
|
5
|
+
|
6
|
+
const config = {withCredentials: !window.custom_backend};
|
7
|
+
|
8
|
+
const {settingsApi} = window.web_version ? window.systemSettings : {};
|
9
|
+
|
10
|
+
export class YdbEmbeddedAPI extends AxiosWrapper {
|
11
|
+
getPath(path) {
|
12
|
+
return `${BACKEND}${path}`;
|
13
|
+
}
|
14
|
+
getClusterInfo() {
|
15
|
+
return this.get(this.getPath('/viewer/json/cluster'), {tablets: true});
|
16
|
+
}
|
17
|
+
getNodes(path) {
|
18
|
+
return this.get(this.getPath('/viewer/json/compute?enums=true'), {path});
|
19
|
+
}
|
20
|
+
getNodeInfo(id) {
|
21
|
+
return this.get(this.getPath('/viewer/json/sysinfo?enums=true'), {
|
22
|
+
node_id: id,
|
23
|
+
});
|
24
|
+
}
|
25
|
+
getTenants() {
|
26
|
+
return this.get(this.getPath('/viewer/json/tenantinfo'), {
|
27
|
+
tablets: 1,
|
28
|
+
storage: 1,
|
29
|
+
nodes: 1,
|
30
|
+
});
|
31
|
+
}
|
32
|
+
getTenantInfo({path}) {
|
33
|
+
return this.get(this.getPath('/viewer/json/tenantinfo'), {
|
34
|
+
path,
|
35
|
+
tablets: true,
|
36
|
+
storage: true,
|
37
|
+
});
|
38
|
+
}
|
39
|
+
getStorageInfo({tenant, filter, nodeId, type}) {
|
40
|
+
return this.get(
|
41
|
+
this.getPath(
|
42
|
+
`/viewer/json/${type === StorageTypes.nodes ? 'nodes' : 'storage'}?enums=true`,
|
43
|
+
),
|
44
|
+
{
|
45
|
+
tenant,
|
46
|
+
node_id: nodeId,
|
47
|
+
with: filter,
|
48
|
+
},
|
49
|
+
);
|
50
|
+
}
|
51
|
+
getPdiskInfo(nodeId, pdiskId) {
|
52
|
+
return this.get(this.getPath('/viewer/json/pdiskinfo?enums=true'), {
|
53
|
+
filter: `(NodeId=${nodeId}${pdiskId ? `;PDiskId=${pdiskId}` : ''})`,
|
54
|
+
});
|
55
|
+
}
|
56
|
+
getVdiskInfo({vdiskId, pdiskId, nodeId}) {
|
57
|
+
return this.get(this.getPath('/viewer/json/vdiskinfo?enums=true'), {
|
58
|
+
filter: `(VDiskId=${vdiskId ?? ''};PDiskId=${pdiskId ?? ''};NodeId=${nodeId ?? ''})`,
|
59
|
+
});
|
60
|
+
}
|
61
|
+
getGroupInfo(groupId) {
|
62
|
+
return this.get(this.getPath('/viewer/json/storage?enums=true'), {
|
63
|
+
group_id: groupId,
|
64
|
+
});
|
65
|
+
}
|
66
|
+
getHostInfo() {
|
67
|
+
return this.get(this.getPath('/viewer/json/sysinfo?node_id=.&enums=true'));
|
68
|
+
}
|
69
|
+
getTabletsInfo({nodes = [], path}) {
|
70
|
+
const filter = nodes.length > 0 && `(NodeId=[${nodes.join(',')}])`;
|
71
|
+
return this.get(this.getPath('/viewer/json/tabletinfo'), {
|
72
|
+
filter,
|
73
|
+
path,
|
74
|
+
enums: true,
|
75
|
+
});
|
76
|
+
}
|
77
|
+
getSchema({path}) {
|
78
|
+
return this.get(
|
79
|
+
this.getPath('/viewer/json/describe'),
|
80
|
+
{
|
81
|
+
path,
|
82
|
+
enums: true,
|
83
|
+
backup: false,
|
84
|
+
private: false,
|
85
|
+
partition_config: false,
|
86
|
+
partition_stats: false,
|
87
|
+
partitioning_info: false,
|
88
|
+
},
|
89
|
+
{concurrentId: `getSchema|${path}`},
|
90
|
+
);
|
91
|
+
}
|
92
|
+
getDescribe({path}) {
|
93
|
+
return this.get(this.getPath('/viewer/json/describe'), {
|
94
|
+
path,
|
95
|
+
enums: true,
|
96
|
+
});
|
97
|
+
}
|
98
|
+
getSchemaAcl({path}) {
|
99
|
+
return this.get(
|
100
|
+
this.getPath('/viewer/json/metainfo'),
|
101
|
+
{
|
102
|
+
path,
|
103
|
+
},
|
104
|
+
{concurrentId: `getSchemaAcl|${path}`},
|
105
|
+
);
|
106
|
+
}
|
107
|
+
getHeatmapData({path}) {
|
108
|
+
return this.get(this.getPath('/viewer/json/describe'), {
|
109
|
+
path,
|
110
|
+
enums: true,
|
111
|
+
backup: false,
|
112
|
+
private: false,
|
113
|
+
children: false,
|
114
|
+
partition_config: false,
|
115
|
+
partition_stats: true,
|
116
|
+
});
|
117
|
+
}
|
118
|
+
getNetwork(path) {
|
119
|
+
return this.get(this.getPath('/viewer/json/netinfo'), {
|
120
|
+
enums: true,
|
121
|
+
path,
|
122
|
+
});
|
123
|
+
}
|
124
|
+
getPoolInfo(poolName) {
|
125
|
+
return this.get(this.getPath('/viewer/json/storage'), {
|
126
|
+
pool: poolName,
|
127
|
+
enums: true,
|
128
|
+
});
|
129
|
+
}
|
130
|
+
getTablet({id}) {
|
131
|
+
return this.get(this.getPath(`/viewer/json/tabletinfo?filter=(TabletId=${id})`), {
|
132
|
+
enums: true,
|
133
|
+
});
|
134
|
+
}
|
135
|
+
getTabletHistory({id}) {
|
136
|
+
return this.get(this.getPath(`/viewer/json/tabletinfo?filter=(TabletId=${id})`), {
|
137
|
+
enums: true,
|
138
|
+
merge: false,
|
139
|
+
});
|
140
|
+
}
|
141
|
+
getNodesList() {
|
142
|
+
return this.get(this.getPath('/viewer/json/nodelist'), {enums: true});
|
143
|
+
}
|
144
|
+
getTenantsList() {
|
145
|
+
return this.get(this.getPath('/viewer/json/tenants'), {
|
146
|
+
enums: true,
|
147
|
+
state: 0,
|
148
|
+
});
|
149
|
+
}
|
150
|
+
sendQuery(query, database, action, stats) {
|
151
|
+
return this.post(this.getPath('/viewer/json/query'), {
|
152
|
+
query,
|
153
|
+
database,
|
154
|
+
action,
|
155
|
+
stats,
|
156
|
+
});
|
157
|
+
}
|
158
|
+
getExplainQuery(query, database) {
|
159
|
+
return this.post(this.getPath('/viewer/json/query'), {
|
160
|
+
query,
|
161
|
+
database,
|
162
|
+
action: 'explain',
|
163
|
+
});
|
164
|
+
}
|
165
|
+
getExplainQueryAst(query, database) {
|
166
|
+
return this.post(this.getPath('/viewer/json/query'), {
|
167
|
+
query,
|
168
|
+
database,
|
169
|
+
action: 'explain-ast',
|
170
|
+
});
|
171
|
+
}
|
172
|
+
getHotKeys(path, enableSampling) {
|
173
|
+
return this.get(this.getPath('/viewer/json/hotkeys'), {
|
174
|
+
path,
|
175
|
+
enable_sampling: enableSampling,
|
176
|
+
});
|
177
|
+
}
|
178
|
+
getHealthcheckInfo(database) {
|
179
|
+
return this.get(this.getPath('/viewer/json/healthcheck'), {
|
180
|
+
tenant: database,
|
181
|
+
});
|
182
|
+
}
|
183
|
+
killTablet(id) {
|
184
|
+
return this.get(this.getPath(`/tablets?KillTabletID=${id}`));
|
185
|
+
}
|
186
|
+
stopTablet(id, hiveId) {
|
187
|
+
return this.get(
|
188
|
+
this.getPath(`/tablets/app?TabletID=${hiveId}&page=StopTablet&tablet=${id}`),
|
189
|
+
);
|
190
|
+
}
|
191
|
+
resumeTablet(id, hiveId) {
|
192
|
+
return this.get(
|
193
|
+
this.getPath(`/tablets/app?TabletID=${hiveId}&page=ResumeTablet&tablet=${id}`),
|
194
|
+
);
|
195
|
+
}
|
196
|
+
getTabletDescribe(TenantId) {
|
197
|
+
return this.get(this.getPath('/viewer/json/describe'), {
|
198
|
+
schemeshard_id: TenantId.SchemeShard,
|
199
|
+
path_id: TenantId.PathId,
|
200
|
+
});
|
201
|
+
}
|
202
|
+
postSetting(name, value) {
|
203
|
+
return this.request({
|
204
|
+
method: 'PATCH',
|
205
|
+
url: settingsApi,
|
206
|
+
data: {[name]: value},
|
207
|
+
});
|
208
|
+
}
|
209
|
+
authenticate(user, password) {
|
210
|
+
return this.post(this.getPath('/login'), {
|
211
|
+
user,
|
212
|
+
password,
|
213
|
+
});
|
214
|
+
}
|
215
|
+
logout() {
|
216
|
+
return this.post(this.getPath('/logout'), {});
|
217
|
+
}
|
218
|
+
whoami() {
|
219
|
+
return this.get(this.getPath('/viewer/json/whoami'));
|
220
|
+
}
|
221
|
+
}
|
222
|
+
|
223
|
+
const api = new YdbEmbeddedAPI({config: config});
|
224
|
+
window.api = api;
|
@@ -0,0 +1,61 @@
|
|
1
|
+
import {createStore, applyMiddleware, compose} from 'redux';
|
2
|
+
import thunkMiddleware from 'redux-thunk';
|
3
|
+
import getLocationMiddleware from './state-url-mapping';
|
4
|
+
import {createBrowserHistory} from 'history';
|
5
|
+
import {listenForHistoryChange} from 'redux-location-state';
|
6
|
+
|
7
|
+
import rootReducer from './reducers';
|
8
|
+
|
9
|
+
import url from 'url';
|
10
|
+
|
11
|
+
export const webVersion = window.web_version;
|
12
|
+
|
13
|
+
export const customBackend = window.custom_backend;
|
14
|
+
|
15
|
+
export const getUrlData = (href, singleClusterMode) => {
|
16
|
+
if (!singleClusterMode) {
|
17
|
+
const {backend, clusterName} = url.parse(href, true).query;
|
18
|
+
return {
|
19
|
+
basename: '/',
|
20
|
+
backend,
|
21
|
+
clusterName,
|
22
|
+
};
|
23
|
+
} else if (customBackend) {
|
24
|
+
const {backend} = url.parse(href, true).query;
|
25
|
+
return {
|
26
|
+
basename: '/',
|
27
|
+
backend: backend || window.custom_backend,
|
28
|
+
};
|
29
|
+
} else {
|
30
|
+
const parsedPrefix = window.location.pathname.match(/.*(?=\/monitoring)/) || [];
|
31
|
+
const basenamePrefix = Boolean(parsedPrefix.length) && parsedPrefix[0];
|
32
|
+
const basename = [basenamePrefix, 'monitoring'].filter(Boolean).join('/');
|
33
|
+
|
34
|
+
return {
|
35
|
+
basename,
|
36
|
+
backend: basenamePrefix || '',
|
37
|
+
};
|
38
|
+
}
|
39
|
+
};
|
40
|
+
|
41
|
+
const composeEnhancers = window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ || compose;
|
42
|
+
|
43
|
+
export let backend, basename, clusterName;
|
44
|
+
|
45
|
+
function _configureStore(aRootReducer, history, singleClusterMode) {
|
46
|
+
const {locationMiddleware, reducersWithLocation} = getLocationMiddleware(history, aRootReducer);
|
47
|
+
const middlewares = applyMiddleware(thunkMiddleware, locationMiddleware);
|
48
|
+
|
49
|
+
return composeEnhancers(middlewares)(createStore)(reducersWithLocation, {
|
50
|
+
singleClusterMode,
|
51
|
+
});
|
52
|
+
}
|
53
|
+
|
54
|
+
export default function configureStore(aRootReducer = rootReducer, singleClusterMode = true) {
|
55
|
+
({backend, basename, clusterName} = getUrlData(window.location.href, singleClusterMode));
|
56
|
+
const history = createBrowserHistory({basename});
|
57
|
+
|
58
|
+
const store = _configureStore(aRootReducer, history, singleClusterMode);
|
59
|
+
listenForHistoryChange(store, history);
|
60
|
+
return {history, store};
|
61
|
+
}
|
@@ -0,0 +1,77 @@
|
|
1
|
+
import {createRequestActionTypes, createApiRequest} from '../utils';
|
2
|
+
import '../../services/api';
|
3
|
+
|
4
|
+
export const SET_UNAUTHENTICATED = createRequestActionTypes(
|
5
|
+
'authentication',
|
6
|
+
'SET_UNAUTHENTICATED',
|
7
|
+
);
|
8
|
+
export const SET_AUTHENTICATED = createRequestActionTypes('authentication', 'SET_AUTHENTICATED');
|
9
|
+
export const FETCH_USER = createRequestActionTypes('authentication', 'FETCH_USER');
|
10
|
+
|
11
|
+
const initialState = {
|
12
|
+
isAuthenticated: true,
|
13
|
+
user: '',
|
14
|
+
error: '',
|
15
|
+
};
|
16
|
+
|
17
|
+
const authentication = function (state = initialState, action) {
|
18
|
+
switch (action.type) {
|
19
|
+
case SET_UNAUTHENTICATED.SUCCESS: {
|
20
|
+
return {...state, isAuthenticated: false, user: '', error: ''};
|
21
|
+
}
|
22
|
+
case SET_AUTHENTICATED.SUCCESS: {
|
23
|
+
return {...state, isAuthenticated: true, error: ''};
|
24
|
+
}
|
25
|
+
case SET_AUTHENTICATED.FAILURE: {
|
26
|
+
return {...state, error: action.error};
|
27
|
+
}
|
28
|
+
case FETCH_USER.SUCCESS: {
|
29
|
+
return {...state, user: action.data};
|
30
|
+
}
|
31
|
+
|
32
|
+
default:
|
33
|
+
return {...state};
|
34
|
+
}
|
35
|
+
};
|
36
|
+
|
37
|
+
export const setIsNotAuthenticated = () => {
|
38
|
+
return (dispatch) => {
|
39
|
+
dispatch({
|
40
|
+
type: SET_UNAUTHENTICATED.SUCCESS,
|
41
|
+
});
|
42
|
+
};
|
43
|
+
};
|
44
|
+
export const setIsAuthenticated = () => {
|
45
|
+
return (dispatch) => {
|
46
|
+
dispatch({
|
47
|
+
type: SET_AUTHENTICATED.SUCCESS,
|
48
|
+
});
|
49
|
+
};
|
50
|
+
};
|
51
|
+
|
52
|
+
export const authenticate = (user, password) => {
|
53
|
+
return createApiRequest({
|
54
|
+
request: window.api.authenticate(user, password),
|
55
|
+
actions: SET_AUTHENTICATED,
|
56
|
+
});
|
57
|
+
};
|
58
|
+
|
59
|
+
export const logout = () => {
|
60
|
+
return createApiRequest({
|
61
|
+
request: window.api.logout(),
|
62
|
+
actions: SET_UNAUTHENTICATED,
|
63
|
+
});
|
64
|
+
};
|
65
|
+
|
66
|
+
export const getUser = () => {
|
67
|
+
return createApiRequest({
|
68
|
+
request: window.api.whoami(),
|
69
|
+
actions: FETCH_USER,
|
70
|
+
dataHandler: (data) => {
|
71
|
+
const {UserSID, AuthType} = data;
|
72
|
+
return AuthType === 'Login' ? UserSID : undefined;
|
73
|
+
},
|
74
|
+
});
|
75
|
+
};
|
76
|
+
|
77
|
+
export default authentication;
|
@@ -0,0 +1,52 @@
|
|
1
|
+
import {createRequestActionTypes, createApiRequest} from '../utils';
|
2
|
+
import '../../services/api';
|
3
|
+
|
4
|
+
const FETCH_CLUSTER = createRequestActionTypes('cluster', 'FETCH_CLUSTER');
|
5
|
+
|
6
|
+
const initialState = {loading: true, wasLoaded: false};
|
7
|
+
|
8
|
+
const cluster = function (state = initialState, action) {
|
9
|
+
switch (action.type) {
|
10
|
+
case FETCH_CLUSTER.REQUEST: {
|
11
|
+
return {
|
12
|
+
...state,
|
13
|
+
loading: true,
|
14
|
+
};
|
15
|
+
}
|
16
|
+
case FETCH_CLUSTER.SUCCESS: {
|
17
|
+
const {data} = action;
|
18
|
+
const clusterInfo = data.cluster ? data.cluster.cluster : data;
|
19
|
+
const clusterName = data.cluster?.title || data.Name;
|
20
|
+
return {
|
21
|
+
...state,
|
22
|
+
data: {
|
23
|
+
...clusterInfo,
|
24
|
+
balancer: data.cluster?.balancer,
|
25
|
+
solomon: data.cluster?.solomon,
|
26
|
+
Name: clusterName,
|
27
|
+
},
|
28
|
+
loading: false,
|
29
|
+
wasLoaded: true,
|
30
|
+
error: undefined,
|
31
|
+
};
|
32
|
+
}
|
33
|
+
case FETCH_CLUSTER.FAILURE: {
|
34
|
+
return {
|
35
|
+
...state,
|
36
|
+
error: action.error,
|
37
|
+
loading: false,
|
38
|
+
};
|
39
|
+
}
|
40
|
+
default:
|
41
|
+
return state;
|
42
|
+
}
|
43
|
+
};
|
44
|
+
|
45
|
+
export function getClusterInfo(clusterName) {
|
46
|
+
return createApiRequest({
|
47
|
+
request: window.api.getClusterInfo(clusterName),
|
48
|
+
actions: FETCH_CLUSTER,
|
49
|
+
});
|
50
|
+
}
|
51
|
+
|
52
|
+
export default cluster;
|
@@ -0,0 +1,48 @@
|
|
1
|
+
import {createRequestActionTypes, createApiRequest} from '../utils';
|
2
|
+
import '../../services/api';
|
3
|
+
|
4
|
+
const FETCH_CLUSTER = createRequestActionTypes('cluster', 'FETCH_CLUSTER');
|
5
|
+
|
6
|
+
const initialState = {loading: false};
|
7
|
+
|
8
|
+
const clusterInfo = function (state = initialState, action) {
|
9
|
+
switch (action.type) {
|
10
|
+
case FETCH_CLUSTER.REQUEST: {
|
11
|
+
return {
|
12
|
+
...state,
|
13
|
+
loading: true,
|
14
|
+
};
|
15
|
+
}
|
16
|
+
case FETCH_CLUSTER.SUCCESS: {
|
17
|
+
const {data = {}} = action;
|
18
|
+
|
19
|
+
return {
|
20
|
+
...state,
|
21
|
+
...data,
|
22
|
+
loading: false,
|
23
|
+
error: undefined,
|
24
|
+
};
|
25
|
+
}
|
26
|
+
case FETCH_CLUSTER.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 getCluster(name) {
|
39
|
+
return createApiRequest({
|
40
|
+
request: window.api.getClustersList(),
|
41
|
+
actions: FETCH_CLUSTER,
|
42
|
+
dataHandler: ({clusters = []}) => {
|
43
|
+
return clusters.filter((item) => item.name === name)[0];
|
44
|
+
},
|
45
|
+
});
|
46
|
+
}
|
47
|
+
|
48
|
+
export default clusterInfo;
|
@@ -0,0 +1,70 @@
|
|
1
|
+
import {createRequestActionTypes, createApiRequest} from '../utils';
|
2
|
+
import {createSelector} from 'reselect';
|
3
|
+
import '../../services/api';
|
4
|
+
import {ALL} from '../../utils/constants';
|
5
|
+
|
6
|
+
const FETCH_NODES_LIST = createRequestActionTypes('tenants', 'FETCH_NODES_LIST');
|
7
|
+
|
8
|
+
const initialState = {loading: true, wasLoaded: false, data: []};
|
9
|
+
|
10
|
+
const nodesList = function (state = initialState, action) {
|
11
|
+
switch (action.type) {
|
12
|
+
case FETCH_NODES_LIST.REQUEST: {
|
13
|
+
return {
|
14
|
+
...state,
|
15
|
+
loading: true,
|
16
|
+
};
|
17
|
+
}
|
18
|
+
case FETCH_NODES_LIST.SUCCESS: {
|
19
|
+
return {
|
20
|
+
...state,
|
21
|
+
data: action.data,
|
22
|
+
loading: false,
|
23
|
+
wasLoaded: true,
|
24
|
+
error: undefined,
|
25
|
+
};
|
26
|
+
}
|
27
|
+
case FETCH_NODES_LIST.FAILURE: {
|
28
|
+
return {
|
29
|
+
...state,
|
30
|
+
error: action.error,
|
31
|
+
loading: false,
|
32
|
+
};
|
33
|
+
}
|
34
|
+
default:
|
35
|
+
return state;
|
36
|
+
}
|
37
|
+
};
|
38
|
+
|
39
|
+
export function getNodesList() {
|
40
|
+
return createApiRequest({
|
41
|
+
request: window.api.getNodeInfo(),
|
42
|
+
actions: FETCH_NODES_LIST,
|
43
|
+
dataHandler: (data) => {
|
44
|
+
const {SystemStateInfo: nodes = []} = data;
|
45
|
+
return nodes;
|
46
|
+
},
|
47
|
+
});
|
48
|
+
}
|
49
|
+
|
50
|
+
export const getFilteredNodes = createSelector(
|
51
|
+
(state) => state.nodes.data?.Tenants,
|
52
|
+
(state) => state.settings.problemFilter,
|
53
|
+
(tenants, filter) => {
|
54
|
+
const nodes = tenants?.reduce((acc, item) => {
|
55
|
+
if (Array.isArray(item.Nodes)) {
|
56
|
+
return [...acc, ...item.Nodes.map((node) => ({...node, TenantName: item.Name}))];
|
57
|
+
}
|
58
|
+
return acc;
|
59
|
+
}, []);
|
60
|
+
if (filter === ALL) {
|
61
|
+
return nodes;
|
62
|
+
}
|
63
|
+
|
64
|
+
return nodes.filter(({Overall}) => {
|
65
|
+
return Overall && Overall !== 'Green';
|
66
|
+
});
|
67
|
+
},
|
68
|
+
);
|
69
|
+
|
70
|
+
export default nodesList;
|
@@ -0,0 +1,45 @@
|
|
1
|
+
import {createRequestActionTypes, createApiRequest} from '../utils';
|
2
|
+
import '../../services/api';
|
3
|
+
|
4
|
+
const FETCH_DESCRIBE = createRequestActionTypes('describe', 'FETCH_DESCRIBE');
|
5
|
+
|
6
|
+
const describe = function z(state = {loading: false, wasLoaded: false, data: {}}, action) {
|
7
|
+
switch (action.type) {
|
8
|
+
case FETCH_DESCRIBE.REQUEST: {
|
9
|
+
return {
|
10
|
+
...state,
|
11
|
+
loading: true,
|
12
|
+
};
|
13
|
+
}
|
14
|
+
case FETCH_DESCRIBE.SUCCESS: {
|
15
|
+
const newData = JSON.parse(JSON.stringify(state.data));
|
16
|
+
newData[action.data.Path] = action.data;
|
17
|
+
return {
|
18
|
+
...state,
|
19
|
+
data: newData,
|
20
|
+
currentDescribe: action.data,
|
21
|
+
loading: false,
|
22
|
+
wasLoaded: true,
|
23
|
+
error: undefined,
|
24
|
+
};
|
25
|
+
}
|
26
|
+
case FETCH_DESCRIBE.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 getDescribe({path}) {
|
39
|
+
return createApiRequest({
|
40
|
+
request: window.api.getDescribe({path}),
|
41
|
+
actions: FETCH_DESCRIBE,
|
42
|
+
});
|
43
|
+
}
|
44
|
+
|
45
|
+
export default describe;
|