diff --git a/packages/gridproxy_client/src/builders/gateways.ts b/packages/gridproxy_client/src/builders/gateways.ts index 0672c70755..971aca9356 100644 --- a/packages/gridproxy_client/src/builders/gateways.ts +++ b/packages/gridproxy_client/src/builders/gateways.ts @@ -7,6 +7,13 @@ export enum NodeStatus { Standby = "standby", } +export enum UnifiedNodeStatus { + Up = "up", + Down = "down", + Standby = "standby", + UpStandby = "up,standby", +} + export interface GatewaysQuery { page: number; size: number; diff --git a/packages/gridproxy_client/src/builders/nodes.ts b/packages/gridproxy_client/src/builders/nodes.ts index 35776811c7..0e5585fda7 100644 --- a/packages/gridproxy_client/src/builders/nodes.ts +++ b/packages/gridproxy_client/src/builders/nodes.ts @@ -1,6 +1,6 @@ import { assertBoolean, assertId, assertIn, assertInt, assertNatural, assertPattern, assertString } from "../utils"; import { AbstractBuilder, BuilderMapper, BuilderMethods, BuilderValidator } from "./abstract_builder"; -import { ID_PATTERN, NodeStatus } from "./gateways"; +import { ID_PATTERN, UnifiedNodeStatus } from "./gateways"; export enum SortBy { NodeId = "node_id", @@ -47,7 +47,7 @@ export interface NodesQuery { totalSru: number; totalHru: number; freeIps: number; - status: NodeStatus; + status: UnifiedNodeStatus; city: string; country: string; region: string; @@ -129,7 +129,12 @@ const NODES_VALIDATOR: BuilderValidator = { freeGpu: assertNatural, freeIps: assertNatural, status(value) { - assertIn(value, [NodeStatus.Up, NodeStatus.Down, NodeStatus.Standby]); + assertIn(value, [ + UnifiedNodeStatus.Up, + UnifiedNodeStatus.Down, + UnifiedNodeStatus.Standby, + UnifiedNodeStatus.UpStandby, + ]); }, city: assertString, country: assertString, diff --git a/packages/playground/src/views/nodes.vue b/packages/playground/src/views/nodes.vue index 880a13ed14..6a46b9321b 100644 --- a/packages/playground/src/views/nodes.vue +++ b/packages/playground/src/views/nodes.vue @@ -43,9 +43,10 @@ :model-value="filters.status || undefined" @update:model-value="filters.status = $event || ''" :items="[ - { title: 'Up', value: NodeStatus.Up }, - { title: 'Down', value: NodeStatus.Down }, - { title: 'Standby', value: NodeStatus.Standby }, + { title: 'Up', value: UnifiedNodeStatus.Up }, + { title: 'Standby', value: UnifiedNodeStatus.Standby }, + { title: 'Up & Standby', value: UnifiedNodeStatus.UpStandby }, + { title: 'Down', value: UnifiedNodeStatus.Down }, ]" label="Select Nodes Status" item-title="title" @@ -443,7 +444,7 @@