Skip to content

Commit

Permalink
fix(frontend): mysql定点回档协议调整 #3758
Browse files Browse the repository at this point in the history
# Reviewed, transaction id: 5387
  • Loading branch information
jinquantianxia authored and zhangzhw8 committed Apr 8, 2024
1 parent 3e2f61c commit a97f22d
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,14 @@
}

interface Exposes {
getValue: () => Promise<Array<string>>;
getValue: () => Promise<{
rollback_host: {
ip: string;
bk_cloud_id: number;
bk_host_id: number;
bk_biz_id: number;
};
}>;
}

const props = defineProps<Props>();
Expand All @@ -57,6 +64,13 @@

let errorMessage = t('IP不存在');

const rollbackHost = {
ip: '',
bk_cloud_id: 0,
bk_host_id: 0,
bk_biz_id: 0,
};

const rules = [
{
validator: (value: string) => ipv4.test(value),
Expand All @@ -76,6 +90,13 @@
errorMessage = t('IP不在x业务空闲机模块', { name: bizName });
return false;
}

const { bk_cloud_id: bkCloudId, bk_host_id: bkHostId, ip } = data.hosts_topo_info[0];
rollbackHost.ip = ip;
rollbackHost.bk_cloud_id = bkCloudId;
rollbackHost.bk_host_id = bkHostId;
rollbackHost.bk_biz_id = currentBizId;

const hostData = data.hosts_topo_info.find((item) => item.bk_cloud_id === props.cloudId);
if (!hostData) {
errorMessage = t('新主机xx跟目标集群xx须在同一个管控区域', {
Expand Down Expand Up @@ -103,7 +124,7 @@
defineExpose<Exposes>({
getValue() {
return inputRef.value.getValue().then(() => ({
rollback_ip: localValue.value,
rollback_host: rollbackHost,
}));
},
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,32 @@
},
],
},
{
moduleId: 'redis',
label: 'RedisCluster',
name: ClusterTypes.PREDIXY_REDIS_CLUSTER,
children: [
{
label: t('后端存储机型'),
name: 'tendiscache',
},
{
label: t('Proxy机型'),
name: 'predixy',
},
],
},
{
moduleId: 'redis',
label: t('Redis主从'),
name: ClusterTypes.REDIS_INSTANCE,
children: [
{
label: t('后端存储机型'),
name: 'tendiscache',
},
],
},
{
moduleId: 'bigdata',
label: 'ES',
Expand Down

0 comments on commit a97f22d

Please sign in to comment.