chore: support ETag for update geo

This commit is contained in:
wwqgtxx
2024-09-22 13:57:57 +08:00
parent 5d242510c8
commit b7cb6774bf
11 changed files with 117 additions and 51 deletions

View File

@@ -381,13 +381,13 @@ func updateTunnels(tunnels []LC.Tunnel) {
}
func initExternalUI() {
if updater.AutoUpdateUI {
if updater.AutoDownloadUI {
dirEntries, _ := os.ReadDir(updater.ExternalUIPath)
if len(dirEntries) > 0 {
log.Infoln("UI already exists, skip downloading")
} else {
log.Infoln("External UI downloading ...")
updater.UpdateUI()
updater.DownloadUI()
}
}
}

View File

@@ -47,7 +47,7 @@ func upgradeCore(w http.ResponseWriter, r *http.Request) {
}
func updateUI(w http.ResponseWriter, r *http.Request) {
err := updater.UpdateUI()
err := updater.DownloadUI()
if err != nil {
log.Warnln("%s", err)
render.Status(r, http.StatusInternalServerError)