- 添加MySQL数据库类型的连接支持,默认端口为3306,用户名为root - 实现Oracle与MySQL连接类型的差异化表单验证逻辑 - 更新连接树组件以区分不同数据库类型的显示方式 - 集成备份恢复任务面板,支持双标签页切换功能 - 优化表格排序功能,增强连接列表的可操作性 - 调整任务面板布局,改进用户体验和界面交互 - 新增连接对话框中数据库类型的选择与初始化逻辑
206 lines
5.7 KiB
TypeScript
206 lines
5.7 KiB
TypeScript
import type { ReqPage, ResPage } from '@/api/interface'
|
|
|
|
export namespace Dbms {
|
|
export type DbType = 'ORACLE' | 'MYSQL'
|
|
export type ConnectType = 'SERVICE_NAME' | 'SID'
|
|
export type BackupStrategy = 'DATA_PUMP' | 'JDBC_EXPORT'
|
|
export type BackupMode = 'FULL_TABLE' | 'TIME_RANGE' | 'SIZE_SPLIT'
|
|
export type OperationType = 'BACKUP' | 'RESTORE'
|
|
export type TaskStatus = 'WAITING' | 'RUNNING' | 'SUCCESS' | 'FAIL' | 'FAILED' | 'CANCELLED'
|
|
export type RestoreMode = 'SKIP' | 'APPEND' | 'TRUNCATE' | 'REPLACE'
|
|
|
|
export interface Overview {
|
|
menuName: string
|
|
menuCode: string
|
|
path: string
|
|
status: string
|
|
description: string
|
|
}
|
|
|
|
export interface ConnectionListParams extends ReqPage {
|
|
connectionName?: string
|
|
dbType?: DbType
|
|
schemaName?: string
|
|
}
|
|
|
|
export interface ConnectionRecord {
|
|
id: string
|
|
connectionName: string
|
|
dbType: DbType
|
|
host: string
|
|
port: number
|
|
connectType?: ConnectType | null
|
|
serviceName?: string | null
|
|
sid?: string | null
|
|
databaseName?: string | null
|
|
schemaName?: string | null
|
|
username: string
|
|
savePassword: 0 | 1
|
|
directoryName?: string | null
|
|
directoryPath?: string | null
|
|
extraConfigJson?: string | null
|
|
remark?: string | null
|
|
lastTestStatus?: string | null
|
|
lastTestMessage?: string | null
|
|
lastTestTime?: string | null
|
|
state?: number
|
|
createTime?: string
|
|
updateTime?: string
|
|
}
|
|
|
|
export interface ConnectionPayload {
|
|
id?: string
|
|
connectionName: string
|
|
dbType: DbType
|
|
host: string
|
|
port: number
|
|
connectType?: ConnectType | null
|
|
serviceName?: string | null
|
|
sid?: string | null
|
|
databaseName?: string | null
|
|
schemaName?: string | null
|
|
username: string
|
|
password?: string | null
|
|
savePassword: 0 | 1
|
|
directoryName?: string | null
|
|
directoryPath?: string | null
|
|
extraConfigJson?: string | null
|
|
remark?: string | null
|
|
}
|
|
|
|
export interface DeleteConnectionParams {
|
|
id: string
|
|
}
|
|
|
|
export interface TestConnectionParams {
|
|
connectionId?: string
|
|
connection?: ConnectionPayload
|
|
temporaryPassword?: string
|
|
}
|
|
|
|
export interface TestConnectionResult {
|
|
success: boolean
|
|
message: string
|
|
}
|
|
|
|
export interface TableListParams {
|
|
connectionId: string
|
|
temporaryPassword?: string
|
|
schemaName?: string
|
|
}
|
|
|
|
export interface TableRecord {
|
|
owner: string
|
|
tableName: string
|
|
autoIncrement?: number | string | null
|
|
updateTime?: string | null
|
|
dataLength?: number | string | null
|
|
engine?: string | null
|
|
tableRows?: number | string | null
|
|
comments?: string | null
|
|
}
|
|
|
|
export interface CreateBackupParams {
|
|
connectionId: string
|
|
backupStrategy?: BackupStrategy
|
|
schemaName?: string
|
|
targetNames?: string[]
|
|
backupMode?: BackupMode
|
|
timeColumn?: string | null
|
|
startTime?: string | null
|
|
endTime?: string | null
|
|
maxFileSizeMb?: number | null
|
|
directoryName?: string | null
|
|
temporaryPassword?: string
|
|
}
|
|
|
|
export interface CreateRestoreParams {
|
|
connectionId: string
|
|
backupFileId: string
|
|
restoreMode?: RestoreMode
|
|
targetSchemaName?: string
|
|
temporaryPassword?: string
|
|
overwriteConfirmText?: string | null
|
|
}
|
|
|
|
export interface TaskCreateResult {
|
|
taskId: string
|
|
taskNo: string
|
|
taskStatus: TaskStatus
|
|
}
|
|
|
|
export interface StopBackupTaskParams {
|
|
taskId: string
|
|
}
|
|
|
|
export interface RestartBackupTaskParams {
|
|
taskId: string
|
|
temporaryPassword?: string
|
|
}
|
|
|
|
export interface TaskListParams extends ReqPage {
|
|
connectionId?: string
|
|
taskStatus?: TaskStatus | ''
|
|
}
|
|
|
|
export interface TaskRecord {
|
|
id: string
|
|
taskNo: string
|
|
connectionId: string
|
|
dbType: DbType
|
|
operationType: OperationType
|
|
backupStrategy?: BackupStrategy | null
|
|
restoreMode?: RestoreMode | null
|
|
taskStatus: TaskStatus
|
|
schemaName?: string | null
|
|
targetNamesJson?: string | null
|
|
resultMessage?: string | null
|
|
progressPercent?: number | null
|
|
startedAt?: string | null
|
|
finishedAt?: string | null
|
|
createTime?: string
|
|
updateTime?: string
|
|
}
|
|
|
|
export interface FileListParams extends ReqPage {
|
|
connectionId?: string
|
|
taskId?: string
|
|
backupStrategy?: BackupStrategy | ''
|
|
}
|
|
|
|
export interface BackupFileRecord {
|
|
id: string
|
|
taskId: string
|
|
connectionId: string
|
|
dbType: DbType
|
|
backupStrategy: BackupStrategy
|
|
fileFormat?: string | null
|
|
schemaName?: string | null
|
|
targetNamesJson?: string | null
|
|
backupMode?: BackupMode | null
|
|
fileName: string
|
|
filePath?: string | null
|
|
metadataFilePath?: string | null
|
|
logFileName?: string | null
|
|
logFilePath?: string | null
|
|
fileSize?: number | null
|
|
checksum?: string | null
|
|
state?: number
|
|
createTime?: string
|
|
}
|
|
|
|
export interface DeleteBackupFileParams {
|
|
backupFileId: string
|
|
confirmText: string
|
|
}
|
|
|
|
export interface DeleteTaskParams {
|
|
taskId: string
|
|
confirmText: string
|
|
}
|
|
|
|
export interface ConnectionPageData extends ResPage<ConnectionRecord> {}
|
|
export interface TaskPageData extends ResPage<TaskRecord> {}
|
|
export interface BackupFilePageData extends ResPage<BackupFileRecord> {}
|
|
}
|