ydb-embedded-ui 6.3.0 → 6.4.0
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +38 -16
- package/dist/assets/icons/disableFullscreen.svg +4 -0
- package/dist/assets/icons/emptyState.svg +13 -0
- package/dist/assets/icons/key.svg +6 -0
- package/dist/assets/icons/monitoring.svg +9 -0
- package/dist/assets/icons/network.svg +21 -0
- package/dist/components/BasicNodeViewer/BasicNodeViewer.js +11 -5
- package/dist/components/CriticalActionDialog/CriticalActionDialog.js +3 -4
- package/dist/components/CriticalActionDialog/CriticalActionDialog.scss +2 -0
- package/dist/components/EmptyState/EmptyState.js +3 -2
- package/dist/components/EnableFullscreenButton/EnableFullscreenButton.js +3 -3
- package/dist/components/Fullscreen/Fullscreen.js +3 -3
- package/dist/components/MonitoringButton/MonitoringButton.js +3 -3
- package/dist/components/NodeHostWrapper/NodeHostWrapper.js +3 -3
- package/dist/components/PDiskInfo/i18n/index.d.ts +1 -1
- package/dist/components/QueryExecutionStatus/QueryExecutionStatus.js +4 -5
- package/dist/components/StatusIcon/StatusIcon.js +5 -7
- package/dist/containers/App/App.js +1 -2
- package/dist/containers/AsideNavigation/AsideNavigation.js +4 -9
- package/dist/containers/AsideNavigation/YdbInternalUser/YdbInternalUser.js +2 -3
- package/dist/containers/AsideNavigation/useNavigationMenuItems.js +5 -6
- package/dist/containers/Authentication/Authentication.js +2 -4
- package/dist/containers/Node/NodeStructure/Pdisk.js +4 -4
- package/dist/containers/Nodes/Nodes.js +19 -15
- package/dist/containers/Nodes/VirtualNodes.js +23 -6
- package/dist/containers/PDiskPage/PDiskPage.js +2 -2
- package/dist/containers/PDiskPage/i18n/index.d.ts +1 -1
- package/dist/containers/Storage/Storage.js +50 -22
- package/dist/containers/Storage/StorageGroups/getStorageGroupsColumns.js +2 -2
- package/dist/containers/Storage/VirtualStorage.js +32 -10
- package/dist/containers/Storage/utils/index.d.ts +4 -1
- package/dist/containers/Storage/utils/index.js +29 -0
- package/dist/containers/Tablet/Tablet.js +3 -3
- package/dist/containers/Tablet/i18n/index.d.ts +1 -1
- package/dist/containers/Tablets/Tablets.d.ts +1 -2
- package/dist/containers/Tablets/Tablets.js +112 -53
- package/dist/containers/Tablets/i18n/en.json +9 -4
- package/dist/containers/Tablets/i18n/index.d.ts +1 -1
- package/dist/containers/Tablets/i18n/index.js +1 -2
- package/dist/containers/Tenant/Diagnostics/Diagnostics.js +5 -5
- package/dist/containers/Tenant/Diagnostics/HotKeys/HotKeys.js +3 -2
- package/dist/containers/Tenant/Diagnostics/Network/Network.js +3 -3
- package/dist/containers/Tenant/Diagnostics/TenantOverview/Healthcheck/HealthcheckPreview.js +2 -2
- package/dist/containers/Tenant/ObjectGeneral/ObjectGeneral.js +2 -8
- package/dist/containers/Tenant/ObjectSummary/ObjectSummary.js +3 -3
- package/dist/containers/Tenant/Query/ExplainResult/ExplainResult.js +1 -1
- package/dist/containers/Tenant/Query/Issues/Issues.js +6 -9
- package/dist/containers/Tenant/Query/Preview/Preview.js +3 -3
- package/dist/containers/Tenant/Query/QueryEditor/QueryEditor.d.ts +1 -1
- package/dist/containers/Tenant/Query/QueryEditorControls/QueryEditorControls.js +4 -4
- package/dist/containers/Tenant/Query/SavedQueries/SavedQueries.js +3 -3
- package/dist/containers/Tenant/Schema/SchemaViewer/helpers.js +3 -2
- package/dist/containers/Tenant/utils/ToggleButton.scss +0 -2
- package/dist/containers/Tenant/utils/paneVisibilityToggleHelpers.js +4 -4
- package/dist/containers/Tenant/utils/schemaControls.js +3 -3
- package/dist/containers/VDiskPage/VDiskPage.js +2 -2
- package/dist/containers/VDiskPage/i18n/index.d.ts +1 -1
- package/dist/routes.d.ts +1 -1
- package/dist/services/settings.d.ts +18 -1
- package/dist/store/configureStore.d.ts +0 -8
- package/dist/store/defaultStore.d.ts +0 -4
- package/dist/store/reducers/authentication/authentication.d.ts +0 -6
- package/dist/store/reducers/executeQuery.d.ts +0 -2
- package/dist/store/reducers/explainQuery.d.ts +0 -4
- package/dist/store/reducers/healthcheckInfo/healthcheckInfo.d.ts +0 -40
- package/dist/store/reducers/host.d.ts +0 -2
- package/dist/store/reducers/index.d.ts +0 -6
- package/dist/store/reducers/index.js +0 -4
- package/dist/store/reducers/node/selectors.d.ts +0 -2
- package/dist/store/reducers/nodes/nodes.d.ts +1 -5
- package/dist/store/reducers/nodes/nodes.js +0 -27
- package/dist/store/reducers/nodes/types.d.ts +4 -13
- package/dist/store/reducers/nodesList.d.ts +0 -2
- package/dist/store/reducers/schema/schema.d.ts +0 -2
- package/dist/store/reducers/schemaAcl/schemaAcl.d.ts +0 -2
- package/dist/store/reducers/storage/selectors.d.ts +2 -17
- package/dist/store/reducers/storage/selectors.js +1 -36
- package/dist/store/reducers/storage/storage.d.ts +2 -6
- package/dist/store/reducers/storage/storage.js +0 -44
- package/dist/store/reducers/storage/types.d.ts +15 -22
- package/dist/store/reducers/storage/types.js +4 -1
- package/dist/store/reducers/tablets.d.ts +92 -1
- package/dist/store/reducers/tablets.js +16 -1
- package/dist/store/reducers/tabletsFilters.d.ts +0 -2
- package/dist/store/reducers/tenant/tenant.d.ts +2 -2
- package/dist/store/reducers/tenant/tenant.js +10 -1
- package/dist/store/reducers/tenant/types.d.ts +8 -3
- package/dist/store/reducers/tenant/types.js +3 -1
- package/dist/store/reducers/tenants/selectors.d.ts +0 -18
- package/dist/store/reducers/tenants/utils.d.ts +4 -4
- package/dist/store/reducers/tenants/utils.js +8 -8
- package/dist/store/reducers/topic.d.ts +0 -30
- package/dist/store/state-url-mapping.js +0 -22
- package/dist/utils/nodes.d.ts +2 -0
- package/dist/utils/nodes.js +4 -0
- package/dist/utils/tablet.d.ts +2 -0
- package/dist/utils/tablet.js +14 -0
- package/package.json +3 -2
- package/dist/assets/icons/bug.svg +0 -1
- package/dist/assets/icons/circle-exclamation.svg +0 -1
- package/dist/assets/icons/circle-info.svg +0 -1
- package/dist/assets/icons/circle-xmark.svg +0 -1
- package/dist/assets/icons/close.svg +0 -1
- package/dist/assets/icons/control-menu-button.svg +0 -1
- package/dist/assets/icons/dots.svg +0 -1
- package/dist/assets/icons/hide.svg +0 -1
- package/dist/assets/icons/question.svg +0 -1
- package/dist/assets/icons/server.svg +0 -1
- package/dist/assets/icons/settings-with-dot.svg +0 -1
- package/dist/assets/icons/settings.svg +0 -1
- package/dist/assets/icons/shield.svg +0 -3
- package/dist/assets/icons/show.svg +0 -1
- package/dist/assets/icons/signIn.svg +0 -1
- package/dist/assets/icons/signOut.svg +0 -1
- package/dist/assets/icons/storage.svg +0 -1
- package/dist/assets/icons/support.svg +0 -1
- package/dist/assets/icons/triangle-exclamation.svg +0 -1
- package/dist/assets/icons/update-arrow.svg +0 -6
- package/dist/components/Icon/Icon.d.ts +0 -14
- package/dist/components/Icon/Icon.js +0 -16
- package/dist/components/Icon/index.d.ts +0 -1
- package/dist/components/Icon/index.js +0 -1
- package/dist/containers/AppIcons/AppIcons.d.ts +0 -2
- package/dist/containers/AppIcons/AppIcons.js +0 -9
- package/dist/containers/Tablets/Tablets.scss +0 -35
- package/dist/containers/Tablets/i18n/ru.json +0 -6
@@ -1,8 +1,5 @@
|
|
1
|
-
import {
|
2
|
-
import { NODES_SORT_VALUES } from '../../../utils/nodes';
|
3
|
-
import { STORAGE_SORT_VALUES, getUsage } from '../../../utils/storage';
|
1
|
+
import { getUsage } from '../../../utils/storage';
|
4
2
|
import { filterNodesByUptime } from '../nodes/selectors';
|
5
|
-
import { VISIBLE_ENTITIES } from './constants';
|
6
3
|
// ==== Filters ====
|
7
4
|
const prepareSearchText = (text) => text.trim().toLowerCase();
|
8
5
|
const filterNodesByText = (entities, text) => {
|
@@ -48,38 +45,6 @@ export function filterGroups(storageGroups, textFilter, usageFilter) {
|
|
48
45
|
result = filterGroupsByUsage(result, usageFilter);
|
49
46
|
return result;
|
50
47
|
}
|
51
|
-
// ==== Simple selectors ====
|
52
|
-
export const selectStorageFilter = (state) => state.storage.filter;
|
53
|
-
export const selectUsageFilter = (state) => state.storage.usageFilter;
|
54
|
-
export const selectVisibleEntities = (state) => state.storage.visible;
|
55
|
-
export const selectNodesUptimeFilter = (state) => state.storage.uptimeFilter;
|
56
|
-
export const selectStorageType = (state) => state.storage.type;
|
57
|
-
// ==== Sort params selectors ====
|
58
|
-
export const selectNodesSortParams = (state) => {
|
59
|
-
const defaultSortValue = NODES_SORT_VALUES.NodeId;
|
60
|
-
const defaultSortOrder = ASCENDING;
|
61
|
-
return {
|
62
|
-
sortValue: state.storage.nodesSortValue || defaultSortValue,
|
63
|
-
sortOrder: state.storage.nodesSortOrder || defaultSortOrder,
|
64
|
-
};
|
65
|
-
};
|
66
|
-
export const selectGroupsSortParams = (state) => {
|
67
|
-
const visibleEntities = state.storage.visible;
|
68
|
-
let defaultSortValue = STORAGE_SORT_VALUES.PoolName;
|
69
|
-
let defaultSortOrder = ASCENDING;
|
70
|
-
if (visibleEntities === VISIBLE_ENTITIES.missing) {
|
71
|
-
defaultSortValue = STORAGE_SORT_VALUES.Degraded;
|
72
|
-
defaultSortOrder = DESCENDING;
|
73
|
-
}
|
74
|
-
if (visibleEntities === VISIBLE_ENTITIES.space) {
|
75
|
-
defaultSortValue = STORAGE_SORT_VALUES.Usage;
|
76
|
-
defaultSortOrder = DESCENDING;
|
77
|
-
}
|
78
|
-
return {
|
79
|
-
sortValue: state.storage.groupsSortValue || defaultSortValue,
|
80
|
-
sortOrder: state.storage.groupsSortOrder || defaultSortOrder,
|
81
|
-
};
|
82
|
-
};
|
83
48
|
// ==== Complex selectors ====
|
84
49
|
export function getUsageFilterOptions(groups) {
|
85
50
|
const items = {};
|
@@ -1,9 +1,5 @@
|
|
1
|
-
import {
|
2
|
-
import type {
|
3
|
-
import type { StorageApiRequestParams, StorageSortParams, StorageState, StorageType, VisibleEntities } from './types';
|
4
|
-
declare const _default: import("redux").Reducer<StorageState>;
|
5
|
-
export default _default;
|
6
|
-
export declare const setInitialState: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"storage/setInitialState">, setStorageTextFilter: import("@reduxjs/toolkit").ActionCreatorWithPayload<string, "storage/setStorageTextFilter">, setUsageFilter: import("@reduxjs/toolkit").ActionCreatorWithPayload<string[], "storage/setUsageFilter">, setVisibleEntities: import("@reduxjs/toolkit").ActionCreatorWithPayload<VisibleEntities, "storage/setVisibleEntities">, setStorageType: import("@reduxjs/toolkit").ActionCreatorWithPayload<StorageType, "storage/setStorageType">, setUptimeFilter: import("@reduxjs/toolkit").ActionCreatorWithPayload<NodesUptimeFilterValues, "storage/setUptimeFilter">, setNodesSortParams: import("@reduxjs/toolkit").ActionCreatorWithPayload<NodesSortParams, "storage/setNodesSortParams">, setGroupsSortParams: import("@reduxjs/toolkit").ActionCreatorWithPayload<StorageSortParams, "storage/setGroupsSortParams">;
|
1
|
+
import type { NodesApiRequestParams } from '../nodes/types';
|
2
|
+
import type { StorageApiRequestParams } from './types';
|
7
3
|
export declare const storageApi: import("@reduxjs/toolkit/query").Api<import("@reduxjs/toolkit/query").BaseQueryFn<void, typeof import("../api")._NEVER, unknown, {}>, {
|
8
4
|
getStorageNodesInfo: import("@reduxjs/toolkit/query").QueryDefinition<Omit<NodesApiRequestParams, "type">, import("@reduxjs/toolkit/query").BaseQueryFn<void, typeof import("../api")._NEVER, unknown, {}>, "All", import("./types").PreparedStorageResponse | undefined, "api">;
|
9
5
|
getStorageGroupsInfo: import("@reduxjs/toolkit/query").QueryDefinition<StorageApiRequestParams, import("@reduxjs/toolkit/query").BaseQueryFn<void, typeof import("../api")._NEVER, unknown, {}>, "All", import("./types").PreparedStorageResponse | undefined, "api">;
|
@@ -1,50 +1,6 @@
|
|
1
|
-
import { createSlice } from '@reduxjs/toolkit';
|
2
1
|
import { EVersion } from '../../../types/api/storage';
|
3
|
-
import { NodesUptimeFilterValues } from '../../../utils/nodes';
|
4
2
|
import { api } from '../api';
|
5
|
-
import { STORAGE_TYPES, VISIBLE_ENTITIES } from './constants';
|
6
3
|
import { prepareStorageGroupsResponse, prepareStorageNodesResponse } from './utils';
|
7
|
-
const initialState = {
|
8
|
-
filter: '',
|
9
|
-
usageFilter: [],
|
10
|
-
visible: VISIBLE_ENTITIES.all,
|
11
|
-
uptimeFilter: NodesUptimeFilterValues.All,
|
12
|
-
type: STORAGE_TYPES.groups,
|
13
|
-
};
|
14
|
-
const slice = createSlice({
|
15
|
-
name: 'storage',
|
16
|
-
initialState,
|
17
|
-
reducers: {
|
18
|
-
setUptimeFilter: (state, action) => {
|
19
|
-
state.uptimeFilter = action.payload;
|
20
|
-
},
|
21
|
-
setStorageType: (state, action) => {
|
22
|
-
state.type = action.payload;
|
23
|
-
},
|
24
|
-
setStorageTextFilter: (state, action) => {
|
25
|
-
state.filter = action.payload;
|
26
|
-
},
|
27
|
-
setUsageFilter: (state, action) => {
|
28
|
-
state.usageFilter = action.payload;
|
29
|
-
},
|
30
|
-
setVisibleEntities: (state, action) => {
|
31
|
-
state.visible = action.payload;
|
32
|
-
},
|
33
|
-
setNodesSortParams: (state, action) => {
|
34
|
-
state.nodesSortValue = action.payload.sortValue;
|
35
|
-
state.nodesSortOrder = action.payload.sortOrder;
|
36
|
-
},
|
37
|
-
setGroupsSortParams: (state, action) => {
|
38
|
-
state.groupsSortValue = action.payload.sortValue;
|
39
|
-
state.groupsSortOrder = action.payload.sortOrder;
|
40
|
-
},
|
41
|
-
setInitialState: () => {
|
42
|
-
return initialState;
|
43
|
-
},
|
44
|
-
},
|
45
|
-
});
|
46
|
-
export default slice.reducer;
|
47
|
-
export const { setInitialState, setStorageTextFilter, setUsageFilter, setVisibleEntities, setStorageType, setUptimeFilter, setNodesSortParams, setGroupsSortParams, } = slice.actions;
|
48
4
|
export const storageApi = api.injectEndpoints({
|
49
5
|
endpoints: (builder) => ({
|
50
6
|
getStorageNodesInfo: builder.query({
|
@@ -1,13 +1,20 @@
|
|
1
1
|
import type { OrderType } from '@gravity-ui/react-data-table';
|
2
|
+
import { z } from 'zod';
|
2
3
|
import type { TSystemStateInfo } from '../../../types/api/nodes';
|
3
4
|
import type { EVersion, TStorageGroupInfo } from '../../../types/api/storage';
|
4
|
-
import type { ValueOf } from '../../../types/common';
|
5
5
|
import type { PreparedPDisk, PreparedVDisk } from '../../../utils/disks/types';
|
6
|
-
import type { NodesSortValue, NodesUptimeFilterValues } from '../../../utils/nodes';
|
7
6
|
import type { StorageSortValue } from '../../../utils/storage';
|
8
|
-
|
9
|
-
|
10
|
-
|
7
|
+
export declare const visibleEntitiesSchema: z.ZodCatch<z.ZodNativeEnum<{
|
8
|
+
readonly all: "all";
|
9
|
+
readonly missing: "missing";
|
10
|
+
readonly space: "space";
|
11
|
+
}>>;
|
12
|
+
export type VisibleEntities = z.infer<typeof visibleEntitiesSchema>;
|
13
|
+
export declare const storageTypeSchema: z.ZodCatch<z.ZodNativeEnum<{
|
14
|
+
readonly groups: "groups";
|
15
|
+
readonly nodes: "nodes";
|
16
|
+
}>>;
|
17
|
+
export type StorageType = z.infer<typeof storageTypeSchema>;
|
11
18
|
export interface PreparedStorageNode extends TSystemStateInfo {
|
12
19
|
NodeId: number;
|
13
20
|
PDisks?: PreparedPDisk[];
|
@@ -34,10 +41,10 @@ export interface UsageFilter {
|
|
34
41
|
count: number;
|
35
42
|
}
|
36
43
|
export interface StorageSortParams {
|
37
|
-
sortOrder
|
38
|
-
sortValue
|
44
|
+
sortOrder: OrderType | undefined;
|
45
|
+
sortValue: StorageSortValue | undefined;
|
39
46
|
}
|
40
|
-
export interface StorageSortAndFilterParams extends StorageSortParams {
|
47
|
+
export interface StorageSortAndFilterParams extends Partial<StorageSortParams> {
|
41
48
|
filter?: string;
|
42
49
|
offset?: number;
|
43
50
|
limit?: number;
|
@@ -50,23 +57,9 @@ export interface StorageApiRequestParams extends StorageSortAndFilterParams {
|
|
50
57
|
visibleEntities?: VisibleEntities;
|
51
58
|
version?: EVersion;
|
52
59
|
}
|
53
|
-
export interface StorageState {
|
54
|
-
filter: string;
|
55
|
-
usageFilter: string[];
|
56
|
-
visible: VisibleEntities;
|
57
|
-
uptimeFilter: NodesUptimeFilterValues;
|
58
|
-
groupsSortValue?: StorageSortValue;
|
59
|
-
groupsSortOrder?: OrderType;
|
60
|
-
nodesSortValue?: NodesSortValue;
|
61
|
-
nodesSortOrder?: OrderType;
|
62
|
-
type: StorageType;
|
63
|
-
}
|
64
60
|
export interface PreparedStorageResponse {
|
65
61
|
nodes?: PreparedStorageNode[];
|
66
62
|
groups?: PreparedStorageGroup[];
|
67
63
|
found: number | undefined;
|
68
64
|
total: number | undefined;
|
69
65
|
}
|
70
|
-
export interface StorageStateSlice {
|
71
|
-
storage: StorageState;
|
72
|
-
}
|
@@ -1 +1,4 @@
|
|
1
|
-
|
1
|
+
import { z } from 'zod';
|
2
|
+
import { STORAGE_TYPES, VISIBLE_ENTITIES } from './constants';
|
3
|
+
export const visibleEntitiesSchema = z.nativeEnum(VISIBLE_ENTITIES).catch(VISIBLE_ENTITIES.all);
|
4
|
+
export const storageTypeSchema = z.nativeEnum(STORAGE_TYPES).catch(STORAGE_TYPES.groups);
|
@@ -1,8 +1,99 @@
|
|
1
|
-
import type { ETabletState, EType } from '../../types/api/tablet';
|
1
|
+
import type { ETabletState, EType, TTabletStateInfo } from '../../types/api/tablet';
|
2
2
|
import type { TabletsApiRequestParams, TabletsState } from '../../types/store/tablets';
|
3
|
+
import type { RootState } from '../defaultStore';
|
3
4
|
export declare const setStateFilter: import("@reduxjs/toolkit").ActionCreatorWithPayload<ETabletState[], "tablets/setStateFilter">, setTypeFilter: import("@reduxjs/toolkit").ActionCreatorWithPayload<EType[], "tablets/setTypeFilter">;
|
4
5
|
declare const _default: import("redux").Reducer<TabletsState>;
|
5
6
|
export default _default;
|
6
7
|
export declare const tabletsApi: import("@reduxjs/toolkit/query").Api<import("@reduxjs/toolkit/query").BaseQueryFn<void, typeof import("./api")._NEVER, unknown, {}>, {
|
7
8
|
getTabletsInfo: import("@reduxjs/toolkit/query").QueryDefinition<TabletsApiRequestParams, import("@reduxjs/toolkit/query").BaseQueryFn<void, typeof import("./api")._NEVER, unknown, {}>, "All", import("../../types/api/tablet").TEvTabletStateResponse | undefined, "api">;
|
8
9
|
}, "api", "All", typeof import("@reduxjs/toolkit/query").coreModuleName | typeof import("@reduxjs/toolkit/dist/query/react").reactHooksModuleName>;
|
10
|
+
export declare const selectTabletsWithFqdn: ((state: {
|
11
|
+
api: import("@reduxjs/toolkit/query").CombinedState<{}, "All", "api">;
|
12
|
+
singleClusterMode: boolean;
|
13
|
+
cluster: import("./cluster/types").ClusterState;
|
14
|
+
tenant: import("./tenant/types").TenantState;
|
15
|
+
tooltip: import("../../types/store/tooltip").ITooltipState;
|
16
|
+
tablets: TabletsState;
|
17
|
+
schema: import("./schema/types").SchemaState;
|
18
|
+
host: import("../../types/store/host").IHostState;
|
19
|
+
tenants: import("./tenants/types").TenantsState;
|
20
|
+
partitions: import("./partitions/types").PartitionsState;
|
21
|
+
executeQuery: import("../../types/store/executeQuery").ExecuteQueryState;
|
22
|
+
explainQuery: import("../../types/store/explainQuery").ExplainQueryState;
|
23
|
+
tabletsFilters: {
|
24
|
+
loading: boolean;
|
25
|
+
requestTime: number;
|
26
|
+
data: undefined;
|
27
|
+
wasLoaded: boolean;
|
28
|
+
stateFilter: never[];
|
29
|
+
typeFilter: never[];
|
30
|
+
} | {
|
31
|
+
tabletsData: any;
|
32
|
+
nodes: any;
|
33
|
+
loading: boolean;
|
34
|
+
wasLoaded: boolean;
|
35
|
+
timeoutForRequest: number;
|
36
|
+
error: undefined;
|
37
|
+
data: undefined;
|
38
|
+
stateFilter: never[];
|
39
|
+
typeFilter: never[];
|
40
|
+
} | {
|
41
|
+
error: any;
|
42
|
+
loading: boolean;
|
43
|
+
data: undefined;
|
44
|
+
wasLoaded: boolean;
|
45
|
+
stateFilter: never[];
|
46
|
+
typeFilter: never[];
|
47
|
+
} | {
|
48
|
+
stateFilter: any;
|
49
|
+
data: undefined;
|
50
|
+
loading: boolean;
|
51
|
+
wasLoaded: boolean;
|
52
|
+
typeFilter: never[];
|
53
|
+
} | {
|
54
|
+
typeFilter: any;
|
55
|
+
data: undefined;
|
56
|
+
loading: boolean;
|
57
|
+
wasLoaded: boolean;
|
58
|
+
stateFilter: never[];
|
59
|
+
};
|
60
|
+
heatmap: import("../../types/store/heatmap").IHeatmapState;
|
61
|
+
settings: import("./settings/types").SettingsState;
|
62
|
+
schemaAcl: import("./schemaAcl/types").SchemaAclState;
|
63
|
+
executeTopQueries: import("./executeTopQueries/types").TopQueriesFilters;
|
64
|
+
shardsWorkload: import("./shardsWorkload/types").ShardsWorkloadFilters;
|
65
|
+
hotKeys: import("./hotKeys/types").HotKeysState;
|
66
|
+
authentication: import("./authentication/types").AuthenticationState;
|
67
|
+
header: import("./header/types").HeaderState;
|
68
|
+
saveQuery: string | null;
|
69
|
+
fullscreen: boolean;
|
70
|
+
clusters: import("./clusters/types").ClustersFilters;
|
71
|
+
}, nodeId: string | undefined, path: string | undefined) => (TTabletStateInfo & {
|
72
|
+
fqdn?: string | undefined;
|
73
|
+
})[]) & {
|
74
|
+
clearCache: () => void;
|
75
|
+
resultsCount: () => number;
|
76
|
+
resetResultsCount: () => void;
|
77
|
+
} & {
|
78
|
+
resultFunc: (resultFuncArgs_0: import("../../types/api/tablet").TEvTabletStateResponse | undefined, resultFuncArgs_1: import("../../types/store/nodesList").NodesMap | undefined) => (TTabletStateInfo & {
|
79
|
+
fqdn?: string | undefined;
|
80
|
+
})[];
|
81
|
+
memoizedResultFunc: ((resultFuncArgs_0: import("../../types/api/tablet").TEvTabletStateResponse | undefined, resultFuncArgs_1: import("../../types/store/nodesList").NodesMap | undefined) => (TTabletStateInfo & {
|
82
|
+
fqdn?: string | undefined;
|
83
|
+
})[]) & {
|
84
|
+
clearCache: () => void;
|
85
|
+
resultsCount: () => number;
|
86
|
+
resetResultsCount: () => void;
|
87
|
+
};
|
88
|
+
lastResult: () => (TTabletStateInfo & {
|
89
|
+
fqdn?: string | undefined;
|
90
|
+
})[];
|
91
|
+
dependencies: [(state: RootState, nodeId: string | undefined, path: string | undefined) => import("../../types/api/tablet").TEvTabletStateResponse | undefined, (state: RootState) => import("../../types/store/nodesList").NodesMap | undefined];
|
92
|
+
recomputations: () => number;
|
93
|
+
resetRecomputations: () => void;
|
94
|
+
dependencyRecomputations: () => number;
|
95
|
+
resetDependencyRecomputations: () => void;
|
96
|
+
} & {
|
97
|
+
argsMemoize: typeof import("reselect").weakMapMemoize;
|
98
|
+
memoize: typeof import("reselect").weakMapMemoize;
|
99
|
+
};
|
@@ -1,5 +1,6 @@
|
|
1
|
-
import { createSlice } from '@reduxjs/toolkit';
|
1
|
+
import { createSelector, createSlice } from '@reduxjs/toolkit';
|
2
2
|
import { api } from './api';
|
3
|
+
import { selectNodesMap } from './nodesList';
|
3
4
|
const initialState = {
|
4
5
|
stateFilter: [],
|
5
6
|
typeFilter: [],
|
@@ -35,3 +36,17 @@ export const tabletsApi = api.injectEndpoints({
|
|
35
36
|
}),
|
36
37
|
overrideExisting: 'throw',
|
37
38
|
});
|
39
|
+
const getTabletsInfoSelector = createSelector((nodeId, path) => ({ nodeId, path }), ({ nodeId, path }) => tabletsApi.endpoints.getTabletsInfo.select(nodeId === undefined ? { path } : { nodes: [nodeId] }));
|
40
|
+
const selectGetTabletsInfo = createSelector((state) => state, (_state, nodeId, path) => getTabletsInfoSelector(nodeId, path), (state, selectTabletsInfo) => selectTabletsInfo(state).data);
|
41
|
+
export const selectTabletsWithFqdn = createSelector((state, nodeId, path) => selectGetTabletsInfo(state, nodeId, path), (state) => selectNodesMap(state), (data, nodesMap) => {
|
42
|
+
if (!(data === null || data === void 0 ? void 0 : data.TabletStateInfo)) {
|
43
|
+
return [];
|
44
|
+
}
|
45
|
+
if (!nodesMap) {
|
46
|
+
return data.TabletStateInfo;
|
47
|
+
}
|
48
|
+
return data.TabletStateInfo.map((tablet) => {
|
49
|
+
const fqdn = tablet.NodeId === undefined ? undefined : nodesMap.get(tablet.NodeId);
|
50
|
+
return Object.assign(Object.assign({}, tablet), { fqdn });
|
51
|
+
});
|
52
|
+
});
|
@@ -1,10 +1,8 @@
|
|
1
1
|
export function getTabletsInfo(data: any): (dispatch: import("redux").Dispatch<import("redux").UnknownAction>, getState: () => {
|
2
2
|
api: import("@reduxjs/toolkit/query").CombinedState<{}, "All", "api">;
|
3
3
|
singleClusterMode: boolean;
|
4
|
-
nodes: import("./nodes/types").NodesState;
|
5
4
|
cluster: import("./cluster/types").ClusterState;
|
6
5
|
tenant: import("./tenant/types").TenantState;
|
7
|
-
storage: import("./storage/types").StorageState;
|
8
6
|
tooltip: import("../../types/store/tooltip").ITooltipState;
|
9
7
|
tablets: import("../../types/store/tablets").TabletsState;
|
10
8
|
schema: import("./schema/types").SchemaState;
|
@@ -1,7 +1,7 @@
|
|
1
|
-
import type { TenantDiagnosticsTab, TenantMetricsTab,
|
1
|
+
import type { TenantDiagnosticsTab, TenantMetricsTab, TenantQueryTab, TenantState, TenantSummaryTab } from './types';
|
2
2
|
declare const _default: import("redux").Reducer<TenantState>;
|
3
3
|
export default _default;
|
4
|
-
export declare const setTenantPage: import("@reduxjs/toolkit").ActionCreatorWithPayload<
|
4
|
+
export declare const setTenantPage: import("@reduxjs/toolkit").ActionCreatorWithPayload<"query" | "diagnostics", "tenant/setTenantPage">, setQueryTab: import("@reduxjs/toolkit").ActionCreatorWithPayload<TenantQueryTab, "tenant/setQueryTab">, setDiagnosticsTab: import("@reduxjs/toolkit").ActionCreatorWithPayload<TenantDiagnosticsTab, "tenant/setDiagnosticsTab">, setSummaryTab: import("@reduxjs/toolkit").ActionCreatorWithPayload<TenantSummaryTab, "tenant/setSummaryTab">, setMetricsTab: import("@reduxjs/toolkit").ActionCreatorWithPayload<TenantMetricsTab, "tenant/setMetricsTab">;
|
5
5
|
export declare const tenantApi: import("@reduxjs/toolkit/query").Api<import("@reduxjs/toolkit/query").BaseQueryFn<void, typeof import("../api")._NEVER, unknown, {}>, {
|
6
6
|
getTenantInfo: import("@reduxjs/toolkit/query").QueryDefinition<{
|
7
7
|
path: string;
|
@@ -1,8 +1,17 @@
|
|
1
1
|
import { createSlice } from '@reduxjs/toolkit';
|
2
|
+
import { DEFAULT_USER_SETTINGS, settingsManager } from '../../../services/settings';
|
3
|
+
import { TENANT_INITIAL_PAGE_KEY } from '../../../utils/constants';
|
2
4
|
import { api } from '../api';
|
5
|
+
import { tenantPageSchema } from './types';
|
6
|
+
const tenantPage = tenantPageSchema
|
7
|
+
.catch(DEFAULT_USER_SETTINGS[TENANT_INITIAL_PAGE_KEY])
|
8
|
+
.parse(settingsManager.readUserSettingsValue(TENANT_INITIAL_PAGE_KEY));
|
9
|
+
const initialState = {
|
10
|
+
tenantPage,
|
11
|
+
};
|
3
12
|
const slice = createSlice({
|
4
13
|
name: 'tenant',
|
5
|
-
initialState
|
14
|
+
initialState,
|
6
15
|
reducers: {
|
7
16
|
setTenantPage: (state, action) => {
|
8
17
|
state.tenantPage = action.payload;
|
@@ -1,12 +1,17 @@
|
|
1
|
+
import { z } from 'zod';
|
1
2
|
import type { ValueOf } from '../../../types/common';
|
2
|
-
import type { TENANT_DIAGNOSTICS_TABS_IDS, TENANT_METRICS_TABS_IDS,
|
3
|
-
export
|
3
|
+
import type { TENANT_DIAGNOSTICS_TABS_IDS, TENANT_METRICS_TABS_IDS, TENANT_QUERY_TABS_ID, TENANT_SUMMARY_TABS_IDS } from './constants';
|
4
|
+
export declare const tenantPageSchema: z.ZodNativeEnum<{
|
5
|
+
readonly query: "query";
|
6
|
+
readonly diagnostics: "diagnostics";
|
7
|
+
}>;
|
8
|
+
export type TenantPage = z.infer<typeof tenantPageSchema>;
|
4
9
|
export type TenantQueryTab = ValueOf<typeof TENANT_QUERY_TABS_ID>;
|
5
10
|
export type TenantDiagnosticsTab = ValueOf<typeof TENANT_DIAGNOSTICS_TABS_IDS>;
|
6
11
|
export type TenantSummaryTab = ValueOf<typeof TENANT_SUMMARY_TABS_IDS>;
|
7
12
|
export type TenantMetricsTab = ValueOf<typeof TENANT_METRICS_TABS_IDS>;
|
8
13
|
export interface TenantState {
|
9
|
-
tenantPage
|
14
|
+
tenantPage: TenantPage;
|
10
15
|
queryTab?: TenantQueryTab;
|
11
16
|
diagnosticsTab?: TenantDiagnosticsTab;
|
12
17
|
summaryTab?: TenantSummaryTab;
|
@@ -4,10 +4,8 @@ import type { PreparedTenant, TenantsStateSlice } from './types';
|
|
4
4
|
export declare const selectTenants: ((state: {
|
5
5
|
api: import("@reduxjs/toolkit/query").CombinedState<{}, "All", "api">;
|
6
6
|
singleClusterMode: boolean;
|
7
|
-
nodes: import("../nodes/types").NodesState;
|
8
7
|
cluster: import("../cluster/types").ClusterState;
|
9
8
|
tenant: import("../tenant/types").TenantState;
|
10
|
-
storage: import("../storage/types").StorageState;
|
11
9
|
tooltip: import("../../../types/store/tooltip").ITooltipState;
|
12
10
|
tablets: import("../../../types/store/tablets").TabletsState;
|
13
11
|
schema: import("../schema/types").SchemaState;
|
@@ -72,10 +70,8 @@ export declare const selectTenants: ((state: {
|
|
72
70
|
resultFunc: (resultFuncArgs_0: {
|
73
71
|
api: import("@reduxjs/toolkit/query").CombinedState<{}, "All", "api">;
|
74
72
|
singleClusterMode: boolean;
|
75
|
-
nodes: import("../nodes/types").NodesState;
|
76
73
|
cluster: import("../cluster/types").ClusterState;
|
77
74
|
tenant: import("../tenant/types").TenantState;
|
78
|
-
storage: import("../storage/types").StorageState;
|
79
75
|
tooltip: import("../../../types/store/tooltip").ITooltipState;
|
80
76
|
tablets: import("../../../types/store/tablets").TabletsState;
|
81
77
|
schema: import("../schema/types").SchemaState;
|
@@ -206,10 +202,8 @@ export declare const selectTenants: ((state: {
|
|
206
202
|
memoizedResultFunc: ((resultFuncArgs_0: {
|
207
203
|
api: import("@reduxjs/toolkit/query").CombinedState<{}, "All", "api">;
|
208
204
|
singleClusterMode: boolean;
|
209
|
-
nodes: import("../nodes/types").NodesState;
|
210
205
|
cluster: import("../cluster/types").ClusterState;
|
211
206
|
tenant: import("../tenant/types").TenantState;
|
212
|
-
storage: import("../storage/types").StorageState;
|
213
207
|
tooltip: import("../../../types/store/tooltip").ITooltipState;
|
214
208
|
tablets: import("../../../types/store/tablets").TabletsState;
|
215
209
|
schema: import("../schema/types").SchemaState;
|
@@ -345,10 +339,8 @@ export declare const selectTenants: ((state: {
|
|
345
339
|
dependencies: [(state: RootState) => {
|
346
340
|
api: import("@reduxjs/toolkit/query").CombinedState<{}, "All", "api">;
|
347
341
|
singleClusterMode: boolean;
|
348
|
-
nodes: import("../nodes/types").NodesState;
|
349
342
|
cluster: import("../cluster/types").ClusterState;
|
350
343
|
tenant: import("../tenant/types").TenantState;
|
351
|
-
storage: import("../storage/types").StorageState;
|
352
344
|
tooltip: import("../../../types/store/tooltip").ITooltipState;
|
353
345
|
tablets: import("../../../types/store/tablets").TabletsState;
|
354
346
|
schema: import("../schema/types").SchemaState;
|
@@ -488,10 +480,8 @@ export declare const selectTenantsSearchValue: (state: TenantsStateSlice) => str
|
|
488
480
|
export declare const selectFilteredTenants: ((state: {
|
489
481
|
api: import("@reduxjs/toolkit/query").CombinedState<{}, "All", "api">;
|
490
482
|
singleClusterMode: boolean;
|
491
|
-
nodes: import("../nodes/types").NodesState;
|
492
483
|
cluster: import("../cluster/types").ClusterState;
|
493
484
|
tenant: import("../tenant/types").TenantState;
|
494
|
-
storage: import("../storage/types").StorageState;
|
495
485
|
tooltip: import("../../../types/store/tooltip").ITooltipState;
|
496
486
|
tablets: import("../../../types/store/tablets").TabletsState;
|
497
487
|
schema: import("../schema/types").SchemaState;
|
@@ -563,10 +553,8 @@ export declare const selectFilteredTenants: ((state: {
|
|
563
553
|
dependencies: [((state: {
|
564
554
|
api: import("@reduxjs/toolkit/query").CombinedState<{}, "All", "api">;
|
565
555
|
singleClusterMode: boolean;
|
566
|
-
nodes: import("../nodes/types").NodesState;
|
567
556
|
cluster: import("../cluster/types").ClusterState;
|
568
557
|
tenant: import("../tenant/types").TenantState;
|
569
|
-
storage: import("../storage/types").StorageState;
|
570
558
|
tooltip: import("../../../types/store/tooltip").ITooltipState;
|
571
559
|
tablets: import("../../../types/store/tablets").TabletsState;
|
572
560
|
schema: import("../schema/types").SchemaState;
|
@@ -631,10 +619,8 @@ export declare const selectFilteredTenants: ((state: {
|
|
631
619
|
resultFunc: (resultFuncArgs_0: {
|
632
620
|
api: import("@reduxjs/toolkit/query").CombinedState<{}, "All", "api">;
|
633
621
|
singleClusterMode: boolean;
|
634
|
-
nodes: import("../nodes/types").NodesState;
|
635
622
|
cluster: import("../cluster/types").ClusterState;
|
636
623
|
tenant: import("../tenant/types").TenantState;
|
637
|
-
storage: import("../storage/types").StorageState;
|
638
624
|
tooltip: import("../../../types/store/tooltip").ITooltipState;
|
639
625
|
tablets: import("../../../types/store/tablets").TabletsState;
|
640
626
|
schema: import("../schema/types").SchemaState;
|
@@ -765,10 +751,8 @@ export declare const selectFilteredTenants: ((state: {
|
|
765
751
|
memoizedResultFunc: ((resultFuncArgs_0: {
|
766
752
|
api: import("@reduxjs/toolkit/query").CombinedState<{}, "All", "api">;
|
767
753
|
singleClusterMode: boolean;
|
768
|
-
nodes: import("../nodes/types").NodesState;
|
769
754
|
cluster: import("../cluster/types").ClusterState;
|
770
755
|
tenant: import("../tenant/types").TenantState;
|
771
|
-
storage: import("../storage/types").StorageState;
|
772
756
|
tooltip: import("../../../types/store/tooltip").ITooltipState;
|
773
757
|
tablets: import("../../../types/store/tablets").TabletsState;
|
774
758
|
schema: import("../schema/types").SchemaState;
|
@@ -904,10 +888,8 @@ export declare const selectFilteredTenants: ((state: {
|
|
904
888
|
dependencies: [(state: RootState) => {
|
905
889
|
api: import("@reduxjs/toolkit/query").CombinedState<{}, "All", "api">;
|
906
890
|
singleClusterMode: boolean;
|
907
|
-
nodes: import("../nodes/types").NodesState;
|
908
891
|
cluster: import("../cluster/types").ClusterState;
|
909
892
|
tenant: import("../tenant/types").TenantState;
|
910
|
-
storage: import("../storage/types").StorageState;
|
911
893
|
tooltip: import("../../../types/store/tooltip").ITooltipState;
|
912
894
|
tablets: import("../../../types/store/tablets").TabletsState;
|
913
895
|
schema: import("../schema/types").SchemaState;
|
@@ -11,13 +11,13 @@ export interface TenantMetricStats<T = string> {
|
|
11
11
|
export type TenantPoolsStats = TenantMetricStats<PoolName>;
|
12
12
|
export type TenantStorageStats = TenantMetricStats<EType>;
|
13
13
|
export declare const calculateTenantMetrics: (tenant?: TTenant) => {
|
14
|
-
memory: number
|
15
|
-
blobStorage: number
|
16
|
-
tabletStorage: number
|
14
|
+
memory: number;
|
15
|
+
blobStorage: number;
|
16
|
+
tabletStorage: number;
|
17
17
|
memoryLimit: number | undefined;
|
18
18
|
blobStorageLimit: number | undefined;
|
19
19
|
tabletStorageLimit: number | undefined;
|
20
|
-
cpu: number
|
20
|
+
cpu: number;
|
21
21
|
poolsStats: TenantPoolsStats[] | undefined;
|
22
22
|
memoryStats: TenantMetricStats<string>[];
|
23
23
|
blobStorageStats: TenantStorageStats[];
|
@@ -25,7 +25,7 @@ const calculatePoolsStats = (poolsStats) => {
|
|
25
25
|
return poolsStats
|
26
26
|
.map((pool) => {
|
27
27
|
if (pool.Name) {
|
28
|
-
const usage = Number(pool.Usage);
|
28
|
+
const usage = Number(pool.Usage) || 0;
|
29
29
|
const limit = Number(pool.Threads);
|
30
30
|
const used = limit * usage;
|
31
31
|
// Multiply usage by 100 to match with usage to status checkers
|
@@ -37,16 +37,16 @@ const calculatePoolsStats = (poolsStats) => {
|
|
37
37
|
};
|
38
38
|
export const calculateTenantMetrics = (tenant = {}) => {
|
39
39
|
const { CoresUsed, MemoryUsed, StorageAllocatedSize, MemoryLimit, StorageAllocatedLimit, PoolStats, Metrics = {}, DatabaseQuotas = {}, StorageUsage, QuotaUsage, } = tenant;
|
40
|
-
const cpu =
|
41
|
-
const memory =
|
42
|
-
const blobStorage =
|
43
|
-
const tabletStorage =
|
40
|
+
const cpu = Number(CoresUsed) * 1000000 || 0;
|
41
|
+
const memory = Number(MemoryUsed) || 0;
|
42
|
+
const blobStorage = Number(StorageAllocatedSize) || 0;
|
43
|
+
const tabletStorage = Number(Metrics.Storage) || 0;
|
44
44
|
const memoryLimit = isNumeric(MemoryLimit) ? Number(MemoryLimit) : undefined;
|
45
45
|
const blobStorageLimit = isNumeric(StorageAllocatedLimit)
|
46
46
|
? Number(StorageAllocatedLimit)
|
47
47
|
: undefined;
|
48
|
-
const tabletStorageLimit = isNumeric(DatabaseQuotas.
|
49
|
-
? Number(DatabaseQuotas.
|
48
|
+
const tabletStorageLimit = isNumeric(DatabaseQuotas.data_size_soft_quota)
|
49
|
+
? Number(DatabaseQuotas.data_size_soft_quota)
|
50
50
|
: undefined;
|
51
51
|
const poolsStats = calculatePoolsStats(PoolStats);
|
52
52
|
let blobStorageStats;
|
@@ -87,7 +87,7 @@ export const calculateTenantMetrics = (tenant = {}) => {
|
|
87
87
|
};
|
88
88
|
});
|
89
89
|
}
|
90
|
-
else if (
|
90
|
+
else if (tabletStorageLimit) {
|
91
91
|
tabletStorageStats = [
|
92
92
|
{
|
93
93
|
name: EType.SSD,
|