feat(ui): rework MySQL delivery workbench form and flow

Rebuild the MySQL standardized delivery form in Catalog.vue: sectioned layout (scope/resources/db config/advanced params), client-generated root password with regenerate/copy, storage slider, install/data path hints, inline field validation, delivery history and task polling.

Align CreateMySQLDeliveryPayload with the backend MySQLDeliveryInput contract (cpu_milli/memory_mi/storage_gi required, legacy fields optional, drop nonexistent param_template) and send mysql_root_password/mysql_admin_password as a pair so the credential shown to the user is the one actually deployed.
This commit is contained in:
Hungerdream
2026-07-28 19:15:14 +08:00
parent c139ed6d2f
commit f01398cc67
2 changed files with 1444 additions and 627 deletions
+30 -16
View File
@@ -26,25 +26,26 @@ export interface CreateMySQLDeliveryPayload {
mysql_port?: number mysql_port?: number
data_disk: string data_disk: string
target_host?: string target_host?: string
cpu_cores: number
memory_gb: number
storage_gb: number
cpu_milli: number cpu_milli: number
memory_mi: number memory_mi: number
storage_gi: number storage_gi: number
param_template: string cpu_cores?: number
timezone: string memory_gb?: number
lower_case_table_names: number storage_gb?: number
character_set: string timezone?: string
collation: string lower_case_table_names?: number
max_connections: string | number character_set?: string
innodb_redo_log_capacity: string collation?: string
innodb_flush_log_at_trx_commit: number max_connections?: string | number
sync_binlog: number innodb_redo_log_capacity?: string
innodb_io_capacity: number innodb_flush_log_at_trx_commit?: number
long_query_time: number sync_binlog?: number
binlog_expire_logs_seconds: number innodb_io_capacity?: number
max_binlog_size: string long_query_time?: number
binlog_expire_logs_seconds?: number
max_binlog_size?: string
mysql_root_password?: string
mysql_admin_password?: string
} }
export interface DeliveryTask { export interface DeliveryTask {
@@ -83,6 +84,12 @@ export interface DeliveryTaskSnapshot {
events: TaskEvent[] events: TaskEvent[]
} }
export interface DeploymentCredential {
username: string
host: string
password: string
}
export interface MySQLServiceLedgerItem { export interface MySQLServiceLedgerItem {
name: string name: string
datacenter: string datacenter: string
@@ -172,6 +179,13 @@ export const deliveryApi = {
method: 'POST', method: 'POST',
}) })
}, },
async revealCredentials(taskId: string): Promise<DeploymentCredential[]> {
const data = await authRequest(`/auth/api/v1/delivery/tasks/${encodeURIComponent(taskId)}/credentials/reveal`, {
method: 'POST',
})
return Array.isArray(data.items) ? data.items : []
},
} }
function createIdempotencyKey(payload: CreateMySQLDeliveryPayload) { function createIdempotencyKey(payload: CreateMySQLDeliveryPayload) {
File diff suppressed because it is too large Load Diff