Skip to content

Commit

Permalink
fix: add Blue status to EFlag (#754)
Browse files Browse the repository at this point in the history
  • Loading branch information
artemmufazalov authored Mar 12, 2024
1 parent 6d8a0ba commit 9a0b867
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
8 changes: 6 additions & 2 deletions src/store/reducers/storage/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,11 @@ import type {PreparedStorageGroup, PreparedStorageNode, PreparedStorageResponse}

// ==== Constants ====

const FLAGS_POINTS = {
// Do not count Grey and Blue statuses in used space severity calculations
const FLAGS_POINTS: Record<EFlag, number> = {
[EFlag.Grey]: 0,
[EFlag.Blue]: 0,

[EFlag.Green]: 1,
[EFlag.Yellow]: 100,
[EFlag.Orange]: 10_000,
Expand Down Expand Up @@ -74,7 +78,7 @@ const prepareStorageGroupData = (
missing += 1;
}

if (DiskSpace && DiskSpace !== EFlag.Grey) {
if (DiskSpace) {
usedSpaceFlag += FLAGS_POINTS[DiskSpace];
}

Expand Down
1 change: 1 addition & 0 deletions src/types/api/enums.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
export enum EFlag {
Grey = 'Grey',
Green = 'Green',
Blue = 'Blue',
Yellow = 'Yellow',
Orange = 'Orange',
Red = 'Red',
Expand Down
2 changes: 1 addition & 1 deletion src/utils/disks/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {TPDiskState} from '../../types/api/pdisk';
import {EVDiskState} from '../../types/api/vdisk';

// state to numbers to allow ordinal comparison
export const DISK_COLOR_STATE_TO_NUMERIC_SEVERITY: Record<EFlag | 'Blue', number> = {
export const DISK_COLOR_STATE_TO_NUMERIC_SEVERITY: Record<EFlag, number> = {
Grey: 0,
Green: 1,
Blue: 2,
Expand Down

0 comments on commit 9a0b867

Please sign in to comment.