2
0
mirror of https://github.com/acepanel/panel.git synced 2026-02-04 10:17:17 +08:00

feat: 同步修改

This commit is contained in:
耗子
2024-10-12 22:05:58 +08:00
parent d18bf93571
commit 99cd473680
38 changed files with 388 additions and 551 deletions

View File

@@ -3,6 +3,7 @@ package mysql
import (
"fmt"
"net/http"
"os"
"regexp"
"github.com/spf13/cast"
@@ -80,11 +81,16 @@ func (s *Service) Load(w http.ResponseWriter, r *http.Request) {
return
}
raw, err := shell.Execf(`mysqladmin -u root -p "%s" extended-status`, rootPassword)
if err = os.Setenv("MYSQL_PWD", rootPassword); err != nil {
service.Error(w, http.StatusInternalServerError, "设置环境变量失败")
return
}
raw, err := shell.Execf(`mysqladmin -u root extended-status`)
if err != nil {
service.Error(w, http.StatusInternalServerError, "获取负载失败")
return
}
_ = os.Unsetenv("MYSQL_PWD")
var load []map[string]string
expressions := []struct {