A privacy-first, self-hosted, fully open source personal knowledge management software, written in typescript and golang. (PERSONAL FORK)
1// SiYuan - Refactor your thinking
2// Copyright (c) 2020-present, b3log.org
3//
4// This program is free software: you can redistribute it and/or modify
5// it under the terms of the GNU Affero General Public License as published by
6// the Free Software Foundation, either version 3 of the License, or
7// (at your option) any later version.
8//
9// This program is distributed in the hope that it will be useful,
10// but WITHOUT ANY WARRANTY; without even the implied warranty of
11// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12// GNU Affero General Public License for more details.
13//
14// You should have received a copy of the GNU Affero General Public License
15// along with this program. If not, see <https://www.gnu.org/licenses/>.
16
17package api
18
19import (
20 "net/http"
21
22 "github.com/88250/gulu"
23 "github.com/gin-gonic/gin"
24 "github.com/siyuan-note/siyuan/kernel/model"
25 "github.com/siyuan-note/siyuan/kernel/util"
26)
27
28func reloadTag(c *gin.Context) {
29 ret := gulu.Ret.NewResult()
30 defer c.JSON(http.StatusOK, ret)
31
32 model.ReloadTag()
33}
34
35func reloadFiletree(c *gin.Context) {
36 ret := gulu.Ret.NewResult()
37 defer c.JSON(http.StatusOK, ret)
38
39 model.ReloadFiletree()
40}
41
42func reloadProtyle(c *gin.Context) {
43 ret := gulu.Ret.NewResult()
44 defer c.JSON(http.StatusOK, ret)
45
46 arg, ok := util.JsonArg(c, ret)
47 if !ok {
48 return
49 }
50
51 id := arg["id"].(string)
52 model.ReloadProtyle(id)
53}
54
55func reloadAttributeView(c *gin.Context) {
56 ret := gulu.Ret.NewResult()
57 defer c.JSON(http.StatusOK, ret)
58
59 arg, ok := util.JsonArg(c, ret)
60 if !ok {
61 return
62 }
63
64 id := arg["id"].(string)
65 model.ReloadAttrView(id)
66}
67
68func reloadUI(c *gin.Context) {
69 ret := gulu.Ret.NewResult()
70 defer c.JSON(http.StatusOK, ret)
71
72 util.ReloadUI()
73}
74
75func reloadIcon(c *gin.Context) {
76 ret := gulu.Ret.NewResult()
77 defer c.JSON(http.StatusOK, ret)
78
79 model.ReloadIcon()
80}