Skip to content

Commit 9a0b867

Browse files
fix: add Blue status to EFlag (#754)
1 parent 6d8a0ba commit 9a0b867

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

src/store/reducers/storage/utils.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,11 @@ import type {PreparedStorageGroup, PreparedStorageNode, PreparedStorageResponse}
1616

1717
// ==== Constants ====
1818

19-
const FLAGS_POINTS = {
19+
// Do not count Grey and Blue statuses in used space severity calculations
20+
const FLAGS_POINTS: Record<EFlag, number> = {
21+
[EFlag.Grey]: 0,
22+
[EFlag.Blue]: 0,
23+
2024
[EFlag.Green]: 1,
2125
[EFlag.Yellow]: 100,
2226
[EFlag.Orange]: 10_000,
@@ -74,7 +78,7 @@ const prepareStorageGroupData = (
7478
missing += 1;
7579
}
7680

77-
if (DiskSpace && DiskSpace !== EFlag.Grey) {
81+
if (DiskSpace) {
7882
usedSpaceFlag += FLAGS_POINTS[DiskSpace];
7983
}
8084

src/types/api/enums.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
export enum EFlag {
55
Grey = 'Grey',
66
Green = 'Green',
7+
Blue = 'Blue',
78
Yellow = 'Yellow',
89
Orange = 'Orange',
910
Red = 'Red',

src/utils/disks/constants.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import {TPDiskState} from '../../types/api/pdisk';
33
import {EVDiskState} from '../../types/api/vdisk';
44

55
// state to numbers to allow ordinal comparison
6-
export const DISK_COLOR_STATE_TO_NUMERIC_SEVERITY: Record<EFlag | 'Blue', number> = {
6+
export const DISK_COLOR_STATE_TO_NUMERIC_SEVERITY: Record<EFlag, number> = {
77
Grey: 0,
88
Green: 1,
99
Blue: 2,

0 commit comments

Comments
 (0)