ydb-embedded-ui 6.23.1 → 6.25.0
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/components/CellWithPopover/CellWithPopover.js +2 -1
- package/dist/components/CellWithPopover/CellWithPopover.js.map +1 -1
- package/dist/components/NodeHostWrapper/NodeHostWrapper.d.ts +6 -2
- package/dist/components/NodeHostWrapper/NodeHostWrapper.js.map +1 -1
- package/dist/components/PDiskPopup/PDiskPopup.js +8 -1
- package/dist/components/PDiskPopup/PDiskPopup.js.map +1 -1
- package/dist/components/PaginatedTable/PaginatedTable.d.ts +3 -2
- package/dist/components/PaginatedTable/PaginatedTable.js +15 -21
- package/dist/components/PaginatedTable/PaginatedTable.js.map +1 -1
- package/dist/components/PaginatedTable/TableChunk.d.ts +1 -2
- package/dist/components/PaginatedTable/TableChunk.js +5 -19
- package/dist/components/PaginatedTable/TableChunk.js.map +1 -1
- package/dist/components/PaginatedTable/useScrollBasedChunks.d.ts +9 -0
- package/dist/components/PaginatedTable/useScrollBasedChunks.js +35 -0
- package/dist/components/PaginatedTable/useScrollBasedChunks.js.map +1 -0
- package/dist/components/TabletsStatistic/TabletsStatistic.d.ts +2 -2
- package/dist/components/TabletsStatistic/TabletsStatistic.js +2 -2
- package/dist/components/TabletsStatistic/TabletsStatistic.js.map +1 -1
- package/dist/components/VDisk/VDisk.js +12 -26
- package/dist/components/VDisk/VDisk.js.map +1 -1
- package/dist/components/VDisk/VDisk.scss +2 -0
- package/dist/components/VDisk/VDiskWithDonorsStack.js +2 -2
- package/dist/components/VDisk/VDiskWithDonorsStack.js.map +1 -1
- package/dist/components/VDisk/utils.d.ts +2 -0
- package/dist/components/VDisk/utils.js +23 -0
- package/dist/components/VDisk/utils.js.map +1 -0
- package/dist/components/VDiskInfo/VDiskInfo.js +2 -2
- package/dist/components/VDiskInfo/VDiskInfo.js.map +1 -1
- package/dist/components/VDiskPopup/VDiskPopup.d.ts +2 -3
- package/dist/components/VDiskPopup/VDiskPopup.js +29 -3
- package/dist/components/VDiskPopup/VDiskPopup.js.map +1 -1
- package/dist/components/nodesColumns/columns.d.ts +55 -0
- package/dist/components/nodesColumns/columns.js +187 -0
- package/dist/components/nodesColumns/columns.js.map +1 -0
- package/dist/components/nodesColumns/constants.d.ts +39 -0
- package/dist/components/nodesColumns/constants.js +73 -0
- package/dist/components/nodesColumns/constants.js.map +1 -0
- package/dist/{containers/Nodes/columns → components/nodesColumns}/i18n/en.json +4 -3
- package/dist/components/nodesColumns/i18n/index.d.ts +2 -0
- package/dist/{containers/Nodes/columns → components/nodesColumns}/i18n/index.js +1 -1
- package/dist/components/nodesColumns/i18n/index.js.map +1 -0
- package/dist/components/nodesColumns/types.d.ts +8 -0
- package/dist/components/nodesColumns/types.js.map +1 -0
- package/dist/containers/AppWithClusters/ExtendedCluster/ExtendedCluster.js +8 -4
- package/dist/containers/AppWithClusters/ExtendedCluster/ExtendedCluster.js.map +1 -1
- package/dist/containers/Authentication/Authentication.js +12 -10
- package/dist/containers/Authentication/Authentication.js.map +1 -1
- package/dist/containers/Cluster/Cluster.js +3 -1
- package/dist/containers/Cluster/Cluster.js.map +1 -1
- package/dist/containers/Cluster/utils.d.ts +4 -0
- package/dist/containers/Cluster/utils.js +6 -1
- package/dist/containers/Cluster/utils.js.map +1 -1
- package/dist/containers/Node/Node.js +1 -1
- package/dist/containers/Node/Node.js.map +1 -1
- package/dist/containers/Nodes/Nodes.js +1 -1
- package/dist/containers/Nodes/Nodes.js.map +1 -1
- package/dist/containers/Nodes/NodesWrapper.d.ts +2 -2
- package/dist/containers/Nodes/NodesWrapper.js +2 -2
- package/dist/containers/Nodes/NodesWrapper.js.map +1 -1
- package/dist/containers/Nodes/PaginatedNodes.d.ts +3 -2
- package/dist/containers/Nodes/PaginatedNodes.js +3 -3
- package/dist/containers/Nodes/PaginatedNodes.js.map +1 -1
- package/dist/containers/Nodes/columns/columns.d.ts +2 -7
- package/dist/containers/Nodes/columns/columns.js +13 -187
- package/dist/containers/Nodes/columns/columns.js.map +1 -1
- package/dist/containers/Nodes/columns/constants.d.ts +1 -38
- package/dist/containers/Nodes/columns/constants.js +0 -68
- package/dist/containers/Nodes/columns/constants.js.map +1 -1
- package/dist/containers/Nodes/columns/hooks.d.ts +3 -3
- package/dist/containers/Nodes/columns/hooks.js +2 -1
- package/dist/containers/Nodes/columns/hooks.js.map +1 -1
- package/dist/containers/PDiskPage/PDiskPage.js +2 -2
- package/dist/containers/PDiskPage/PDiskPage.js.map +1 -1
- package/dist/containers/Storage/Disks/Disks.d.ts +2 -2
- package/dist/containers/Storage/Disks/Disks.js +5 -6
- package/dist/containers/Storage/Disks/Disks.js.map +1 -1
- package/dist/containers/Storage/PDisk/PDisk.d.ts +2 -2
- package/dist/containers/Storage/PDisk/PDisk.js +13 -11
- package/dist/containers/Storage/PDisk/PDisk.js.map +1 -1
- package/dist/containers/Storage/PaginatedStorage.d.ts +4 -1
- package/dist/containers/Storage/PaginatedStorage.js +3 -2
- package/dist/containers/Storage/PaginatedStorage.js.map +1 -1
- package/dist/containers/Storage/PaginatedStorageGroups.js +7 -6
- package/dist/containers/Storage/PaginatedStorageGroups.js.map +1 -1
- package/dist/containers/Storage/PaginatedStorageNodes.js +9 -8
- package/dist/containers/Storage/PaginatedStorageNodes.js.map +1 -1
- package/dist/containers/Storage/Storage.d.ts +3 -1
- package/dist/containers/Storage/Storage.js +3 -3
- package/dist/containers/Storage/Storage.js.map +1 -1
- package/dist/containers/Storage/StorageControls/StorageControls.js +2 -2
- package/dist/containers/Storage/StorageGroups/PaginatedStorageGroupsTable.d.ts +3 -2
- package/dist/containers/Storage/StorageGroups/PaginatedStorageGroupsTable.js +2 -2
- package/dist/containers/Storage/StorageGroups/PaginatedStorageGroupsTable.js.map +1 -1
- package/dist/containers/Storage/StorageGroups/columns/StorageGroupsColumns.scss +10 -1
- package/dist/containers/Storage/StorageGroups/columns/columns.js +21 -16
- package/dist/containers/Storage/StorageGroups/columns/columns.js.map +1 -1
- package/dist/containers/Storage/StorageGroups/columns/constants.js +1 -1
- package/dist/containers/Storage/StorageGroups/columns/constants.js.map +1 -1
- package/dist/containers/Storage/StorageGroups/columns/hooks.d.ts +3 -2
- package/dist/containers/Storage/StorageGroups/columns/hooks.js +5 -5
- package/dist/containers/Storage/StorageGroups/columns/hooks.js.map +1 -1
- package/dist/containers/Storage/StorageGroups/columns/i18n/en.json +1 -1
- package/dist/containers/Storage/StorageGroups/columns/i18n/index.d.ts +1 -1
- package/dist/containers/Storage/StorageGroups/columns/types.d.ts +3 -2
- package/dist/containers/Storage/StorageNodes/PaginatedStorageNodesTable.d.ts +3 -2
- package/dist/containers/Storage/StorageNodes/PaginatedStorageNodesTable.js +2 -2
- package/dist/containers/Storage/StorageNodes/PaginatedStorageNodesTable.js.map +1 -1
- package/dist/containers/Storage/StorageNodes/columns/columns.d.ts +2 -38
- package/dist/containers/Storage/StorageNodes/columns/columns.js +34 -71
- package/dist/containers/Storage/StorageNodes/columns/columns.js.map +1 -1
- package/dist/containers/Storage/StorageNodes/columns/constants.d.ts +20 -4
- package/dist/containers/Storage/StorageNodes/columns/constants.js +4 -32
- package/dist/containers/Storage/StorageNodes/columns/constants.js.map +1 -1
- package/dist/containers/Storage/StorageNodes/columns/hooks.d.ts +2 -39
- package/dist/containers/Storage/StorageNodes/columns/hooks.js +4 -4
- package/dist/containers/Storage/StorageNodes/columns/hooks.js.map +1 -1
- package/dist/containers/Storage/StorageNodes/columns/i18n/en.json +0 -8
- package/dist/containers/Storage/StorageNodes/columns/i18n/index.d.ts +1 -1
- package/dist/containers/Storage/StorageNodes/columns/types.d.ts +5 -5
- package/dist/containers/Storage/StorageWrapper.d.ts +6 -3
- package/dist/containers/Storage/StorageWrapper.js +10 -3
- package/dist/containers/Storage/StorageWrapper.js.map +1 -1
- package/dist/containers/Storage/types.d.ts +6 -0
- package/dist/containers/Storage/types.js +2 -0
- package/dist/containers/Storage/types.js.map +1 -0
- package/dist/containers/Storage/utils/index.d.ts +4 -6
- package/dist/containers/Storage/utils/index.js +35 -9
- package/dist/containers/Storage/utils/index.js.map +1 -1
- package/dist/containers/StorageGroupPage/StorageGroupPage.js +2 -2
- package/dist/containers/StorageGroupPage/StorageGroupPage.js.map +1 -1
- package/dist/containers/Tablet/components/TabletStorageInfo/TabletStorageInfo.scss +2 -9
- package/dist/containers/Tablets/Tablets.js +2 -123
- package/dist/containers/Tablets/Tablets.js.map +1 -1
- package/dist/containers/Tablets/TabletsTable.d.ts +10 -0
- package/dist/containers/Tablets/TabletsTable.js +129 -0
- package/dist/containers/Tablets/TabletsTable.js.map +1 -0
- package/dist/containers/Tenant/Diagnostics/Diagnostics.js +4 -4
- package/dist/containers/Tenant/Diagnostics/Diagnostics.js.map +1 -1
- package/dist/containers/Tenant/Diagnostics/TenantOverview/TenantCpu/TopNodesByCpu.d.ts +4 -0
- package/dist/containers/Tenant/Diagnostics/TenantOverview/TenantCpu/TopNodesByCpu.js +18 -3
- package/dist/containers/Tenant/Diagnostics/TenantOverview/TenantCpu/TopNodesByCpu.js.map +1 -1
- package/dist/containers/Tenant/Diagnostics/TenantOverview/TenantCpu/TopNodesByLoad.js +22 -3
- package/dist/containers/Tenant/Diagnostics/TenantOverview/TenantCpu/TopNodesByLoad.js.map +1 -1
- package/dist/containers/Tenant/Diagnostics/TenantOverview/TenantCpu/TopQueries.js +2 -1
- package/dist/containers/Tenant/Diagnostics/TenantOverview/TenantCpu/TopQueries.js.map +1 -1
- package/dist/containers/Tenant/Diagnostics/TenantOverview/TenantCpu/TopShards.js +2 -1
- package/dist/containers/Tenant/Diagnostics/TenantOverview/TenantCpu/TopShards.js.map +1 -1
- package/dist/containers/Tenant/Diagnostics/TenantOverview/TenantMemory/TopNodesByMemory.js +23 -2
- package/dist/containers/Tenant/Diagnostics/TenantOverview/TenantMemory/TopNodesByMemory.js.map +1 -1
- package/dist/containers/Tenant/Diagnostics/TenantOverview/TenantStorage/TopGroups.js +2 -6
- package/dist/containers/Tenant/Diagnostics/TenantOverview/TenantStorage/TopGroups.js.map +1 -1
- package/dist/containers/Tenant/Diagnostics/TenantOverview/TenantStorage/TopTables.js +2 -1
- package/dist/containers/Tenant/Diagnostics/TenantOverview/TenantStorage/TopTables.js.map +1 -1
- package/dist/containers/Tenant/Diagnostics/TenantOverview/i18n/en.json +2 -1
- package/dist/containers/Tenant/Diagnostics/TenantOverview/i18n/index.d.ts +1 -1
- package/dist/containers/Tenant/Diagnostics/TopQueries/RunningQueriesData.js +4 -2
- package/dist/containers/Tenant/Diagnostics/TopQueries/RunningQueriesData.js.map +1 -1
- package/dist/containers/Tenant/Diagnostics/TopQueries/TopQueriesData.js +2 -1
- package/dist/containers/Tenant/Diagnostics/TopQueries/TopQueriesData.js.map +1 -1
- package/dist/containers/Tenant/Diagnostics/TopShards/TopShards.js +2 -1
- package/dist/containers/Tenant/Diagnostics/TopShards/TopShards.js.map +1 -1
- package/dist/containers/Tenant/Query/ExecuteResult/ExecuteResult.js +5 -7
- package/dist/containers/Tenant/Query/ExecuteResult/ExecuteResult.js.map +1 -1
- package/dist/containers/Tenant/Query/ExplainResult/components/SimplifiedPlan/SimplifiedPlan.scss +1 -1
- package/dist/containers/Tenant/Query/Preview/Preview.js +3 -2
- package/dist/containers/Tenant/Query/Preview/Preview.js.map +1 -1
- package/dist/containers/Tenant/Query/QueryEditor/QueryEditor.js +1 -4
- package/dist/containers/Tenant/Query/QueryEditor/QueryEditor.js.map +1 -1
- package/dist/containers/Tenant/Query/QuerySettingsDialog/constants.d.ts +4 -4
- package/dist/containers/Tenant/Query/QuerySettingsDialog/constants.js +1 -1
- package/dist/containers/Tenant/Query/QuerySettingsDialog/constants.js.map +1 -1
- package/dist/containers/Tenants/Tenants.js +10 -2
- package/dist/containers/Tenants/Tenants.js.map +1 -1
- package/dist/containers/UserSettings/i18n/en.json +0 -2
- package/dist/containers/UserSettings/i18n/index.d.ts +1 -1
- package/dist/containers/UserSettings/settings.d.ts +0 -1
- package/dist/containers/UserSettings/settings.js +2 -7
- package/dist/containers/UserSettings/settings.js.map +1 -1
- package/dist/containers/VDiskPage/VDiskPage.js +3 -4
- package/dist/containers/VDiskPage/VDiskPage.js.map +1 -1
- package/dist/services/api.d.ts +3 -4
- package/dist/services/api.js +1 -3
- package/dist/services/api.js.map +1 -1
- package/dist/services/settings.d.ts +1 -2
- package/dist/services/settings.js +1 -2
- package/dist/services/settings.js.map +1 -1
- package/dist/store/reducers/cluster/__test__/parseGroupsStatsQueryResponse.test.js +62 -40
- package/dist/store/reducers/cluster/__test__/parseGroupsStatsQueryResponse.test.js.map +1 -1
- package/dist/store/reducers/cluster/cluster.js +0 -1
- package/dist/store/reducers/cluster/cluster.js.map +1 -1
- package/dist/store/reducers/cluster/utils.d.ts +1 -1
- package/dist/store/reducers/cluster/utils.js +2 -1
- package/dist/store/reducers/cluster/utils.js.map +1 -1
- package/dist/store/reducers/executeQuery.d.ts +0 -2
- package/dist/store/reducers/executeQuery.js +1 -2
- package/dist/store/reducers/executeQuery.js.map +1 -1
- package/dist/store/reducers/executeTopQueries/executeTopQueries.d.ts +1 -1
- package/dist/store/reducers/executeTopQueries/executeTopQueries.js +4 -4
- package/dist/store/reducers/executeTopQueries/executeTopQueries.js.map +1 -1
- package/dist/store/reducers/nodes/types.d.ts +2 -7
- package/dist/store/reducers/nodes/utils.js +0 -6
- package/dist/store/reducers/nodes/utils.js.map +1 -1
- package/dist/store/reducers/preview.js +1 -1
- package/dist/store/reducers/preview.js.map +1 -1
- package/dist/store/reducers/shardsWorkload/shardsWorkload.js +0 -1
- package/dist/store/reducers/shardsWorkload/shardsWorkload.js.map +1 -1
- package/dist/store/reducers/storage/types.d.ts +6 -7
- package/dist/store/reducers/storage/utils.js +23 -9
- package/dist/store/reducers/storage/utils.js.map +1 -1
- package/dist/store/reducers/tenantOverview/executeTopTables/executeTopTables.js +0 -1
- package/dist/store/reducers/tenantOverview/executeTopTables/executeTopTables.js.map +1 -1
- package/dist/store/reducers/tenantOverview/topShards/tenantOverviewTopShards.js +0 -1
- package/dist/store/reducers/tenantOverview/topShards/tenantOverviewTopShards.js.map +1 -1
- package/dist/store/reducers/tenants/types.d.ts +1 -0
- package/dist/store/reducers/tenants/utils.js +4 -2
- package/dist/store/reducers/tenants/utils.js.map +1 -1
- package/dist/store/reducers/viewSchema/viewSchema.js +2 -2
- package/dist/store/reducers/viewSchema/viewSchema.js.map +1 -1
- package/dist/types/additionalProps.d.ts +1 -1
- package/dist/types/api/cluster.d.ts +2 -0
- package/dist/types/api/cluster.js +3 -1
- package/dist/types/api/cluster.js.map +1 -1
- package/dist/types/api/nodes.d.ts +3 -0
- package/dist/types/api/nodes.js.map +1 -1
- package/dist/types/api/query.d.ts +16 -30
- package/dist/types/api/storage.d.ts +2 -2
- package/dist/types/store/query.d.ts +0 -1
- package/dist/utils/constants.d.ts +0 -1
- package/dist/utils/constants.js +0 -2
- package/dist/utils/constants.js.map +1 -1
- package/dist/utils/disks/__test__/calculateVDiskSeverity.test.js +1 -2
- package/dist/utils/disks/__test__/calculateVDiskSeverity.test.js.map +1 -1
- package/dist/utils/disks/calculateVDiskSeverity.js +2 -3
- package/dist/utils/disks/calculateVDiskSeverity.js.map +1 -1
- package/dist/utils/disks/prepareDisks.js +3 -0
- package/dist/utils/disks/prepareDisks.js.map +1 -1
- package/dist/utils/disks/types.d.ts +1 -0
- package/dist/utils/nodes.d.ts +4 -2
- package/dist/utils/nodes.js +10 -1
- package/dist/utils/nodes.js.map +1 -1
- package/dist/utils/query.d.ts +5 -5
- package/dist/utils/query.js +7 -22
- package/dist/utils/query.js.map +1 -1
- package/dist/utils/query.test.js +221 -56
- package/dist/utils/query.test.js.map +1 -1
- package/dist/utils/storage.d.ts +1 -0
- package/dist/utils/storage.js +3 -0
- package/dist/utils/storage.js.map +1 -1
- package/package.json +1 -1
- package/dist/components/PaginatedTable/useIntersectionObserver.d.ts +0 -9
- package/dist/components/PaginatedTable/useIntersectionObserver.js +0 -28
- package/dist/components/PaginatedTable/useIntersectionObserver.js.map +0 -1
- package/dist/containers/Nodes/columns/i18n/index.d.ts +0 -2
- package/dist/containers/Nodes/columns/i18n/index.js.map +0 -1
- package/dist/containers/Nodes/columns/types.d.ts +0 -9
- package/dist/containers/Nodes/columns/types.js.map +0 -1
- package/dist/containers/Tenant/Diagnostics/TenantOverview/TenantStorage/utils.d.ts +0 -2
- package/dist/containers/Tenant/Diagnostics/TenantOverview/TenantStorage/utils.js +0 -7
- package/dist/containers/Tenant/Diagnostics/TenantOverview/TenantStorage/utils.js.map +0 -1
- /package/dist/{containers/Nodes/columns → components/nodesColumns}/types.js +0 -0
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"prepareDisks.js","sourceRoot":"","sources":["../../../src/utils/disks/prepareDisks.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"prepareDisks.js","sourceRoot":"","sources":["../../../src/utils/disks/prepareDisks.ts"],"names":[],"mappings":"AAEA,OAAO,EAAC,gBAAgB,EAAC,MAAM,kCAAkC,CAAC;AAElE,OAAO,EAAC,sBAAsB,EAAC,MAAM,0BAA0B,CAAC;AAChE,OAAO,EAAC,sBAAsB,EAAC,MAAM,0BAA0B,CAAC;AAChE,OAAO,EAAC,YAAY,EAAC,MAAM,gBAAgB,CAAC;AAG5C,MAAM,UAAU,gBAAgB,CAAC,aAA8B,EAAE;;IAC7D,sCAAsC;IACtC,MAAM,KAAK,GAAG,UAAU,CAAC,KAAK;QAC1B,CAAC,CAAC,gBAAgB,CAAC;YACb,GAAG,UAAU,CAAC,KAAK;YACnB,MAAM,EAAE,MAAA,UAAU,CAAC,KAAK,CAAC,MAAM,mCAAI,UAAU,CAAC,MAAM;SACvD,CAAC;QACJ,CAAC,CAAC,SAAS,CAAC;IAEhB,MAAM,OAAO,GAAG,MAAA,UAAU,CAAC,OAAO,mCAAI,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,OAAO,CAAC;IAErD,MAAM,SAAS,GAAG,MAAM,CAAC,MAAA,UAAU,CAAC,aAAa,mCAAI,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,aAAa,CAAC,CAAC;IAC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C,CAAC;IAEtE,OAAO;QACH,GAAG,YAAY;QACf,GAAG,UAAU;QACb,IAAI;QACJ,QAAQ;QAER,aAAa,EAAE,SAAS;QACxB,gBAAgB,EAAE,gBAAgB;KACrC,CAAC;AACN,CAAC"}
|
@@ -11,6 +11,7 @@ export type PreparedPDisk = TPDiskStateInfo & Omit<Partial<TPDiskInfo>, 'Type'>
|
|
11
11
|
export interface PreparedVDisk extends TVDiskStateInfo {
|
12
12
|
PDisk?: PreparedPDisk;
|
13
13
|
Severity?: number;
|
14
|
+
StringifiedId?: string;
|
14
15
|
TotalSize?: number;
|
15
16
|
AllocatedPercent?: number;
|
16
17
|
}
|
package/dist/utils/nodes.d.ts
CHANGED
@@ -1,5 +1,4 @@
|
|
1
1
|
import { z } from 'zod';
|
2
|
-
import type { NodesPreparedEntity } from '../store/reducers/nodes/types';
|
3
2
|
import type { ProblemFilterValue } from '../store/reducers/settings/types';
|
4
3
|
import type { NodesSortValue, TSystemStateInfo } from '../types/api/nodes';
|
5
4
|
import type { TNodeInfo } from '../types/api/nodesList';
|
@@ -13,7 +12,7 @@ export declare const NodesUptimeFilterTitles: {
|
|
13
12
|
All: string;
|
14
13
|
SmallUptime: string;
|
15
14
|
};
|
16
|
-
export declare const isUnavailableNode: (node:
|
15
|
+
export declare const isUnavailableNode: <T extends Pick<TSystemStateInfo, "SystemState"> = Pick<TSystemStateInfo, "SystemState">>(node: T) => boolean;
|
17
16
|
export declare const prepareNodeHostsMap: (nodesList?: TNodeInfo[]) => NodeHostsMap | undefined;
|
18
17
|
export declare function calculateLoadAveragePercents(node?: TSystemStateInfo): number[] | undefined;
|
19
18
|
export interface PreparedNodeSystemState extends TSystemStateInfo {
|
@@ -21,6 +20,9 @@ export interface PreparedNodeSystemState extends TSystemStateInfo {
|
|
21
20
|
DC?: string;
|
22
21
|
LoadAveragePercents?: number[];
|
23
22
|
Uptime: string;
|
23
|
+
TenantName?: string;
|
24
|
+
SharedCacheLimit?: number;
|
25
|
+
SharedCacheUsed?: number;
|
24
26
|
}
|
25
27
|
export declare const prepareNodeSystemState: (systemState?: TSystemStateInfo) => PreparedNodeSystemState;
|
26
28
|
export declare const getProblemParamValue: (problemFilter: ProblemFilterValue | undefined) => problemFilter is "With problems";
|
package/dist/utils/nodes.js
CHANGED
@@ -35,18 +35,27 @@ export function calculateLoadAveragePercents(node = {}) {
|
|
35
35
|
});
|
36
36
|
}
|
37
37
|
export const prepareNodeSystemState = (systemState = {}) => {
|
38
|
-
var _a, _b;
|
38
|
+
var _a, _b, _c, _d, _e, _f;
|
39
39
|
// There is no Rack in Location field for din nodes
|
40
40
|
const Rack = ((_a = systemState.Location) === null || _a === void 0 ? void 0 : _a.Rack) || systemState.Rack;
|
41
41
|
const DC = ((_b = systemState.Location) === null || _b === void 0 ? void 0 : _b.DataCenter) || systemState.DataCenter;
|
42
|
+
const TenantName = (_c = systemState === null || systemState === void 0 ? void 0 : systemState.Tenants) === null || _c === void 0 ? void 0 : _c[0];
|
42
43
|
const Uptime = calcUptime(systemState.StartTime);
|
43
44
|
const LoadAveragePercents = calculateLoadAveragePercents(systemState);
|
45
|
+
// 0 limit means that limit is not set, so it should be undefined
|
46
|
+
const SharedCacheLimit = Number((_d = systemState.SharedCacheStats) === null || _d === void 0 ? void 0 : _d.LimitBytes) || undefined;
|
47
|
+
const SharedCacheUsed = valueIsDefined((_e = systemState.SharedCacheStats) === null || _e === void 0 ? void 0 : _e.UsedBytes)
|
48
|
+
? Number((_f = systemState.SharedCacheStats) === null || _f === void 0 ? void 0 : _f.UsedBytes)
|
49
|
+
: undefined;
|
44
50
|
return {
|
45
51
|
...systemState,
|
46
52
|
Rack,
|
47
53
|
DC,
|
48
54
|
Uptime,
|
49
55
|
LoadAveragePercents,
|
56
|
+
TenantName,
|
57
|
+
SharedCacheLimit,
|
58
|
+
SharedCacheUsed,
|
50
59
|
};
|
51
60
|
};
|
52
61
|
export const getProblemParamValue = (problemFilter) => {
|
package/dist/utils/nodes.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"nodes.js","sourceRoot":"","sources":["../../src/utils/nodes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;
|
1
|
+
{"version":3,"file":"nodes.js","sourceRoot":"","sources":["../../src/utils/nodes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AAEtB,OAAO,EAAC,mBAAmB,EAAC,MAAM,qCAAqC,CAAC;AAExE,OAAO,EAAC,KAAK,EAAC,MAAM,oBAAoB,CAAC;AAKzC,OAAO,EAAC,eAAe,EAAC,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAC,UAAU,EAAC,MAAM,iCAAiC,CAAC;AAE3D,OAAO,EAAC,cAAc,EAAC,MAAM,GAAG,CAAC;AAEjC,MAAM,CAAN,IAAY,uBAGX;AAHD,WAAY,uBAAuB;IAC/B,sCAAa,CAAA;IACb,sDAA6B,CAAA;AACjC,CAAC,EAHW,uBAAuB,KAAvB,uBAAuB,QAGlC;AAED,MAAM,CAAC,MAAM,6BAA6B,GAAG,CAAC;KACzC,UAAU,CAAC,uBAAuB,CAAC;KACnC,KAAK,CAAC,uBAAuB,CAAC,GAAG,CAAC,CAAC;AAExC,MAAM,CAAC,MAAM,uBAAuB,GAAG;IACnC,CAAC,uBAAuB,CAAC,GAAG,CAAC,EAAE,KAAK;IACpC,CAAC,uBAAuB,CAAC,WAAW,CAAC,EAAE,aAAa;CACvD,CAAC;AAEF,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAG7B,IAAO,EACT,EAAE,CAAC,CAAC,IAAI,CAAC,WAAW,IAAI,IAAI,CAAC,WAAW,KAAK,KAAK,CAAC,IAAI,CAAC;AAE1D,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,SAAuB,EAAE,EAAE;IAC3D,OAAO,SAAS,aAAT,SAAS,uBAAT,SAAS,CAAE,MAAM,CAAe,CAAC,SAAS,EAAE,IAAI,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C,MAAA,WAAW,CAAC,gBAAgB,0CAAE,UAAU,CAAC,IAAI,SAAS,CAAC;IACvF,MAAM,eAAe,GAAG,cAAc,CAAC,MAAA,WAAW,CAAC,gBAAgB,0CAAE,SAAS,CAAC;QAC3E,CAAC,CAAC,MAAM,CAAC,MAAA,WAAW,CAAC,gBAAgB,0CAAE,SAAS,CAAC;QACjD,CAAC,CAAC,SAAS,CAAC;IAEhB,OAAO;QACH,GAAG,WAAW;QACd,IAAI;QACJ,EAAE;QACF,MAAM;QACN,mBAAmB;QACnB,UAAU;QACV,gBAAgB;QAChB,eAAe;KAClB,CAAC;AACN,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,aAA6C,EAAE,EAAE;IAClF,OAAO,aAAa,KAAK,mBAAmB,CAAC,QAAQ,CAAC;AAC1D,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,iBAAsD,EAAE,EAAE;IAC1F,OAAO,iBAAiB,KAAK,uBAAuB,CAAC,WAAW,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,SAAS,CAAC;AACnG,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,iBAAiB,GAAqB;IAC/C,QAAQ;IACR,MAAM;IACN,UAAU;IACV,IAAI;IACJ,MAAM;IACN,SAAS;IACT,QAAQ;IACR,KAAK;IACL,aAAa;IACb,QAAQ;IACR,SAAS;IACT,gBAAgB;IAChB,UAAU;CACb,CAAC;AAEF,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,KAAc,EAA2B,EAAE,CAC/E,iBAAiB,CAAC,QAAQ,CAAC,KAAuB,CAAC,CAAC"}
|
package/dist/utils/query.d.ts
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
import { z } from 'zod';
|
2
|
-
import type {
|
2
|
+
import type { ErrorResponse, ExecuteResponse, ExplainResponse, KeyValueRow, QueryPlan, ScriptPlan } from '../types/api/query';
|
3
3
|
import type { IQueryResult, QueryMode, StatisticsMode, TracingLevel, TransactionMode } from '../types/store/query';
|
4
4
|
export declare const TRANSACTION_MODES: {
|
5
5
|
readonly serializable: "serializable-read-write";
|
@@ -41,13 +41,13 @@ export declare const QUERY_SYNTAX: {
|
|
41
41
|
readonly yql: "yql_v1";
|
42
42
|
readonly pg: "pg";
|
43
43
|
};
|
44
|
-
export declare const getColumnType: (type: string) => "
|
44
|
+
export declare const getColumnType: (type: string) => "number" | "boolean" | "string" | "date" | undefined;
|
45
45
|
type UnsupportedQueryResponseFormat = Array<unknown> | string | null | undefined | {
|
46
46
|
result: string | Record<string, unknown>;
|
47
47
|
};
|
48
48
|
export declare function isQueryErrorResponse(data: unknown): data is ErrorResponse;
|
49
|
-
export declare const parseQueryAPIExecuteResponse: (data:
|
50
|
-
export declare const parseQueryAPIExplainResponse: (data:
|
49
|
+
export declare const parseQueryAPIExecuteResponse: (data: ExecuteResponse | UnsupportedQueryResponseFormat) => IQueryResult;
|
50
|
+
export declare const parseQueryAPIExplainResponse: (data: ExplainResponse | UnsupportedQueryResponseFormat) => IQueryResult;
|
51
51
|
export declare const parseQueryExplainPlan: (plan: ScriptPlan | QueryPlan) => QueryPlan;
|
52
52
|
export declare const prepareQueryResponse: (data?: KeyValueRow[]) => KeyValueRow[];
|
53
53
|
export declare const parseQueryError: (error: unknown) => ErrorResponse | string | undefined;
|
@@ -58,7 +58,7 @@ export declare const DEFAULT_QUERY_SETTINGS: {
|
|
58
58
|
timeout: number;
|
59
59
|
limitRows: number;
|
60
60
|
statisticsMode: "none";
|
61
|
-
tracingLevel: "
|
61
|
+
tracingLevel: "off";
|
62
62
|
};
|
63
63
|
export declare const queryModeSchema: z.ZodNativeEnum<{
|
64
64
|
readonly scan: "scan";
|
package/dist/utils/query.js
CHANGED
@@ -102,7 +102,7 @@ export const getColumnType = (type) => {
|
|
102
102
|
}
|
103
103
|
};
|
104
104
|
/** parse response result from ArrayRow to KeyValueRow */
|
105
|
-
const
|
105
|
+
const parseResult = (rows, columns) => {
|
106
106
|
return rows.map((row) => {
|
107
107
|
return row.reduce((newRow, cellData, columnIndex) => {
|
108
108
|
const { name } = columns[columnIndex];
|
@@ -111,15 +111,7 @@ const parseModernResult = (rows, columns) => {
|
|
111
111
|
}, {});
|
112
112
|
});
|
113
113
|
};
|
114
|
-
const
|
115
|
-
const { result, columns, ...restData } = data;
|
116
|
-
return {
|
117
|
-
result: result && columns && parseModernResult(result, columns),
|
118
|
-
columns,
|
119
|
-
...restData,
|
120
|
-
};
|
121
|
-
};
|
122
|
-
const parseExecuteMultiResponse = (data) => {
|
114
|
+
const parseExecuteResponse = (data) => {
|
123
115
|
const { result, ...restData } = data;
|
124
116
|
const parsedResult = result === null || result === void 0 ? void 0 : result.map((resultSet) => {
|
125
117
|
const { rows, columns, truncated } = resultSet;
|
@@ -129,7 +121,7 @@ const parseExecuteMultiResponse = (data) => {
|
|
129
121
|
parsedRows = [];
|
130
122
|
}
|
131
123
|
if (rows && columns) {
|
132
|
-
parsedRows =
|
124
|
+
parsedRows = parseResult(rows, columns);
|
133
125
|
}
|
134
126
|
return {
|
135
127
|
columns: columns,
|
@@ -142,11 +134,7 @@ const parseExecuteMultiResponse = (data) => {
|
|
142
134
|
...restData,
|
143
135
|
};
|
144
136
|
};
|
145
|
-
const
|
146
|
-
!Array.isArray(response) &&
|
147
|
-
Array.isArray(response.result) &&
|
148
|
-
Array.isArray(response.columns));
|
149
|
-
const isMulti = (response) => Boolean(response &&
|
137
|
+
const isSupportedType = (response) => Boolean(response &&
|
150
138
|
!Array.isArray(response) &&
|
151
139
|
Array.isArray(response.result) &&
|
152
140
|
typeof response.result[0] === 'object' &&
|
@@ -167,11 +155,8 @@ export const parseQueryAPIExecuteResponse = (data) => {
|
|
167
155
|
if (isUnsupportedType(data)) {
|
168
156
|
return {};
|
169
157
|
}
|
170
|
-
if (
|
171
|
-
return
|
172
|
-
}
|
173
|
-
if (isModern(data)) {
|
174
|
-
return parseExecuteModernResponse(data);
|
158
|
+
if (isSupportedType(data)) {
|
159
|
+
return parseExecuteResponse(data);
|
175
160
|
}
|
176
161
|
return data;
|
177
162
|
};
|
@@ -249,7 +234,7 @@ export const DEFAULT_QUERY_SETTINGS = {
|
|
249
234
|
timeout: 60,
|
250
235
|
limitRows: 10000,
|
251
236
|
statisticsMode: STATISTICS_MODES.none,
|
252
|
-
tracingLevel: TRACING_LEVELS.
|
237
|
+
tracingLevel: TRACING_LEVELS.off,
|
253
238
|
};
|
254
239
|
export const queryModeSchema = z.nativeEnum(QUERY_MODES);
|
255
240
|
export const transactionModeSchema = z.nativeEnum(TRANSACTION_MODES);
|
package/dist/utils/query.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"query.js","sourceRoot":"","sources":["../../src/utils/query.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AAEtB,OAAO,EAAC,OAAO,EAAC,MAAM,UAAU,CAAC;
|
1
|
+
{"version":3,"file":"query.js","sourceRoot":"","sources":["../../src/utils/query.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AAEtB,OAAO,EAAC,OAAO,EAAC,MAAM,UAAU,CAAC;AAmBjC,OAAO,EAAC,eAAe,EAAE,cAAc,EAAC,MAAM,YAAY,CAAC;AAE3D,MAAM,CAAC,MAAM,iBAAiB,GAAG;IAC7B,YAAY,EAAE,yBAAyB;IACvC,OAAO,EAAE,iBAAiB;IAC1B,QAAQ,EAAE,kBAAkB;IAC5B,QAAQ,EAAE,oBAAoB;IAC9B,QAAQ,EAAE,UAAU;CACd,CAAC;AAEX,MAAM,CAAC,MAAM,wBAAwB,GAAoC;IACrE,CAAC,iBAAiB,CAAC,YAAY,CAAC,EAAE,cAAc;IAChD,CAAC,iBAAiB,CAAC,OAAO,CAAC,EAAE,iBAAiB;IAC9C,CAAC,iBAAiB,CAAC,QAAQ,CAAC,EAAE,kBAAkB;IAChD,CAAC,iBAAiB,CAA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IAClE,eAAe,EAAE,qBAAqB,CAAC,KAAK,CAAC,sBAAsB,CAAC,eAAe,CAAC;IACpF,cAAc,EAAE,oBAAoB,CAAC,KAAK,CAAC,sBAAsB,CAAC,cAAc,CAAC;IACjF,YAAY,EAAE,kBAAkB,CAAC,KAAK,CAAC,sBAAsB,CAAC,YAAY,CAAC;CAC9E,CAAC;KACD,KAAK,CAAC,sBAAsB,CAAC,CAAC"}
|
package/dist/utils/query.test.js
CHANGED
@@ -26,72 +26,237 @@ describe('API utils', () => {
|
|
26
26
|
});
|
27
27
|
});
|
28
28
|
describe('should correctly parse data', () => {
|
29
|
-
it('should
|
30
|
-
|
31
|
-
|
32
|
-
|
29
|
+
it('should accept stats without a result', () => {
|
30
|
+
var _a, _b;
|
31
|
+
const stats = { metric: 'good' };
|
32
|
+
const response = { stats };
|
33
|
+
const actual = parseQueryAPIExecuteResponse(response);
|
34
|
+
expect((_b = (_a = actual.resultSets) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.result).toBeUndefined();
|
35
|
+
expect(actual.columns).toBeUndefined();
|
36
|
+
expect(actual.stats).toEqual(response.stats);
|
37
|
+
});
|
38
|
+
const mockColumns = [
|
39
|
+
{ name: 'PDiskFilter', type: 'Utf8?' },
|
40
|
+
{ name: 'ErasureSpecies', type: 'Utf8?' },
|
41
|
+
{ name: 'CurrentAvailableSize', type: 'Uint64?' },
|
42
|
+
{ name: 'CurrentAllocatedSize', type: 'Uint64?' },
|
43
|
+
{ name: 'CurrentGroupsCreated', type: 'Uint32?' },
|
44
|
+
{ name: 'AvailableGroupsToCreate', type: 'Uint32?' },
|
45
|
+
];
|
46
|
+
const mockRows = [
|
47
|
+
['Type:SSD', 'block-4-2', '1000', '2000', 100, 50],
|
48
|
+
['Type:ROT', 'block-4-2', '2000', '1000', 50, 0],
|
49
|
+
];
|
50
|
+
it('should parse a valid ExecuteResponse correctly', () => {
|
51
|
+
const input = {
|
52
|
+
result: [
|
33
53
|
{
|
34
|
-
|
35
|
-
|
54
|
+
columns: mockColumns,
|
55
|
+
rows: mockRows,
|
56
|
+
truncated: false,
|
36
57
|
},
|
58
|
+
],
|
59
|
+
stats: { DurationUs: '1000' },
|
60
|
+
};
|
61
|
+
const expected = {
|
62
|
+
resultSets: [
|
37
63
|
{
|
38
|
-
|
39
|
-
|
64
|
+
columns: mockColumns,
|
65
|
+
result: [
|
66
|
+
{
|
67
|
+
PDiskFilter: 'Type:SSD',
|
68
|
+
ErasureSpecies: 'block-4-2',
|
69
|
+
CurrentAvailableSize: '1000',
|
70
|
+
CurrentAllocatedSize: '2000',
|
71
|
+
CurrentGroupsCreated: 100,
|
72
|
+
AvailableGroupsToCreate: 50,
|
73
|
+
},
|
74
|
+
{
|
75
|
+
PDiskFilter: 'Type:ROT',
|
76
|
+
ErasureSpecies: 'block-4-2',
|
77
|
+
CurrentAvailableSize: '2000',
|
78
|
+
CurrentAllocatedSize: '1000',
|
79
|
+
CurrentGroupsCreated: 50,
|
80
|
+
AvailableGroupsToCreate: 0,
|
81
|
+
},
|
82
|
+
],
|
83
|
+
truncated: false,
|
40
84
|
},
|
41
85
|
],
|
86
|
+
stats: { DurationUs: '1000' },
|
42
87
|
};
|
43
|
-
|
44
|
-
expect(parsedResponse.result).toEqual([
|
45
|
-
{
|
46
|
-
id: '42',
|
47
|
-
value: 'hello world',
|
48
|
-
},
|
49
|
-
]);
|
50
|
-
expect(parsedResponse.columns).toEqual(response.columns);
|
88
|
+
expect(parseQueryAPIExecuteResponse(input)).toEqual(expected);
|
51
89
|
});
|
52
|
-
it('should
|
53
|
-
const
|
54
|
-
|
90
|
+
it('should handle empty result array', () => {
|
91
|
+
const input = {
|
92
|
+
result: [],
|
93
|
+
stats: { DurationUs: '1000' },
|
94
|
+
};
|
95
|
+
const expected = {
|
96
|
+
result: [],
|
97
|
+
stats: { DurationUs: '1000' },
|
98
|
+
};
|
99
|
+
expect(parseQueryAPIExecuteResponse(input)).toEqual(expected);
|
55
100
|
});
|
56
|
-
it('
|
57
|
-
const
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
},
|
76
|
-
|
77
|
-
expect(
|
78
|
-
expect(parsedResponse.stats).toEqual(response.stats);
|
101
|
+
it('should handle result with columns but no rows', () => {
|
102
|
+
const input = {
|
103
|
+
result: [
|
104
|
+
{
|
105
|
+
columns: mockColumns,
|
106
|
+
rows: [],
|
107
|
+
truncated: false,
|
108
|
+
},
|
109
|
+
],
|
110
|
+
stats: { DurationUs: '1000' },
|
111
|
+
};
|
112
|
+
const expected = {
|
113
|
+
resultSets: [
|
114
|
+
{
|
115
|
+
columns: mockColumns,
|
116
|
+
result: [],
|
117
|
+
truncated: false,
|
118
|
+
},
|
119
|
+
],
|
120
|
+
stats: { DurationUs: '1000' },
|
121
|
+
};
|
122
|
+
expect(parseQueryAPIExecuteResponse(input)).toEqual(expected);
|
79
123
|
});
|
80
|
-
it('
|
81
|
-
const
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
expect(parsedResponse.result).toEqual(response.result);
|
86
|
-
expect(parsedResponse.stats).toEqual(response.stats);
|
124
|
+
it('should return empty object for unsupported format', () => {
|
125
|
+
const input = {
|
126
|
+
result: 'unsupported',
|
127
|
+
};
|
128
|
+
expect(parseQueryAPIExecuteResponse(input)).toEqual({});
|
87
129
|
});
|
88
|
-
it('should
|
89
|
-
const
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
130
|
+
it('should handle multiple result sets', () => {
|
131
|
+
const input = {
|
132
|
+
result: [
|
133
|
+
{
|
134
|
+
columns: mockColumns,
|
135
|
+
rows: mockRows,
|
136
|
+
truncated: false,
|
137
|
+
},
|
138
|
+
{
|
139
|
+
columns: [{ name: 'Count', type: 'Uint32?' }],
|
140
|
+
rows: [[2]],
|
141
|
+
truncated: false,
|
142
|
+
},
|
143
|
+
],
|
144
|
+
stats: { DurationUs: '1500' },
|
145
|
+
};
|
146
|
+
const expected = {
|
147
|
+
resultSets: [
|
148
|
+
{
|
149
|
+
columns: mockColumns,
|
150
|
+
result: [
|
151
|
+
{
|
152
|
+
PDiskFilter: 'Type:SSD',
|
153
|
+
ErasureSpecies: 'block-4-2',
|
154
|
+
CurrentAvailableSize: '1000',
|
155
|
+
CurrentAllocatedSize: '2000',
|
156
|
+
CurrentGroupsCreated: 100,
|
157
|
+
AvailableGroupsToCreate: 50,
|
158
|
+
},
|
159
|
+
{
|
160
|
+
PDiskFilter: 'Type:ROT',
|
161
|
+
ErasureSpecies: 'block-4-2',
|
162
|
+
CurrentAvailableSize: '2000',
|
163
|
+
CurrentAllocatedSize: '1000',
|
164
|
+
CurrentGroupsCreated: 50,
|
165
|
+
AvailableGroupsToCreate: 0,
|
166
|
+
},
|
167
|
+
],
|
168
|
+
truncated: false,
|
169
|
+
},
|
170
|
+
{
|
171
|
+
columns: [{ name: 'Count', type: 'Uint32?' }],
|
172
|
+
result: [{ Count: 2 }],
|
173
|
+
truncated: false,
|
174
|
+
},
|
175
|
+
],
|
176
|
+
stats: { DurationUs: '1500' },
|
177
|
+
};
|
178
|
+
expect(parseQueryAPIExecuteResponse(input)).toEqual(expected);
|
179
|
+
});
|
180
|
+
it('should handle null values in rows', () => {
|
181
|
+
const input = {
|
182
|
+
result: [
|
183
|
+
{
|
184
|
+
columns: mockColumns,
|
185
|
+
rows: [
|
186
|
+
['Type:SSD', null, '1000', null, 100, 50],
|
187
|
+
[null, 'block-4-2', null, '1000', null, 0],
|
188
|
+
],
|
189
|
+
truncated: false,
|
190
|
+
},
|
191
|
+
],
|
192
|
+
stats: { DurationUs: '1000' },
|
193
|
+
};
|
194
|
+
const expected = {
|
195
|
+
resultSets: [
|
196
|
+
{
|
197
|
+
columns: mockColumns,
|
198
|
+
result: [
|
199
|
+
{
|
200
|
+
PDiskFilter: 'Type:SSD',
|
201
|
+
ErasureSpecies: null,
|
202
|
+
CurrentAvailableSize: '1000',
|
203
|
+
CurrentAllocatedSize: null,
|
204
|
+
CurrentGroupsCreated: 100,
|
205
|
+
AvailableGroupsToCreate: 50,
|
206
|
+
},
|
207
|
+
{
|
208
|
+
PDiskFilter: null,
|
209
|
+
ErasureSpecies: 'block-4-2',
|
210
|
+
CurrentAvailableSize: null,
|
211
|
+
CurrentAllocatedSize: '1000',
|
212
|
+
CurrentGroupsCreated: null,
|
213
|
+
AvailableGroupsToCreate: 0,
|
214
|
+
},
|
215
|
+
],
|
216
|
+
truncated: false,
|
217
|
+
},
|
218
|
+
],
|
219
|
+
stats: { DurationUs: '1000' },
|
220
|
+
};
|
221
|
+
expect(parseQueryAPIExecuteResponse(input)).toEqual(expected);
|
222
|
+
});
|
223
|
+
it('should handle truncated results', () => {
|
224
|
+
var _a;
|
225
|
+
const input = {
|
226
|
+
result: [
|
227
|
+
{
|
228
|
+
columns: mockColumns,
|
229
|
+
rows: mockRows,
|
230
|
+
truncated: true,
|
231
|
+
},
|
232
|
+
],
|
233
|
+
stats: { DurationUs: '1000' },
|
234
|
+
};
|
235
|
+
const result = parseQueryAPIExecuteResponse(input);
|
236
|
+
expect((_a = result.resultSets) === null || _a === void 0 ? void 0 : _a[0].truncated).toBe(true);
|
237
|
+
});
|
238
|
+
it('should handle empty columns and rows', () => {
|
239
|
+
const input = {
|
240
|
+
result: [
|
241
|
+
{
|
242
|
+
columns: [],
|
243
|
+
rows: [],
|
244
|
+
truncated: false,
|
245
|
+
},
|
246
|
+
],
|
247
|
+
stats: { DurationUs: '1000' },
|
248
|
+
};
|
249
|
+
const expected = {
|
250
|
+
resultSets: [
|
251
|
+
{
|
252
|
+
columns: [],
|
253
|
+
result: [],
|
254
|
+
truncated: false,
|
255
|
+
},
|
256
|
+
],
|
257
|
+
stats: { DurationUs: '1000' },
|
258
|
+
};
|
259
|
+
expect(parseQueryAPIExecuteResponse(input)).toEqual(expected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,CAAC,CAAC;gBACtC,MAAM,CAAC,UAAU,CAAC,cAAc,CAAC,CAAC,OAAO,CAAC,cAAc,CAAC,CAAC;gBAC1D,MAAM,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;gBACvC,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;YAC1C,CAAC,CAAC,CAAC;YACH,EAAE,CAAC,iCAAiC,EAAE,GAAG,EAAE;gBACvC,MAAM,IAAI,GAAa,EAAE,CAAC;gBAC1B,MAAM,MAAM,GAAgB,EAAE,CAAC;gBAC/B,MAAM,IAAI,GAAa,EAAC,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAC,CAAC;gBAExD,MAAM,OAAO,GAAG;oBACZ,IAAI,EAAE,IAAI;oBACV,MAAM,EAAE,MAAM;oBACd,IAAI,EAAE,IAAI;iBACb,CAAC;gBACF,MAAM,UAAU,GAAG,qBAAqB,CAAC,OAAO,CAAC,CAAC;gBAClD,MAAM,CAAC,UAAU,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;YACxC,CAAC,CAAC,CAAC;QACP,CAAC,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC"}
|
package/dist/utils/storage.d.ts
CHANGED
@@ -4,5 +4,6 @@ interface EntityWithUsage {
|
|
4
4
|
Limit: number;
|
5
5
|
}
|
6
6
|
export declare const getUsage: <T extends EntityWithUsage>(data: T, step?: number) => number;
|
7
|
+
export declare const getSpaceUsageSeverity: (value: number) => "success" | "danger" | "warning" | undefined;
|
7
8
|
export declare const isSortableStorageProperty: (value: unknown) => value is StorageV2SortValue;
|
8
9
|
export {};
|
package/dist/utils/storage.js
CHANGED
@@ -1,8 +1,10 @@
|
|
1
|
+
import { generateEvaluator } from './generateEvaluator';
|
1
2
|
export const getUsage = (data, step = 1) => {
|
2
3
|
// if limit is 0, display 0
|
3
4
|
const usage = data.Limit ? (data.Used * 100) / data.Limit : 0;
|
4
5
|
return Math.floor(usage / step) * step;
|
5
6
|
};
|
7
|
+
export const getSpaceUsageSeverity = generateEvaluator(80, 85, ['success', 'warning', 'danger']);
|
6
8
|
const STORAGE_SORT_VALUES = [
|
7
9
|
'PoolName',
|
8
10
|
'Kind',
|
@@ -17,6 +19,7 @@ const STORAGE_SORT_VALUES = [
|
|
17
19
|
'Write',
|
18
20
|
'AllocationUnits',
|
19
21
|
'Latency',
|
22
|
+
'DiskSpaceUsage',
|
20
23
|
];
|
21
24
|
export const isSortableStorageProperty = (value) => STORAGE_SORT_VALUES.includes(value);
|
22
25
|
//# sourceMappingURL=storage.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"storage.js","sourceRoot":"","sources":["../../src/utils/storage.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"storage.js","sourceRoot":"","sources":["../../src/utils/storage.ts"],"names":[],"mappings":"AAEA,OAAO,EAAC,iBAAiB,EAAC,MAAM,qBAAqB,CAAC;AAOtD,MAAM,CAAC,MAAM,QAAQ,GAAG,CAA4B,IAAO,EAAE,IAAI,GAAG,CAAC,EAAE,EAAE;IACrE,2BAA2B;IAC3B,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,GAAG,GAAG,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;IAE9D,OAAO,IAAI,CAAC,KAAK,CAAC,KAAK,GAAG,IAAI,CAAC,GAAG,IAAI,CAAC;AAC3C,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,qBAAqB,GAAG,iBAAiB,CAAC,EAAE,EAAE,EAAE,EAAE,CAAC,SAAS,EAAE,SAAS,EAAE,QAAQ,CAAC,CAAC,CAAC;AAEjG,MAAM,mBAAmB,GAAyB;IAC9C,UAAU;IACV,MAAM;IACN,WAAW;IACX,SAAS;IACT,UAAU;IACV,OAAO;IACP,SAAS;IACT,MAAM;IACN,OAAO;IACP,MAAM;IACN,OAAO;IAEP,iBAAiB;IACjB,SAAS;IACT,gBAAgB;CACnB,CAAC;AAEF,MAAM,CAAC,MAAM,yBAAyB,GAAG,CAAC,KAAc,EAA+B,EAAE,CACrF,mBAAmB,CAAC,QAAQ,CAAC,KAA2B,CAAC,CAAC"}
|