mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-16 22:50:13 +01:00
🎨 API getTag add an optional parameter ignoreMaxListHint https://github.com/siyuan-note/siyuan/issues/16000
Signed-off-by: Daniel <845765@qq.com>
This commit is contained in:
parent
f69cad6349
commit
e9411f9677
2 changed files with 10 additions and 3 deletions
|
|
@ -43,7 +43,14 @@ func getTag(c *gin.Context) {
|
||||||
model.Conf.Tag.Sort = sortMode
|
model.Conf.Tag.Sort = sortMode
|
||||||
model.Conf.Save()
|
model.Conf.Save()
|
||||||
|
|
||||||
ret.Data = model.BuildTags()
|
// API `getTag` add an optional parameter `ignoreMaxListHint` https://github.com/siyuan-note/siyuan/issues/16000
|
||||||
|
ignoreMaxListHint := false
|
||||||
|
ignoreMaxListHintArg := arg["ignoreMaxListHint"]
|
||||||
|
if nil != ignoreMaxListHintArg {
|
||||||
|
ignoreMaxListHint = ignoreMaxListHintArg.(bool)
|
||||||
|
}
|
||||||
|
|
||||||
|
ret.Data = model.BuildTags(ignoreMaxListHint)
|
||||||
}
|
}
|
||||||
|
|
||||||
func renameTag(c *gin.Context) {
|
func renameTag(c *gin.Context) {
|
||||||
|
|
|
||||||
|
|
@ -236,7 +236,7 @@ type Tag struct {
|
||||||
|
|
||||||
type Tags []*Tag
|
type Tags []*Tag
|
||||||
|
|
||||||
func BuildTags() (ret *Tags) {
|
func BuildTags(ignoreMaxListHintArg bool) (ret *Tags) {
|
||||||
FlushTxQueue()
|
FlushTxQueue()
|
||||||
sql.FlushQueue()
|
sql.FlushQueue()
|
||||||
|
|
||||||
|
|
@ -254,7 +254,7 @@ func BuildTags() (ret *Tags) {
|
||||||
for _, tag := range tags {
|
for _, tag := range tags {
|
||||||
*tmp = append(*tmp, tag)
|
*tmp = append(*tmp, tag)
|
||||||
countTag(tag, &total)
|
countTag(tag, &total)
|
||||||
if Conf.FileTree.MaxListCount < total {
|
if Conf.FileTree.MaxListCount < total && !ignoreMaxListHintArg {
|
||||||
util.PushMsg(fmt.Sprintf(Conf.Language(243), Conf.FileTree.MaxListCount), 7000)
|
util.PushMsg(fmt.Sprintf(Conf.Language(243), Conf.FileTree.MaxListCount), 7000)
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue