Skip to content

Commit

Permalink
fix(frontend): tendbcluster迁移主从bug #7767
Browse files Browse the repository at this point in the history
# Reviewed, transaction id: 23412
  • Loading branch information
JustaCattt authored and hLinx committed Nov 11, 2024
1 parent 704b9cc commit f08be7f
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 28 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@
field: props.firsrColumn?.field ? props.firsrColumn.field : 'instance_address',
},
{
label: t('关联的从库实例'),
label: t('关联实例'),
field: 'related_instances',
showOverflowTooltip: true,
width: 200,
Expand Down
1 change: 1 addition & 0 deletions dbm-ui/frontend/src/locales/zh-cn.json
Original file line number Diff line number Diff line change
Expand Up @@ -3670,5 +3670,6 @@
"无只读主机": "无只读主机",
"批量录入:按行录入,快速批量输入多个单元格的值": "批量录入:按行录入,快速批量输入多个单元格的值",
"高可用": "高可用",
"关联实例": "关联实例",
"这行勿动!新增翻译请在上一行添加!": ""
}
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,11 @@
watch(
localValue,
() => {
setTimeout(() => {
editRef.value!.getValue();
});
if (localValue.value) {
setTimeout(() => {
editRef.value!.getValue();
});
}
},
{
immediate: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,6 @@
}"
:data="localHostList"
:disable-dialog-submit-method="disableDialogSubmitMethod"
:disable-host-method="disableHostMethod"
:os-types="[OSTypes.Linux]"
service-mode="idle_only"
:show-view="false"
Expand Down Expand Up @@ -345,9 +344,7 @@
isShowIpSelector.value = true;
};

const disableDialogSubmitMethod = (hostList: HostInfo[]) => (hostList.length === 2 ? false : t('需n台', { n: 2 }));

const disableHostMethod = (data: HostInfo, list: HostInfo[]) => (list.length >= 2 ? t('仅需n台', { n: 2 }) : false);
const disableDialogSubmitMethod = (hostList: HostInfo[]) => (hostList.length === 2 ? false : t('仅需n台', { n: 2 }));

const handleHostChange = (hostList: HostInfo[]) => {
localHostList.value = hostList;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,14 @@

<template>
<DbOriginalTable
class="details-migrate__table"
:columns="columns"
:data="tableData" />
<DemandInfo
:config="config"
:data="ticketDetails" />
<div class="ticket-details-item">
<span class="ticket-details-item-label">{{ t('备份源') }}:</span>
<span class="ticket-details-item-value">
{{ props.ticketDetails.details.backup_source === 'local' ? t('本地备份') : t('远程备份') }}
</span>
</div>
</template>

<script setup lang="tsx">
Expand All @@ -28,10 +30,6 @@
import TicketModel from '@services/model/ticket/ticket';
import { checkInstance } from '@services/source/dbbase';

import DemandInfo, {
type DemandInfoConfig,
} from '../components/DemandInfo.vue';

interface Props {
ticketDetails: TicketModel<SpiderMigrateCluster>
}
Expand All @@ -50,18 +48,6 @@

const { t } = useI18n();

const config: DemandInfoConfig[] = [
{
list: [
{
label: t('备份源'),
key: 'details.backup_source',
render: () => props.ticketDetails.details.backup_source === 'local' ? t('本地备份') : t('远程备份')
},
],
},
]

const columns = [
{
label: t('目标主库主机'),
Expand Down Expand Up @@ -144,4 +130,5 @@

<style lang="less" scoped>
@import '@views/tickets/common/styles/DetailsTable.less';
@import '@views/tickets/common/styles/ticketDetails.less';
</style>

0 comments on commit f08be7f

Please sign in to comment.