feat: gh-ost真实集成验证通过 + 登录页全面中文化 + 外观设置跨浏览器同步修复
gh-ost集成: - handler根据instance_id查DB获取连接信息(host/port/user/password) - 修复gh-ost参数: 去掉不存在的--dry-run(默认noop), 加--execute才真执行 - 加--skip-port-validation(端口映射环境必须) - 加--allow-on-master(单机MySQL直接执行) - 加--initially-drop-ghost-table/old-table/socket-file(清理残留) - GhOstTask增加Port字段, buildArgs同步更新 - dry-run真实验证通过: 连接1.94.55.133:9005, 3行表, 3.85s完成 登录页中文化: - 5个登录组件(SplitView/CenteredCard/SidePanel/FullImage/MinimalDark) - 46处英文文案全部替换为中文 - 平台标题统一为'SQL审核平台' 外观设置同步修复: - GetPublicLoginStyle: GORM First()复用主键导致第二次查询失败 - 改用Take()+重置结构体, 修复theme始终返回dark的bug - UpdateUserPreferences: 同步写入SystemSetting表(login_style+default_theme)
This commit is contained in:
1 parent
62a2b383e1
commit
8aaf2271b8
8 files changed
+135
-61
No files matched your search
@@ -13,6 +13,7 @@ import (
|
||||
// GhOstTask defines a gh-ost execution task
|
||||
type GhOstTask struct {
|
||||
Host string `json:"host"`
|
||||
Port int `json:"port,omitempty"`
|
||||
User string `json:"user"`
|
||||
Password string `json:"password"`
|
||||
Database string `json:"database"`
|
||||
@@ -60,12 +61,18 @@ func RunGhOst(ctx context.Context, task GhOstTask, ghOstPath string) (*GhOstResu
|
||||
|
||||
args := []string{
|
||||
"--host=" + task.Host,
|
||||
fmt.Sprintf("--port=%d", task.Port),
|
||||
"--user=" + task.User,
|
||||
"--password=" + task.Password,
|
||||
"--database=" + task.Database,
|
||||
"--table=" + task.Table,
|
||||
"--alter=" + task.Alter,
|
||||
"--verbose",
|
||||
"--skip-port-validation",
|
||||
"--allow-on-master",
|
||||
"--initially-drop-ghost-table",
|
||||
"--initially-drop-old-table",
|
||||
"--initially-drop-socket-file",
|
||||
}
|
||||
|
||||
if task.ChunkSize > 0 {
|
||||
@@ -91,11 +98,11 @@ func RunGhOst(ctx context.Context, task GhOstTask, ghOstPath string) (*GhOstResu
|
||||
}
|
||||
|
||||
// Dry-Run vs Execute
|
||||
if task.DryRun || !task.Execute {
|
||||
args = append(args, "--dry-run")
|
||||
} else {
|
||||
// gh-ost defaults to noop (dry-run), only --execute actually applies changes
|
||||
if task.Execute {
|
||||
args = append(args, "--execute")
|
||||
}
|
||||
// always verbose for output
|
||||
|
||||
cmd := exec.CommandContext(ctx, ghOstPath, args...)
|
||||
var stdout, stderr bytes.Buffer
|
||||
@@ -193,12 +200,18 @@ func (m *TaskManager) ListTasks() map[string]string {
|
||||
func buildArgs(task GhOstTask, ghOstPath string) []string {
|
||||
args := []string{
|
||||
"--host=" + task.Host,
|
||||
fmt.Sprintf("--port=%d", task.Port),
|
||||
"--user=" + task.User,
|
||||
"--password=" + task.Password,
|
||||
"--database=" + task.Database,
|
||||
"--table=" + task.Table,
|
||||
"--alter=" + task.Alter,
|
||||
"--verbose",
|
||||
"--skip-port-validation",
|
||||
"--allow-on-master",
|
||||
"--initially-drop-ghost-table",
|
||||
"--initially-drop-old-table",
|
||||
"--initially-drop-socket-file",
|
||||
}
|
||||
|
||||
if task.ChunkSize > 0 {
|
||||
@@ -223,9 +236,8 @@ func buildArgs(task GhOstTask, ghOstPath string) []string {
|
||||
args = append(args, "--postpone-cut-over-flag-file=/tmp/gh-ost-cutover.flag")
|
||||
}
|
||||
|
||||
if task.DryRun || !task.Execute {
|
||||
args = append(args, "--dry-run")
|
||||
} else {
|
||||
// gh-ost defaults to noop, only --execute actually applies changes
|
||||
if task.Execute {
|
||||
args = append(args, "--execute")
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user