mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-16 22:50:13 +01:00
This commit is contained in:
parent
a11e3d9871
commit
a021097b06
2 changed files with 20 additions and 2 deletions
|
|
@ -102,6 +102,15 @@ func removeNotebook(c *gin.Context) {
|
|||
return
|
||||
}
|
||||
|
||||
if util.ReadOnly && !model.IsUserGuide(notebook) {
|
||||
result := util.NewResult()
|
||||
result.Code = -1
|
||||
result.Msg = model.Conf.Language(34)
|
||||
result.Data = map[string]interface{}{"closeTimeout": 5000}
|
||||
c.JSON(200, result)
|
||||
return
|
||||
}
|
||||
|
||||
err := model.RemoveBox(notebook)
|
||||
if nil != err {
|
||||
ret.Code = -1
|
||||
|
|
@ -167,6 +176,15 @@ func openNotebook(c *gin.Context) {
|
|||
return
|
||||
}
|
||||
|
||||
if util.ReadOnly && !model.IsUserGuide(notebook) {
|
||||
result := util.NewResult()
|
||||
result.Code = -1
|
||||
result.Msg = model.Conf.Language(34)
|
||||
result.Data = map[string]interface{}{"closeTimeout": 5000}
|
||||
c.JSON(200, result)
|
||||
return
|
||||
}
|
||||
|
||||
msgId := util.PushMsg(model.Conf.Language(45), 1000*60*15)
|
||||
defer util.PushClearMsg(msgId)
|
||||
existed, err := model.Mount(notebook)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue