Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(frontend): 单节点原地升级支持跨版本 #8697 #9104

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,9 @@ export async function generateMysqlVersionLocalUpgradeCloneData(ticketData: Tick
moduleId: clusters[clusterId].db_module_id,
cloudId: clusters[clusterId].bk_cloud_id,
},
targetVersion: item.display_info.target_version,
targetPackage: item.pkg_id,
targetModule: item.new_db_module_id,
};
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,16 @@ export interface LocalUpgrade extends DetailBase {
infos: {
pkg_id: number;
cluster_ids: number[];
new_db_module_id?: number; // 单节点集群传递
display_info: {
cluster_type: string;
current_version: string;
current_package: string;
target_package: string;
charset: string;
current_module_name: string;
target_version?: string; // 单节点集群传递
target_module_name?: string; // 单节点集群传递
};
}[];
force: boolean;
Expand Down
1 change: 1 addition & 0 deletions dbm-ui/frontend/src/services/source/mysqlToolbox.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import http from '@services/http';
export function queryMysqlHigherVersionPkgList(params: {
cluster_id: number;
higher_major_version?: boolean; // 代表是否跨版本升级, 默认false
higher_all_version?: boolean; // 单节点本地升级 获取可用的升级包
}) {
return http.post<
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,6 @@
interface Exposes {
getValue: () => Promise<{
pkg_id: number;
new_db_module_id: number;
display_info: {
target_version: string;
target_package: string;
Expand All @@ -128,7 +127,6 @@
const { t } = useI18n();

const packageSelectRef = ref<InstanceType<typeof TableEditSelect>>();
const moduleSelectRef = ref<InstanceType<typeof TableEditSelect>>();
const localVersion = ref<string>('');
const localPackage = ref<number | ''>('');
const localModule = ref<number | ''>('');
Expand Down Expand Up @@ -271,9 +269,8 @@

defineExpose<Exposes>({
getValue() {
return Promise.all([packageSelectRef.value!.getValue(), moduleSelectRef.value?.getValue()]).then(() => ({
return packageSelectRef.value!.getValue().then(() => ({
pkg_id: localPackage.value as number,
new_db_module_id: localModule.value as number,
display_info: {
target_version: localVersion.value,
target_package: packageSelectList.value.find((item) => item.id === localPackage.value)?.name || '',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@

import RenderCluster from '../RenderClusterWithRelateCluster.vue';
import RenderCurrentVersion from '../RenderCurrentVersion.vue';
import RenderTargetVersion from '../RenderTargetVersion.vue';

import RenderTargetVersion from './RenderTargetVersion.vue';

export interface IDataRow {
rowKey: string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@
import { getModules } from '@services/source/cmdb';
import { queryMysqlHigherVersionPkgList } from '@services/source/mysqlToolbox';

import { ClusterTypes, TicketTypes } from '@common/const';
import { TicketTypes } from '@common/const';

import TableEditSelect, { type IListItem } from '@views/db-manage/mysql/common/edit/Select.vue';

Expand Down Expand Up @@ -415,10 +415,7 @@
const url = router.resolve({
name: 'SelfServiceCreateDbModule',
params: {
type:
props.data!.clusterType === ClusterTypes.TENDBSINGLE
? TicketTypes.MYSQL_SINGLE_APPLY
: TicketTypes.MYSQL_HA_APPLY,
type: TicketTypes.MYSQL_HA_APPLY,
bk_biz_id: bizId,
},
query: {
Expand Down
Loading
Loading