Skip to content

Commit

Permalink
feat(frontend): 单据管理迭代 TencentBlueKing#7190
Browse files Browse the repository at this point in the history
  • Loading branch information
hLinx committed Nov 11, 2024
1 parent aa66fb2 commit ddac6e1
Show file tree
Hide file tree
Showing 758 changed files with 8,484 additions and 39,311 deletions.
88 changes: 45 additions & 43 deletions dbm-ui/frontend/src/common/const/ticketTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,43 +40,44 @@ export enum TicketTypes {
MYSQL_PROXY_UPGRADE = 'MYSQL_PROXY_UPGRADE', // MySQL Proxy 升级
MYSQL_LOCAL_UPGRADE = 'MYSQL_LOCAL_UPGRADE', // MySQL 原地升级
MYSQL_MIGRATE_UPGRADE = 'MYSQL_MIGRATE_UPGRADE', // MySQL 迁移升级
MYSQL_ACCOUNT_RULE_CHANGE = 'MYSQL_ACCOUNT_RULE_CHANGE',
}
export enum TicketTypes {
REDIS_CLUSTER_APPLY = 'REDIS_CLUSTER_APPLY',
REDIS_KEYS_EXTRACT = 'REDIS_KEYS_EXTRACT',
REDIS_KEYS_DELETE = 'REDIS_KEYS_DELETE',
REDIS_BACKUP = 'REDIS_BACKUP',
REDIS_PURGE = 'REDIS_PURGE',
REDIS_CLUSTER_ADD_SLAVE = 'REDIS_CLUSTER_ADD_SLAVE',
REDIS_CLUSTER_APPLY = 'REDIS_CLUSTER_APPLY',
REDIS_CLUSTER_CUTOFF = 'REDIS_CLUSTER_CUTOFF',
REDIS_CLUSTER_DATA_COPY = 'REDIS_CLUSTER_DATA_COPY',
REDIS_CLUSTER_ROLLBACK_DATA_COPY = 'REDIS_CLUSTER_ROLLBACK_DATA_COPY',
REDIS_CLUSTER_SHARD_NUM_UPDATE = 'REDIS_CLUSTER_SHARD_NUM_UPDATE',
REDIS_CLUSTER_TYPE_UPDATE = 'REDIS_CLUSTER_TYPE_UPDATE',
REDIS_DATACOPY_CHECK_REPAIR = 'REDIS_DATACOPY_CHECK_REPAIR',
REDIS_DESTROY = 'REDIS_DESTROY',
REDIS_PROXY_OPEN = 'REDIS_PROXY_OPEN',
REDIS_PROXY_CLOSE = 'REDIS_PROXY_CLOSE',
REDIS_PLUGIN_DNS_BIND_CLB = 'REDIS_PLUGIN_DNS_BIND_CLB',
REDIS_PLUGIN_DNS_UNBIND_CLB = 'REDIS_PLUGIN_DNS_UNBIND_CLB',
REDIS_INS_APPLY = 'REDIS_INS_APPLY',
REDIS_INSTANCE_PROXY_CLOSE = 'REDIS_INSTANCE_PROXY_CLOSE',
REDIS_INSTANCE_PROXY_OPEN = 'REDIS_INSTANCE_PROXY_OPEN',
REDIS_INSTANCE_DESTROY = 'REDIS_INSTANCE_DESTROY',
REDIS_KEYS_DELETE = 'REDIS_KEYS_DELETE',
REDIS_KEYS_EXTRACT = 'REDIS_KEYS_EXTRACT',
REDIS_MASTER_SLAVE_SWITCH = 'REDIS_MASTER_SLAVE_SWITCH',
REDIS_PLUGIN_CREATE_CLB = 'REDIS_PLUGIN_CREATE_CLB',
REDIS_PLUGIN_DELETE_CLB = 'REDIS_PLUGIN_DELETE_CLB',
REDIS_PLUGIN_CREATE_POLARIS = 'REDIS_PLUGIN_CREATE_POLARIS',
REDIS_PLUGIN_DELETE_CLB = 'REDIS_PLUGIN_DELETE_CLB',
REDIS_PLUGIN_DELETE_POLARIS = 'REDIS_PLUGIN_DELETE_POLARIS',
REDIS_CLUSTER_CUTOFF = 'REDIS_CLUSTER_CUTOFF', // redis 整机替换
REDIS_PROXY_SCALE_UP = 'REDIS_PROXY_SCALE_UP', // redis 接入层扩容
REDIS_PROXY_SCALE_DOWN = 'REDIS_PROXY_SCALE_DOWN', // redis 接入层缩容
REDIS_SCALE_UPDOWN = 'REDIS_SCALE_UPDOWN', // redis 集群容量变更
REDIS_SCALE_UP = 'REDIS_SCALE_UP', // redis 存储层扩容
REDIS_SCALE_DOWN = 'REDIS_SCALE_DOWN', // redis 存储层缩容
REDIS_MASTER_SLAVE_SWITCH = 'REDIS_MASTER_SLAVE_SWITCH', // redis 主故障切换
REDIS_SLOTS_MIGRATE = 'REDIS_SLOTS_MIGRATE', // redis slots 迁移
REDIS_DATA_STRUCTURE = 'REDIS_DATA_STRUCTURE', // redis 定点构造
REDIS_DATA_STRUCTURE_TASK_DELETE = 'REDIS_DATA_STRUCTURE_TASK_DELETE', // redis 构造销毁
REDIS_CLUSTER_ADD_SLAVE = 'REDIS_CLUSTER_ADD_SLAVE', // redis 新建从库
REDIS_CLUSTER_DATA_COPY = 'REDIS_CLUSTER_DATA_COPY', // redis 数据复制
REDIS_CLUSTER_SHARD_NUM_UPDATE = 'REDIS_CLUSTER_SHARD_NUM_UPDATE', // redis 集群分片变更
REDIS_CLUSTER_TYPE_UPDATE = 'REDIS_CLUSTER_TYPE_UPDATE', // redis 集群类型变更
REDIS_DATACOPY_CHECK_REPAIR = 'REDIS_DATACOPY_CHECK_REPAIR', // redis 数据校验与修复
REDIS_CLUSTER_ROLLBACK_DATA_COPY = 'REDIS_CLUSTER_ROLLBACK_DATA_COPY', // redis 数据回写
REDIS_VERSION_UPDATE_ONLINE = 'REDIS_VERSION_UPDATE_ONLINE', // redis 版本升级
REDIS_INS_APPLY = 'REDIS_INS_APPLY', // redis 主从集群部署
REDIS_INSTANCE_PROXY_OPEN = 'REDIS_INSTANCE_PROXY_OPEN', // redis 主从集群启用
REDIS_INSTANCE_PROXY_CLOSE = 'REDIS_INSTANCE_PROXY_CLOSE', // redis 主从集群禁用
REDIS_INSTANCE_DESTROY = 'REDIS_INSTANCE_DESTROY', // redis 主从集群删除
REDIS_PLUGIN_DNS_BIND_CLB = 'REDIS_PLUGIN_DNS_BIND_CLB',
REDIS_PLUGIN_DNS_UNBIND_CLB = 'REDIS_PLUGIN_DNS_UNBIND_CLB',
REDIS_PURGE = 'REDIS_PURGE',
REDIS_PROXY_CLOSE = 'REDIS_PROXY_CLOSE',
REDIS_PROXY_OPEN = 'REDIS_PROXY_OPEN',
REDIS_PROXY_SCALE_DOWN = 'REDIS_PROXY_SCALE_DOWN',
REDIS_PROXY_SCALE_UP = 'REDIS_PROXY_SCALE_UP',
REDIS_SCALE_DOWN = 'REDIS_SCALE_DOWN',
REDIS_SCALE_UP = 'REDIS_SCALE_UP',
REDIS_SCALE_UPDOWN = 'REDIS_SCALE_UPDOWN',
REDIS_SLOTS_MIGRATE = 'REDIS_SLOTS_MIGRATE',
REDIS_VERSION_UPDATE_ONLINE = 'REDIS_VERSION_UPDATE_ONLINE',
REDIS_DATA_STRUCTURE = 'REDIS_DATA_STRUCTURE',
REDIS_DATA_STRUCTURE_TASK_DELETE = 'REDIS_DATA_STRUCTURE_TASK_DELETE',
}
export enum TicketTypes {
TENDBCLUSTER_APPLY = 'TENDBCLUSTER_APPLY',
Expand Down Expand Up @@ -113,29 +114,30 @@ export enum TicketTypes {
TENDBCLUSTER_RESTORE_SLAVE = 'TENDBCLUSTER_RESTORE_SLAVE', // spider 重建从库-新机重建
TENDBCLUSTER_DUMP_DATA = 'TENDBCLUSTER_DUMP_DATA', // spider 数据导出
TENDBCLUSTER_SEMANTIC_CHECK = 'TENDBCLUSTER_SEMANTIC_CHECK', // spider 模拟执行
TENDBCLUSTER_ACCOUNT_RULE_CHANGE = 'TENDBCLUSTER_ACCOUNT_RULE_CHANGE',
}
export enum TicketTypes {
MONGODB_ADD_MONGOS = 'MONGODB_ADD_MONGOS', // mongo 扩容接入层
MONGODB_ADD_SHARD_NODES = 'MONGODB_ADD_SHARD_NODES', // mongo 扩容 shard 节点数
MONGODB_AUTHORIZE_RULES = 'MONGODB_AUTHORIZE_RULES', // MongoDB 集群授权
MONGODB_BACKUP = 'MONGODB_BACKUP', // mongo 库表备份
MONGODB_CUTOFF = 'MONGODB_CUTOFF', // mongo 整机替换
MONGODB_DISABLE = 'MONGODB_DISABLE', // mongodb禁用
MONGODB_INSTANCE_RELOAD = 'MONGODB_INSTANCE_RELOAD', // mongodb重启
MONGODB_SHARD_APPLY = 'MONGODB_SHARD_APPLY', // MongoDB 分片式集群部署申请
MONGODB_REPLICASET_APPLY = 'MONGODB_REPLICASET_APPLY', // MongoDB 副本集部署申请
MONGODB_ENABLE = 'MONGODB_ENABLE', // MongoDB 集群启用
MONGODB_DESTROY = 'MONGODB_DESTROY', // MongoDB 集群删除
MONGODB_SCALE_UPDOWN = 'MONGODB_SCALE_UPDOWN', // MongoDB 分片式集群单个容量变更
MONGODB_ENABLE = 'MONGODB_ENABLE', // MongoDB 集群启用
MONGODB_EXCEL_AUTHORIZE = 'MONGODB_EXCEL_AUTHORIZE', // MongoDB 导入授权
MONGODB_AUTHORIZE_RULES = 'MONGODB_AUTHORIZE_RULES', // MongoDB 集群授权
MONGODB_EXCEL_AUTHORIZE_RULES = 'MONGODB_EXCEL_AUTHORIZE_RULES', // MongoDB 导入授权
MONGODB_EXEC_SCRIPT_APPLY = 'MONGODB_EXEC_SCRIPT_APPLY', // mongo 变更脚本执行
MONGODB_ADD_SHARD_NODES = 'MONGODB_ADD_SHARD_NODES', // mongo 扩容 shard 节点数
MONGODB_REDUCE_SHARD_NODES = 'MONGODB_REDUCE_SHARD_NODES', // mongo 缩容 shard 节点数
MONGODB_ADD_MONGOS = 'MONGODB_ADD_MONGOS', // mongo 扩容接入层
MONGODB_REDUCE_MONGOS = 'MONGODB_REDUCE_MONGOS', // mongo 缩容接入层
MONGODB_CUTOFF = 'MONGODB_CUTOFF', // mongo 整机替换
MONGODB_FULL_BACKUP = 'MONGODB_FULL_BACKUP', // mongo 全库备份
MONGODB_INSTANCE_RELOAD = 'MONGODB_INSTANCE_RELOAD', // mongodb重启
MONGODB_REMOVE_NS = 'MONGODB_REMOVE_NS', // mongo 清档
MONGODB_BACKUP = 'MONGODB_BACKUP', // mongo 库表备份
MONGODB_REDUCE_MONGOS = 'MONGODB_REDUCE_MONGOS', // mongo 缩容接入层
MONGODB_REDUCE_SHARD_NODES = 'MONGODB_REDUCE_SHARD_NODES', // mongo 缩容 shard 节点数
MONGODB_RESTORE = 'MONGODB_RESTORE', // mongo 定点构造
MONGODB_SCALE_UPDOWN = 'MONGODB_SCALE_UPDOWN', // MongoDB 分片式集群单个容量变更
MONGODB_SHARD_APPLY = 'MONGODB_SHARD_APPLY', // MongoDB 分片式集群部署申请
MONGODB_REPLICASET_APPLY = 'MONGODB_REPLICASET_APPLY', // MongoDB 副本集部署申请
MONGODB_TEMPORARY_DESTROY = 'MONGODB_TEMPORARY_DESTROY', // mongo 临时集群销毁
MONGODB_FULL_BACKUP = 'MONGODB_FULL_BACKUP', // mongo 全库备份
}
export enum TicketTypes {
SQLSERVER_SINGLE_APPLY = 'SQLSERVER_SINGLE_APPLY', // sqlserver单节点部署
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,15 @@
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for
* the specific language governing permissions and limitations under the License.
*/
import type { MysqlAuthorizationDetails } from '@services/model/ticket/details/mysql';
import TicketModel from '@services/model/ticket/ticket';
import TicketModel, { type Mysql } from '@services/model/ticket/ticket';
import { checkHost } from '@services/source/ipchooser';
import { getTendbhaList } from '@services/source/tendbha';
import { getTendbsingleList } from '@services/source/tendbsingle';

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

// Mysql 集群授权
export async function generateMysqlAuthorizeRuleCloneData(ticketData: TicketModel<MysqlAuthorizationDetails>) {
export async function generateMysqlAuthorizeRuleCloneData(ticketData: TicketModel<Mysql.AuthorizeRules>) {
const { authorize_data: authorizeData } = ticketData.details;
const sourceIpList: ServiceReturnType<typeof checkHost> = [];
if (authorizeData.source_ips && Array.isArray(authorizeData.source_ips)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,13 @@
* the specific language governing permissions and limitations under the License.
*/
import TendbhaModel from '@services/model/mysql/tendbha';
import type { MySQLChecksumDetails } from '@services/model/ticket/details/mysql';
import TicketModel from '@services/model/ticket/ticket';
import TicketModel, { type Mysql } from '@services/model/ticket/ticket';
import { getTendbhaList } from '@services/source/tendbha';

import { random } from '@utils';

// Mysql SQL变更执行
export async function generateMysqlChecksumCloneData(ticketData: TicketModel<MySQLChecksumDetails>) {
export async function generateMysqlChecksumCloneData(ticketData: TicketModel<Mysql.CheckSum>) {
const { details, remark } = ticketData;
const clustersResult = await getTendbhaList({
cluster_ids: details.infos.map((item) => item.cluster_id),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,12 @@
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for
* the specific language governing permissions and limitations under the License.
*/
import type { MySQLCloneDetails } from '@services/model/ticket/details/mysql';
import TicketModel from '@services/model/ticket/ticket';
import TicketModel, { type Mysql } from '@services/model/ticket/ticket';

import { random } from '@utils';

// Mysql 客户端权限克隆
export function generateMysqlClientCloneData(ticketData: TicketModel<MySQLCloneDetails>) {
export function generateMysqlClientCloneData(ticketData: TicketModel<Mysql.ClientCloneRules>) {
return Promise.resolve({
tableDataList: ticketData.details.clone_data.map((item) => ({
...item,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,12 @@
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for
* the specific language governing permissions and limitations under the License.
*/
import type { MysqlDataMigrateDetails } from '@services/model/ticket/details/mysql';
import TicketModel from '@services/model/ticket/ticket';
import TicketModel, { type Mysql } from '@services/model/ticket/ticket';

import { random } from '@utils';

// MySQL DB克隆
export function generateMysqlDataMigrateCloneData(ticketData: TicketModel<MysqlDataMigrateDetails>) {
export function generateMysqlDataMigrateCloneData(ticketData: TicketModel<Mysql.DataMigrate>) {
const { clusters, infos } = ticketData.details;
const tableDataList = infos.map((item) => {
const sourceClusterInfo = clusters[item.source_cluster];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,12 @@
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for
* the specific language governing permissions and limitations under the License.
*/
import type { MySQLRenameDetails } from '@services/model/ticket/details/mysql';
import TicketModel from '@services/model/ticket/ticket';
import TicketModel, { type Mysql } from '@services/model/ticket/ticket';

import { random } from '@utils';

// MySQL 高可用DB重命名
export function generateMysqlDbRenameCloneData(ticketData: TicketModel<MySQLRenameDetails>) {
export function generateMysqlDbRenameCloneData(ticketData: TicketModel<Mysql.HaRenameDatabase>) {
const { clusters, force, infos } = ticketData.details;
const tableDataList = infos.map((item) => ({
rowKey: random(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,12 @@
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for
* the specific language governing permissions and limitations under the License.
*/
import type { MySQLFlashback } from '@services/model/ticket/details/mysql';
import TicketModel from '@services/model/ticket/ticket';
import TicketModel, { type Mysql } from '@services/model/ticket/ticket';

import { random } from '@utils';

// MySQL 闪回
export function generateMysqlFlashbackCloneData(ticketData: TicketModel<MySQLFlashback>) {
export function generateMysqlFlashbackCloneData(ticketData: TicketModel<Mysql.FlashBack>) {
const { clusters, infos } = ticketData.details;
const tableDataList = infos.map((item) => ({
rowKey: random(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,10 @@
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for
* the specific language governing permissions and limitations under the License.
*/
import type { MySQLDetails } from '@services/model/ticket/details/mysql';
import TicketModel from '@services/model/ticket/ticket';
import TicketModel, { type Mysql } from '@services/model/ticket/ticket';

// Mysql 高可用部署
export function generateMysqlHaApplyCloneData(ticketData: TicketModel<MySQLDetails>) {
export function generateMysqlHaApplyCloneData(ticketData: TicketModel<Mysql.HaApply>) {
const { details } = ticketData;
return Promise.resolve({
affinity: details.disaster_tolerance_level,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,12 @@
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for
* the specific language governing permissions and limitations under the License.
*/
import type { MySQLFullBackupDetails } from '@services/model/ticket/details/mysql';
import TicketModel from '@services/model/ticket/ticket';
import TicketModel, { type Mysql } from '@services/model/ticket/ticket';

import { random } from '@utils';

// Mysql 全库备份
export function generateMysqlDbBackupCloneData(ticketData: TicketModel<MySQLFullBackupDetails>) {
export function generateMysqlDbBackupCloneData(ticketData: TicketModel<Mysql.HaFullBackup>) {
const { clusters, infos } = ticketData.details;
const tableDataList = infos.clusters.map((item) => ({
rowKey: random(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,12 @@
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for
* the specific language governing permissions and limitations under the License.
*/
import type { MySQLHATruncateDetails } from '@services/model/ticket/details/mysql';
import TicketModel from '@services/model/ticket/ticket';
import TicketModel, { type Mysql } from '@services/model/ticket/ticket';

import { random } from '@utils';

// MySQL 高可用清档
export function generateMysqlDbClearCloneData(ticketData: TicketModel<MySQLHATruncateDetails>) {
export function generateMysqlDbClearCloneData(ticketData: TicketModel<Mysql.HaTeuncateData>) {
const { clusters, infos } = ticketData.details;
const tableDataList = infos.map((item) => ({
rowKey: random(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,12 @@
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for
* the specific language governing permissions and limitations under the License.
*/
import type { MySQLTableBackupDetails } from '@services/model/ticket/details/mysql';
import TicketModel from '@services/model/ticket/ticket';
import TicketModel, { type Mysql } from '@services/model/ticket/ticket';

import { random } from '@utils';

// Mysql 库表备份
export function generateMysqlDbTableBackupCloneData(ticketData: TicketModel<MySQLTableBackupDetails>) {
export function generateMysqlDbTableBackupCloneData(ticketData: TicketModel<Mysql.HaDBTableBackup>) {
const { clusters, infos } = ticketData.details;
const tableDataList = infos.map((item) => ({
rowKey: random(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,17 @@
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for
* the specific language governing permissions and limitations under the License.
*/
import type { MySQLImportSQLFileDetails } from '@services/model/ticket/details/mysql';
import TicketModel from '@services/model/ticket/ticket';
import TicketModel, { type Mysql } from '@services/model/ticket/ticket';

// Mysql SQL变更执行
export function generateMysqlImportSqlFileCloneData(ticketData: TicketModel<MySQLImportSQLFileDetails>) {
export function generateMysqlImportSqlFileCloneData(ticketData: TicketModel<Mysql.ImportSqlFile>) {
const { details } = ticketData;
return Promise.resolve({
backup: details.backup,
charset: details.charset,
cluster_ids: details.cluster_ids,
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,
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,15 @@
*/
import _ from 'lodash';

import type { MySQLInstanceCloneDetails } from '@services/model/ticket/details/mysql';
import TicketModel from '@services/model/ticket/ticket';
import TicketModel, { type Mysql } from '@services/model/ticket/ticket';
import { checkMysqlInstances } from '@services/source/instances';

import { random } from '@utils';

type InstanceInfo = ServiceReturnType<typeof checkMysqlInstances>[number];

// Mysql DB实例权限克隆
export async function generateMysqlInstanceCloneData(ticketData: TicketModel<MySQLInstanceCloneDetails>) {
export async function generateMysqlInstanceCloneData(ticketData: TicketModel<Mysql.InstanceCloneRules>) {
const instanceList = _.flatMap(ticketData.details.clone_data.map((item) => [item.source, item.target]));
const instanceListInfos = await checkMysqlInstances({
bizId: ticketData.bk_biz_id,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,12 @@
* the specific language governing permissions and limitations under the License.
*/

import type { MySQLMasterFailDetails } from '@services/model/ticket/details/mysql';
import TicketModel from '@services/model/ticket/ticket';
import TicketModel, { type Mysql } from '@services/model/ticket/ticket';

import { random } from '@utils';

// MySQL 主库故障切换
export function generateMysqlMasterFailoverCloneData(ticketData: TicketModel<MySQLMasterFailDetails>) {
export function generateMysqlMasterFailoverCloneData(ticketData: TicketModel<Mysql.MasterFailOver>) {
const {
clusters,
infos,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,12 @@
* the specific language governing permissions and limitations under the License.
*/

import type { MySQLMasterSlaveDetails } from '@services/model/ticket/details/mysql';
import TicketModel from '@services/model/ticket/ticket';
import TicketModel, { type Mysql } from '@services/model/ticket/ticket';

import { random } from '@utils';

// MySQL 主从互换
export function generateMysqlMasterSlaveSwicthCloneData(ticketData: TicketModel<MySQLMasterSlaveDetails>) {
export function generateMysqlMasterSlaveSwicthCloneData(ticketData: TicketModel<Mysql.MasterSlaveSwitch>) {
const {
clusters,
infos,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,12 @@
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for
* the specific language governing permissions and limitations under the License.
*/
import type { MySQLMigrateDetails } from '@services/model/ticket/details/mysql';
import TicketModel from '@services/model/ticket/ticket';
import TicketModel, { type Mysql } from '@services/model/ticket/ticket';

import { random } from '@utils';

// MySQL 迁移(克隆)主从
export function generateMysqlMigrateClusterCloneData(ticketData: TicketModel<MySQLMigrateDetails>) {
export function generateMysqlMigrateClusterCloneData(ticketData: TicketModel<Mysql.MigrateCluster>) {
const { clusters, infos } = ticketData.details;
const tableDataList = infos.map((item) => {
const clusterId = item.cluster_ids[0];
Expand Down
Loading

0 comments on commit ddac6e1

Please sign in to comment.