An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作
TypeScript agentic-aiai-agentknowledge-baselocal-firstmarkdownmcpmindmapnote-takingself-hostedsiyuanworkspace
:art: Supports multiple views for the database https://github.com/siyuan-note/siyuan/issues/9751
Daniel083e9b839b72
diff --git a/kernel/api/av.go b/kernel/api/av.goindex 2f4a773fa5..b7b1d66eef 100644--- a/kernel/api/av.go+++ b/kernel/api/av.go@@ -48,6 +48,7 @@ func renderSnapshotAttributeView(c *gin.Context) {for _, v := range attrView.Views {view := map[string]interface{}{"id": v.ID,+ "icon": v.Icon,"name": v.Name,"type": v.LayoutType,}@@ -88,6 +89,7 @@ func renderHistoryAttributeView(c *gin.Context) {for _, v := range attrView.Views {view := map[string]interface{}{"id": v.ID,+ "icon": v.Icon,"name": v.Name,"type": v.LayoutType,}@@ -132,6 +134,7 @@ func renderAttributeView(c *gin.Context) {for _, v := range attrView.Views {view := map[string]interface{}{"id": v.ID,+ "icon": v.Icon,"name": v.Name,"type": v.LayoutType,}diff --git a/kernel/model/attribute_view.go b/kernel/model/attribute_view.goindex d482436a3f..b76c235caa 100644--- a/kernel/model/attribute_view.go+++ b/kernel/model/attribute_view.go@@ -644,18 +644,21 @@ func (tx *Transaction) doRemoveAttrViewView(operation *Operation) (ret *TxErr) {}if 1 >= len(attrView.Views) {+ logging.LogWarnf("can't remove last view [%s] of attribute view [%s]", operation.ID, avID)return}viewID := operation.ID+ var index intfor i, view := range attrView.Views {if viewID == view.ID {attrView.Views = append(attrView.Views[:i], attrView.Views[i+1:]...)+ index = i - 1break}}- attrView.ViewID = attrView.Views[0].ID+ attrView.ViewID = attrView.Views[index].IDif err = av.SaveAttributeView(attrView); nil != err {logging.LogErrorf("save attribute view [%s] failed: %s", avID, err)return &TxErr{code: TxErrCodeWriteTree, msg: err.Error(), id: avID}