ydb-embedded-ui 22.1.0 → 22.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/DiskStateProgressBar/AllModeIndicators.js +4 -1
- package/dist/components/DiskStateProgressBar/AllModeIndicators.js.map +1 -1
- package/dist/components/DiskStateProgressBar/DiskIndicator.js +5 -1
- package/dist/components/DiskStateProgressBar/DiskIndicator.js.map +1 -1
- package/dist/components/DiskStateProgressBar/DiskStateProgressBar.scss +50 -8
- package/dist/components/PDiskInfo/PDiskInfo.js +2 -1
- package/dist/components/PDiskInfo/PDiskInfo.js.map +1 -1
- package/dist/components/PDiskPopup/PDiskPopup.js +5 -1
- package/dist/components/PDiskPopup/PDiskPopup.js.map +1 -1
- package/dist/components/PaginatedTable/PaginatedTable.js +27 -15
- package/dist/components/PaginatedTable/PaginatedTable.js.map +1 -1
- package/dist/components/PaginatedTable/PaginatedTableContext.d.ts +2 -3
- package/dist/components/PaginatedTable/PaginatedTableContext.js +10 -11
- package/dist/components/PaginatedTable/PaginatedTableContext.js.map +1 -1
- package/dist/components/PaginatedTable/TableChunk.d.ts +1 -1
- package/dist/components/PaginatedTable/TableChunk.js +2 -1
- package/dist/components/PaginatedTable/TableChunk.js.map +1 -1
- package/dist/components/PaginatedTable/TableChunksRenderer.d.ts +1 -1
- package/dist/components/PaginatedTable/tableCounts.d.ts +19 -0
- package/dist/components/PaginatedTable/tableCounts.js +30 -0
- package/dist/components/PaginatedTable/tableCounts.js.map +1 -0
- package/dist/components/VDisk/VDisk.d.ts +2 -1
- package/dist/components/VDisk/VDisk.js +17 -7
- package/dist/components/VDisk/VDisk.js.map +1 -1
- package/dist/components/VDisk/VDiskWithDonorsStack.d.ts +3 -2
- package/dist/components/VDisk/VDiskWithDonorsStack.js +2 -1
- package/dist/components/VDisk/VDiskWithDonorsStack.js.map +1 -1
- package/dist/components/VDisk/i18n/en.json +3 -1
- package/dist/components/VDisk/i18n/index.d.ts +1 -1
- package/dist/containers/Storage/Disks/Disks.js +1 -3
- package/dist/containers/Storage/Disks/Disks.js.map +1 -1
- package/dist/containers/Storage/PDisk/PDisk.js +9 -2
- package/dist/containers/Storage/PDisk/PDisk.js.map +1 -1
- package/dist/containers/Storage/PDisk/i18n/en.json +1 -0
- package/dist/containers/Storage/PDisk/i18n/index.d.ts +1 -1
- package/dist/containers/Storage/StorageExpertModePanel/StorageGroupsExpertModePanel.js +2 -0
- package/dist/containers/Storage/StorageExpertModePanel/StorageGroupsExpertModePanel.js.map +1 -1
- package/dist/containers/Storage/StorageExpertModePanel/components/DriveTypeLegend.d.ts +1 -0
- package/dist/containers/Storage/StorageExpertModePanel/components/DriveTypeLegend.js +7 -0
- package/dist/containers/Storage/StorageExpertModePanel/components/DriveTypeLegend.js.map +1 -0
- package/dist/containers/Storage/StorageExpertModePanel/components/renderExpertModeLegend.js +5 -0
- package/dist/containers/Storage/StorageExpertModePanel/components/renderExpertModeLegend.js.map +1 -1
- package/dist/containers/Storage/StorageExpertModePanel/constants.d.ts +3 -0
- package/dist/containers/Storage/StorageExpertModePanel/constants.js +1 -0
- package/dist/containers/Storage/StorageExpertModePanel/constants.js.map +1 -1
- package/dist/containers/Storage/StorageExpertModePanel/i18n/en.json +4 -0
- package/dist/containers/Storage/StorageExpertModePanel/i18n/index.d.ts +1 -1
- package/dist/containers/Storage/useStoragePDiskDisplayStateGetter.js +7 -0
- package/dist/containers/Storage/useStoragePDiskDisplayStateGetter.js.map +1 -1
- package/dist/containers/Storage/useStorageQueryParams.d.ts +4 -4
- package/dist/containers/Storage/useStorageVDiskDisplayStateGetter.js +10 -1
- package/dist/containers/Storage/useStorageVDiskDisplayStateGetter.js.map +1 -1
- package/dist/containers/VDiskPage/VDiskPage.js +9 -1
- package/dist/containers/VDiskPage/VDiskPage.js.map +1 -1
- package/dist/store/reducers/table/table.js +6 -0
- package/dist/store/reducers/table/table.js.map +1 -1
- package/dist/store/reducers/topic/topic.js +7 -1
- package/dist/store/reducers/topic/topic.js.map +1 -1
- package/dist/uiFactory/types.d.ts +6 -0
- package/dist/utils/disks/displayState.d.ts +3 -2
- package/dist/utils/disks/displayState.js.map +1 -1
- package/dist/utils/disks/driveType.d.ts +3 -0
- package/dist/utils/disks/driveType.js +27 -0
- package/dist/utils/disks/driveType.js.map +1 -0
- package/dist/utils/disks/getDiskBarTone.d.ts +3 -2
- package/dist/utils/disks/getDiskBarTone.js +4 -1
- package/dist/utils/disks/getDiskBarTone.js.map +1 -1
- package/dist/utils/disks/getPDiskType.d.ts +1 -0
- package/dist/utils/disks/getPDiskType.js +3 -0
- package/dist/utils/disks/getPDiskType.js.map +1 -1
- package/dist/utils/disks/groupBy.d.ts +1 -0
- package/dist/utils/disks/groupBy.js +1 -0
- package/dist/utils/disks/groupBy.js.map +1 -1
- package/dist/utils/disks/iconCalculators.d.ts +1 -1
- package/dist/utils/disks/iconCalculators.js +2 -2
- package/dist/utils/disks/iconCalculators.js.map +1 -1
- package/dist/utils/disks/types.d.ts +1 -1
- package/dist/utils/objectCreationMetrics.d.ts +5 -0
- package/dist/utils/objectCreationMetrics.js +38 -0
- package/dist/utils/objectCreationMetrics.js.map +1 -0
- package/package.json +1 -1
- package/src/components/DiskStateProgressBar/AllModeIndicators.tsx +12 -1
- package/src/components/DiskStateProgressBar/DiskIndicator.tsx +9 -1
- package/src/components/DiskStateProgressBar/DiskStateProgressBar.scss +50 -8
- package/src/components/PDiskInfo/PDiskInfo.tsx +2 -1
- package/src/components/PDiskPopup/PDiskPopup.tsx +5 -1
- package/src/components/PaginatedTable/PaginatedTable.tsx +34 -24
- package/src/components/PaginatedTable/PaginatedTableContext.tsx +14 -19
- package/src/components/PaginatedTable/TableChunk.tsx +3 -2
- package/src/components/PaginatedTable/TableChunksRenderer.tsx +1 -1
- package/src/components/PaginatedTable/tableCounts.ts +50 -0
- package/src/components/VDisk/VDisk.tsx +28 -5
- package/src/components/VDisk/VDiskWithDonorsStack.tsx +5 -1
- package/src/components/VDisk/i18n/en.json +3 -1
- package/src/containers/Storage/Disks/Disks.tsx +2 -4
- package/src/containers/Storage/PDisk/PDisk.tsx +11 -2
- package/src/containers/Storage/PDisk/i18n/en.json +1 -0
- package/src/containers/Storage/StorageExpertModePanel/StorageGroupsExpertModePanel.tsx +2 -0
- package/src/containers/Storage/StorageExpertModePanel/components/DriveTypeLegend.tsx +22 -0
- package/src/containers/Storage/StorageExpertModePanel/components/renderExpertModeLegend.tsx +5 -0
- package/src/containers/Storage/StorageExpertModePanel/constants.ts +1 -0
- package/src/containers/Storage/StorageExpertModePanel/i18n/en.json +4 -0
- package/src/containers/Storage/useStoragePDiskDisplayStateGetter.ts +8 -0
- package/src/containers/Storage/useStorageVDiskDisplayStateGetter.ts +11 -1
- package/src/containers/VDiskPage/VDiskPage.tsx +9 -1
- package/src/store/reducers/table/table.ts +6 -0
- package/src/store/reducers/topic/topic.ts +7 -1
- package/src/uiFactory/types.ts +6 -0
- package/src/utils/disks/displayState.ts +3 -1
- package/src/utils/disks/driveType.ts +30 -0
- package/src/utils/disks/getDiskBarTone.ts +7 -1
- package/src/utils/disks/getPDiskType.ts +4 -0
- package/src/utils/disks/groupBy.ts +1 -0
- package/src/utils/disks/iconCalculators.ts +2 -2
- package/src/utils/disks/types.ts +1 -1
- package/src/utils/objectCreationMetrics.ts +47 -0
|
@@ -3,6 +3,7 @@ import {PDisksGroupBy, VDisksGroupBy} from '../constants';
|
|
|
3
3
|
|
|
4
4
|
import {AllLegend} from './AllLegend';
|
|
5
5
|
import {CompactionLegend} from './CompactionLegend';
|
|
6
|
+
import {DriveTypeLegend} from './DriveTypeLegend';
|
|
6
7
|
import {FrontQueuesLegend} from './FrontQueuesLegend';
|
|
7
8
|
import {PDiskDecommitLegend} from './PDiskDecommitLegend';
|
|
8
9
|
import {PDiskDeviceLegend} from './PDiskDeviceLegend';
|
|
@@ -18,6 +19,8 @@ export function renderVDiskLegend(
|
|
|
18
19
|
selectionScope: SpaceLegendSelectionScope,
|
|
19
20
|
) {
|
|
20
21
|
switch (vdisksGroupBy) {
|
|
22
|
+
case VDisksGroupBy.DriveType:
|
|
23
|
+
return <DriveTypeLegend />;
|
|
21
24
|
case VDisksGroupBy.State:
|
|
22
25
|
return <StateLegend />;
|
|
23
26
|
case VDisksGroupBy.Space:
|
|
@@ -38,6 +41,8 @@ export function renderPDiskLegend(
|
|
|
38
41
|
selectionScope: SpaceLegendSelectionScope,
|
|
39
42
|
) {
|
|
40
43
|
switch (pdisksGroupBy) {
|
|
44
|
+
case PDisksGroupBy.DriveType:
|
|
45
|
+
return <DriveTypeLegend />;
|
|
41
46
|
case PDisksGroupBy.State:
|
|
42
47
|
return <PDiskStateLegend />;
|
|
43
48
|
case PDisksGroupBy.Space:
|
|
@@ -12,6 +12,7 @@ import type {
|
|
|
12
12
|
PDiskDisplayStateGetter,
|
|
13
13
|
} from '../../utils/disks/displayState';
|
|
14
14
|
import {getDefaultPDiskDisplayState} from '../../utils/disks/displayState';
|
|
15
|
+
import {getDriveTypeDisplayState} from '../../utils/disks/driveType';
|
|
15
16
|
import {calculateFlagPairIcon, calculateSpaceIcon} from '../../utils/disks/iconCalculators';
|
|
16
17
|
import {
|
|
17
18
|
getPDiskDecommitDisplayState,
|
|
@@ -205,6 +206,13 @@ function usePDiskDisplayStateGetter(
|
|
|
205
206
|
return getDefaultPDiskDisplayState(pDisk);
|
|
206
207
|
}
|
|
207
208
|
|
|
209
|
+
if (pdisksGroupBy === PDisksGroupBy.DriveType) {
|
|
210
|
+
return {
|
|
211
|
+
...getDriveTypeDisplayState(pDisk),
|
|
212
|
+
width: EXPERT_MODE_PDISK_WIDTH,
|
|
213
|
+
};
|
|
214
|
+
}
|
|
215
|
+
|
|
208
216
|
const mode = getMode(pdisksGroupBy);
|
|
209
217
|
const hasWhiteboardData = pDisk.HasWhiteboardData ?? pDisk.WhiteboardSize !== undefined;
|
|
210
218
|
|
|
@@ -16,6 +16,7 @@ import type {
|
|
|
16
16
|
VDiskDisplayStateGetter,
|
|
17
17
|
} from '../../utils/disks/displayState';
|
|
18
18
|
import {getDefaultDiskDisplayState} from '../../utils/disks/displayState';
|
|
19
|
+
import {getDriveTypeDisplayState} from '../../utils/disks/driveType';
|
|
19
20
|
import {getIconCalculator} from '../../utils/disks/getIconStrategy';
|
|
20
21
|
import {getSeverityCalculator} from '../../utils/disks/getSeverityStrategy';
|
|
21
22
|
import type {VDisksGroupByValue} from '../../utils/disks/groupBy';
|
|
@@ -170,8 +171,17 @@ function getExpertVDiskDisplayState({
|
|
|
170
171
|
vDisk,
|
|
171
172
|
vdisksGroupBy,
|
|
172
173
|
}: GetExpertVDiskDisplayStateParams): VDiskDisplayState {
|
|
174
|
+
const hasWhiteboardData = vDisk.HasWhiteboardData ?? Boolean(vDisk.VDiskId);
|
|
175
|
+
if (vdisksGroupBy === VDisksGroupBy.DriveType) {
|
|
176
|
+
return {
|
|
177
|
+
...getDriveTypeDisplayState(hasWhiteboardData ? vDisk.PDisk : undefined),
|
|
178
|
+
striped: false,
|
|
179
|
+
iconPlacement: 'inline',
|
|
180
|
+
};
|
|
181
|
+
}
|
|
182
|
+
|
|
173
183
|
const mode = getMode(vdisksGroupBy);
|
|
174
|
-
if (!
|
|
184
|
+
if (!hasWhiteboardData) {
|
|
175
185
|
return getMissingVDiskDisplayState(vDisk, isDonor, mode, selectionScope !== 'nodes-vdisks');
|
|
176
186
|
}
|
|
177
187
|
|
|
@@ -23,6 +23,7 @@ import {vDiskApi} from '../../store/reducers/vdisk/vdisk';
|
|
|
23
23
|
import {cn} from '../../utils/cn';
|
|
24
24
|
import {parseVdiskId} from '../../utils/dataFormatters/dataFormatters';
|
|
25
25
|
import {VDISK_LABEL_CONFIG} from '../../utils/disks/constants';
|
|
26
|
+
import {formatPDiskType} from '../../utils/disks/getPDiskType';
|
|
26
27
|
import {getDataSeverityColor} from '../../utils/disks/helpers';
|
|
27
28
|
import {useAutoRefreshInterval, useTypedDispatch} from '../../utils/hooks';
|
|
28
29
|
import {useAppTitle} from '../App/AppTitleContext';
|
|
@@ -122,7 +123,14 @@ export function VDiskPage() {
|
|
|
122
123
|
<PageMetaWithAutorefresh
|
|
123
124
|
className={vDiskPageCn('meta')}
|
|
124
125
|
loading={loading}
|
|
125
|
-
items={[
|
|
126
|
+
items={[
|
|
127
|
+
hostItem,
|
|
128
|
+
nodeIdItem,
|
|
129
|
+
NodeType,
|
|
130
|
+
NodeDC,
|
|
131
|
+
pDiskIdItem,
|
|
132
|
+
formatPDiskType(PDiskType),
|
|
133
|
+
]}
|
|
126
134
|
/>
|
|
127
135
|
);
|
|
128
136
|
};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type {SchemaPathParam} from '../../../types/api/common';
|
|
2
2
|
import type {TEvDescribeSchemeResult} from '../../../types/api/schema/schema';
|
|
3
|
+
import {reachObjectCreationGoal} from '../../../utils/objectCreationMetrics';
|
|
3
4
|
import {isQueryErrorResponse, parseQueryAPIResponse} from '../../../utils/query';
|
|
4
5
|
import {api} from '../api';
|
|
5
6
|
|
|
@@ -42,6 +43,8 @@ export const tableApi = api.injectEndpoints({
|
|
|
42
43
|
database: string;
|
|
43
44
|
formValues: TableFormValues;
|
|
44
45
|
}) => {
|
|
46
|
+
const objectType = formValues.type === 'row' ? 'row_table' : 'column_table';
|
|
47
|
+
reachObjectCreationGoal('createObject', objectType);
|
|
45
48
|
try {
|
|
46
49
|
const {
|
|
47
50
|
type,
|
|
@@ -79,12 +82,15 @@ export const tableApi = api.injectEndpoints({
|
|
|
79
82
|
});
|
|
80
83
|
|
|
81
84
|
if (isQueryErrorResponse(response)) {
|
|
85
|
+
reachObjectCreationGoal('createObjectError', objectType, response);
|
|
82
86
|
return {error: response};
|
|
83
87
|
}
|
|
84
88
|
|
|
85
89
|
const data = parseQueryAPIResponse(response);
|
|
90
|
+
reachObjectCreationGoal('createObjectSuccess', objectType);
|
|
86
91
|
return {data};
|
|
87
92
|
} catch (error) {
|
|
93
|
+
reachObjectCreationGoal('createObjectError', objectType, error);
|
|
88
94
|
return {error};
|
|
89
95
|
}
|
|
90
96
|
},
|
|
@@ -4,6 +4,7 @@ import {createSelector} from '@reduxjs/toolkit';
|
|
|
4
4
|
import type {IProtobufTimeObject} from '../../../types/api/common';
|
|
5
5
|
import type {TopicDataRequest} from '../../../types/api/topic';
|
|
6
6
|
import {convertBytesObjectToSpeed} from '../../../utils/bytesParsers';
|
|
7
|
+
import {reachObjectCreationGoal} from '../../../utils/objectCreationMetrics';
|
|
7
8
|
import {isQueryErrorResponse, parseQueryAPIResponse} from '../../../utils/query';
|
|
8
9
|
import {parseLag, parseTimestampToIdleTime} from '../../../utils/timeParsers';
|
|
9
10
|
import type {RootState} from '../../defaultStore';
|
|
@@ -82,6 +83,7 @@ export const topicApi = api.injectEndpoints({
|
|
|
82
83
|
database: string;
|
|
83
84
|
formData: TopicFormValues;
|
|
84
85
|
}) => {
|
|
86
|
+
reachObjectCreationGoal('createObject', 'topic');
|
|
85
87
|
try {
|
|
86
88
|
const query = buildCreateTopicQuery(formData);
|
|
87
89
|
|
|
@@ -92,11 +94,15 @@ export const topicApi = api.injectEndpoints({
|
|
|
92
94
|
});
|
|
93
95
|
|
|
94
96
|
if (isQueryErrorResponse(response)) {
|
|
97
|
+
reachObjectCreationGoal('createObjectError', 'topic', response);
|
|
95
98
|
return {error: response};
|
|
96
99
|
}
|
|
97
100
|
|
|
98
|
-
|
|
101
|
+
const data = parseQueryAPIResponse(response);
|
|
102
|
+
reachObjectCreationGoal('createObjectSuccess', 'topic');
|
|
103
|
+
return {data};
|
|
99
104
|
} catch (error) {
|
|
105
|
+
reachObjectCreationGoal('createObjectError', 'topic', error);
|
|
100
106
|
return {error};
|
|
101
107
|
}
|
|
102
108
|
},
|
package/src/uiFactory/types.ts
CHANGED
|
@@ -216,6 +216,12 @@ export type RenderHealthcheckAssistantAction = (
|
|
|
216
216
|
) => React.ReactNode;
|
|
217
217
|
|
|
218
218
|
export interface UiMetricaGoals {
|
|
219
|
+
/** Creation attempt after form validation. Params: objectType (row_table, column_table, topic). */
|
|
220
|
+
createObject?: string;
|
|
221
|
+
/** Successful creation response. Params: objectType. */
|
|
222
|
+
createObjectSuccess?: string;
|
|
223
|
+
/** Failed creation. Params: objectType, errorType (ydb, http, network, timeout, cancelled, unknown), httpStatus (HTTP errors only). */
|
|
224
|
+
createObjectError?: string;
|
|
219
225
|
runQuery?: string;
|
|
220
226
|
explainAnalyzeQuery?: string;
|
|
221
227
|
stopQuery?: string;
|
|
@@ -2,13 +2,14 @@ import type {IconData} from '@gravity-ui/uikit';
|
|
|
2
2
|
|
|
3
3
|
import {DATA_SEVERITY, DISK_COLOR_STATE_TO_NUMERIC_SEVERITY} from './constants';
|
|
4
4
|
import type {IconWithColor} from './iconCalculators';
|
|
5
|
-
import type {DisplaySeverity, PreparedPDisk, PreparedVDisk} from './types';
|
|
5
|
+
import type {DisplaySeverity, PDiskType, PreparedPDisk, PreparedVDisk} from './types';
|
|
6
6
|
|
|
7
7
|
export type DiskDisplayMode =
|
|
8
8
|
| 'state'
|
|
9
9
|
| 'space'
|
|
10
10
|
| 'frontQueues'
|
|
11
11
|
| 'compaction'
|
|
12
|
+
| 'driveType'
|
|
12
13
|
| 'all'
|
|
13
14
|
| 'drive'
|
|
14
15
|
| 'decommit'
|
|
@@ -42,6 +43,7 @@ export interface PDiskAllModeDisplayState {
|
|
|
42
43
|
}
|
|
43
44
|
|
|
44
45
|
export interface BaseDiskDisplayState {
|
|
46
|
+
driveType?: PDiskType;
|
|
45
47
|
severity: DisplaySeverity;
|
|
46
48
|
icon: DiskIndicatorValue | undefined;
|
|
47
49
|
mode: DiskDisplayMode | undefined;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import {CircleQuestionFill} from '@gravity-ui/icons';
|
|
2
|
+
|
|
3
|
+
import {NOT_AVAILABLE_SEVERITY} from './constants';
|
|
4
|
+
import type {BaseDiskDisplayState} from './displayState';
|
|
5
|
+
import {formatPDiskType} from './getPDiskType';
|
|
6
|
+
import type {PDiskType, PreparedPDisk} from './types';
|
|
7
|
+
|
|
8
|
+
export function getDriveTypeDisplayState(pDisk: PreparedPDisk = {}): BaseDiskDisplayState {
|
|
9
|
+
const hasWhiteboardData = pDisk.HasWhiteboardData ?? pDisk.WhiteboardSize !== undefined;
|
|
10
|
+
const isNoData = !hasWhiteboardData;
|
|
11
|
+
let driveType: PDiskType | undefined;
|
|
12
|
+
if (hasWhiteboardData) {
|
|
13
|
+
switch (pDisk.Type) {
|
|
14
|
+
case 'SSD':
|
|
15
|
+
case 'HDD':
|
|
16
|
+
case 'NVME':
|
|
17
|
+
driveType = pDisk.Type;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
return {
|
|
22
|
+
mode: 'driveType',
|
|
23
|
+
driveType,
|
|
24
|
+
severity: NOT_AVAILABLE_SEVERITY,
|
|
25
|
+
icon: isNoData ? undefined : (formatPDiskType(driveType) ?? CircleQuestionFill),
|
|
26
|
+
isNoData,
|
|
27
|
+
borderless: true,
|
|
28
|
+
showNoDataPlaceholder: isNoData,
|
|
29
|
+
};
|
|
30
|
+
}
|
|
@@ -5,9 +5,10 @@ import {EFlag} from '../../types/api/enums';
|
|
|
5
5
|
import {DONOR_COLOR, NOT_AVAILABLE_SEVERITY} from './constants';
|
|
6
6
|
import type {DiskIndicatorValue} from './displayState';
|
|
7
7
|
import {getDisplaySeverityColor} from './helpers';
|
|
8
|
-
import type {DiskBarTone} from './types';
|
|
8
|
+
import type {DiskBarTone, PDiskType} from './types';
|
|
9
9
|
|
|
10
10
|
interface GetDiskBarToneParams {
|
|
11
|
+
driveType?: PDiskType;
|
|
11
12
|
severity?: number;
|
|
12
13
|
isDonor?: boolean;
|
|
13
14
|
showIndicator?: boolean;
|
|
@@ -24,12 +25,17 @@ function hasMissingDataIndicator(indicator: DiskIndicatorValue | undefined) {
|
|
|
24
25
|
}
|
|
25
26
|
|
|
26
27
|
export function getDiskBarTone({
|
|
28
|
+
driveType,
|
|
27
29
|
severity,
|
|
28
30
|
isDonor,
|
|
29
31
|
showIndicator,
|
|
30
32
|
indicator,
|
|
31
33
|
isNoData,
|
|
32
34
|
}: GetDiskBarToneParams): DiskBarTone {
|
|
35
|
+
if (driveType) {
|
|
36
|
+
return driveType;
|
|
37
|
+
}
|
|
38
|
+
|
|
33
39
|
if (isDonor) {
|
|
34
40
|
return DONOR_COLOR;
|
|
35
41
|
}
|
|
@@ -32,6 +32,10 @@ export const PDISK_TYPES = {
|
|
|
32
32
|
MVME: 'NVME',
|
|
33
33
|
} as const;
|
|
34
34
|
|
|
35
|
+
export function formatPDiskType(type?: string) {
|
|
36
|
+
return type === 'NVME' ? 'NVMe' : type;
|
|
37
|
+
}
|
|
38
|
+
|
|
35
39
|
// Bear with me.
|
|
36
40
|
// Disk type is determined by the field Category.
|
|
37
41
|
// Category is a bit field defined as follows:
|
|
@@ -165,7 +165,7 @@ function getFlagIconWithColor(flag: EFlag | undefined): IconWithColor | undefine
|
|
|
165
165
|
if (!flag || flag === EFlag.Grey) {
|
|
166
166
|
return {
|
|
167
167
|
icon: CircleQuestionFill,
|
|
168
|
-
color: '
|
|
168
|
+
color: 'var(--g-color-text-hint)',
|
|
169
169
|
};
|
|
170
170
|
}
|
|
171
171
|
|
|
@@ -230,7 +230,7 @@ export function calculateFlagPairIcon(
|
|
|
230
230
|
* - Yellow: TriangleExclamationFill (text-warning)
|
|
231
231
|
* - Orange: CircleExclamationFill (text-danger)
|
|
232
232
|
* - Red: CircleXmarkFill (text-primary)
|
|
233
|
-
* - Missing: CircleQuestionFill (
|
|
233
|
+
* - Missing: CircleQuestionFill (text-hint)
|
|
234
234
|
*/
|
|
235
235
|
export function calculateCompactionIcon(
|
|
236
236
|
vDisk: PreparedVDisk,
|
package/src/utils/disks/types.ts
CHANGED
|
@@ -25,7 +25,7 @@ export type ExtendedDiskColor =
|
|
|
25
25
|
*/
|
|
26
26
|
export type DiskColor = EFlag | ExtendedDiskColor;
|
|
27
27
|
|
|
28
|
-
export type DiskBarTone = DiskColor | 'DarkGrey' | 'LightGrey';
|
|
28
|
+
export type DiskBarTone = DiskColor | 'DarkGrey' | 'LightGrey' | PDiskType;
|
|
29
29
|
|
|
30
30
|
/**
|
|
31
31
|
* Basic severity levels for data storage (0-5).
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import {isQueryCancelledError, isQueryErrorResponse} from './query';
|
|
2
|
+
import {isNetworkError, isResponseError} from './response';
|
|
3
|
+
import {reachMetricaGoal} from './yaMetrica';
|
|
4
|
+
|
|
5
|
+
type ObjectType = 'row_table' | 'column_table' | 'topic';
|
|
6
|
+
type CreationGoal = 'createObject' | 'createObjectSuccess' | 'createObjectError';
|
|
7
|
+
|
|
8
|
+
export function getObjectCreationErrorParams(error: unknown): Record<string, string | number> {
|
|
9
|
+
if (isQueryCancelledError(error)) {
|
|
10
|
+
return {errorType: 'cancelled'};
|
|
11
|
+
}
|
|
12
|
+
if (isResponseError(error)) {
|
|
13
|
+
if (typeof error.status === 'number' && error.status > 0) {
|
|
14
|
+
return {errorType: 'http', httpStatus: error.status};
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
if (isQueryErrorResponse(error)) {
|
|
18
|
+
return {errorType: 'ydb'};
|
|
19
|
+
}
|
|
20
|
+
if (isNetworkError(error)) {
|
|
21
|
+
return {errorType: 'network'};
|
|
22
|
+
}
|
|
23
|
+
if (
|
|
24
|
+
error &&
|
|
25
|
+
typeof error === 'object' &&
|
|
26
|
+
'code' in error &&
|
|
27
|
+
(error.code === 'ECONNABORTED' || error.code === 'ETIMEDOUT')
|
|
28
|
+
) {
|
|
29
|
+
return {errorType: 'timeout'};
|
|
30
|
+
}
|
|
31
|
+
return {errorType: 'unknown'};
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export function reachObjectCreationGoal(
|
|
35
|
+
goal: CreationGoal,
|
|
36
|
+
objectType: ObjectType,
|
|
37
|
+
error?: unknown,
|
|
38
|
+
) {
|
|
39
|
+
try {
|
|
40
|
+
reachMetricaGoal(goal, {
|
|
41
|
+
objectType,
|
|
42
|
+
...(goal === 'createObjectError' ? getObjectCreationErrorParams(error) : {}),
|
|
43
|
+
});
|
|
44
|
+
} catch {
|
|
45
|
+
// Analytics failures must not affect the creation request or its result.
|
|
46
|
+
}
|
|
47
|
+
}
|