mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-05-07 02:51:37 +08:00
⬆️ Upgrade database table view
This commit is contained in:
parent
c3918a2a71
commit
8f9ce6e3f0
@ -1117,6 +1117,10 @@
|
|||||||
"resetWindow": "Reset window and exit",
|
"resetWindow": "Reset window and exit",
|
||||||
"quit": "Quit application"
|
"quit": "Quit application"
|
||||||
},
|
},
|
||||||
|
"_attrView": {
|
||||||
|
"table": "Table",
|
||||||
|
"key": "Primary Key"
|
||||||
|
},
|
||||||
"_kernel": {
|
"_kernel": {
|
||||||
"0": "Query notebook failed",
|
"0": "Query notebook failed",
|
||||||
"1": "Duplicated filename",
|
"1": "Duplicated filename",
|
||||||
|
@ -1117,6 +1117,10 @@
|
|||||||
"resetWindow": "Restablecer ventana y salir del programa",
|
"resetWindow": "Restablecer ventana y salir del programa",
|
||||||
"quit": "Salir de la aplicación"
|
"quit": "Salir de la aplicación"
|
||||||
},
|
},
|
||||||
|
"_attrView": {
|
||||||
|
"tabla": "Tabla",
|
||||||
|
"clave": "Clave principal"
|
||||||
|
},
|
||||||
"_kernel": {
|
"_kernel": {
|
||||||
"0": "Consulta al cuaderno de notas fallido",
|
"0": "Consulta al cuaderno de notas fallido",
|
||||||
"1": "Nombre de archivo duplicado",
|
"1": "Nombre de archivo duplicado",
|
||||||
|
@ -1117,6 +1117,10 @@
|
|||||||
"resetWindow": "Réinitialiser la fenêtre et quitter le programme",
|
"resetWindow": "Réinitialiser la fenêtre et quitter le programme",
|
||||||
"quit": "Quitter le programme"
|
"quit": "Quitter le programme"
|
||||||
},
|
},
|
||||||
|
"_attrView": {
|
||||||
|
"table": "Tableau",
|
||||||
|
"key": "Clé primaire"
|
||||||
|
},
|
||||||
"_kernel": {
|
"_kernel": {
|
||||||
"0": "Échec du cahier de requêtes",
|
"0": "Échec du cahier de requêtes",
|
||||||
"1": "Nom de fichier dupliqué",
|
"1": "Nom de fichier dupliqué",
|
||||||
|
@ -1117,6 +1117,10 @@
|
|||||||
"resetWindow": "重置窗口並退出程序",
|
"resetWindow": "重置窗口並退出程序",
|
||||||
"quit": "退出程序"
|
"quit": "退出程序"
|
||||||
},
|
},
|
||||||
|
"_attrView": {
|
||||||
|
"table": "表格",
|
||||||
|
"key": "主鍵"
|
||||||
|
},
|
||||||
"_kernel": {
|
"_kernel": {
|
||||||
"0": "查詢筆記本失敗",
|
"0": "查詢筆記本失敗",
|
||||||
"1": "檔案名重複",
|
"1": "檔案名重複",
|
||||||
|
@ -1117,6 +1117,10 @@
|
|||||||
"resetWindow": "重置窗口并退出程序",
|
"resetWindow": "重置窗口并退出程序",
|
||||||
"quit": "退出程序"
|
"quit": "退出程序"
|
||||||
},
|
},
|
||||||
|
"_attrView": {
|
||||||
|
"table": "表格",
|
||||||
|
"key": "主键"
|
||||||
|
},
|
||||||
"_kernel": {
|
"_kernel": {
|
||||||
"0": "查询笔记本失败",
|
"0": "查询笔记本失败",
|
||||||
"1": "文件名重复",
|
"1": "文件名重复",
|
||||||
|
@ -564,7 +564,7 @@ const (
|
|||||||
func NewTableView() (ret *View) {
|
func NewTableView() (ret *View) {
|
||||||
ret = &View{
|
ret = &View{
|
||||||
ID: ast.NewNodeID(),
|
ID: ast.NewNodeID(),
|
||||||
Name: "Table",
|
Name: getI18nName("table"),
|
||||||
LayoutType: LayoutTypeTable,
|
LayoutType: LayoutTypeTable,
|
||||||
Table: &LayoutTable{
|
Table: &LayoutTable{
|
||||||
Spec: 0,
|
Spec: 0,
|
||||||
@ -578,7 +578,7 @@ func NewTableView() (ret *View) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func NewTableViewWithBlockKey(blockKeyID string) (view *View, blockKey *Key) {
|
func NewTableViewWithBlockKey(blockKeyID string) (view *View, blockKey *Key) {
|
||||||
name := "Table"
|
name := getI18nName("table")
|
||||||
view = &View{
|
view = &View{
|
||||||
ID: ast.NewNodeID(),
|
ID: ast.NewNodeID(),
|
||||||
Name: name,
|
Name: name,
|
||||||
@ -591,7 +591,7 @@ func NewTableViewWithBlockKey(blockKeyID string) (view *View, blockKey *Key) {
|
|||||||
PageSize: 50,
|
PageSize: 50,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
blockKey = NewKey(blockKeyID, "Block", "", KeyTypeBlock)
|
blockKey = NewKey(blockKeyID, getI18nName("key"), "", KeyTypeBlock)
|
||||||
view.Table.Columns = []*ViewTableColumn{{ID: blockKeyID}}
|
view.Table.Columns = []*ViewTableColumn{{ID: blockKeyID}}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@ -781,6 +781,10 @@ func GetAttributeViewDataPath(avID string) (ret string) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func getI18nName(name string) string {
|
||||||
|
return util.AttrViewLangs[util.Lang][name].(string)
|
||||||
|
}
|
||||||
|
|
||||||
var (
|
var (
|
||||||
ErrViewNotFound = errors.New("view not found")
|
ErrViewNotFound = errors.New("view not found")
|
||||||
ErrKeyNotFound = errors.New("key not found")
|
ErrKeyNotFound = errors.New("key not found")
|
||||||
|
@ -492,6 +492,7 @@ func initLang() {
|
|||||||
util.TimeLangs[name] = langMap["_time"].(map[string]interface{})
|
util.TimeLangs[name] = langMap["_time"].(map[string]interface{})
|
||||||
util.TaskActionLangs[name] = langMap["_taskAction"].(map[string]interface{})
|
util.TaskActionLangs[name] = langMap["_taskAction"].(map[string]interface{})
|
||||||
util.TrayMenuLangs[name] = langMap["_trayMenu"].(map[string]interface{})
|
util.TrayMenuLangs[name] = langMap["_trayMenu"].(map[string]interface{})
|
||||||
|
util.AttrViewLangs[name] = langMap["_attrView"].(map[string]interface{})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -139,6 +139,7 @@ var (
|
|||||||
TimeLangs = map[string]map[string]interface{}{}
|
TimeLangs = map[string]map[string]interface{}{}
|
||||||
TaskActionLangs = map[string]map[string]interface{}{}
|
TaskActionLangs = map[string]map[string]interface{}{}
|
||||||
TrayMenuLangs = map[string]map[string]interface{}{}
|
TrayMenuLangs = map[string]map[string]interface{}{}
|
||||||
|
AttrViewLangs = map[string]map[string]interface{}{}
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
|
Loading…
Reference in New Issue
Block a user