From 306ca7c4f90755f44bfa76e147b7b910102e9e58 Mon Sep 17 00:00:00 2001 From: Josue Date: Thu, 25 Mar 2021 16:15:28 -0400 Subject: [PATCH] refactor: create Node type as subtype of Anvil --- striker-ui/types/AnvilListItem.d.ts | 4 ++-- striker-ui/types/AnvilListItemNode.d.ts | 4 ++++ striker-ui/types/AnvilStatus.d.ts | 4 +--- striker-ui/types/AnvilStatusNode.d.ts | 5 +++++ 4 files changed, 12 insertions(+), 5 deletions(-) create mode 100644 striker-ui/types/AnvilListItemNode.d.ts create mode 100644 striker-ui/types/AnvilStatusNode.d.ts diff --git a/striker-ui/types/AnvilListItem.d.ts b/striker-ui/types/AnvilListItem.d.ts index cf56bcb8..82e8ec8d 100644 --- a/striker-ui/types/AnvilListItem.d.ts +++ b/striker-ui/types/AnvilListItem.d.ts @@ -1,8 +1,8 @@ declare type AnvilListItem = { anvil_name: string; anvil_uuid: string; + anvil_state: string; nodes: Array<{ - node_name: string; - node_uuid: string; + AnvilListItemNode; }>; }; diff --git a/striker-ui/types/AnvilListItemNode.d.ts b/striker-ui/types/AnvilListItemNode.d.ts new file mode 100644 index 00000000..b396cd1f --- /dev/null +++ b/striker-ui/types/AnvilListItemNode.d.ts @@ -0,0 +1,4 @@ +declare type AnvilListItemNode = { + node_name: string; + node_uuid: string; +}; diff --git a/striker-ui/types/AnvilStatus.d.ts b/striker-ui/types/AnvilStatus.d.ts index 1f4ebff8..4914f77b 100644 --- a/striker-ui/types/AnvilStatus.d.ts +++ b/striker-ui/types/AnvilStatus.d.ts @@ -1,8 +1,6 @@ declare type AnvilStatus = { anvil_state: 'optimal' | 'not_ready' | 'degraded'; nodes: Array<{ - state: 'unknown' | 'off' | 'on' | 'accessible' | 'ready'; - state_percent: number; - state_message: string; + AnvilStatusNode; }>; }; diff --git a/striker-ui/types/AnvilStatusNode.d.ts b/striker-ui/types/AnvilStatusNode.d.ts new file mode 100644 index 00000000..e5aa984b --- /dev/null +++ b/striker-ui/types/AnvilStatusNode.d.ts @@ -0,0 +1,5 @@ +declare type AnvilStatusNode = { + state: 'unknown' | 'off' | 'on' | 'accessible' | 'ready'; + state_percent: number; + state_message: string; +};