ydb-embedded-ui 5.4.0 → 5.5.0
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/components/DiskPageTitle/DiskPageTitle.d.ts +11 -0
- package/dist/components/DiskPageTitle/DiskPageTitle.js +8 -0
- package/dist/components/DiskPageTitle/DiskPageTitle.scss +17 -0
- package/dist/{containers/Storage → components}/DiskStateProgressBar/DiskStateProgressBar.js +3 -3
- package/dist/components/ErrorBoundary/ErrorBoundary.d.ts +1 -1
- package/dist/components/GroupInfo/GroupInfo.d.ts +8 -0
- package/dist/components/GroupInfo/GroupInfo.js +28 -0
- package/dist/components/GroupInfo/i18n/en.json +6 -0
- package/dist/components/GroupInfo/i18n/index.d.ts +1 -0
- package/dist/components/GroupInfo/i18n/index.js +4 -0
- package/dist/components/MetricChart/MetricChart.js +3 -1
- package/dist/components/MetricChart/types.d.ts +4 -0
- package/dist/components/MonacoEditor/MonacoEditor.d.ts +2 -0
- package/dist/components/MonacoEditor/MonacoEditor.js +7 -0
- package/dist/{containers/Storage → components}/PDiskPopup/PDiskPopup.d.ts +3 -3
- package/dist/{containers/Storage → components}/PDiskPopup/PDiskPopup.js +6 -5
- package/dist/components/PageMeta/PageMeta.d.ts +2 -1
- package/dist/components/PageMeta/PageMeta.js +9 -2
- package/dist/components/PageMeta/PageMeta.scss +9 -0
- package/dist/components/Stack/Stack.scss +2 -0
- package/dist/{containers/Storage → components}/VDisk/VDisk.d.ts +2 -2
- package/dist/{containers/Storage → components}/VDisk/VDisk.js +8 -8
- package/dist/{containers/Storage → components}/VDisk/VDisk.scss +1 -1
- package/dist/components/VDisk/VDiskWithDonorsStack.d.ts +12 -0
- package/dist/components/VDisk/VDiskWithDonorsStack.js +14 -0
- package/dist/components/VDiskInfo/VDiskInfo.d.ts +10 -0
- package/dist/components/VDiskInfo/VDiskInfo.js +113 -0
- package/dist/components/VDiskInfo/VDiskInfo.scss +8 -0
- package/dist/components/VDiskInfo/i18n/en.json +23 -0
- package/dist/components/VDiskInfo/i18n/index.d.ts +1 -0
- package/dist/components/VDiskInfo/i18n/index.js +4 -0
- package/dist/{containers/Storage → components}/VDiskPopup/VDiskPopup.d.ts +3 -3
- package/dist/{containers/Storage → components}/VDiskPopup/VDiskPopup.js +8 -7
- package/dist/components/VirtualTable/TableHead.d.ts +2 -1
- package/dist/components/VirtualTable/TableHead.js +6 -6
- package/dist/components/VirtualTable/constants.d.ts +1 -0
- package/dist/components/VirtualTable/constants.js +1 -0
- package/dist/containers/App/App.js +0 -2
- package/dist/containers/App/App.scss +3 -0
- package/dist/containers/App/Content.js +19 -5
- package/dist/containers/App/appSlots.d.ts +9 -3
- package/dist/containers/App/appSlots.js +2 -1
- package/dist/containers/Header/breadcrumbs.js +12 -0
- package/dist/containers/Header/i18n/en.json +1 -0
- package/dist/containers/Header/i18n/index.d.ts +1 -1
- package/dist/containers/Heatmap/HeatmapCanvas/HeatmapCanvas.js +2 -2
- package/dist/containers/Node/NodeStructure/NodeStructure.js +1 -1
- package/dist/containers/Node/NodeStructure/Pdisk.js +2 -2
- package/dist/containers/Node/NodeStructure/Vdisk.d.ts +6 -2
- package/dist/containers/Node/NodeStructure/Vdisk.js +5 -78
- package/dist/containers/Nodes/getNodesColumns.js +0 -1
- package/dist/containers/PDiskPage/PDiskPage.d.ts +3 -0
- package/dist/containers/{PDisk/PDisk.js → PDiskPage/PDiskPage.js} +9 -11
- package/dist/containers/{PDisk/PDisk.scss → PDiskPage/PDiskPage.scss} +0 -14
- package/dist/containers/Storage/PDisk/PDisk.js +4 -10
- package/dist/containers/Storage/PDisk/PDisk.scss +0 -2
- package/dist/containers/Storage/Storage.js +1 -2
- package/dist/containers/Storage/StorageGroups/StorageGroups.scss +1 -7
- package/dist/containers/Storage/StorageGroups/getStorageGroupsColumns.d.ts +1 -1
- package/dist/containers/Storage/StorageGroups/getStorageGroupsColumns.js +9 -17
- package/dist/containers/Storage/VirtualStorage.js +3 -7
- package/dist/containers/Tablet/TabletControls/TabletControls.js +2 -1
- package/dist/containers/TabletsFilters/TabletsFilters.d.ts +2 -2
- package/dist/containers/TabletsFilters/TabletsFilters.js +7 -6
- package/dist/containers/Tenant/Diagnostics/Consumers/Consumers.js +1 -1
- package/dist/containers/Tenant/Diagnostics/Network/Network.js +2 -2
- package/dist/containers/Tenant/Diagnostics/Partitions/Partitions.js +1 -2
- package/dist/containers/Tenant/Diagnostics/Partitions/PartitionsControls/PartitionsControls.js +1 -1
- package/dist/containers/Tenant/Diagnostics/TenantOverview/TenantCpu/cpuDashboardConfig.js +4 -0
- package/dist/containers/Tenant/Query/ExplainResult/ExplainResult.js +5 -3
- package/dist/containers/Tenant/Query/QueryEditor/QueryEditor.js +6 -4
- package/dist/containers/Tenant/Query/SaveQuery/SaveQuery.js +2 -2
- package/dist/containers/Tenant/Tenant.js +10 -5
- package/dist/containers/Tenants/Tenants.js +3 -2
- package/dist/containers/VDiskPage/VDiskPage.d.ts +3 -0
- package/dist/containers/VDiskPage/VDiskPage.js +109 -0
- package/dist/containers/VDiskPage/VDiskPage.scss +32 -0
- package/dist/containers/VDiskPage/i18n/en.json +9 -0
- package/dist/containers/VDiskPage/i18n/index.d.ts +1 -0
- package/dist/containers/VDiskPage/i18n/index.js +4 -0
- package/dist/containers/Versions/groupNodes.js +1 -1
- package/dist/routes.d.ts +3 -0
- package/dist/routes.js +5 -0
- package/dist/services/api.d.ts +11 -4
- package/dist/services/api.js +26 -4
- package/dist/store/configureStore.d.ts +4 -0
- package/dist/store/defaultStore.d.ts +2 -0
- package/dist/store/reducers/authentication/authentication.d.ts +3 -0
- package/dist/store/reducers/cluster/cluster.d.ts +1 -0
- package/dist/store/reducers/clusterNodes/clusterNodes.d.ts +1 -0
- package/dist/store/reducers/clusters/clusters.d.ts +1 -0
- package/dist/store/reducers/clusters/selectors.js +1 -1
- package/dist/store/reducers/describe.d.ts +2 -0
- package/dist/store/reducers/executeQuery.d.ts +1 -0
- package/dist/store/reducers/explainQuery.d.ts +2 -0
- package/dist/store/reducers/header/types.d.ts +4 -1
- package/dist/store/reducers/healthcheckInfo/healthcheckInfo.d.ts +1 -0
- package/dist/store/reducers/heatmap.d.ts +1 -0
- package/dist/store/reducers/host.d.ts +1 -0
- package/dist/store/reducers/index.d.ts +3 -0
- package/dist/store/reducers/index.js +2 -0
- package/dist/store/reducers/network/network.d.ts +1 -0
- package/dist/store/reducers/node/node.d.ts +2 -0
- package/dist/store/reducers/node/selectors.js +1 -1
- package/dist/store/reducers/nodes/nodes.d.ts +2 -0
- package/dist/store/reducers/nodesList.d.ts +1 -0
- package/dist/store/reducers/olapStats.d.ts +1 -0
- package/dist/store/reducers/overview/overview.d.ts +2 -0
- package/dist/store/reducers/partitions/partitions.d.ts +1 -0
- package/dist/store/reducers/pdisk/pdisk.d.ts +2 -0
- package/dist/store/reducers/pdisk/utils.js +1 -1
- package/dist/store/reducers/preview.d.ts +1 -0
- package/dist/store/reducers/schema/schema.d.ts +1 -0
- package/dist/store/reducers/schemaAcl/schemaAcl.d.ts +1 -0
- package/dist/store/reducers/shardsWorkload/shardsWorkload.d.ts +1 -0
- package/dist/store/reducers/storage/storage.d.ts +2 -0
- package/dist/store/reducers/storage/types.d.ts +3 -1
- package/dist/store/reducers/storage/utils.d.ts +1 -1
- package/dist/store/reducers/storage/utils.js +8 -9
- package/dist/store/reducers/tablet.d.ts +2 -0
- package/dist/store/reducers/tablets.d.ts +1 -0
- package/dist/store/reducers/tabletsFilters.d.ts +1 -0
- package/dist/store/reducers/tenant/tenant.d.ts +1 -0
- package/dist/store/reducers/tenantOverview/executeTopTables/executeTopTables.d.ts +1 -0
- package/dist/store/reducers/tenantOverview/topNodesByCpu/topNodesByCpu.d.ts +1 -0
- package/dist/store/reducers/tenantOverview/topNodesByLoad/topNodesByLoad.d.ts +1 -0
- package/dist/store/reducers/tenantOverview/topNodesByMemory/topNodesByMemory.d.ts +1 -0
- package/dist/store/reducers/tenantOverview/topQueries/tenantOverviewTopQueries.d.ts +1 -0
- package/dist/store/reducers/tenantOverview/topShards/tenantOverviewTopShards.d.ts +1 -0
- package/dist/store/reducers/tenantOverview/topStorageGroups/topStorageGroups.d.ts +1 -0
- package/dist/store/reducers/tenants/selectors.js +1 -1
- package/dist/store/reducers/tenants/tenants.d.ts +1 -0
- package/dist/store/reducers/topic.d.ts +1 -0
- package/dist/store/reducers/vdisk/types.d.ts +25 -0
- package/dist/store/reducers/vdisk/utils.d.ts +11 -0
- package/dist/store/reducers/vdisk/utils.js +33 -0
- package/dist/store/reducers/vdisk/vdisk.d.ts +100 -0
- package/dist/store/reducers/vdisk/vdisk.js +64 -0
- package/dist/store/state-url-mapping.js +6 -4
- package/dist/types/api/storage.d.ts +2 -0
- package/dist/utils/bytesParsers/__test__/formatBytes.test.js +7 -7
- package/dist/utils/clusterVersionColors.js +1 -1
- package/dist/utils/dataFormatters/dataFormatters.js +1 -0
- package/dist/utils/disks/constants.js +2 -2
- package/dist/utils/disks/types.d.ts +5 -1
- package/dist/utils/filters.js +1 -1
- package/dist/utils/hooks/useTableResize.d.ts +1 -1
- package/dist/utils/hooks/useTableResize.js +5 -3
- package/dist/utils/lazyComponent.d.ts +4 -0
- package/dist/utils/lazyComponent.js +25 -0
- package/dist/utils/monaco/index.d.ts +1 -0
- package/dist/utils/monaco/index.js +4 -0
- package/dist/utils/monaco/s-expression/constants.d.ts +1 -0
- package/dist/utils/monaco/s-expression/constants.js +1 -0
- package/dist/utils/monaco/s-expression/registerLanguage.d.ts +1 -0
- package/dist/utils/{monaco.js → monaco/s-expression/registerLanguage.js} +2 -19
- package/dist/utils/{yqlSuggestions → monaco/yqlSuggestions}/generateSuggestions.d.ts +2 -2
- package/dist/utils/{yqlSuggestions → monaco/yqlSuggestions}/generateSuggestions.js +40 -11
- package/dist/utils/monaco/yqlSuggestions/registerCompletionItemProvider.d.ts +1 -0
- package/dist/utils/monaco/yqlSuggestions/registerCompletionItemProvider.js +15 -0
- package/dist/utils/{yqlSuggestions → monaco/yqlSuggestions}/yqlSuggestions.js +1 -1
- package/dist/utils/numeral.js +7 -1
- package/dist/utils/storage.d.ts +1 -0
- package/dist/utils/storage.js +1 -0
- package/dist/utils/timeParsers/parsers.js +1 -1
- package/package.json +3 -1
- package/dist/containers/PDisk/PDisk.d.ts +0 -3
- package/dist/containers/Storage/DiskStateProgressBar/index.d.ts +0 -1
- package/dist/containers/Storage/DiskStateProgressBar/index.js +0 -1
- package/dist/containers/Storage/PDiskPopup/index.d.ts +0 -1
- package/dist/containers/Storage/PDiskPopup/index.js +0 -1
- package/dist/containers/Storage/VDisk/index.d.ts +0 -1
- package/dist/containers/Storage/VDisk/index.js +0 -1
- package/dist/containers/Storage/VDiskPopup/index.d.ts +0 -1
- package/dist/containers/Storage/VDiskPopup/index.js +0 -1
- package/dist/containers/Storage/utils/types.d.ts +0 -5
- package/dist/utils/monaco.d.ts +0 -3
- /package/dist/{containers/Storage → components}/DiskStateProgressBar/DiskStateProgressBar.d.ts +0 -0
- /package/dist/{containers/Storage → components}/DiskStateProgressBar/DiskStateProgressBar.scss +0 -0
- /package/dist/{containers/Storage → components}/PDiskPopup/PDiskPopup.scss +0 -0
- /package/dist/{containers/Storage → components}/VDiskPopup/VDiskPopup.scss +0 -0
- /package/dist/containers/{PDisk → PDiskPage}/PDiskGroups.d.ts +0 -0
- /package/dist/containers/{PDisk → PDiskPage}/PDiskGroups.js +0 -0
- /package/dist/containers/{PDisk → PDiskPage}/i18n/en.json +0 -0
- /package/dist/containers/{PDisk → PDiskPage}/i18n/index.d.ts +0 -0
- /package/dist/containers/{PDisk → PDiskPage}/i18n/index.js +0 -0
- /package/dist/containers/{PDisk → PDiskPage}/shared.d.ts +0 -0
- /package/dist/containers/{PDisk → PDiskPage}/shared.js +0 -0
- /package/dist/{containers/Storage/utils → store/reducers/vdisk}/types.js +0 -0
- /package/dist/utils/{yqlSuggestions → monaco/yqlSuggestions}/constants.d.ts +0 -0
- /package/dist/utils/{yqlSuggestions → monaco/yqlSuggestions}/constants.js +0 -0
- /package/dist/utils/{yqlSuggestions → monaco/yqlSuggestions}/yqlSuggestions.d.ts +0 -0
@@ -0,0 +1,11 @@
|
|
1
|
+
import type { TEvPDiskStateResponse } from '../../../types/api/pdisk';
|
2
|
+
import type { TStorageInfo } from '../../../types/api/storage';
|
3
|
+
import type { TEvSystemStateResponse } from '../../../types/api/systemState';
|
4
|
+
import type { TEvVDiskStateResponse } from '../../../types/api/vdisk';
|
5
|
+
import type { VDiskData } from './types';
|
6
|
+
export declare function prepareVDiskDataResponse([vDiskResponse, pDiskResponse, nodeResponse]: [
|
7
|
+
TEvVDiskStateResponse,
|
8
|
+
TEvPDiskStateResponse,
|
9
|
+
TEvSystemStateResponse
|
10
|
+
]): VDiskData;
|
11
|
+
export declare function prepareVDiskGroupResponse(data: TStorageInfo, poolName: string, groupId: number): import("../storage/types").PreparedStorageGroup | undefined;
|
@@ -0,0 +1,33 @@
|
|
1
|
+
import { preparePDiskData, prepareVDiskData } from '../../../utils/disks/prepareDisks';
|
2
|
+
import { prepareNodeSystemState } from '../../../utils/nodes';
|
3
|
+
import { prepareStorageGroupData } from '../storage/utils';
|
4
|
+
export function prepareVDiskDataResponse([vDiskResponse, pDiskResponse, nodeResponse]) {
|
5
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
6
|
+
const rawVDisk = (_a = vDiskResponse.VDiskStateInfo) === null || _a === void 0 ? void 0 : _a[0];
|
7
|
+
const preparedVDisk = prepareVDiskData(rawVDisk);
|
8
|
+
const rawPDisk = (_b = pDiskResponse.PDiskStateInfo) === null || _b === void 0 ? void 0 : _b[0];
|
9
|
+
const preparedPDisk = preparePDiskData(rawPDisk);
|
10
|
+
const rawNode = (_c = nodeResponse.SystemStateInfo) === null || _c === void 0 ? void 0 : _c[0];
|
11
|
+
const preparedNode = prepareNodeSystemState(rawNode);
|
12
|
+
const NodeId = (_e = (_d = preparedVDisk.NodeId) !== null && _d !== void 0 ? _d : preparedPDisk.NodeId) !== null && _e !== void 0 ? _e : preparedNode.NodeId;
|
13
|
+
const NodeHost = preparedNode.Host;
|
14
|
+
const NodeType = (_f = preparedNode.Roles) === null || _f === void 0 ? void 0 : _f[0];
|
15
|
+
const NodeDC = preparedNode.DC;
|
16
|
+
const PDiskId = (_g = preparedVDisk.PDiskId) !== null && _g !== void 0 ? _g : preparedPDisk.PDiskId;
|
17
|
+
const PDiskType = preparedPDisk.Type;
|
18
|
+
return Object.assign(Object.assign({}, preparedVDisk), { NodeId,
|
19
|
+
NodeHost,
|
20
|
+
NodeType,
|
21
|
+
NodeDC,
|
22
|
+
PDiskId,
|
23
|
+
PDiskType });
|
24
|
+
}
|
25
|
+
export function prepareVDiskGroupResponse(data, poolName, groupId) {
|
26
|
+
var _a, _b;
|
27
|
+
const rawPoolData = (_a = data.StoragePools) === null || _a === void 0 ? void 0 : _a.find((pool) => pool.Name === poolName);
|
28
|
+
const rawGroupData = (_b = rawPoolData === null || rawPoolData === void 0 ? void 0 : rawPoolData.Groups) === null || _b === void 0 ? void 0 : _b.find((group) => group.GroupID === groupId);
|
29
|
+
if (rawGroupData && rawPoolData) {
|
30
|
+
return prepareStorageGroupData(rawGroupData, rawPoolData);
|
31
|
+
}
|
32
|
+
return undefined;
|
33
|
+
}
|
@@ -0,0 +1,100 @@
|
|
1
|
+
import type { Reducer } from '@reduxjs/toolkit';
|
2
|
+
import type { VDiskAction, VDiskState } from './types';
|
3
|
+
export declare const FETCH_VDISK: {
|
4
|
+
readonly REQUEST: "vdisk/FETCH_VDISK_REQUEST";
|
5
|
+
readonly SUCCESS: "vdisk/FETCH_VDISK_SUCCESS";
|
6
|
+
readonly FAILURE: "vdisk/FETCH_VDISK_FAILURE";
|
7
|
+
};
|
8
|
+
declare const vdisk: Reducer<VDiskState, VDiskAction>;
|
9
|
+
export declare const setVDiskDataWasNotLoaded: () => {
|
10
|
+
readonly type: "vdisk/SET_VDISK_DATA_WAS_NOT_LOADED";
|
11
|
+
};
|
12
|
+
interface VDiskDataRequestParams {
|
13
|
+
nodeId: number | string;
|
14
|
+
pDiskId: number | string;
|
15
|
+
vDiskSlotId: number | string;
|
16
|
+
}
|
17
|
+
export declare const getVDiskData: (params: VDiskDataRequestParams) => (dispatch: import("redux").Dispatch<import("redux").UnknownAction>, getState: () => {
|
18
|
+
singleClusterMode: boolean;
|
19
|
+
nodes: import("../nodes/types").NodesState;
|
20
|
+
topNodesByLoad: import("../tenantOverview/topNodesByLoad/types").TopNodesByLoadState;
|
21
|
+
topNodesByCpu: import("../tenantOverview/topNodesByCpu/types").TopNodesByCpuState;
|
22
|
+
topNodesByMemory: import("../tenantOverview/topNodesByMemory/types").TopNodesByMemoryState;
|
23
|
+
cluster: import("../cluster/types").ClusterState;
|
24
|
+
clusterNodes: import("../clusterNodes/types").ClusterNodesState;
|
25
|
+
tenant: import("../tenant/types").TenantState;
|
26
|
+
storage: import("../storage/types").StorageState;
|
27
|
+
topStorageGroups: import("../tenantOverview/topStorageGroups/types").TopStorageGroupsState;
|
28
|
+
node: import("../node/types").NodeState;
|
29
|
+
tooltip: import("../../../types/store/tooltip").ITooltipState;
|
30
|
+
tablets: import("../../../types/store/tablets").ITabletsState;
|
31
|
+
schema: import("../schema/types").SchemaState;
|
32
|
+
overview: import("../overview/types").OverviewState;
|
33
|
+
olapStats: import("../../../types/store/olapStats").OlapStatsState;
|
34
|
+
host: import("../../../types/store/host").IHostState;
|
35
|
+
network: import("../network/types").NetworkState;
|
36
|
+
tenants: import("../tenants/types").TenantsState;
|
37
|
+
tablet: import("../../../types/store/tablet").ITabletState;
|
38
|
+
topic: import("../../../types/store/topic").ITopicState;
|
39
|
+
partitions: import("../partitions/types").PartitionsState;
|
40
|
+
pDisk: import("../pdisk/types").PDiskState;
|
41
|
+
executeQuery: import("../../../types/store/executeQuery").ExecuteQueryState;
|
42
|
+
explainQuery: import("../../../types/store/explainQuery").ExplainQueryState;
|
43
|
+
tabletsFilters: {
|
44
|
+
loading: boolean;
|
45
|
+
requestTime: number;
|
46
|
+
data: undefined;
|
47
|
+
wasLoaded: boolean;
|
48
|
+
stateFilter: never[];
|
49
|
+
typeFilter: never[];
|
50
|
+
} | {
|
51
|
+
tabletsData: any;
|
52
|
+
nodes: any;
|
53
|
+
loading: boolean;
|
54
|
+
wasLoaded: boolean;
|
55
|
+
timeoutForRequest: number;
|
56
|
+
error: undefined;
|
57
|
+
data: undefined;
|
58
|
+
stateFilter: never[];
|
59
|
+
typeFilter: never[];
|
60
|
+
} | {
|
61
|
+
error: any;
|
62
|
+
loading: boolean;
|
63
|
+
data: undefined;
|
64
|
+
wasLoaded: boolean;
|
65
|
+
stateFilter: never[];
|
66
|
+
typeFilter: never[];
|
67
|
+
} | {
|
68
|
+
stateFilter: any;
|
69
|
+
data: undefined;
|
70
|
+
loading: boolean;
|
71
|
+
wasLoaded: boolean;
|
72
|
+
typeFilter: never[];
|
73
|
+
} | {
|
74
|
+
typeFilter: any;
|
75
|
+
data: undefined;
|
76
|
+
loading: boolean;
|
77
|
+
wasLoaded: boolean;
|
78
|
+
stateFilter: never[];
|
79
|
+
};
|
80
|
+
heatmap: import("../../../types/store/heatmap").IHeatmapState;
|
81
|
+
settings: import("../settings/types").SettingsState;
|
82
|
+
preview: any;
|
83
|
+
nodesList: import("../../../types/store/nodesList").NodesListState;
|
84
|
+
describe: import("../../../types/store/describe").IDescribeState;
|
85
|
+
schemaAcl: import("../schemaAcl/types").SchemaAclState;
|
86
|
+
executeTopQueries: import("../executeTopQueries/types").ITopQueriesState;
|
87
|
+
executeTopTables: import("../tenantOverview/executeTopTables/types").TopTablesState;
|
88
|
+
tenantOverviewTopQueries: import("../tenantOverview/topQueries/types").TenantOverviewTopQueriesState;
|
89
|
+
healthcheckInfo: import("../healthcheckInfo/types").HealthcheckInfoState;
|
90
|
+
shardsWorkload: import("../shardsWorkload/types").IShardsWorkloadState;
|
91
|
+
tenantOverviewTopShards: import("../tenantOverview/topShards/types").TenantOverviewTopShardsState;
|
92
|
+
hotKeys: import("../hotKeys/types").HotKeysState;
|
93
|
+
authentication: import("../authentication/types").AuthenticationState;
|
94
|
+
header: import("../header/types").HeaderState;
|
95
|
+
saveQuery: string | null;
|
96
|
+
fullscreen: boolean;
|
97
|
+
clusters: import("../clusters/types").ClustersState;
|
98
|
+
vDisk: VDiskState;
|
99
|
+
}) => Promise<unknown>;
|
100
|
+
export default vdisk;
|
@@ -0,0 +1,64 @@
|
|
1
|
+
import { EVersion } from '../../../types/api/storage';
|
2
|
+
import { valueIsDefined } from '../../../utils';
|
3
|
+
import { createRequestActionTypes, createApiRequest } from '../../utils';
|
4
|
+
import { prepareVDiskDataResponse, prepareVDiskGroupResponse } from './utils';
|
5
|
+
export const FETCH_VDISK = createRequestActionTypes('vdisk', 'FETCH_VDISK');
|
6
|
+
const SET_VDISK_DATA_WAS_NOT_LOADED = 'vdisk/SET_VDISK_DATA_WAS_NOT_LOADED';
|
7
|
+
const initialState = {
|
8
|
+
loading: false,
|
9
|
+
wasLoaded: false,
|
10
|
+
vDiskData: {},
|
11
|
+
};
|
12
|
+
const vdisk = (state = initialState, action) => {
|
13
|
+
switch (action.type) {
|
14
|
+
case FETCH_VDISK.REQUEST: {
|
15
|
+
return Object.assign(Object.assign({}, state), { loading: true });
|
16
|
+
}
|
17
|
+
case FETCH_VDISK.SUCCESS: {
|
18
|
+
const { vDiskData, groupData } = action.data;
|
19
|
+
return Object.assign(Object.assign({}, state), { vDiskData,
|
20
|
+
groupData, loading: false, wasLoaded: true, error: undefined });
|
21
|
+
}
|
22
|
+
case FETCH_VDISK.FAILURE: {
|
23
|
+
return Object.assign(Object.assign({}, state), { error: action.error, loading: false });
|
24
|
+
}
|
25
|
+
case SET_VDISK_DATA_WAS_NOT_LOADED: {
|
26
|
+
return Object.assign(Object.assign({}, state), { wasLoaded: false });
|
27
|
+
}
|
28
|
+
default:
|
29
|
+
return state;
|
30
|
+
}
|
31
|
+
};
|
32
|
+
export const setVDiskDataWasNotLoaded = () => {
|
33
|
+
return {
|
34
|
+
type: SET_VDISK_DATA_WAS_NOT_LOADED,
|
35
|
+
};
|
36
|
+
};
|
37
|
+
const requestVDiskData = async ({ nodeId, pDiskId, vDiskSlotId }) => {
|
38
|
+
const vDiskDataResponse = await Promise.all([
|
39
|
+
window.api.getVdiskInfo({ nodeId, pDiskId, vDiskSlotId }),
|
40
|
+
window.api.getPdiskInfo(nodeId, pDiskId),
|
41
|
+
window.api.getNodeInfo(nodeId),
|
42
|
+
]);
|
43
|
+
const vDiskData = prepareVDiskDataResponse(vDiskDataResponse);
|
44
|
+
const { StoragePoolName, VDiskId = {} } = vDiskData;
|
45
|
+
const { GroupID } = VDiskId;
|
46
|
+
let groupData;
|
47
|
+
if (valueIsDefined(StoragePoolName) && valueIsDefined(GroupID)) {
|
48
|
+
const groupResponse = await window.api.getStorageInfo({
|
49
|
+
nodeId,
|
50
|
+
poolName: StoragePoolName,
|
51
|
+
groupId: GroupID,
|
52
|
+
version: EVersion.v1,
|
53
|
+
});
|
54
|
+
groupData = prepareVDiskGroupResponse(groupResponse, StoragePoolName, GroupID);
|
55
|
+
}
|
56
|
+
return { vDiskData, groupData };
|
57
|
+
};
|
58
|
+
export const getVDiskData = (params) => {
|
59
|
+
return createApiRequest({
|
60
|
+
request: requestVDiskData(params),
|
61
|
+
actions: FETCH_VDISK,
|
62
|
+
});
|
63
|
+
};
|
64
|
+
export default vdisk;
|
@@ -1,7 +1,9 @@
|
|
1
1
|
import { __rest } from "tslib";
|
2
2
|
import { createReduxLocationActions } from 'redux-location-state';
|
3
3
|
import qs from 'qs';
|
4
|
-
import
|
4
|
+
import each from 'lodash/each';
|
5
|
+
import keys from 'lodash/keys';
|
6
|
+
import merge from 'lodash/merge';
|
5
7
|
import { stateToParams } from 'redux-location-state/lib/stateToParams';
|
6
8
|
import { parseQuery } from 'redux-location-state/lib/parseQuery';
|
7
9
|
import { LOCATION_PUSH, LOCATION_POP } from 'redux-location-state/lib/constants';
|
@@ -81,7 +83,7 @@ const paramSetup = {
|
|
81
83
|
},
|
82
84
|
};
|
83
85
|
function mergeLocationToState(state, location) {
|
84
|
-
return
|
86
|
+
return merge({}, state, location.query);
|
85
87
|
}
|
86
88
|
function restoreUnknownParams(location, prevLocation) {
|
87
89
|
const { search } = location, rest = __rest(location, ["search"]);
|
@@ -90,11 +92,11 @@ function restoreUnknownParams(location, prevLocation) {
|
|
90
92
|
const declaredPath = getMatchingDeclaredPath(paramSetup, location);
|
91
93
|
const entries = declaredPath && paramSetup[declaredPath];
|
92
94
|
// remove params which are mapped for this page
|
93
|
-
|
95
|
+
each(keys(entries), (param) => {
|
94
96
|
delete params[param];
|
95
97
|
});
|
96
98
|
// and globally
|
97
|
-
|
99
|
+
each(keys(paramSetup.global || {}), (param) => {
|
98
100
|
delete params[param];
|
99
101
|
});
|
100
102
|
const restoredParams = qs.stringify(params, { encoder: encodeURIComponent });
|
@@ -31,10 +31,12 @@ export interface TStoragePoolInfo {
|
|
31
31
|
MaximumThroughput?: string;
|
32
32
|
/** uint64 */
|
33
33
|
MaximumSize?: string;
|
34
|
+
MediaType?: string;
|
34
35
|
}
|
35
36
|
export interface TStorageGroupInfoV2 extends TStorageGroupInfo {
|
36
37
|
PoolName?: string;
|
37
38
|
Kind?: string;
|
39
|
+
MediaType?: string;
|
38
40
|
/** uint64 */
|
39
41
|
Degraded?: string;
|
40
42
|
/** uint64 */
|
@@ -8,21 +8,21 @@ describe('formatBytes', () => {
|
|
8
8
|
expect(formatBytes({ value: 100000000000000 })).toBe('100 TB');
|
9
9
|
});
|
10
10
|
it('should convert to size', () => {
|
11
|
-
expect(formatBytes({ value: 100000, size: 'b' })).toBe('100
|
12
|
-
expect(formatBytes({ value: 100000000000000, size: 'gb' })).toBe('100
|
11
|
+
expect(formatBytes({ value: 100000, size: 'b' })).toBe('100 000 B');
|
12
|
+
expect(formatBytes({ value: 100000000000000, size: 'gb' })).toBe('100 000 GB');
|
13
13
|
});
|
14
14
|
it('should convert without labels', () => {
|
15
|
-
expect(formatBytes({ value: 100000, size: 'b', withSizeLabel: false })).toBe('100
|
16
|
-
expect(formatBytes({ value: 100000000000000, size: 'gb', withSizeLabel: false })).toBe('100
|
15
|
+
expect(formatBytes({ value: 100000, size: 'b', withSizeLabel: false })).toBe('100 000');
|
16
|
+
expect(formatBytes({ value: 100000000000000, size: 'gb', withSizeLabel: false })).toBe('100 000');
|
17
17
|
});
|
18
18
|
it('should convert to speed', () => {
|
19
19
|
expect(formatBytes({ value: 100000, withSpeedLabel: true })).toBe('100 KB/s');
|
20
|
-
expect(formatBytes({ value: 100000, size: 'b', withSpeedLabel: true })).toBe('100
|
20
|
+
expect(formatBytes({ value: 100000, size: 'b', withSpeedLabel: true })).toBe('100 000 B/s');
|
21
21
|
});
|
22
22
|
it('should return fixed amount of significant digits', () => {
|
23
|
-
expect(formatBytes({ value: 99000, significantDigits: 2 })).toEqual('99
|
23
|
+
expect(formatBytes({ value: 99000, significantDigits: 2 })).toEqual('99 000 B');
|
24
24
|
expect(formatBytes({ value: 100000, significantDigits: 2 })).toEqual('100 KB');
|
25
|
-
expect(formatBytes({ value: 99000000000000, significantDigits: 2 })).toEqual('99
|
25
|
+
expect(formatBytes({ value: 99000000000000, significantDigits: 2 })).toEqual('99 000 GB');
|
26
26
|
expect(formatBytes({ value: 100000000000000, significantDigits: 2 })).toEqual('100 TB');
|
27
27
|
});
|
28
28
|
it('should return empty string on invalid data', () => {
|
@@ -68,6 +68,7 @@ export const formatNumber = (number) => {
|
|
68
68
|
if (!isNumeric(number)) {
|
69
69
|
return '';
|
70
70
|
}
|
71
|
+
// "," in format is delimiter sign, not delimiter itself
|
71
72
|
return configuredNumeral(number).format('0,0.[00000]');
|
72
73
|
};
|
73
74
|
export const roundToPrecision = (value, precision = 0) => {
|
@@ -13,12 +13,12 @@ export const DISK_NUMERIC_SEVERITY_TO_STATE_COLOR = Object.entries(DISK_COLOR_ST
|
|
13
13
|
export const NOT_AVAILABLE_SEVERITY = DISK_COLOR_STATE_TO_NUMERIC_SEVERITY.Grey;
|
14
14
|
export const NOT_AVAILABLE_SEVERITY_COLOR = DISK_NUMERIC_SEVERITY_TO_STATE_COLOR[NOT_AVAILABLE_SEVERITY];
|
15
15
|
export const VDISK_STATE_SEVERITY = {
|
16
|
+
[EVDiskState.OK]: DISK_COLOR_STATE_TO_NUMERIC_SEVERITY.Green,
|
16
17
|
[EVDiskState.Initial]: DISK_COLOR_STATE_TO_NUMERIC_SEVERITY.Yellow,
|
18
|
+
[EVDiskState.SyncGuidRecovery]: DISK_COLOR_STATE_TO_NUMERIC_SEVERITY.Yellow,
|
17
19
|
[EVDiskState.LocalRecoveryError]: DISK_COLOR_STATE_TO_NUMERIC_SEVERITY.Red,
|
18
20
|
[EVDiskState.SyncGuidRecoveryError]: DISK_COLOR_STATE_TO_NUMERIC_SEVERITY.Red,
|
19
|
-
[EVDiskState.SyncGuidRecovery]: DISK_COLOR_STATE_TO_NUMERIC_SEVERITY.Yellow,
|
20
21
|
[EVDiskState.PDiskError]: DISK_COLOR_STATE_TO_NUMERIC_SEVERITY.Red,
|
21
|
-
[EVDiskState.OK]: DISK_COLOR_STATE_TO_NUMERIC_SEVERITY.Green,
|
22
22
|
};
|
23
23
|
export const PDISK_STATE_SEVERITY = {
|
24
24
|
[TPDiskState.Initial]: DISK_COLOR_STATE_TO_NUMERIC_SEVERITY.Grey,
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import type { TPDiskStateInfo } from '../../types/api/pdisk';
|
2
|
-
import type { TVDiskStateInfo } from '../../types/api/vdisk';
|
2
|
+
import type { TVDiskStateInfo, TVSlotId } from '../../types/api/vdisk';
|
3
3
|
import type { ValueOf } from '../../types/common';
|
4
4
|
import type { PDISK_TYPES } from './getPDiskType';
|
5
5
|
export interface PreparedPDisk extends TPDiskStateInfo {
|
@@ -13,3 +13,7 @@ export interface PreparedVDisk extends TVDiskStateInfo {
|
|
13
13
|
Severity?: number;
|
14
14
|
}
|
15
15
|
export type PDiskType = ValueOf<typeof PDISK_TYPES>;
|
16
|
+
export interface UnavailableDonor extends TVSlotId {
|
17
|
+
DonorMode?: boolean;
|
18
|
+
StoragePoolName?: string;
|
19
|
+
}
|
package/dist/utils/filters.js
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
import type { Column as DataTableColumn } from '@gravity-ui/react-data-table';
|
2
|
-
import type
|
2
|
+
import { type Column as VirtualTableColumn } from '../../components/VirtualTable';
|
3
3
|
export type Column<T> = VirtualTableColumn<T> & DataTableColumn<T>;
|
4
4
|
export type TableColumnsWidthSetup = Record<string, number>;
|
5
5
|
export type HandleTableColumnsResize = (newSetup: TableColumnsWidthSetup) => void;
|
@@ -1,12 +1,14 @@
|
|
1
1
|
import { useCallback, useState } from 'react';
|
2
|
+
import { DEFAULT_RESIZEABLE } from '../../components/VirtualTable';
|
2
3
|
import { settingsManager } from '../../services/settings';
|
3
4
|
export const updateColumnsWidth = (columns, columnsWidthSetup) => {
|
4
5
|
return columns.map((column) => {
|
5
|
-
var _a;
|
6
|
-
|
6
|
+
var _a, _b;
|
7
|
+
const resizeable = (_a = column.resizeable) !== null && _a !== void 0 ? _a : DEFAULT_RESIZEABLE;
|
8
|
+
if (!resizeable) {
|
7
9
|
return column;
|
8
10
|
}
|
9
|
-
return Object.assign(Object.assign({}, column), { width: (
|
11
|
+
return Object.assign(Object.assign({}, column), { width: (_b = columnsWidthSetup[column.name]) !== null && _b !== void 0 ? _b : column.width });
|
10
12
|
});
|
11
13
|
};
|
12
14
|
export const useTableResize = (localStorageKey) => {
|
@@ -0,0 +1,4 @@
|
|
1
|
+
import * as React from 'react';
|
2
|
+
export declare function lazyComponent<TExports extends {
|
3
|
+
[key: string]: any;
|
4
|
+
}, TKey extends keyof TExports>(moduleLoader: () => Promise<TExports>, exportName: TKey, loader?: React.ReactNode): React.ForwardRefExoticComponent<React.PropsWithoutRef<React.ComponentProps<TExports[TKey]>> & React.RefAttributes<TExports[TKey]>>;
|
@@ -0,0 +1,25 @@
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
2
|
+
import * as React from 'react';
|
3
|
+
import { Loader } from '@gravity-ui/uikit';
|
4
|
+
import { ErrorBoundaryFallback } from '../components/ErrorBoundary/ErrorBoundary';
|
5
|
+
import { useComponent } from '../components/ComponentsProvider/ComponentsProvider';
|
6
|
+
export function lazyComponent(moduleLoader, exportName, loader) {
|
7
|
+
const Component = React.lazy(() => moduleLoader()
|
8
|
+
.then((module) => ({ default: module[exportName] }))
|
9
|
+
.catch((error) => ({ default: () => _jsx(ErrorBoundaryFallback, { error: error }) })));
|
10
|
+
const LazyComponent = (props, ref) => {
|
11
|
+
const ErrorBoundary = useComponent('ErrorBoundary');
|
12
|
+
return (_jsx(ErrorBoundary, { children: _jsx(React.Suspense, Object.assign({ fallback: loader !== null && loader !== void 0 ? loader : _jsx(DefaultLoader, {}) }, { children: _jsx(Component, Object.assign({ ref: ref }, props)) })) }));
|
13
|
+
};
|
14
|
+
LazyComponent.displayName = exportName;
|
15
|
+
return React.forwardRef(LazyComponent);
|
16
|
+
}
|
17
|
+
function DefaultLoader() {
|
18
|
+
return (_jsx("div", Object.assign({ style: {
|
19
|
+
width: '100%',
|
20
|
+
height: '100%',
|
21
|
+
display: 'flex',
|
22
|
+
alignItems: 'center',
|
23
|
+
justifyContent: 'center',
|
24
|
+
} }, { children: _jsx(Loader, { size: "l" }) })));
|
25
|
+
}
|
@@ -0,0 +1 @@
|
|
1
|
+
export declare function registerLanguages(): void;
|
@@ -0,0 +1 @@
|
|
1
|
+
export declare const LANGUAGE_S_EXPRESSION_ID = "s-expression";
|
@@ -0,0 +1 @@
|
|
1
|
+
export const LANGUAGE_S_EXPRESSION_ID = 's-expression';
|
@@ -0,0 +1 @@
|
|
1
|
+
export declare function registerSExpressionLanguage(): void;
|
@@ -1,7 +1,6 @@
|
|
1
1
|
import * as monaco from 'monaco-editor';
|
2
|
-
import {
|
3
|
-
export
|
4
|
-
function registerSExpressionLanguage() {
|
2
|
+
import { LANGUAGE_S_EXPRESSION_ID } from './constants';
|
3
|
+
export function registerSExpressionLanguage() {
|
5
4
|
monaco.languages.register({ id: LANGUAGE_S_EXPRESSION_ID });
|
6
5
|
monaco.languages.setMonarchTokensProvider(LANGUAGE_S_EXPRESSION_ID, {
|
7
6
|
defaultToken: 'text',
|
@@ -58,19 +57,3 @@ function registerSExpressionLanguage() {
|
|
58
57
|
},
|
59
58
|
});
|
60
59
|
}
|
61
|
-
let completionProvider;
|
62
|
-
function disableCodeSuggestions() {
|
63
|
-
if (completionProvider) {
|
64
|
-
completionProvider.dispose();
|
65
|
-
}
|
66
|
-
}
|
67
|
-
export function registerYQLCompletionItemProvider(database) {
|
68
|
-
disableCodeSuggestions();
|
69
|
-
completionProvider = monaco.languages.registerCompletionItemProvider('sql', {
|
70
|
-
triggerCharacters: [' ', '\n', '', ',', '.', '`', '('],
|
71
|
-
provideCompletionItems: createProvideSuggestionsFunction(database),
|
72
|
-
});
|
73
|
-
}
|
74
|
-
export function registerLanguages() {
|
75
|
-
registerSExpressionLanguage();
|
76
|
-
}
|
@@ -1,5 +1,5 @@
|
|
1
|
-
import * as monaco from 'monaco-editor/esm/vs/editor/editor.api';
|
2
|
-
import { ColumnAliasSuggestion, KeywordSuggestion, YqlAutocompleteResult } from '@gravity-ui/websql-autocomplete';
|
1
|
+
import type * as monaco from 'monaco-editor/esm/vs/editor/editor.api';
|
2
|
+
import type { ColumnAliasSuggestion, KeywordSuggestion, YqlAutocompleteResult } from '@gravity-ui/websql-autocomplete';
|
3
3
|
export declare function generateColumnsSuggestion(rangeToInsertSuggestion: monaco.IRange, suggestColumns: YqlAutocompleteResult['suggestColumns'] | undefined, database: string): Promise<monaco.languages.CompletionItem[]>;
|
4
4
|
export declare function generateColumnAliasesSuggestion(rangeToInsertSuggestion: monaco.IRange, suggestColumnAliases?: ColumnAliasSuggestion[]): {
|
5
5
|
label: string;
|
@@ -1,5 +1,34 @@
|
|
1
|
-
import * as monaco from 'monaco-editor/esm/vs/editor/editor.api';
|
2
1
|
import { AggregateFunctions, Pragmas, SimpleFunctions, SimpleTypes, TableFunction, Udfs, WindowFunctions, } from './constants';
|
2
|
+
const CompletionItemKind = {
|
3
|
+
Method: 0,
|
4
|
+
Function: 1,
|
5
|
+
Constructor: 2,
|
6
|
+
Field: 3,
|
7
|
+
Variable: 4,
|
8
|
+
Class: 5,
|
9
|
+
Struct: 6,
|
10
|
+
Interface: 7,
|
11
|
+
Module: 8,
|
12
|
+
Property: 9,
|
13
|
+
Event: 10,
|
14
|
+
Operator: 11,
|
15
|
+
Unit: 12,
|
16
|
+
Value: 13,
|
17
|
+
Constant: 14,
|
18
|
+
Enum: 15,
|
19
|
+
EnumMember: 16,
|
20
|
+
Keyword: 17,
|
21
|
+
Text: 18,
|
22
|
+
Color: 19,
|
23
|
+
File: 20,
|
24
|
+
Reference: 21,
|
25
|
+
Customcolor: 22,
|
26
|
+
Folder: 23,
|
27
|
+
TypeParameter: 24,
|
28
|
+
User: 25,
|
29
|
+
Issue: 26,
|
30
|
+
Snippet: 27,
|
31
|
+
};
|
3
32
|
const re = /[\s'"-/@]/;
|
4
33
|
function wrapStringToBackticks(value) {
|
5
34
|
let result = value;
|
@@ -124,7 +153,7 @@ export async function generateColumnsSuggestion(rangeToInsertSuggestion, suggest
|
|
124
153
|
suggestions.push({
|
125
154
|
label: columnNameSuggestion,
|
126
155
|
insertText: columnNameSuggestion,
|
127
|
-
kind:
|
156
|
+
kind: CompletionItemKind.Field,
|
128
157
|
detail: 'Column',
|
129
158
|
range: rangeToInsertSuggestion,
|
130
159
|
sortText: suggestionIndexToWeight(getSuggestionIndex('suggestColumns')),
|
@@ -140,7 +169,7 @@ export function generateColumnAliasesSuggestion(rangeToInsertSuggestion, suggest
|
|
140
169
|
return suggestColumnAliases === null || suggestColumnAliases === void 0 ? void 0 : suggestColumnAliases.map((columnAliasSuggestion) => ({
|
141
170
|
label: columnAliasSuggestion.name,
|
142
171
|
insertText: columnAliasSuggestion.name,
|
143
|
-
kind:
|
172
|
+
kind: CompletionItemKind.Field,
|
144
173
|
detail: 'Column alias',
|
145
174
|
range: rangeToInsertSuggestion,
|
146
175
|
sortText: suggestionIndexToWeight(getSuggestionIndex('suggestColumnAliases')),
|
@@ -153,7 +182,7 @@ export function generateKeywordsSuggestion(rangeToInsertSuggestion, suggestKeywo
|
|
153
182
|
return suggestKeywords === null || suggestKeywords === void 0 ? void 0 : suggestKeywords.map((keywordSuggestion) => ({
|
154
183
|
label: keywordSuggestion.value,
|
155
184
|
insertText: keywordSuggestion.value,
|
156
|
-
kind:
|
185
|
+
kind: CompletionItemKind.Keyword,
|
157
186
|
detail: 'Keyword',
|
158
187
|
range: rangeToInsertSuggestion,
|
159
188
|
sortText: suggestionIndexToWeight(getSuggestionIndex('suggestKeywords')),
|
@@ -167,7 +196,7 @@ export async function generateSimpleFunctionsSuggestion(rangeToInsertSuggestion)
|
|
167
196
|
return functions.map((el) => ({
|
168
197
|
label: el,
|
169
198
|
insertText: el,
|
170
|
-
kind:
|
199
|
+
kind: CompletionItemKind.Function,
|
171
200
|
detail: 'Function',
|
172
201
|
range: rangeToInsertSuggestion,
|
173
202
|
sortText: suggestionIndexToWeight(getSuggestionIndex('suggestFunctions')),
|
@@ -178,7 +207,7 @@ export async function generateSimpleTypesSuggestion(rangeToInsertSuggestion) {
|
|
178
207
|
return simpleTypes.map((el) => ({
|
179
208
|
label: el,
|
180
209
|
insertText: el,
|
181
|
-
kind:
|
210
|
+
kind: CompletionItemKind.TypeParameter,
|
182
211
|
detail: 'Type',
|
183
212
|
range: rangeToInsertSuggestion,
|
184
213
|
sortText: suggestionIndexToWeight(getSuggestionIndex('suggestSimpleTypes')),
|
@@ -189,7 +218,7 @@ export async function generateUdfSuggestion(rangeToInsertSuggestion) {
|
|
189
218
|
return udfs.map((el) => ({
|
190
219
|
label: el,
|
191
220
|
insertText: el,
|
192
|
-
kind:
|
221
|
+
kind: CompletionItemKind.Function,
|
193
222
|
detail: 'UDF',
|
194
223
|
range: rangeToInsertSuggestion,
|
195
224
|
sortText: suggestionIndexToWeight(getSuggestionIndex('suggestUdfs')),
|
@@ -200,7 +229,7 @@ export async function generateWindowFunctionsSuggestion(rangeToInsertSuggestion)
|
|
200
229
|
return windowFunctions.map((el) => ({
|
201
230
|
label: el,
|
202
231
|
insertText: el,
|
203
|
-
kind:
|
232
|
+
kind: CompletionItemKind.Function,
|
204
233
|
detail: 'Window function',
|
205
234
|
range: rangeToInsertSuggestion,
|
206
235
|
sortText: suggestionIndexToWeight(getSuggestionIndex('suggestWindowFunctions')),
|
@@ -211,7 +240,7 @@ export async function generateTableFunctionsSuggestion(rangeToInsertSuggestion)
|
|
211
240
|
return tableFunctions.map((el) => ({
|
212
241
|
label: el,
|
213
242
|
insertText: el,
|
214
|
-
kind:
|
243
|
+
kind: CompletionItemKind.Function,
|
215
244
|
detail: 'Table function',
|
216
245
|
range: rangeToInsertSuggestion,
|
217
246
|
sortText: suggestionIndexToWeight(getSuggestionIndex('suggestTableFunctions')),
|
@@ -222,7 +251,7 @@ export async function generateAggregateFunctionsSuggestion(rangeToInsertSuggesti
|
|
222
251
|
return aggreagteFunctions.map((el) => ({
|
223
252
|
label: el,
|
224
253
|
insertText: el,
|
225
|
-
kind:
|
254
|
+
kind: CompletionItemKind.Function,
|
226
255
|
detail: 'Aggregate function',
|
227
256
|
range: rangeToInsertSuggestion,
|
228
257
|
sortText: suggestionIndexToWeight(getSuggestionIndex('suggestAggregateFunctions')),
|
@@ -233,7 +262,7 @@ export async function generatePragmasSuggestion(rangeToInsertSuggestion) {
|
|
233
262
|
return pragmas.map((el) => ({
|
234
263
|
label: el,
|
235
264
|
insertText: el,
|
236
|
-
kind:
|
265
|
+
kind: CompletionItemKind.Module,
|
237
266
|
detail: 'Pragma',
|
238
267
|
range: rangeToInsertSuggestion,
|
239
268
|
sortText: suggestionIndexToWeight(getSuggestionIndex('suggestPragmas')),
|
@@ -0,0 +1 @@
|
|
1
|
+
export declare function registerYQLCompletionItemProvider(database: string): void;
|
@@ -0,0 +1,15 @@
|
|
1
|
+
import * as monaco from 'monaco-editor';
|
2
|
+
import { createProvideSuggestionsFunction } from './yqlSuggestions';
|
3
|
+
let completionProvider;
|
4
|
+
function disableCodeSuggestions() {
|
5
|
+
if (completionProvider) {
|
6
|
+
completionProvider.dispose();
|
7
|
+
}
|
8
|
+
}
|
9
|
+
export function registerYQLCompletionItemProvider(database) {
|
10
|
+
disableCodeSuggestions();
|
11
|
+
completionProvider = monaco.languages.registerCompletionItemProvider('sql', {
|
12
|
+
triggerCharacters: [' ', '\n', '', ',', '.', '`', '('],
|
13
|
+
provideCompletionItems: createProvideSuggestionsFunction(database),
|
14
|
+
});
|
15
|
+
}
|
@@ -1,4 +1,3 @@
|
|
1
|
-
import { parseYqlQuery } from '@gravity-ui/websql-autocomplete';
|
2
1
|
import { generateAggregateFunctionsSuggestion, generateColumnAliasesSuggestion, generateColumnsSuggestion, generateEntitiesSuggestion, generateKeywordsSuggestion, generatePragmasSuggestion, generateSimpleFunctionsSuggestion, generateSimpleTypesSuggestion, generateTableFunctionsSuggestion, generateUdfSuggestion, generateWindowFunctionsSuggestion, } from './generateSuggestions';
|
3
2
|
export function createProvideSuggestionsFunction(database) {
|
4
3
|
return async (model, monacoCursorPosition, _context, _token) => {
|
@@ -12,6 +11,7 @@ export function createProvideSuggestionsFunction(database) {
|
|
12
11
|
};
|
13
12
|
}
|
14
13
|
async function getSuggestions(model, cursorPosition, rangeToInsertSuggestion, database) {
|
14
|
+
const { parseYqlQuery } = await import('@gravity-ui/websql-autocomplete');
|
15
15
|
const parseResult = parseYqlQuery(model.getValue(), cursorPosition);
|
16
16
|
let entitiesSuggestions = [];
|
17
17
|
let functionsSuggestions = [];
|
package/dist/utils/numeral.js
CHANGED
@@ -1,5 +1,11 @@
|
|
1
1
|
import numeral from 'numeral';
|
2
2
|
import 'numeral/locales'; // Without this numeral will throw an error when using not 'en' locale
|
3
|
-
import { i18n } from './i18n';
|
3
|
+
import { Lang, i18n } from './i18n';
|
4
|
+
// Set space delimiter for all locales possible in project
|
5
|
+
Object.values(Lang).forEach((value) => {
|
6
|
+
if (numeral.locales[value]) {
|
7
|
+
numeral.locales[value].delimiters.thousands = ' ';
|
8
|
+
}
|
9
|
+
});
|
4
10
|
numeral.locale(i18n.lang);
|
5
11
|
export const configuredNumeral = numeral;
|
package/dist/utils/storage.d.ts
CHANGED
@@ -12,6 +12,7 @@ export declare const getUsage: <T extends EntityWithUsage>(data: T, step?: numbe
|
|
12
12
|
export declare const STORAGE_SORT_VALUES: {
|
13
13
|
readonly PoolName: "PoolName";
|
14
14
|
readonly Kind: "Kind";
|
15
|
+
readonly MediaType: "MediaType";
|
15
16
|
readonly Erasure: "Erasure";
|
16
17
|
readonly Degraded: "Degraded";
|
17
18
|
readonly Usage: "Usage";
|