Skip to content

Commit

Permalink
fix(frontend): redis集群容量、分片和类型变更容灾要求参数异常修复 TencentBlueKing#8138
Browse files Browse the repository at this point in the history
  • Loading branch information
jinquantianxia committed Nov 25, 2024
1 parent 14e13b7 commit 73550d1
Show file tree
Hide file tree
Showing 12 changed files with 23 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ export async function generateRedisClusterShardUpdateCloneData(
groupNum: currentClusterInfo.machine_pair_cnt,
currentSpecId: currentClusterInfo.cluster_spec.spec_id,
dbVersion: item.db_version,
disasterToleranceLevel: currentClusterInfo.disaster_tolerance_level,
specConfig: {
cpu: currentClusterInfo.cluster_spec.cpu,
id: currentClusterInfo.cluster_spec.spec_id,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ export async function generateRedisClusterTypeUpdateCloneData(ticketData: Ticket
groupNum: currentClusterInfo.machine_pair_cnt,
clusterTypeName: currentClusterInfo.cluster_type_name,
currentSpecId: currentClusterInfo.cluster_spec.spec_id,
disasterToleranceLevel: currentClusterInfo.disaster_tolerance_level,
dbVersion: item.db_version,
specConfig: {
cpu: currentClusterInfo.cluster_spec.cpu,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ export async function generateRedisScaleUpdownCloneData(ticketData: TicketModel<
bkCloudId: item.bk_cloud_id,
clusterTypeName: clusterListMap[item.cluster_id].cluster_type_name,
clusterStats: clusterListMap[item.cluster_id].cluster_stats,
disasterToleranceLevel: clusterListMap[item.cluster_id].disaster_tolerance_level,
shardNum: clusterListMap[item.cluster_id].cluster_shard_num,
groupNum: clusterListMap[item.cluster_id].machine_pair_cnt,
version: item.db_version,
Expand Down
2 changes: 2 additions & 0 deletions dbm-ui/frontend/src/services/model/redis/redis.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ export default class Redis {
creator: string;
db_module_id: number;
db_module_name: string;
disaster_tolerance_level: string;
dns_to_clb: boolean;
id: number;
machine_pair_cnt: number;
Expand Down Expand Up @@ -115,6 +116,7 @@ export default class Redis {
this.creator = payload.creator;
this.db_module_id = payload.db_module_id;
this.db_module_name = payload.db_module_name;
this.disaster_tolerance_level = payload.disaster_tolerance_level || '';
this.dns_to_clb = payload.dns_to_clb;
this.id = payload.id;
this.machine_pair_cnt = payload.machine_pair_cnt;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@
bkCloudId: data.bk_cloud_id,
clusterTypeName: data.cluster_type_name,
clusterStats: data.cluster_stats,
disasterToleranceLevel: data.disaster_tolerance_level,
shardNum: data.cluster_shard_num,
groupNum: data.machine_pair_cnt,
machineCount: data.redis_master.length,
Expand Down Expand Up @@ -223,7 +224,6 @@
infos,
},
};
await createTicket(params).then((data) => {
window.changeConfirm = false;
router.push({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@
<span
v-else
style="color: #c4c6cc">
{{ t('--') }}
--
</span>
</div>
</div>
Expand All @@ -110,7 +110,7 @@
<span
v-else
style="color: #c4c6cc">
{{ t('--') }}
--
</span>
</div>
</div>
Expand All @@ -135,7 +135,7 @@
<span
v-else
style="color: #c4c6cc">
{{ t('--') }}
--
</span>
</div>
</div>
Expand All @@ -160,7 +160,7 @@
<span
v-else
style="color: #c4c6cc">
{{ t('--') }}
--
</span>
</div>
</div>
Expand All @@ -176,7 +176,7 @@
<span
v-else
style="color: #c4c6cc">
{{ t('--') }}
--
</span>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@
backend_group: {
spec_id: localValue.spec_id,
count: targetObj.value!.requireMachineGroupNum, // 机器实际需要申请的组数
affinity: AffinityType.CROS_SUBZONE, // 暂时固定 'CROS_SUBZONE',
affinity: props.rowData?.disasterToleranceLevel || AffinityType.CROS_SUBZONE, // 暂时固定 'CROS_SUBZONE',
},
},
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@
bkCloudId: number;
clusterTypeName: string;
clusterStats: RedisModel['cluster_stats'];
disasterToleranceLevel: string;
shardNum?: number;
groupNum?: number;
currentSepc?: string;
Expand Down Expand Up @@ -134,6 +135,7 @@
bkCloudId: 0,
clusterTypeName: '',
clusterStats: {} as IDataRow['clusterStats'],
disasterToleranceLevel: '',
});
interface Props {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,7 @@
clusterTypeName: item.cluster_type_name,
currentSpecId: item.cluster_spec.spec_id,
dbVersion: item.major_version,
disasterToleranceLevel: item.disaster_tolerance_level,
specConfig: {
cpu: item.cluster_spec.cpu,
id: item.cluster_spec.spec_id,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@
currentSpecId: number;
clusterTypeName: string;
dbVersion: string;
disasterToleranceLevel: string;
specConfig: {
cpu: {
max: number;
Expand Down Expand Up @@ -157,6 +158,7 @@
groupNum: 0,
currentSpecId: 0,
dbVersion: '',
disasterToleranceLevel: '',
specConfig: {
cpu: {
max: 0,
Expand Down Expand Up @@ -254,12 +256,12 @@
proxy: {
spec_id: props.data.proxy.id,
count: props.data.proxy.count,
affinity: AffinityType.CROS_SUBZONE,
affinity: props.data.disasterToleranceLevel || AffinityType.CROS_SUBZONE,
},
backend_group: {
spec_id: deployData.spec_id,
count: deployData.count, // 机器组数
affinity: AffinityType.CROS_SUBZONE, // 暂时固定 'CROS_SUBZONE',
affinity: props.data.disasterToleranceLevel || AffinityType.CROS_SUBZONE, // 暂时固定 'CROS_SUBZONE',
},
},
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,6 @@
type: TicketTypes.REDIS_CLUSTER_TYPE_UPDATE,
onSuccess(cloneData) {
const { tableList, type, frequency } = cloneData;
tableData.value = tableList;
repairAndVerifyType.value = type;
repairAndVerifyFrequency.value = frequency;
Expand Down Expand Up @@ -258,6 +257,7 @@
clusterType: item.cluster_type,
machineType: item.cluster_spec.spec_machine_type,
currentShardNum: item.cluster_shard_num,
disasterToleranceLevel: item.disaster_tolerance_level,
groupNum: item.machine_pair_cnt,
dbVersion: item.major_version,
specConfig: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@
currentShardNum: number;
groupNum: number;
clusterTypeName: string;
disasterToleranceLevel: string;
specConfig: {
cpu: {
max: number;
Expand Down Expand Up @@ -181,6 +182,7 @@
groupNum: 0,
clusterTypeName: '',
currentSepc: '',
disasterToleranceLevel: '',
specConfig: {
cpu: {
max: 0,
Expand Down Expand Up @@ -313,7 +315,7 @@
backend_group: {
spec_id: deployData.spec_id,
count: deployData.count, // 机器组数
affinity: AffinityType.CROS_SUBZONE, // 暂时固定 'CROS_SUBZONE',
affinity: props.data.disasterToleranceLevel || AffinityType.CROS_SUBZONE, // 暂时固定 'CROS_SUBZONE',
},
},
};
Expand Down

0 comments on commit 73550d1

Please sign in to comment.