diff --git a/dbm-ui/frontend/src/components/batch-edit-column/Index.vue b/dbm-ui/frontend/src/components/batch-edit-column/Index.vue index f415d404f7..f0ef354565 100644 --- a/dbm-ui/frontend/src/components/batch-edit-column/Index.vue +++ b/dbm-ui/frontend/src/components/batch-edit-column/Index.vue @@ -54,6 +54,7 @@ :disabled="disabled" has-delete-icon :model-value="localValue as string[]" + :paste-fn="tagInputPasteFn" @change="handleChange" /> value.split(batchSplitRegex).map((item) => ({ id: item })); + const handleChange = (value: UnwrapRef) => { localValue.value = value; }; diff --git a/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/mysql/versionLocalUpgrade.ts b/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/mysql/versionLocalUpgrade.ts index 6cc136309d..6f2eb27e65 100644 --- a/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/mysql/versionLocalUpgrade.ts +++ b/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/mysql/versionLocalUpgrade.ts @@ -60,5 +60,5 @@ export async function generateMysqlVersionLocalUpgradeCloneData(ticketData: Tick }; }); - return Promise.resolve({ tableList }); + return Promise.resolve({ tableList, remark: ticketData.remark }); } diff --git a/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/mysql/versionMigrateUpgrade.ts b/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/mysql/versionMigrateUpgrade.ts index a9c09da0c3..55719d9caa 100644 --- a/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/mysql/versionMigrateUpgrade.ts +++ b/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/mysql/versionMigrateUpgrade.ts @@ -58,5 +58,6 @@ export async function generateMysqlVersionMigrateUpgradeCloneData(ticketData: Ti return Promise.resolve({ tableList, backupSource, + remark: ticketData.remark, }); } diff --git a/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/mysql/versionProxyUpgrade.ts b/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/mysql/versionProxyUpgrade.ts index 09fc6fa1b1..928bd434eb 100644 --- a/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/mysql/versionProxyUpgrade.ts +++ b/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/mysql/versionProxyUpgrade.ts @@ -34,5 +34,5 @@ export function generateMysqlVersionProxyUpgradeCloneData(ticketData: TicketMode }; }); - return Promise.resolve({ tableList }); + return Promise.resolve({ tableList, remark: ticketData.remark }); } diff --git a/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/redis/scaleUpdown.ts b/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/redis/scaleUpdown.ts index 0d61b283b6..971401fa73 100644 --- a/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/redis/scaleUpdown.ts +++ b/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/redis/scaleUpdown.ts @@ -33,7 +33,7 @@ export async function generateRedisScaleUpdownCloneData(ticketData: TicketModel< {} as Record, ); - return infos.map((item) => ({ + const tableDataList = infos.map((item) => ({ rowKey: random(), isLoading: false, targetCluster: clusters[item.cluster_id].immute_domain, @@ -53,4 +53,9 @@ export async function generateRedisScaleUpdownCloneData(ticketData: TicketModel< switchMode: item.online_switch_type, spec: clusterListMap[item.cluster_id].cluster_spec, })); + + return { + tableDataList, + remark: ticketData.remark, + }; } diff --git a/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/spider/sqlExecute.ts b/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/spider/sqlExecute.ts index f033a8f1bb..6dbf2a0d28 100644 --- a/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/spider/sqlExecute.ts +++ b/dbm-ui/frontend/src/hooks/useTicketCloneInfo/generateCloneData/spider/sqlExecute.ts @@ -14,21 +14,17 @@ import type { MySQLImportSQLFileDetails } from '@services/model/ticket/details/mysql'; import TicketModel from '@services/model/ticket/ticket'; -import { random } from '@utils'; - // spider SQL变更执行 export function generateSpiderSqlExecuteCloneData(ticketData: TicketModel) { const { details } = ticketData; return Promise.resolve({ backup: details.backup, charset: details.charset, - ticket_mode: details.ticket_mode, - import_mode: details.import_mode, cluster_ids: details.cluster_ids, - execute_db_infos: details.execute_objects.map((item) => ({ - ...item, - rowKey: random(), - })), + execute_objects: details.execute_objects, + ticket_mode: details.ticket_mode, + execute_sql_files: details.execute_sql_files as string[], + path: details.path, remark: ticketData.remark, }); } diff --git a/dbm-ui/frontend/src/views/db-manage/mysql/sql-execute/steps/step1/Index.vue b/dbm-ui/frontend/src/views/db-manage/mysql/sql-execute/steps/step1/Index.vue index 0147ec7b21..3d3e5710a4 100644 --- a/dbm-ui/frontend/src/views/db-manage/mysql/sql-execute/steps/step1/Index.vue +++ b/dbm-ui/frontend/src/views/db-manage/mysql/sql-execute/steps/step1/Index.vue @@ -23,7 +23,7 @@ :model="formData"> + @@ -96,6 +97,7 @@ type: TicketTypes.MYSQL_PROXY_UPGRADE, onSuccess(cloneData) { tableList.value = cloneData.tableList; + remark.value = cloneData.remark; window.changeConfirm = true; formData.roleType = 'haAccessLayer'; }, @@ -106,6 +108,7 @@ type: TicketTypes.MYSQL_LOCAL_UPGRADE, onSuccess(cloneData) { tableList.value = cloneData.tableList; + remark.value = cloneData.remark; window.changeConfirm = true; const isSingle = cloneData.tableList[0].clusterData.clusterType === ClusterTypes.TENDBSINGLE; @@ -119,6 +122,7 @@ type: TicketTypes.MYSQL_MIGRATE_UPGRADE, onSuccess(cloneData) { backupSource.value = cloneData.backupSource; + remark.value = cloneData.remark; window.changeConfirm = true; formData.roleType = 'haStorageLayer'; @@ -152,6 +156,7 @@ ]; const backupSource = ref(''); + const remark = ref(''); const tableList = shallowRef< HaAccessLayerRow[] | HaStorageLayerLocalRow[] | HaStorageLayerRemoteRow[] | SingleStorageRow[] @@ -184,6 +189,7 @@ () => formData.updateType, () => { tableList.value = []; + remark.value = ''; if (formData.updateType === '') { formData.updateType = 'local'; } @@ -191,6 +197,7 @@ ); const handleRoleTypeChange = () => { + remark.value = ''; tableList.value = []; }; diff --git a/dbm-ui/frontend/src/views/db-manage/mysql/version-upgrade/pages/page1/components/ha-access-layer/Index.vue b/dbm-ui/frontend/src/views/db-manage/mysql/version-upgrade/pages/page1/components/ha-access-layer/Index.vue index d0987369c9..0ce950cabd 100644 --- a/dbm-ui/frontend/src/views/db-manage/mysql/version-upgrade/pages/page1/components/ha-access-layer/Index.vue +++ b/dbm-ui/frontend/src/views/db-manage/mysql/version-upgrade/pages/page1/components/ha-access-layer/Index.vue @@ -56,6 +56,7 @@ @remove="handleRemove(index)" /> + }>({ [ClusterTypes.TENDBHA]: [] }); @@ -138,6 +141,16 @@ }, ); + watch( + () => props.remark, + () => { + localRemark.value = props.remark; + }, + { + immediate: true, + }, + ); + const handleShowMasterBatchSelector = () => { isShowClusterSelector.value = true; }; @@ -237,7 +250,7 @@ const infos = await Promise.all(rowRefs.value.map((item: { getValue: () => Promise }) => item.getValue())); await createTicket({ ticket_type: TicketTypes.MYSQL_PROXY_UPGRADE, - remark: '', + remark: localRemark.value, details: { infos, }, @@ -262,6 +275,7 @@ const handleReset = () => { tableData.value = [createRowData()]; + localRemark.value = ''; domainMemo = {}; selectedClusters.value[ClusterTypes.TENDBHA] = []; window.changeConfirm = false; diff --git a/dbm-ui/frontend/src/views/db-manage/mysql/version-upgrade/pages/page1/components/ha-storage-layer-local/Index.vue b/dbm-ui/frontend/src/views/db-manage/mysql/version-upgrade/pages/page1/components/ha-storage-layer-local/Index.vue index f755111bf4..6faab8ce04 100644 --- a/dbm-ui/frontend/src/views/db-manage/mysql/version-upgrade/pages/page1/components/ha-storage-layer-local/Index.vue +++ b/dbm-ui/frontend/src/views/db-manage/mysql/version-upgrade/pages/page1/components/ha-storage-layer-local/Index.vue @@ -52,6 +52,7 @@ @remove="handleRemove(index)" /> + }>({ [ClusterTypes.TENDBHA]: [] }); @@ -130,6 +134,16 @@ }, ); + watch( + () => props.remark, + () => { + localRemark.value = props.remark; + }, + { + immediate: true, + }, + ); + // 集群域名是否已存在表格的映射表 let domainMemo: Record = {}; @@ -234,7 +248,7 @@ const infos = await Promise.all(rowRefs.value.map((item: { getValue: () => Promise }) => item.getValue())); await createTicket({ ticket_type: TicketTypes.MYSQL_LOCAL_UPGRADE, - remark: '', + remark: localRemark.value, details: { infos, }, @@ -259,6 +273,7 @@ const handleReset = () => { tableData.value = [createRowData()]; + localRemark.value = ''; domainMemo = {}; selectedClusters.value[ClusterTypes.TENDBHA] = []; window.changeConfirm = false; diff --git a/dbm-ui/frontend/src/views/db-manage/mysql/version-upgrade/pages/page1/components/ha-storage-layer-remote/Index.vue b/dbm-ui/frontend/src/views/db-manage/mysql/version-upgrade/pages/page1/components/ha-storage-layer-remote/Index.vue index adb3ba3e4c..a8a7116592 100644 --- a/dbm-ui/frontend/src/views/db-manage/mysql/version-upgrade/pages/page1/components/ha-storage-layer-remote/Index.vue +++ b/dbm-ui/frontend/src/views/db-manage/mysql/version-upgrade/pages/page1/components/ha-storage-layer-remote/Index.vue @@ -73,6 +73,7 @@ + }>({ [ClusterTypes.TENDBHA]: [] }); @@ -163,6 +167,16 @@ }, ); + watch( + () => props.remark, + () => { + localRemark.value = props.remark; + }, + { + immediate: true, + }, + ); + // 集群域名是否已存在表格的映射表 let domainMemo: Record = {}; @@ -267,7 +281,7 @@ const infos = await Promise.all(rowRefs.value.map((item: { getValue: () => Promise }) => item.getValue())); await createTicket({ ticket_type: TicketTypes.MYSQL_MIGRATE_UPGRADE, - remark: '', + remark: localRemark.value, details: { ip_source: 'manual_input', backup_source: localBackupSource.value, @@ -294,6 +308,7 @@ const handleReset = () => { tableData.value = [createRowData()]; + localRemark.value = ''; domainMemo = {}; selectedClusters.value[ClusterTypes.TENDBHA] = []; window.changeConfirm = false; diff --git a/dbm-ui/frontend/src/views/db-manage/mysql/version-upgrade/pages/page1/components/single-storage-layer/Index.vue b/dbm-ui/frontend/src/views/db-manage/mysql/version-upgrade/pages/page1/components/single-storage-layer/Index.vue index dfa4c0244e..d1f99c2fa5 100644 --- a/dbm-ui/frontend/src/views/db-manage/mysql/version-upgrade/pages/page1/components/single-storage-layer/Index.vue +++ b/dbm-ui/frontend/src/views/db-manage/mysql/version-upgrade/pages/page1/components/single-storage-layer/Index.vue @@ -52,6 +52,7 @@ @remove="handleRemove(index)" /> + }>({ [ClusterTypes.TENDBSINGLE]: [] }); @@ -130,6 +134,16 @@ }, ); + watch( + () => props.remark, + () => { + localRemark.value = props.remark; + }, + { + immediate: true, + }, + ); + // 集群域名是否已存在表格的映射表 let domainMemo: Record = {}; @@ -214,7 +228,7 @@ const infos = await Promise.all(rowRefs.value.map((item: { getValue: () => Promise }) => item.getValue())); await createTicket({ ticket_type: TicketTypes.MYSQL_LOCAL_UPGRADE, - remark: '', + remark: localRemark.value, details: { infos, }, @@ -239,6 +253,7 @@ const handleReset = () => { tableData.value = [createRowData()]; + localRemark.value = ''; domainMemo = {}; selectedClusters.value[ClusterTypes.TENDBHA] = []; window.changeConfirm = false; diff --git a/dbm-ui/frontend/src/views/db-manage/mysql/version-upgrade/pages/page1/components/single-storage-layer/Row.vue b/dbm-ui/frontend/src/views/db-manage/mysql/version-upgrade/pages/page1/components/single-storage-layer/Row.vue index 5b789f50c2..89b72c6b22 100644 --- a/dbm-ui/frontend/src/views/db-manage/mysql/version-upgrade/pages/page1/components/single-storage-layer/Row.vue +++ b/dbm-ui/frontend/src/views/db-manage/mysql/version-upgrade/pages/page1/components/single-storage-layer/Row.vue @@ -30,6 +30,7 @@ ref="targetVersionRef" :data="data.clusterData" :is-loading="data.isLoading" + :target-package="data.targetPackage" @module-change="handleModuleChange" /> +