mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-17 15:10:12 +01:00
🧑💻 Add an internal kernel API /api/ui/reloadFiletree https://github.com/siyuan-note/siyuan/issues/14493
Add an internal kernel API `/api/ui/reloadUI` https://github.com/siyuan-note/siyuan/issues/14494
This commit is contained in:
parent
31312bd7c0
commit
d0ad863651
3 changed files with 18 additions and 9 deletions
|
|
@ -473,6 +473,8 @@ func ServeAPI(ginServer *gin.Engine) {
|
|||
ginServer.Handle("POST", "/api/archive/zip", model.CheckAuth, model.CheckAdminRole, model.CheckReadonly, zip)
|
||||
ginServer.Handle("POST", "/api/archive/unzip", model.CheckAuth, model.CheckAdminRole, model.CheckReadonly, unzip)
|
||||
|
||||
ginServer.Handle("POST", "/api/editor/reloadAttributeView", model.CheckAuth, model.CheckAdminRole, model.CheckReadonly, reloadAttributeView)
|
||||
ginServer.Handle("POST", "/api/editor/reloadProtyle", model.CheckAuth, model.CheckAdminRole, model.CheckReadonly, reloadProtyle)
|
||||
ginServer.Handle("POST", "/api/ui/reloadUI", model.CheckAuth, model.CheckAdminRole, model.CheckReadonly, reloadUI)
|
||||
ginServer.Handle("POST", "/api/ui/reloadAttributeView", model.CheckAuth, model.CheckAdminRole, model.CheckReadonly, reloadAttributeView)
|
||||
ginServer.Handle("POST", "/api/ui/reloadProtyle", model.CheckAuth, model.CheckAdminRole, model.CheckReadonly, reloadProtyle)
|
||||
ginServer.Handle("POST", "/api/ui/reloadFiletree", model.CheckAuth, model.CheckAdminRole, model.CheckReadonly, reloadFiletree)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -60,13 +60,6 @@ func ignoreAddMicrosoftDefenderExclusion(c *gin.Context) {
|
|||
model.Conf.Save()
|
||||
}
|
||||
|
||||
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)
|
||||
|
|
|
|||
|
|
@ -25,6 +25,13 @@ import (
|
|||
"github.com/siyuan-note/siyuan/kernel/util"
|
||||
)
|
||||
|
||||
func reloadFiletree(c *gin.Context) {
|
||||
ret := gulu.Ret.NewResult()
|
||||
defer c.JSON(http.StatusOK, ret)
|
||||
|
||||
util.PushReloadFiletree()
|
||||
}
|
||||
|
||||
func reloadProtyle(c *gin.Context) {
|
||||
ret := gulu.Ret.NewResult()
|
||||
defer c.JSON(http.StatusOK, ret)
|
||||
|
|
@ -50,3 +57,10 @@ func reloadAttributeView(c *gin.Context) {
|
|||
id := arg["id"].(string)
|
||||
model.ReloadAttrView(id)
|
||||
}
|
||||
|
||||
func reloadUI(c *gin.Context) {
|
||||
ret := gulu.Ret.NewResult()
|
||||
defer c.JSON(http.StatusOK, ret)
|
||||
|
||||
util.ReloadUI()
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue