diff --git a/dbm-ui/frontend/src/views/db-manage/redis/apply-ha/Index.vue b/dbm-ui/frontend/src/views/db-manage/redis/apply-ha/Index.vue index a82fdc9b2f..9605429d36 100644 --- a/dbm-ui/frontend/src/views/db-manage/redis/apply-ha/Index.vue +++ b/dbm-ui/frontend/src/views/db-manage/redis/apply-ha/Index.vue @@ -170,6 +170,7 @@ :is-append="isAppend" :max-memory="maxMemory" :port="formData.details.port" + :port-type="portType" @host-change="handleHostChange" /> @@ -315,6 +316,26 @@ const isAppend = computed(() => formData.details.appendApply === 'append'); const machineCount = computed(() => formData.details.cluster_count / formData.details.group_count); + const portType = computed(() => { + if (formData.details.cluster_count % formData.details.group_count !== 0) { + return ''; + } + if (formData.details.cluster_count === formData.details.group_count) { + return 'increment'; // 递增端口号 + } + if (formData.details.group_count === 1) { + return 'same'; // 端口号相同 + } + const ports = Array(formData.details.group_count) + .fill(0) + .map((_, index) => formData.details.port + index); + const groups = formData.details.cluster_count / formData.details.group_count; + return _.flatMap( + Array(groups) + .fill(0) + .map(() => ports), + ); + }); watch( () => formData.details.city_code, diff --git a/dbm-ui/frontend/src/views/db-manage/redis/apply-ha/components/domain-table/Index.vue b/dbm-ui/frontend/src/views/db-manage/redis/apply-ha/components/domain-table/Index.vue index 30551bdd2e..45461dffca 100644 --- a/dbm-ui/frontend/src/views/db-manage/redis/apply-ha/components/domain-table/Index.vue +++ b/dbm-ui/frontend/src/views/db-manage/redis/apply-ha/components/domain-table/Index.vue @@ -75,6 +75,7 @@ cityCode: string, cityName: string } + portType: string | number[]; } interface Emits { @@ -156,7 +157,7 @@ const columns = computed(() => { const baseColums: Column[] = [ { - type: 'index', + type: 'seq', label: t('序号'), width: 60, }, @@ -194,7 +195,12 @@ onChange={(value: string) => handleChangeCellValue(value, index, 'cluster_name')} /> -
.{ props.appAbbr }.db{props.isAppend ? '' : `#${props.port + index}`}
+ { + typeof props.portType === 'string' ? +
.{ props.appAbbr }.db{props.isAppend ? '' : `#${props.portType === 'increment' ? props.port + index : props.port }`}
+ : +
.{ props.appAbbr }.db{props.isAppend ? '' : `#${props.portType.length === tableData.value.length ? props.portType[index] : ''}`}
+ } ), }, diff --git a/dbm-ui/frontend/src/views/ticket-center/common/ticket-detail/components/task-info/com-factory/redis/ClusterApply.vue b/dbm-ui/frontend/src/views/ticket-center/common/ticket-detail/components/task-info/com-factory/redis/ClusterApply.vue index 27ba326014..837299ec1f 100644 --- a/dbm-ui/frontend/src/views/ticket-center/common/ticket-detail/components/task-info/com-factory/redis/ClusterApply.vue +++ b/dbm-ui/frontend/src/views/ticket-center/common/ticket-detail/components/task-info/com-factory/redis/ClusterApply.vue @@ -31,7 +31,7 @@
{{ t('地域要求') }}
- {{ ticketDetails?.details.city_name || '--' }} + {{ ticketDetails?.details.city_code || '--' }}
{{ t('数据库部署信息') }}