Merge remote-tracking branch 'origin/dev' into dev

This commit is contained in:
Vanessa 2022-06-18 22:48:23 +08:00
commit da19c1fc47
4 changed files with 24 additions and 12 deletions

View file

@ -27,6 +27,7 @@ type FileTree struct {
CreateDocNameTemplate string `json:"createDocNameTemplate"` // 新建文档名模板
MaxListCount int `json:"maxListCount"` // 最大列出数量
AllowCreateDeeper bool `json:"allowCreateDeeper"` // 允许创建超过 7 层深度的子文档
RemoveDocConfirm int `json:"removeDocConfirm"` // 删除文档时是否需要确认0需要确认1不需要确认
Sort int `json:"sort"` // 排序方式
}

View file

@ -40,7 +40,7 @@ require (
github.com/patrickmn/go-cache v2.1.0+incompatible
github.com/qiniu/go-sdk/v7 v7.13.0
github.com/radovskyb/watcher v1.0.7
github.com/siyuan-note/dejavu v0.0.0-20220616063348-51925ac64e13
github.com/siyuan-note/dejavu v0.0.0-20220618124953-c714755a1685
github.com/siyuan-note/encryption v0.0.0-20220612074546-f1dd94fe8676
github.com/siyuan-note/filelock v0.0.0-20220616063212-74cfba0754ee
github.com/vmihailenco/msgpack/v5 v5.3.5

View file

@ -419,8 +419,8 @@ github.com/shurcooL/httpfs v0.0.0-20190707220628-8d4bc4ba7749/go.mod h1:ZY1cvUeJ
github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc=
github.com/shurcooL/vfsgen v0.0.0-20200824052919-0d455de96546/go.mod h1:TrYk7fJVaAttu97ZZKrO9UbRa8izdowaMIZcxYMbVaw=
github.com/sirupsen/logrus v1.8.1/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0=
github.com/siyuan-note/dejavu v0.0.0-20220616063348-51925ac64e13 h1:bmiOyGZR4w6dvIU13oYqwMFrrnFuiG38Mc3UWpVrVu0=
github.com/siyuan-note/dejavu v0.0.0-20220616063348-51925ac64e13/go.mod h1:nCckhUVoaofwwlBOglCui+Mr7Hhyd059vMXzs7jdne0=
github.com/siyuan-note/dejavu v0.0.0-20220618124953-c714755a1685 h1:8DgrXnXk1HPAj2G4DNI1wcDLdCnmddYAUfW/j3dkFVg=
github.com/siyuan-note/dejavu v0.0.0-20220618124953-c714755a1685/go.mod h1:nCckhUVoaofwwlBOglCui+Mr7Hhyd059vMXzs7jdne0=
github.com/siyuan-note/encryption v0.0.0-20220612074546-f1dd94fe8676 h1:QB9TjJQFhXhZ6dAtPpY02DlzHAQm1C+WqZq6OadG8mI=
github.com/siyuan-note/encryption v0.0.0-20220612074546-f1dd94fe8676/go.mod h1:H8fyqqAbp9XreANjeSbc72zEdFfKTXYN34tc1TjZwtw=
github.com/siyuan-note/filelock v0.0.0-20220616063212-74cfba0754ee h1:8nBBJKHbXuMF2dWKUKsrnnFblgeNBfPjLgVm0aDas/s=

View file

@ -191,9 +191,10 @@ func linkTagBlocks(blocks *[]*Block, nodes *[]*GraphNode, links *[]*GraphLink, p
return
}
nodeSize := Conf.Graph.Local.NodeSize
if "" != p {
nodeSize = Conf.Graph.Global.NodeSize
isGlobal := "" == p
nodeSize := Conf.Graph.Global.NodeSize
if !isGlobal {
nodeSize = Conf.Graph.Local.NodeSize
}
// 构造标签节点
@ -215,12 +216,22 @@ func linkTagBlocks(blocks *[]*Block, nodes *[]*GraphNode, links *[]*GraphLink, p
// 连接标签和块
for _, block := range *blocks {
for _, tagSpan := range tagSpans {
if block.ID == tagSpan.BlockID {
*links = append(*links, &GraphLink{
From: tagSpan.Content,
To: block.ID,
Color: &GraphLinkColor{Color: style["--b3-graph-tag-line"]},
})
if isGlobal { // 全局关系图将标签链接到文档块上
if block.RootID == tagSpan.RootID { // 局部关系图将标签链接到子块上
*links = append(*links, &GraphLink{
From: tagSpan.Content,
To: block.RootID,
Color: &GraphLinkColor{Color: style["--b3-graph-tag-line"]},
})
}
} else {
if block.ID == tagSpan.BlockID { // 局部关系图将标签链接到子块上
*links = append(*links, &GraphLink{
From: tagSpan.Content,
To: block.ID,
Color: &GraphLinkColor{Color: style["--b3-graph-tag-line"]},
})
}
}
}
}