Skip to content

Commit

Permalink
feat(frontend): 单据管理迭代_1203 #7190
Browse files Browse the repository at this point in the history
  • Loading branch information
JustaCattt committed Dec 3, 2024
1 parent 0a93e96 commit a18caad
Show file tree
Hide file tree
Showing 10 changed files with 200 additions and 4 deletions.
4 changes: 3 additions & 1 deletion dbm-ui/frontend/src/common/const/ticketTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ export enum TicketTypes {
MYSQL_HA_FULL_BACKUP = 'MYSQL_HA_FULL_BACKUP',
MYSQL_OPEN_AREA = 'MYSQL_OPEN_AREA', // 开区
MYSQL_PARTITION = 'MYSQL_PARTITION',
MYSQL_DUMP_DATA = 'MYSQL_DUMP_DATA', // mysql mysql 数据导出
MYSQL_DUMP_DATA = 'MYSQL_DUMP_DATA', // mysql 数据导出
MYSQL_DATA_REPAIR = 'MYSQL_DATA_REPAIR', // mysql 数据修复
MYSQL_PROXY_UPGRADE = 'MYSQL_PROXY_UPGRADE', // MySQL Proxy 升级
MYSQL_LOCAL_UPGRADE = 'MYSQL_LOCAL_UPGRADE', // MySQL 原地升级
MYSQL_MIGRATE_UPGRADE = 'MYSQL_MIGRATE_UPGRADE', // MySQL 迁移升级
Expand Down Expand Up @@ -115,6 +116,7 @@ export enum TicketTypes {
TENDBCLUSTER_RESTORE_LOCAL_SLAVE = 'TENDBCLUSTER_RESTORE_LOCAL_SLAVE', // spider 重建从库-原地重建
TENDBCLUSTER_RESTORE_SLAVE = 'TENDBCLUSTER_RESTORE_SLAVE', // spider 重建从库-新机重建
TENDBCLUSTER_DUMP_DATA = 'TENDBCLUSTER_DUMP_DATA', // spider 数据导出
TENDBCLUSTER_DATA_REPAIR = 'TENDBCLUSTER_DATA_REPAIR', // spider 数据修复
TENDBCLUSTER_SEMANTIC_CHECK = 'TENDBCLUSTER_SEMANTIC_CHECK', // spider 模拟执行
TENDBCLUSTER_ACCOUNT_RULE_CHANGE = 'TENDBCLUSTER_ACCOUNT_RULE_CHANGE', // spider 权限变更
}
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 @@ -3744,5 +3744,6 @@
"只读集群名称:": "只读集群名称:",
"强制实例下架:": "强制实例下架:",
"Excel文件:": "Excel文件:",
"不一致时间范围:": "不一致时间范围:",
"这行勿动!新增翻译请在上一行添加!": ""
}
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export interface CheckSum extends DetailBase {
bk_host_id: number;
ip: string;
port?: number;
};
}[];
table_patterns: string[];
}[];
is_sync_non_innodb: boolean;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import type { DetailBase, DetailClusters } from '../common';

