mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-16 06:30:14 +01:00
🧑💻 Add internal kernel API /api/ui/reloadIcon https://github.com/siyuan-note/siyuan/issues/16008
Signed-off-by: Daniel <845765@qq.com>
This commit is contained in:
parent
e9411f9677
commit
e22d373ba8
3 changed files with 12 additions and 0 deletions
|
|
@ -493,6 +493,7 @@ func ServeAPI(ginServer *gin.Engine) {
|
|||
ginServer.Handle("POST", "/api/archive/unzip", model.CheckAuth, model.CheckAdminRole, model.CheckReadonly, unzip)
|
||||
|
||||
ginServer.Handle("POST", "/api/ui/reloadUI", model.CheckAuth, model.CheckAdminRole, model.CheckReadonly, reloadUI)
|
||||
ginServer.Handle("POST", "/api/ui/reloadIcon", model.CheckAuth, model.CheckAdminRole, model.CheckReadonly, reloadIcon)
|
||||
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)
|
||||
|
|
|
|||
|
|
@ -71,3 +71,10 @@ func reloadUI(c *gin.Context) {
|
|||
|
||||
util.ReloadUI()
|
||||
}
|
||||
|
||||
func reloadIcon(c *gin.Context) {
|
||||
ret := gulu.Ret.NewResult()
|
||||
defer c.JSON(http.StatusOK, ret)
|
||||
|
||||
model.ReloadIcon()
|
||||
}
|
||||
|
|
|
|||
|
|
@ -213,6 +213,10 @@ func loadIcons() {
|
|||
}
|
||||
}
|
||||
|
||||
func ReloadIcon() {
|
||||
loadIcons()
|
||||
}
|
||||
|
||||
func unwatchTheme(folder string) {
|
||||
val, _ := themeWatchers.Load(folder)
|
||||
if nil != val {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue