mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-18 15:40:12 +01:00
🎨 Database column icon https://github.com/siyuan-note/siyuan/issues/9304
This commit is contained in:
parent
8db022ec8a
commit
a3ea6a2362
2 changed files with 4 additions and 3 deletions
|
|
@ -82,11 +82,12 @@ type Key struct {
|
||||||
Template string `json:"template"` // 模板内容
|
Template string `json:"template"` // 模板内容
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewKey(id, name string, keyType KeyType) *Key {
|
func NewKey(id, name, icon string, keyType KeyType) *Key {
|
||||||
return &Key{
|
return &Key{
|
||||||
ID: id,
|
ID: id,
|
||||||
Name: name,
|
Name: name,
|
||||||
Type: keyType,
|
Type: keyType,
|
||||||
|
Icon: icon,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -397,7 +398,7 @@ type Viewable interface {
|
||||||
|
|
||||||
func NewAttributeView(id string) (ret *AttributeView) {
|
func NewAttributeView(id string) (ret *AttributeView) {
|
||||||
view := NewView()
|
view := NewView()
|
||||||
key := NewKey(ast.NewNodeID(), "Block", KeyTypeBlock)
|
key := NewKey(ast.NewNodeID(), "Block", "", KeyTypeBlock)
|
||||||
ret = &AttributeView{
|
ret = &AttributeView{
|
||||||
Spec: 0,
|
Spec: 0,
|
||||||
ID: id,
|
ID: id,
|
||||||
|
|
|
||||||
|
|
@ -903,7 +903,7 @@ func addAttributeViewColumn(operation *Operation) (err error) {
|
||||||
keyType := av.KeyType(operation.Typ)
|
keyType := av.KeyType(operation.Typ)
|
||||||
switch keyType {
|
switch keyType {
|
||||||
case av.KeyTypeText, av.KeyTypeNumber, av.KeyTypeDate, av.KeyTypeSelect, av.KeyTypeMSelect, av.KeyTypeURL, av.KeyTypeEmail, av.KeyTypePhone, av.KeyTypeMAsset, av.KeyTypeTemplate:
|
case av.KeyTypeText, av.KeyTypeNumber, av.KeyTypeDate, av.KeyTypeSelect, av.KeyTypeMSelect, av.KeyTypeURL, av.KeyTypeEmail, av.KeyTypePhone, av.KeyTypeMAsset, av.KeyTypeTemplate:
|
||||||
key := av.NewKey(operation.ID, operation.Name, keyType)
|
key := av.NewKey(operation.ID, operation.Name, operation.Data.(string), keyType)
|
||||||
attrView.KeyValues = append(attrView.KeyValues, &av.KeyValues{Key: key})
|
attrView.KeyValues = append(attrView.KeyValues, &av.KeyValues{Key: key})
|
||||||
|
|
||||||
switch view.LayoutType {
|
switch view.LayoutType {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue