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,78 @@
|
|
1
|
+
import {combineReducers} from 'redux';
|
2
|
+
|
3
|
+
import nodes from './nodes';
|
4
|
+
import cluster from './cluster';
|
5
|
+
import tenant from './tenant';
|
6
|
+
import storage from './storage';
|
7
|
+
import node from './node';
|
8
|
+
import pdisk from './pdisk';
|
9
|
+
import vdisk from './vdisk';
|
10
|
+
import group from './group';
|
11
|
+
import tooltip from './tooltip';
|
12
|
+
import tablets from './tablets';
|
13
|
+
import heatmap from './heatmap';
|
14
|
+
import schema from './schema';
|
15
|
+
import host from './host';
|
16
|
+
import network from './network';
|
17
|
+
import pool from './pool';
|
18
|
+
import tenants from './tenants';
|
19
|
+
import tablet from './tablet';
|
20
|
+
import executeQuery from './executeQuery';
|
21
|
+
import explainQuery from './explainQuery';
|
22
|
+
import tabletsFilters from './tabletsFilters';
|
23
|
+
import clusterInfo from './clusterInfo';
|
24
|
+
import settings from './settings';
|
25
|
+
import preview from './preview';
|
26
|
+
import nodesList from './clusterNodes';
|
27
|
+
import describe from './describe';
|
28
|
+
import schemaAcl from './schemaAcl';
|
29
|
+
import executeTopQueries from './executeTopQueries';
|
30
|
+
import healthcheckInfo from './healthcheckInfo';
|
31
|
+
import shardsWorkload from './shardsWorkload';
|
32
|
+
import hotKeys from './hotKeys';
|
33
|
+
import olapStats from './olapStats';
|
34
|
+
import authentication from './authentication';
|
35
|
+
|
36
|
+
function singleClusterMode(state = true) {
|
37
|
+
return state;
|
38
|
+
}
|
39
|
+
|
40
|
+
export const rootReducer = {
|
41
|
+
singleClusterMode,
|
42
|
+
nodes,
|
43
|
+
cluster,
|
44
|
+
tenant,
|
45
|
+
storage,
|
46
|
+
node,
|
47
|
+
pdisk,
|
48
|
+
vdisk,
|
49
|
+
group,
|
50
|
+
tooltip,
|
51
|
+
tablets,
|
52
|
+
schema,
|
53
|
+
olapStats,
|
54
|
+
host,
|
55
|
+
network,
|
56
|
+
pool,
|
57
|
+
tenants,
|
58
|
+
tablet,
|
59
|
+
executeQuery,
|
60
|
+
explainQuery,
|
61
|
+
tabletsFilters,
|
62
|
+
heatmap,
|
63
|
+
clusterInfo,
|
64
|
+
settings,
|
65
|
+
preview,
|
66
|
+
nodesList,
|
67
|
+
describe,
|
68
|
+
schemaAcl,
|
69
|
+
executeTopQueries,
|
70
|
+
healthcheckInfo,
|
71
|
+
shardsWorkload,
|
72
|
+
hotKeys,
|
73
|
+
authentication,
|
74
|
+
};
|
75
|
+
|
76
|
+
export default combineReducers({
|
77
|
+
...rootReducer,
|
78
|
+
});
|
@@ -0,0 +1,45 @@
|
|
1
|
+
import {createRequestActionTypes, createApiRequest} from '../utils';
|
2
|
+
import '../../services/api';
|
3
|
+
|
4
|
+
const FETCH_ALL_NODES_NETWORK = createRequestActionTypes(
|
5
|
+
'ALL_NODES_NETWORK',
|
6
|
+
'FETCH_ALL_NODES_NETWORK',
|
7
|
+
);
|
8
|
+
|
9
|
+
const network = (state = {data: {}, loading: true, wasLoaded: false}, action) => {
|
10
|
+
switch (action.type) {
|
11
|
+
case FETCH_ALL_NODES_NETWORK.REQUEST: {
|
12
|
+
return {
|
13
|
+
...state,
|
14
|
+
loading: true,
|
15
|
+
};
|
16
|
+
}
|
17
|
+
case FETCH_ALL_NODES_NETWORK.SUCCESS: {
|
18
|
+
return {
|
19
|
+
...state,
|
20
|
+
data: action.data,
|
21
|
+
loading: false,
|
22
|
+
wasLoaded: true,
|
23
|
+
error: undefined,
|
24
|
+
};
|
25
|
+
}
|
26
|
+
case FETCH_ALL_NODES_NETWORK.FAILURE: {
|
27
|
+
return {
|
28
|
+
...state,
|
29
|
+
error: action.error,
|
30
|
+
loading: false,
|
31
|
+
};
|
32
|
+
}
|
33
|
+
default:
|
34
|
+
return state;
|
35
|
+
}
|
36
|
+
};
|
37
|
+
|
38
|
+
export const getNetworkInfo = (tenant) => {
|
39
|
+
return createApiRequest({
|
40
|
+
request: window.api.getNetwork(tenant),
|
41
|
+
actions: FETCH_ALL_NODES_NETWORK,
|
42
|
+
});
|
43
|
+
};
|
44
|
+
|
45
|
+
export default network;
|
@@ -0,0 +1,42 @@
|
|
1
|
+
import {createRequestActionTypes, createApiRequest} from '../utils';
|
2
|
+
import '../../services/api';
|
3
|
+
|
4
|
+
const FETCH_NODE = createRequestActionTypes('NODE', 'FETCH_NODE');
|
5
|
+
|
6
|
+
const NODE = (state = {data: {}, loading: true, wasLoaded: false}, action) => {
|
7
|
+
switch (action.type) {
|
8
|
+
case FETCH_NODE.REQUEST: {
|
9
|
+
return {
|
10
|
+
...state,
|
11
|
+
loading: true,
|
12
|
+
};
|
13
|
+
}
|
14
|
+
case FETCH_NODE.SUCCESS: {
|
15
|
+
return {
|
16
|
+
...state,
|
17
|
+
data: action.data,
|
18
|
+
loading: false,
|
19
|
+
wasLoaded: true,
|
20
|
+
error: undefined,
|
21
|
+
};
|
22
|
+
}
|
23
|
+
case FETCH_NODE.FAILURE: {
|
24
|
+
return {
|
25
|
+
...state,
|
26
|
+
error: action.error,
|
27
|
+
loading: false,
|
28
|
+
};
|
29
|
+
}
|
30
|
+
default:
|
31
|
+
return state;
|
32
|
+
}
|
33
|
+
};
|
34
|
+
|
35
|
+
export const getNodeInfo = (id) => {
|
36
|
+
return createApiRequest({
|
37
|
+
request: window.api.getNodeInfo(id),
|
38
|
+
actions: FETCH_NODE,
|
39
|
+
});
|
40
|
+
};
|
41
|
+
|
42
|
+
export default NODE;
|
@@ -0,0 +1,58 @@
|
|
1
|
+
import {createRequestActionTypes, createApiRequest} from '../utils';
|
2
|
+
import '../../services/api';
|
3
|
+
import {AUTO_RELOAD_INTERVAL} from '../../utils/constants';
|
4
|
+
|
5
|
+
const FETCH_NODES = createRequestActionTypes('nodes', 'FETCH_NODES');
|
6
|
+
|
7
|
+
const nodes = function z(state = {loading: true, wasLoaded: false}, action) {
|
8
|
+
switch (action.type) {
|
9
|
+
case FETCH_NODES.REQUEST: {
|
10
|
+
return {
|
11
|
+
...state,
|
12
|
+
loading: true,
|
13
|
+
requestTime: new Date().getTime(),
|
14
|
+
};
|
15
|
+
}
|
16
|
+
case FETCH_NODES.SUCCESS: {
|
17
|
+
const timeout = new Date().getTime() - state.requestTime;
|
18
|
+
return {
|
19
|
+
...state,
|
20
|
+
data: action.data,
|
21
|
+
loading: false,
|
22
|
+
wasLoaded: true,
|
23
|
+
timeoutForRequest: timeout > AUTO_RELOAD_INTERVAL ? timeout : AUTO_RELOAD_INTERVAL,
|
24
|
+
error: undefined,
|
25
|
+
};
|
26
|
+
}
|
27
|
+
case FETCH_NODES.FAILURE: {
|
28
|
+
return {
|
29
|
+
...state,
|
30
|
+
error: action.error,
|
31
|
+
loading: false,
|
32
|
+
};
|
33
|
+
}
|
34
|
+
case 'CLEAR_NODES': {
|
35
|
+
return {
|
36
|
+
...state,
|
37
|
+
loading: true,
|
38
|
+
data: undefined,
|
39
|
+
wasLoaded: false,
|
40
|
+
requestTime: new Date().getTime(),
|
41
|
+
error: undefined,
|
42
|
+
};
|
43
|
+
}
|
44
|
+
default:
|
45
|
+
return state;
|
46
|
+
}
|
47
|
+
};
|
48
|
+
|
49
|
+
export function getNodes(path) {
|
50
|
+
return createApiRequest({
|
51
|
+
request: window.api.getNodes(path),
|
52
|
+
actions: FETCH_NODES,
|
53
|
+
});
|
54
|
+
}
|
55
|
+
|
56
|
+
export const clearNodes = () => ({type: 'CLEAR_NODES'});
|
57
|
+
|
58
|
+
export default nodes;
|
@@ -0,0 +1,74 @@
|
|
1
|
+
import {createRequestActionTypes, createApiRequest} from '../utils';
|
2
|
+
import '../../services/api';
|
3
|
+
|
4
|
+
const FETCH_OLAP_STATS = createRequestActionTypes('query', 'SEND_OLAP_STATS_QUERY');
|
5
|
+
const SET_OLAP_STATS_OPTIONS = createRequestActionTypes('query', 'SET_OLAP_STATS_OPTIONS');
|
6
|
+
|
7
|
+
const initialState = {
|
8
|
+
loading: false,
|
9
|
+
wasLoaded: false,
|
10
|
+
};
|
11
|
+
|
12
|
+
function createOlatStatsQuery(path) {
|
13
|
+
return `SELECT * FROM \`${path}/.sys/primary_index_stats\``;
|
14
|
+
}
|
15
|
+
|
16
|
+
const queryAction = 'execute-scan';
|
17
|
+
|
18
|
+
const olapStats = (state = initialState, action) => {
|
19
|
+
switch (action.type) {
|
20
|
+
case FETCH_OLAP_STATS.REQUEST: {
|
21
|
+
return {
|
22
|
+
...state,
|
23
|
+
loading: true,
|
24
|
+
error: undefined,
|
25
|
+
};
|
26
|
+
}
|
27
|
+
case FETCH_OLAP_STATS.SUCCESS: {
|
28
|
+
return {
|
29
|
+
...state,
|
30
|
+
data: action.data,
|
31
|
+
loading: false,
|
32
|
+
error: undefined,
|
33
|
+
wasLoaded: true,
|
34
|
+
};
|
35
|
+
}
|
36
|
+
case FETCH_OLAP_STATS.FAILURE: {
|
37
|
+
return {
|
38
|
+
...state,
|
39
|
+
error: action.error || 'Unauthorized',
|
40
|
+
loading: false,
|
41
|
+
};
|
42
|
+
}
|
43
|
+
case SET_OLAP_STATS_OPTIONS:
|
44
|
+
return {
|
45
|
+
...state,
|
46
|
+
...action.data,
|
47
|
+
};
|
48
|
+
default:
|
49
|
+
return state;
|
50
|
+
}
|
51
|
+
};
|
52
|
+
|
53
|
+
export const getOlapStats = ({path = ''}) => {
|
54
|
+
return createApiRequest({
|
55
|
+
request: window.api.sendQuery(createOlatStatsQuery(path), path, queryAction),
|
56
|
+
actions: FETCH_OLAP_STATS,
|
57
|
+
dataHandler: (result) => {
|
58
|
+
if (result && typeof result === 'string') {
|
59
|
+
throw 'Unexpected token in JSON.';
|
60
|
+
}
|
61
|
+
|
62
|
+
return result;
|
63
|
+
},
|
64
|
+
});
|
65
|
+
};
|
66
|
+
|
67
|
+
export function setOlapStatsOptions(options) {
|
68
|
+
return {
|
69
|
+
type: SET_OLAP_STATS_OPTIONS,
|
70
|
+
data: options,
|
71
|
+
};
|
72
|
+
}
|
73
|
+
|
74
|
+
export default olapStats;
|
@@ -0,0 +1,51 @@
|
|
1
|
+
import {createRequestActionTypes, createApiRequest} from '../utils';
|
2
|
+
import '../../services/api';
|
3
|
+
|
4
|
+
const FETCH_PDISK = createRequestActionTypes('PDISK', 'FETCH_PDISK');
|
5
|
+
|
6
|
+
const initialState = {loading: true, wasLoaded: false, data: undefined};
|
7
|
+
|
8
|
+
const pdisk = (state = initialState, action) => {
|
9
|
+
switch (action.type) {
|
10
|
+
case FETCH_PDISK.REQUEST: {
|
11
|
+
return {
|
12
|
+
...state,
|
13
|
+
loading: true,
|
14
|
+
};
|
15
|
+
}
|
16
|
+
case FETCH_PDISK.SUCCESS: {
|
17
|
+
return {
|
18
|
+
...state,
|
19
|
+
data: action.data,
|
20
|
+
loading: false,
|
21
|
+
wasLoaded: true,
|
22
|
+
error: undefined,
|
23
|
+
};
|
24
|
+
}
|
25
|
+
case FETCH_PDISK.FAILURE: {
|
26
|
+
return {
|
27
|
+
...state,
|
28
|
+
error: action.error,
|
29
|
+
loading: false,
|
30
|
+
};
|
31
|
+
}
|
32
|
+
|
33
|
+
case 'CLEAR_STORE': {
|
34
|
+
return initialState;
|
35
|
+
}
|
36
|
+
|
37
|
+
default:
|
38
|
+
return state;
|
39
|
+
}
|
40
|
+
};
|
41
|
+
|
42
|
+
export const clearStore = () => ({type: 'CLEAR_STORE'});
|
43
|
+
|
44
|
+
export const getPdiskInfo = (nodeId, pdiskId) => {
|
45
|
+
return createApiRequest({
|
46
|
+
request: window.api.getPdiskInfo(nodeId, pdiskId),
|
47
|
+
actions: FETCH_PDISK,
|
48
|
+
});
|
49
|
+
};
|
50
|
+
|
51
|
+
export default pdisk;
|
@@ -0,0 +1,42 @@
|
|
1
|
+
import {createRequestActionTypes, createApiRequest} from '../utils';
|
2
|
+
import '../../services/api';
|
3
|
+
|
4
|
+
const FETCH_POOL = createRequestActionTypes('pool', 'FETCH_POOL');
|
5
|
+
|
6
|
+
const pool = function z(state = {loading: true, wasLoaded: false}, action) {
|
7
|
+
switch (action.type) {
|
8
|
+
case FETCH_POOL.REQUEST: {
|
9
|
+
return {
|
10
|
+
...state,
|
11
|
+
loading: true,
|
12
|
+
};
|
13
|
+
}
|
14
|
+
case FETCH_POOL.SUCCESS: {
|
15
|
+
return {
|
16
|
+
...state,
|
17
|
+
data: action.data,
|
18
|
+
loading: false,
|
19
|
+
wasLoaded: true,
|
20
|
+
error: undefined,
|
21
|
+
};
|
22
|
+
}
|
23
|
+
case FETCH_POOL.FAILURE: {
|
24
|
+
return {
|
25
|
+
...state,
|
26
|
+
error: action.error,
|
27
|
+
loading: false,
|
28
|
+
};
|
29
|
+
}
|
30
|
+
default:
|
31
|
+
return state;
|
32
|
+
}
|
33
|
+
};
|
34
|
+
|
35
|
+
export function getPoolInfo(poolName) {
|
36
|
+
return createApiRequest({
|
37
|
+
request: window.api.getPoolInfo(poolName),
|
38
|
+
actions: FETCH_POOL,
|
39
|
+
});
|
40
|
+
}
|
41
|
+
|
42
|
+
export default pool;
|
@@ -0,0 +1,73 @@
|
|
1
|
+
import {createRequestActionTypes, createApiRequest} from '../utils';
|
2
|
+
import '../../services/api';
|
3
|
+
|
4
|
+
const SEND_QUERY = createRequestActionTypes('preview', 'SEND_QUERY');
|
5
|
+
const SET_QUERY_OPTIONS = createRequestActionTypes('preview', 'SET_QUERY_OPTIONS');
|
6
|
+
|
7
|
+
const initialState = {
|
8
|
+
loading: false,
|
9
|
+
wasLoaded: false,
|
10
|
+
};
|
11
|
+
|
12
|
+
const preview = (state = initialState, action) => {
|
13
|
+
switch (action.type) {
|
14
|
+
case SEND_QUERY.REQUEST: {
|
15
|
+
return {
|
16
|
+
...state,
|
17
|
+
loading: true,
|
18
|
+
error: undefined,
|
19
|
+
};
|
20
|
+
}
|
21
|
+
case SEND_QUERY.SUCCESS: {
|
22
|
+
return {
|
23
|
+
...state,
|
24
|
+
data: action.data,
|
25
|
+
loading: false,
|
26
|
+
error: undefined,
|
27
|
+
wasLoaded: true,
|
28
|
+
};
|
29
|
+
}
|
30
|
+
// 401 Unauthorized error is handled by GenericAPI
|
31
|
+
case SEND_QUERY.FAILURE: {
|
32
|
+
return {
|
33
|
+
...state,
|
34
|
+
error: action.error || 'Unauthorized',
|
35
|
+
loading: false,
|
36
|
+
};
|
37
|
+
}
|
38
|
+
case SET_QUERY_OPTIONS:
|
39
|
+
return {
|
40
|
+
...state,
|
41
|
+
...action.data,
|
42
|
+
};
|
43
|
+
default:
|
44
|
+
return state;
|
45
|
+
}
|
46
|
+
};
|
47
|
+
|
48
|
+
export const sendQuery = ({query, database, action}) => {
|
49
|
+
return createApiRequest({
|
50
|
+
request: window.api.sendQuery(query, database, action),
|
51
|
+
actions: SEND_QUERY,
|
52
|
+
dataHandler: (data) => {
|
53
|
+
if (!Array.isArray(data)) {
|
54
|
+
try {
|
55
|
+
return JSON.parse(data);
|
56
|
+
} catch (e) {
|
57
|
+
return [];
|
58
|
+
}
|
59
|
+
}
|
60
|
+
|
61
|
+
return data;
|
62
|
+
},
|
63
|
+
});
|
64
|
+
};
|
65
|
+
|
66
|
+
export function setQueryOptions(options) {
|
67
|
+
return {
|
68
|
+
type: SET_QUERY_OPTIONS,
|
69
|
+
data: options,
|
70
|
+
};
|
71
|
+
}
|
72
|
+
|
73
|
+
export default preview;
|
@@ -0,0 +1,95 @@
|
|
1
|
+
import {createRequestActionTypes, createApiRequest} from '../utils';
|
2
|
+
import '../../services/api';
|
3
|
+
|
4
|
+
const FETCH_SCHEMA = createRequestActionTypes('schema', 'FETCH_SCHEMA');
|
5
|
+
const SET_SCHEMA = 'schema/SET_SCHEMA';
|
6
|
+
const ENABLE_AUTOREFRESH = 'schema/ENABLE_AUTOREFRESH';
|
7
|
+
const DISABLE_AUTOREFRESH = 'schema/DISABLE_AUTOREFRESH';
|
8
|
+
|
9
|
+
export const initialState = {
|
10
|
+
loading: true,
|
11
|
+
wasLoaded: false,
|
12
|
+
data: {},
|
13
|
+
currentSchemaPath: undefined,
|
14
|
+
autorefresh: false,
|
15
|
+
};
|
16
|
+
|
17
|
+
const schema = function z(state = initialState, action) {
|
18
|
+
switch (action.type) {
|
19
|
+
case FETCH_SCHEMA.REQUEST: {
|
20
|
+
return {
|
21
|
+
...state,
|
22
|
+
loading: true,
|
23
|
+
};
|
24
|
+
}
|
25
|
+
case FETCH_SCHEMA.SUCCESS: {
|
26
|
+
const newData = JSON.parse(JSON.stringify(state.data));
|
27
|
+
newData[action.data.Path] = action.data;
|
28
|
+
const currentSchema = state.currentSchemaPath
|
29
|
+
? newData[state.currentSchemaPath]
|
30
|
+
: action.data;
|
31
|
+
const currentSchemaPath = state.currentSchemaPath || action.data.Path;
|
32
|
+
return {
|
33
|
+
...state,
|
34
|
+
error: undefined,
|
35
|
+
data: newData,
|
36
|
+
currentSchema,
|
37
|
+
currentSchemaPath,
|
38
|
+
loading: false,
|
39
|
+
wasLoaded: true,
|
40
|
+
};
|
41
|
+
}
|
42
|
+
case FETCH_SCHEMA.FAILURE: {
|
43
|
+
return {
|
44
|
+
...state,
|
45
|
+
error: action.error,
|
46
|
+
loading: false,
|
47
|
+
};
|
48
|
+
}
|
49
|
+
case SET_SCHEMA: {
|
50
|
+
return {
|
51
|
+
...state,
|
52
|
+
currentSchemaPath: action.data,
|
53
|
+
};
|
54
|
+
}
|
55
|
+
case ENABLE_AUTOREFRESH: {
|
56
|
+
return {
|
57
|
+
...state,
|
58
|
+
autorefresh: true,
|
59
|
+
};
|
60
|
+
}
|
61
|
+
case DISABLE_AUTOREFRESH: {
|
62
|
+
return {
|
63
|
+
...state,
|
64
|
+
autorefresh: false,
|
65
|
+
};
|
66
|
+
}
|
67
|
+
default:
|
68
|
+
return state;
|
69
|
+
}
|
70
|
+
};
|
71
|
+
|
72
|
+
export function getSchema({path}) {
|
73
|
+
return createApiRequest({
|
74
|
+
request: window.api.getSchema({path}),
|
75
|
+
actions: FETCH_SCHEMA,
|
76
|
+
});
|
77
|
+
}
|
78
|
+
|
79
|
+
export function setCurrentSchemaPath(currentSchemaPath) {
|
80
|
+
return {
|
81
|
+
type: SET_SCHEMA,
|
82
|
+
data: currentSchemaPath,
|
83
|
+
};
|
84
|
+
}
|
85
|
+
export function enableAutorefresh() {
|
86
|
+
return {
|
87
|
+
type: ENABLE_AUTOREFRESH,
|
88
|
+
};
|
89
|
+
}
|
90
|
+
export function disableAutorefresh() {
|
91
|
+
return {
|
92
|
+
type: DISABLE_AUTOREFRESH,
|
93
|
+
};
|
94
|
+
}
|
95
|
+
export default schema;
|
@@ -0,0 +1,44 @@
|
|
1
|
+
import {createRequestActionTypes, createApiRequest} from '../utils';
|
2
|
+
import '../../services/api';
|
3
|
+
import _ from 'lodash';
|
4
|
+
|
5
|
+
const FETCH_SCHEMA_ACL = createRequestActionTypes('schemaAcl', 'FETCH_SCHEMA_ACL');
|
6
|
+
|
7
|
+
const schemaAcl = function z(state = {loading: false, wasLoaded: false, acl: undefined}, action) {
|
8
|
+
switch (action.type) {
|
9
|
+
case FETCH_SCHEMA_ACL.REQUEST: {
|
10
|
+
return {
|
11
|
+
...state,
|
12
|
+
loading: true,
|
13
|
+
};
|
14
|
+
}
|
15
|
+
case FETCH_SCHEMA_ACL.SUCCESS: {
|
16
|
+
return {
|
17
|
+
...state,
|
18
|
+
error: undefined,
|
19
|
+
acl: _.get(action.data, 'Common.ACL'),
|
20
|
+
owner: _.get(action.data, 'Common.Owner'),
|
21
|
+
loading: false,
|
22
|
+
wasLoaded: true,
|
23
|
+
};
|
24
|
+
}
|
25
|
+
case FETCH_SCHEMA_ACL.FAILURE: {
|
26
|
+
return {
|
27
|
+
...state,
|
28
|
+
error: action.error,
|
29
|
+
loading: false,
|
30
|
+
};
|
31
|
+
}
|
32
|
+
default:
|
33
|
+
return state;
|
34
|
+
}
|
35
|
+
};
|
36
|
+
|
37
|
+
export function getSchemaAcl({path}) {
|
38
|
+
return createApiRequest({
|
39
|
+
request: window.api.getSchemaAcl({path}),
|
40
|
+
actions: FETCH_SCHEMA_ACL,
|
41
|
+
});
|
42
|
+
}
|
43
|
+
|
44
|
+
export default schemaAcl;
|
@@ -0,0 +1,76 @@
|
|
1
|
+
import {ALL, defaultUserSettings, SAVED_QUERIES_KEY, THEME_KEY} from '../../utils/constants';
|
2
|
+
import '../../services/api';
|
3
|
+
import {getValueFromLS} from '../../utils/utils';
|
4
|
+
|
5
|
+
const CHANGE_PROBLEM_FILTER = 'settings/CHANGE_PROBLEM_FILTER';
|
6
|
+
const SET_SETTING_VALUE = 'settings/SET_VALUE';
|
7
|
+
|
8
|
+
const userSettings = window.userSettings || {};
|
9
|
+
const systemSettings = window.systemSettings || {};
|
10
|
+
const theme = window.web_version
|
11
|
+
? userSettings.theme || 'light'
|
12
|
+
: getValueFromLS(THEME_KEY, 'light');
|
13
|
+
const savedQueries = window.web_version
|
14
|
+
? userSettings[SAVED_QUERIES_KEY]
|
15
|
+
: getValueFromLS(SAVED_QUERIES_KEY, '[]');
|
16
|
+
|
17
|
+
export const initialState = {
|
18
|
+
problemFilter: ALL,
|
19
|
+
userSettings: {
|
20
|
+
...defaultUserSettings,
|
21
|
+
...userSettings,
|
22
|
+
theme,
|
23
|
+
[SAVED_QUERIES_KEY]: savedQueries,
|
24
|
+
},
|
25
|
+
systemSettings,
|
26
|
+
};
|
27
|
+
|
28
|
+
const settings = (state = initialState, action) => {
|
29
|
+
switch (action.type) {
|
30
|
+
case CHANGE_PROBLEM_FILTER:
|
31
|
+
return {
|
32
|
+
...state,
|
33
|
+
problemFilter: action.data,
|
34
|
+
};
|
35
|
+
|
36
|
+
case SET_SETTING_VALUE: {
|
37
|
+
const newSettings = {
|
38
|
+
...state.userSettings,
|
39
|
+
[action.data.name]: action.data.value,
|
40
|
+
};
|
41
|
+
|
42
|
+
return {
|
43
|
+
...state,
|
44
|
+
userSettings: newSettings,
|
45
|
+
};
|
46
|
+
}
|
47
|
+
|
48
|
+
default:
|
49
|
+
return state;
|
50
|
+
}
|
51
|
+
};
|
52
|
+
|
53
|
+
export const setSettingValue = (name, value) => {
|
54
|
+
return (dispatch, getState) => {
|
55
|
+
dispatch({type: SET_SETTING_VALUE, data: {name, value}});
|
56
|
+
const {singleClusterMode} = getState();
|
57
|
+
if (singleClusterMode) {
|
58
|
+
localStorage.setItem(name, value);
|
59
|
+
} else {
|
60
|
+
window.api.postSetting(name, value);
|
61
|
+
}
|
62
|
+
};
|
63
|
+
};
|
64
|
+
|
65
|
+
export const getSettingValue = (state, name) => {
|
66
|
+
return state.settings.userSettings[name];
|
67
|
+
};
|
68
|
+
|
69
|
+
export const changeFilter = (filter) => {
|
70
|
+
return {
|
71
|
+
type: CHANGE_PROBLEM_FILTER,
|
72
|
+
data: filter,
|
73
|
+
};
|
74
|
+
};
|
75
|
+
|
76
|
+
export default settings;
|