🧑‍💻 Add a internal kernel API /api/system/reloadUI https://github.com/siyuan-note/siyuan/issues/13402

This commit is contained in:
Daniel 2024-12-08 22:21:06 +08:00
parent ada8c71ca9
commit 497037465b
No known key found for this signature in database
GPG key ID: 86211BA83DF03017
2 changed files with 8 additions and 0 deletions

View file

@ -66,6 +66,7 @@ func ServeAPI(ginServer *gin.Engine) {
ginServer.Handle("POST", "/api/system/exportConf", model.CheckAuth, model.CheckAdminRole, exportConf)
ginServer.Handle("POST", "/api/system/importConf", model.CheckAuth, model.CheckAdminRole, model.CheckReadonly, importConf)
ginServer.Handle("POST", "/api/system/getWorkspaceInfo", model.CheckAuth, model.CheckAdminRole, model.CheckReadonly, getWorkspaceInfo)
ginServer.Handle("POST", "/api/system/reloadUI", model.CheckAuth, model.CheckAdminRole, model.CheckReadonly, reloadUI)
ginServer.Handle("POST", "/api/storage/setLocalStorage", model.CheckAuth, model.CheckAdminRole, model.CheckReadonly, setLocalStorage)
ginServer.Handle("POST", "/api/storage/getLocalStorage", model.CheckAuth, getLocalStorage)

View file

@ -35,6 +35,13 @@ import (
"github.com/siyuan-note/siyuan/kernel/util"
)
func reloadUI(c *gin.Context) {
ret := gulu.Ret.NewResult()
defer c.JSON(http.StatusOK, ret)
util.ReloadUI()
}
func getWorkspaceInfo(c *gin.Context) {
ret := gulu.Ret.NewResult()
defer c.JSON(http.StatusOK, ret)