Skip to content

Commit

Permalink
fix(frontend): 修复mysql版本升级模块取值问题 #8357
Browse files Browse the repository at this point in the history
  • Loading branch information
3octaves authored and jinquantianxia committed Dec 2, 2024
1 parent 22472b2 commit 7008f65
Show file tree
Hide file tree
Showing 11 changed files with 21 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ export async function generateMysqlVersionLocalUpgradeCloneData(ticketData: Tick
currentVersion: clusters[clusterId].major_version,
packageVersion: clusterListMap[clusterId].masters[0].version,
moduleName: item.display_info.current_module_name,
moduleId: clusters[clusterId].db_module_id,
cloudId: clusters[clusterId].bk_cloud_id,
},
targetPackage: item.pkg_id,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ export async function generateMysqlVersionMigrateUpgradeCloneData(ticketData: Ti
currentVersion: clusters[clusterId].major_version,
packageVersion: clusterListMap[clusterId].masters[0].version,
moduleName: item.display_info.current_module_name,
moduleId: clusters[clusterId].db_module_id,
cloudId: clusters[clusterId].bk_cloud_id,
masterSlaveList: [
...clusterListMap[clusterId].masters,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,14 +107,16 @@
useTicketCloneInfo({
type: TicketTypes.MYSQL_LOCAL_UPGRADE,
onSuccess(cloneData) {
tableList.value = cloneData.tableList;
force.value = cloneData.force;
remark.value = cloneData.remark;
window.changeConfirm = true;

const isSingle = cloneData.tableList[0].clusterData.clusterType === ClusterTypes.TENDBSINGLE;
formData.roleType = isSingle ? 'singleStorageLayer' : 'haStorageLayer';
formData.updateType = 'local';

nextTick(() => {
tableList.value = cloneData.tableList;
force.value = cloneData.force;
remark.value = cloneData.remark;
window.changeConfirm = true;
});
},
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@
clusterType: string;
currentVersion: string;
moduleName: string;
moduleId: number;
};
targetVersion?: string;
targetPackage?: number;
Expand Down Expand Up @@ -159,8 +160,8 @@
manual: true,
onSuccess(modules) {
// const moduleList: IListItem[] = [];
const { moduleName } = props.data!;
const currentModule = modules.find((moduleItem) => moduleItem.alias_name === moduleName);
const { moduleId } = props.data!;
const currentModule = modules.find((moduleItem) => moduleItem.db_module_id === moduleId);
if (currentModule) {
const currentCharset = currentModule.db_module_info.conf_items.find(
(confItem) => confItem.conf_name === 'charset',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,7 @@
currentVersion: item.major_version,
packageVersion: item.masters[0].version,
moduleName: item.db_module_name,
moduleId: item.db_module_id,
cloudId: item.bk_cloud_id,
},
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@
currentVersion: string;
packageVersion: string;
moduleName: string;
moduleId: number;
};
targetPackage?: number;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,7 @@
currentVersion: item.major_version,
packageVersion: item.masters[0].version,
moduleName: item.db_module_name,
moduleId: item.db_module_id,
cloudId: item.bk_cloud_id,
masterSlaveList: [...item.masters, ...item.slaves.filter((item) => item.is_stand_by)].map((item) => ({
bk_biz_id: item.bk_biz_id,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,7 @@
clusterType: string;
currentVersion: string;
moduleName: string;
moduleId: number;
};
targetVersion?: string;
targetPackage?: number;
Expand Down Expand Up @@ -276,8 +277,8 @@
manual: true,
onSuccess(modules) {
const moduleList: IListItem[] = [];
const { moduleName } = props.data!;
const currentModule = modules.find((moduleItem) => moduleItem.alias_name === moduleName);
const { moduleId } = props.data!;
const currentModule = modules.find((moduleItem) => moduleItem.db_module_id === moduleId);
if (currentModule) {
const currentCharset = currentModule.db_module_info.conf_items.find(
(confItem) => confItem.conf_name === 'charset',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@
currentVersion: string;
packageVersion: string;
moduleName: string;
moduleId: number;
cloudId: number;
masterSlaveList: IHostData[];
readonlySlaveList: IHostData[];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,7 @@
currentVersion: item.major_version,
packageVersion: item.masters[0].version,
moduleName: item.db_module_name,
moduleId: item.db_module_id,
cloudId: item.bk_cloud_id,
},
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@
currentVersion: string;
packageVersion: string;
moduleName: string;
moduleId: number;
};
targetPackage?: number;
}
Expand Down

0 comments on commit 7008f65

Please sign in to comment.