/**
* MySQL 数据修复
*/
export interface DataRepair extends DetailBase {
clusters: DetailClusters;
infos: {
cluster_id: number;
master: {
id: number;
ip: string;
port: number;
bk_biz_id: number;
bk_host_id: number;
bk_cloud_id: number;
};
slaves: {
id: number;
ip: string;
port: number;
bk_biz_id: number;
bk_host_id: number;
bk_cloud_id: number;
is_consistent: boolean;
}[];
}[];
end_time: string;
start_time: string;
trigger_type: string;
checksum_table: string;
is_sync_non_innodb: boolean;
is_ticket_consistent: boolean;
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ export * from './addSlava';
export * from './authorizeRules';
export * from './checkSum';
export * from './clientCloneRules';
export * from './clusterSwitch';
export * from './dataMigrate';
export * from './dataRepair';
export * from './dumpData';
export * from './flashBack';
export * from './haApply';
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import type { DetailBase, DetailClusters } from '../common';

/**
* TenDBCluster 数据修复
*/
export interface DataRepair extends DetailBase {
clusters: DetailClusters;
infos: {
cluster_id: number;
master: {
id: number;
ip: string;
port: number;
bk_biz_id: number;
bk_host_id: number;
bk_cloud_id: number;
};
slaves: {
id: number;
ip: string;
port: number;
bk_biz_id: number;
bk_host_id: number;
bk_cloud_id: number;
is_consistent: boolean;
}[];
}[];
end_time: string;
start_time: string;
trigger_type: string;
checksum_table: string;
is_sync_non_innodb: boolean;
is_ticket_consistent: boolean;
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ export * from './apply';
export * from './authorizeRules';
export * from './checkSum';
export * from './clientCloneRules';
export * from './dataRepair';
export * from './dbTableBackup';
export * from './destroy';
export * from './destroy';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
<BkTableColumn :label="t('校验从库')">
<template #default="{ data }: { data: RowData }">
<div
v-for="(item, index) in data?.slaves"
v-for="(item, index) in data.slaves"
:key="index">
<p class="pt-2 pb-2">{{ item.ip }}: {{ item.port }}</p>
</div>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
<!--
* TencentBlueKing is pleased to support the open source community by making 蓝鲸智云-DB管理系统(BlueKing-BK-DBM) available.
*
* Copyright (C) 2017-2023 THL A29 Limited, a Tencent company. All rights reserved.
*
* Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License.
* You may obtain a copy of the License athttps://opensource.org/licenses/MIT
*
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed
* 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.
-->

<template>
<BkTable :data="ticketDetails.details.infos">
<BkTableColumn :label="t('集群域名')">
<template #default="{ data }">
{{ ticketDetails.details.clusters[data.cluster_id].immute_domain }}
</template>
</BkTableColumn>
<BkTableColumn :label="t('修复主库')">
<template #default="{ data }">
{{ data.master.ip }}
</template>
</BkTableColumn>
<BkTableColumn :label="t('修复从库')">
<template #default="{ data }: { data: RowData }">
{{ data.slaves.map((item) => item.ip).join(',') }}
</template>
</BkTableColumn>
</BkTable>
<InfoList>
<InfoItem :label="t('不一致时间范围:')">
{{ `${ticketDetails.details.start_time} - ${ticketDetails.details.end_time}` }}
</InfoItem>
</InfoList>
</template>

<script setup lang="ts">
import { useI18n } from 'vue-i18n';

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

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

import InfoList, { Item as InfoItem } from '../components/info-list/Index.vue';

interface Props {
ticketDetails: TicketModel<Mysql.DataRepair>;
}

type RowData = Props['ticketDetails']['details']['infos'][number];

defineProps<Props>();

defineOptions({
name: TicketTypes.MYSQL_DATA_REPAIR,
inheritAttrs: false,
});

const { t } = useI18n();
</script>
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
<!--
* TencentBlueKing is pleased to support the open source community by making 蓝鲸智云-DB管理系统(BlueKing-BK-DBM) available.
*
* Copyright (C) 2017-2023 THL A29 Limited, a Tencent company. All rights reserved.
*
* Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License.
* You may obtain a copy of the License athttps://opensource.org/licenses/MIT
*
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed
* 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.
-->

<template>
<BkTable :data="ticketDetails.details.infos">
<BkTableColumn :label="t('集群域名')">
<template #default="{ data }">
{{ ticketDetails.details.clusters[data.cluster_id].immute_domain }}
</template>
</BkTableColumn>
<BkTableColumn :label="t('修复主库')">
<template #default="{ data }">
{{ data.master.ip }}
</template>
</BkTableColumn>
<BkTableColumn :label="t('修复从库')">
<template #default="{ data }: { data: RowData }">
{{ data.slaves.map((item) => item.ip).join(',') }}
</template>
</BkTableColumn>
</BkTable>
<InfoList>
<InfoItem :label="t('不一致时间范围:')">
{{ `${ticketDetails.details.start_time} - ${ticketDetails.details.end_time}` }}
</InfoItem>
</InfoList>
</template>

<script setup lang="ts">
import { useI18n } from 'vue-i18n';

import TicketModel, { type TendbCluster } from '@services/model/ticket/ticket';

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

import InfoList, { Item as InfoItem } from '../components/info-list/Index.vue';

interface Props {
ticketDetails: TicketModel<TendbCluster.DataRepair>;
}

type RowData = Props['ticketDetails']['details']['infos'][number];

defineProps<Props>();

defineOptions({
name: TicketTypes.TENDBCLUSTER_DATA_REPAIR,
inheritAttrs: false,
});

const { t } = useI18n();
</script>

0 comments on commit a18caad

Please sign in to comment.