From c0c7999005888a28de0e0b5914e4553abd46ce11 Mon Sep 17 00:00:00 2001 From: Dmitriy Koltsov <dkoltsov@picodata.io> Date: Thu, 11 Jul 2024 20:53:24 +0300 Subject: [PATCH] fix(webui): use state instead of grade --- .../nodesPage/ClusterInfo/ClusterInfo.tsx | 8 ++--- .../ReplicasetCard/ReplicasetCard.module.scss | 4 +-- .../ReplicasetCard/ReplicasetCard.tsx | 10 +++--- .../instanceBlock/InstanceCard.module.scss | 8 ++--- .../instanceBlock/InstanceCard.tsx | 16 +++++----- webui/src/shared/entity/cluster/info/mock.ts | 4 +-- webui/src/shared/entity/cluster/info/types.ts | 4 +-- .../shared/entity/instance/common/types.ts | 4 +-- .../shared/entity/replicaset/common/types.ts | 2 +- webui/src/shared/entity/tier/list/mock.ts | 32 +++++++++---------- .../intl/translations/en/pages/instances.ts | 16 +++++----- .../intl/translations/ru/pages/instances.ts | 16 +++++----- 12 files changed, 62 insertions(+), 62 deletions(-) diff --git a/webui/src/modules/nodes/nodesPage/ClusterInfo/ClusterInfo.tsx b/webui/src/modules/nodes/nodesPage/ClusterInfo/ClusterInfo.tsx index 3d1c4170d3..35eb26caf7 100644 --- a/webui/src/modules/nodes/nodesPage/ClusterInfo/ClusterInfo.tsx +++ b/webui/src/modules/nodes/nodesPage/ClusterInfo/ClusterInfo.tsx @@ -61,18 +61,18 @@ export const ClusterInfo = (props: ClusterInfoProps) => { <div className={styles.instancesBlock}> <div className={styles.columnContent}> <div className={styles.columnValue}> - {clusterInfoData.instancesCurrentGradeOnline} + {clusterInfoData.instancesCurrentStateOnline} </div> <div className={styles.columnLabel}> - {clusterTranslations.instances.onlineGrade} + {clusterTranslations.instances.onlineState} </div> </div> <div className={styles.columnContent}> <div className={styles.columnValue}> - {clusterInfoData.instancesCurrentGradeOffline} + {clusterInfoData.instancesCurrentStateOffline} </div> <div className={styles.columnLabel}> - {clusterTranslations.instances.offlineGrade} + {clusterTranslations.instances.offlineState} </div> </div> </div> diff --git a/webui/src/modules/nodes/nodesPage/NodesContent/ReplicasetCard/ReplicasetCard.module.scss b/webui/src/modules/nodes/nodesPage/NodesContent/ReplicasetCard/ReplicasetCard.module.scss index d3f5f3d8dd..872c4c8f9b 100644 --- a/webui/src/modules/nodes/nodesPage/NodesContent/ReplicasetCard/ReplicasetCard.module.scss +++ b/webui/src/modules/nodes/nodesPage/NodesContent/ReplicasetCard/ReplicasetCard.module.scss @@ -41,7 +41,7 @@ $column-item-horizontal-padding: 8px; flex: 1 326px; } -.gradeColumn { +.stateColumn { flex: 1 135px; } @@ -80,7 +80,7 @@ $column-item-horizontal-padding: 8px; @include ellipsis; } -.gradeValue { +.stateValue { padding: 0; } diff --git a/webui/src/modules/nodes/nodesPage/NodesContent/ReplicasetCard/ReplicasetCard.tsx b/webui/src/modules/nodes/nodesPage/NodesContent/ReplicasetCard/ReplicasetCard.tsx index 50ff31ae55..67e5293a2e 100644 --- a/webui/src/modules/nodes/nodesPage/NodesContent/ReplicasetCard/ReplicasetCard.tsx +++ b/webui/src/modules/nodes/nodesPage/NodesContent/ReplicasetCard/ReplicasetCard.tsx @@ -19,7 +19,7 @@ export type TReplicaset = { instanceCount: number; instances: InstanceType[]; version: string; - grade: "Online" | "Offline"; + state: "Online" | "Offline"; capacityUsage: number; memory: { usable: number; @@ -68,12 +68,12 @@ export const ReplicasetCard: FC<ReplicasetCardProps> = React.memo( </div> <div className={styles.infoValue}>{replicaset.instanceCount}</div> </div> - <div className={cn(styles.infoColumn, styles.gradeColumn)}> + <div className={cn(styles.infoColumn, styles.stateColumn)}> <div className={styles.label}> - {replicasetTranslations.grade.label} + {replicasetTranslations.state.label} </div> - <div className={cn(styles.infoValue, styles.gradeValue)}> - <NetworkState state={replicaset.grade} /> + <div className={cn(styles.infoValue, styles.stateValue)}> + <NetworkState state={replicaset.state} /> </div> </div> <div className={cn(styles.infoColumn, styles.capacityColumn)}> diff --git a/webui/src/modules/nodes/nodesPage/NodesContent/ReplicasetCard/instanceBlock/InstanceCard.module.scss b/webui/src/modules/nodes/nodesPage/NodesContent/ReplicasetCard/instanceBlock/InstanceCard.module.scss index 9391194d12..3b707e3d07 100644 --- a/webui/src/modules/nodes/nodesPage/NodesContent/ReplicasetCard/instanceBlock/InstanceCard.module.scss +++ b/webui/src/modules/nodes/nodesPage/NodesContent/ReplicasetCard/instanceBlock/InstanceCard.module.scss @@ -42,11 +42,11 @@ $leader-height: 16px; overflow: hidden; } -.targetGradeColumn { +.targetStateColumn { flex: 1 118px; } -.currentGradeColumn { +.currentStateColumn { flex: 1 118px; } @@ -99,11 +99,11 @@ $leader-height: 16px; justify-content: center; } -.targetGradeValue { +.targetStateValue { padding: 0; } -.currentGradeValue { +.currentStateValue { padding: 0; } diff --git a/webui/src/modules/nodes/nodesPage/NodesContent/ReplicasetCard/instanceBlock/InstanceCard.tsx b/webui/src/modules/nodes/nodesPage/NodesContent/ReplicasetCard/instanceBlock/InstanceCard.tsx index 9babf21482..d5d871f516 100644 --- a/webui/src/modules/nodes/nodesPage/NodesContent/ReplicasetCard/instanceBlock/InstanceCard.tsx +++ b/webui/src/modules/nodes/nodesPage/NodesContent/ReplicasetCard/instanceBlock/InstanceCard.tsx @@ -76,20 +76,20 @@ export const InstanceCard: FC<InstanceCardProps> = React.memo( <FailureDomainLabel failureDomain={instance.failureDomain} /> </div> </div> - <div className={cn(styles.infoColumn, styles.targetGradeColumn)}> + <div className={cn(styles.infoColumn, styles.targetStateColumn)}> <div className={styles.label}> - {instanceTranslations.targetGrade.label} + {instanceTranslations.targetState.label} </div> - <div className={cn(styles.value, styles.targetGradeValue)}> - <NetworkState state={instance.targetGrade} /> + <div className={cn(styles.value, styles.targetStateValue)}> + <NetworkState state={instance.targetState} /> </div> </div> - <div className={cn(styles.infoColumn, styles.currentGradeColumn)}> + <div className={cn(styles.infoColumn, styles.currentStateColumn)}> <div className={styles.label}> - {instanceTranslations.currentGrade.label} + {instanceTranslations.currentState.label} </div> - <div className={cn(styles.value, styles.currentGradeValue)}> - <NetworkState state={instance.currentGrade} /> + <div className={cn(styles.value, styles.currentStateValue)}> + <NetworkState state={instance.currentState} /> </div> </div> <div className={cn(styles.infoColumn, styles.binaryAddressColumn)}> diff --git a/webui/src/shared/entity/cluster/info/mock.ts b/webui/src/shared/entity/cluster/info/mock.ts index bc4ee9f675..9c649481c3 100644 --- a/webui/src/shared/entity/cluster/info/mock.ts +++ b/webui/src/shared/entity/cluster/info/mock.ts @@ -5,7 +5,7 @@ export const mock = { usable: 80, }, replicasetsCount: 4, - instancesCurrentGradeOnline: 3, - instancesCurrentGradeOffline: 2, + instancesCurrentStateOnline: 3, + instancesCurrentStateOffline: 2, currentInstaceVersion: "123", }; diff --git a/webui/src/shared/entity/cluster/info/types.ts b/webui/src/shared/entity/cluster/info/types.ts index 78f68711d9..4e51e2c7d9 100644 --- a/webui/src/shared/entity/cluster/info/types.ts +++ b/webui/src/shared/entity/cluster/info/types.ts @@ -5,8 +5,8 @@ export type ServerClusterInfoType = { usable: number; }; replicasetsCount: number; - instancesCurrentGradeOnline: number; - instancesCurrentGradeOffline: number; + instancesCurrentStateOnline: number; + instancesCurrentStateOffline: number; currentInstaceVersion: string; }; diff --git a/webui/src/shared/entity/instance/common/types.ts b/webui/src/shared/entity/instance/common/types.ts index 3ad93e7003..02e281faa7 100644 --- a/webui/src/shared/entity/instance/common/types.ts +++ b/webui/src/shared/entity/instance/common/types.ts @@ -2,8 +2,8 @@ import { Override } from "../../../utils/tsUtils"; export type ServerInstanceType = { name: string; - targetGrade: "Online" | "Offline"; - currentGrade: "Online" | "Offline"; + targetState: "Online" | "Offline"; + currentState: "Online" | "Offline"; failureDomain: Record<string, string>; version: string; isLeader: boolean; diff --git a/webui/src/shared/entity/replicaset/common/types.ts b/webui/src/shared/entity/replicaset/common/types.ts index a796490496..c330a4f948 100644 --- a/webui/src/shared/entity/replicaset/common/types.ts +++ b/webui/src/shared/entity/replicaset/common/types.ts @@ -6,7 +6,7 @@ export type ServerReplicasetType = { instanceCount: number; instances: ServerInstanceType[]; version: string; - grade: "Online" | "Offline"; + state: "Online" | "Offline" | "Replicated" | "Expelled"; capacityUsage: number; memory: { usable: number; diff --git a/webui/src/shared/entity/tier/list/mock.ts b/webui/src/shared/entity/tier/list/mock.ts index f296354d8a..df61a02c96 100644 --- a/webui/src/shared/entity/tier/list/mock.ts +++ b/webui/src/shared/entity/tier/list/mock.ts @@ -5,7 +5,7 @@ export const mock: ServerTiersListType = [ replicasets: [ { version: "??.??", - grade: "Online", + state: "Online", instanceCount: 2, capacityUsage: 100, instances: [ @@ -16,8 +16,8 @@ export const mock: ServerTiersListType = [ DC: "1", }, isLeader: true, - currentGrade: "Online", - targetGrade: "Online", + currentState: "Online", + targetState: "Online", name: "i2", binaryAddress: "127.0.0.1:3402", }, @@ -28,8 +28,8 @@ export const mock: ServerTiersListType = [ DC: "2", }, isLeader: false, - currentGrade: "Online", - targetGrade: "Online", + currentState: "Online", + targetState: "Online", name: "i4", binaryAddress: "127.0.0.1:3403", }, @@ -42,7 +42,7 @@ export const mock: ServerTiersListType = [ }, { version: "??.??", - grade: "Online", + state: "Online", instanceCount: 2, capacityUsage: 100, instances: [ @@ -54,8 +54,8 @@ export const mock: ServerTiersListType = [ DC: "1", }, isLeader: false, - currentGrade: "Online", - targetGrade: "Online", + currentState: "Online", + targetState: "Online", name: "i1", binaryAddress: "127.0.0.1:3401", }, @@ -66,8 +66,8 @@ export const mock: ServerTiersListType = [ DC: "2", }, isLeader: true, - currentGrade: "Online", - targetGrade: "Online", + currentState: "Online", + targetState: "Online", name: "i5", binaryAddress: "127.0.0.1:3404", }, @@ -90,7 +90,7 @@ export const mock: ServerTiersListType = [ replicasets: [ { version: "??.??", - grade: "Online", + state: "Online", instanceCount: 1, capacityUsage: 100, instances: [ @@ -101,8 +101,8 @@ export const mock: ServerTiersListType = [ DC: "2", }, isLeader: true, - currentGrade: "Online", - targetGrade: "Online", + currentState: "Online", + targetState: "Online", name: "i6", binaryAddress: "127.0.0.1:3406", }, @@ -115,7 +115,7 @@ export const mock: ServerTiersListType = [ }, { version: "??.??", - grade: "Online", + state: "Online", instanceCount: 1, capacityUsage: 100, instances: [ @@ -126,8 +126,8 @@ export const mock: ServerTiersListType = [ DC: "1", }, isLeader: true, - currentGrade: "Online", - targetGrade: "Online", + currentState: "Online", + targetState: "Online", name: "i3", binaryAddress: "127.0.0.1:3405", }, diff --git a/webui/src/shared/intl/translations/en/pages/instances.ts b/webui/src/shared/intl/translations/en/pages/instances.ts index c9435d9274..daf322fad1 100644 --- a/webui/src/shared/intl/translations/en/pages/instances.ts +++ b/webui/src/shared/intl/translations/en/pages/instances.ts @@ -10,8 +10,8 @@ export const instances = { }, instances: { label: "Instances", - onlineGrade: "current grade online", - offlineGrade: "current grade offline", + onlineState: "current state online", + offlineState: "current state offline", }, version: { label: "Version", @@ -80,8 +80,8 @@ export const instances = { instances: { label: "Instances", }, - grade: { - label: "Grade", + state: { + label: "State", }, }, instanceCard: { @@ -94,11 +94,11 @@ export const instances = { failureDomain: { label: "Failure domain", }, - targetGrade: { - label: "Target grade", + targetState: { + label: "Target state", }, - currentGrade: { - label: "Current grade", + currentState: { + label: "Current state", }, binaryAddress: { label: "Binary address", diff --git a/webui/src/shared/intl/translations/ru/pages/instances.ts b/webui/src/shared/intl/translations/ru/pages/instances.ts index 7f261e6feb..a70b532352 100644 --- a/webui/src/shared/intl/translations/ru/pages/instances.ts +++ b/webui/src/shared/intl/translations/ru/pages/instances.ts @@ -12,8 +12,8 @@ export const instances: TPages["instances"] = { }, instances: { label: "ИнÑтанÑÑ‹", - onlineGrade: "онлайн", - offlineGrade: "оффлайн", + onlineState: "онлайн", + offlineState: "оффлайн", }, version: { label: "ВерÑиÑ", @@ -82,8 +82,8 @@ export const instances: TPages["instances"] = { instances: { label: "ИнÑтанÑÑ‹", }, - grade: { - label: "Грейд", + state: { + label: "СоÑтоÑние лидера", }, }, instanceCard: { @@ -96,11 +96,11 @@ export const instances: TPages["instances"] = { failureDomain: { label: "Домен отказа", }, - targetGrade: { - label: "Целевой грейд", + targetState: { + label: "Целевое ÑоÑтоÑние", }, - currentGrade: { - label: "Текущий грейд", + currentState: { + label: "Текущие ÑоÑтоÑние", }, binaryAddress: { label: "RPC адреÑ", -- GitLab