feat: update external-ui
This commit is contained in:
@ -49,7 +49,6 @@ type Memory struct {
|
||||
|
||||
func SetUIPath(path string) {
|
||||
uiPath = C.Path.Resolve(path)
|
||||
C.UIPath = uiPath
|
||||
}
|
||||
|
||||
func Start(addr string, tlsAddr string, secret string,
|
||||
|
@ -16,7 +16,7 @@ import (
|
||||
func upgradeRouter() http.Handler {
|
||||
r := chi.NewRouter()
|
||||
r.Post("/", upgrade)
|
||||
r.Post("/xd", updateXD)
|
||||
r.Post("/ui", updateUI)
|
||||
return r
|
||||
}
|
||||
|
||||
@ -46,8 +46,8 @@ func upgrade(w http.ResponseWriter, r *http.Request) {
|
||||
go restartExecutable(execPath)
|
||||
}
|
||||
|
||||
func updateXD(w http.ResponseWriter, r *http.Request) {
|
||||
err := config.UpdateXD()
|
||||
func updateUI(w http.ResponseWriter, r *http.Request) {
|
||||
err := config.UpdateUI()
|
||||
if err != nil {
|
||||
log.Warnln("%s", err)
|
||||
render.Status(r, http.StatusInternalServerError)
|
||||
|
Reference in New Issue
Block a user