🎨 Database table view breadcrumb
This commit is contained in:
parent
6b1a2925c9
commit
d78a0205f5
2 changed files with 23 additions and 0 deletions
|
@ -304,6 +304,8 @@ func buildBlockBreadcrumb(node *ast.Node, excludeTypes []string) (ret []*BlockPa
|
|||
name := util.EscapeHTML(parent.IALAttr("name"))
|
||||
if ast.NodeDocument == parent.Type {
|
||||
name = util.EscapeHTML(box.Name) + util.EscapeHTML(hPath)
|
||||
} else if ast.NodeAttributeView == parent.Type {
|
||||
name = treenode.GetAttributeViewName(parent.AttributeViewID)
|
||||
} else {
|
||||
if "" == name {
|
||||
if ast.NodeListItem == parent.Type {
|
||||
|
|
|
@ -475,6 +475,27 @@ func IsChartCodeBlockCode(code *ast.Node) bool {
|
|||
return render.NoHighlight(language)
|
||||
}
|
||||
|
||||
func GetAttributeViewName(avID string) (name string) {
|
||||
if "" == avID {
|
||||
return
|
||||
}
|
||||
|
||||
attrView, err := av.ParseAttributeView(avID)
|
||||
if nil != err {
|
||||
logging.LogErrorf("parse attribute view [%s] failed: %s", avID, err)
|
||||
return
|
||||
}
|
||||
|
||||
buf := bytes.Buffer{}
|
||||
for _, v := range attrView.Views {
|
||||
buf.WriteString(v.Name)
|
||||
buf.WriteByte(' ')
|
||||
}
|
||||
|
||||
name = strings.TrimSpace(buf.String())
|
||||
return
|
||||
}
|
||||
|
||||
func getAttributeViewContent(avID string) (content string) {
|
||||
if "" == avID {
|
||||
return
|
||||
|
|
Loading…
Add table
Reference in a new issue