From e6366f7442d97785da3d6a31b12cf2e9a085386b Mon Sep 17 00:00:00 2001 From: Larvan2 <78135608+Larvan2@users.noreply.github.com> Date: Sun, 24 Sep 2023 19:00:51 +0800 Subject: [PATCH] chore: fix typo --- config/config.go | 1 + config/update_ui.go | 4 ++-- hub/route/upgrade.go | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/config/config.go b/config/config.go index fd1a4116..a1ddde81 100644 --- a/config/config.go +++ b/config/config.go @@ -461,6 +461,7 @@ func UnmarshalRawConfig(buf []byte) (*RawConfig, error) { GeoIp: "https://fastly.jsdelivr.net/gh/MetaCubeX/meta-rules-dat@release/geoip.dat", GeoSite: "https://fastly.jsdelivr.net/gh/MetaCubeX/meta-rules-dat@release/geosite.dat", }, + ExternalUIURL: "https://github.com/MetaCubeX/metacubexd/archive/refs/heads/gh-pages.zip", } if err := yaml.Unmarshal(buf, rawCfg); err != nil { diff --git a/config/update_ui.go b/config/update_ui.go index 3526836e..27e0f382 100644 --- a/config/update_ui.go +++ b/config/update_ui.go @@ -21,7 +21,7 @@ var ( ExternalUIName string ) var ( - ErrImcompleteConf = errors.New("ExternalUI configure incomplete") + ErrIncompleteConf = errors.New("ExternalUI configure incomplete") ) var xdMutex sync.Mutex @@ -66,7 +66,7 @@ func UpdateUI() error { func prepare() error { if ExternalUIPath == "" || ExternalUIURL == "" { - return ErrImcompleteConf + return ErrIncompleteConf } if ExternalUIName != "" { diff --git a/hub/route/upgrade.go b/hub/route/upgrade.go index 28acb23a..7b486ee3 100644 --- a/hub/route/upgrade.go +++ b/hub/route/upgrade.go @@ -50,7 +50,7 @@ func upgradeCore(w http.ResponseWriter, r *http.Request) { func updateUI(w http.ResponseWriter, r *http.Request) { err := config.UpdateUI() if err != nil { - if errors.Is(err, config.ErrImcompleteConf) { + if errors.Is(err, config.ErrIncompleteConf) { log.Warnln("%s", err) render.Status(r, http.StatusNotImplemented) render.JSON(w, r, newError(fmt.Sprintf("%s", err)))