fix: db alias not display in empty database
This commit is contained in:
parent
700a54081b
commit
673159dc85
|
@ -177,12 +177,12 @@ func (b *browserService) OpenConnection(name string) (resp types.JSResp) {
|
||||||
queryDB := func(idx int) types.ConnectionDB {
|
queryDB := func(idx int) types.ConnectionDB {
|
||||||
dbName := "db" + strconv.Itoa(idx)
|
dbName := "db" + strconv.Itoa(idx)
|
||||||
dbInfoStr := info["Keyspace"][dbName]
|
dbInfoStr := info["Keyspace"][dbName]
|
||||||
if len(dbInfoStr) > 0 {
|
|
||||||
dbInfo := b.parseDBItemInfo(dbInfoStr)
|
|
||||||
var alias string
|
var alias string
|
||||||
if selConn.Alias != nil {
|
if selConn.Alias != nil {
|
||||||
alias = selConn.Alias[idx]
|
alias = selConn.Alias[idx]
|
||||||
}
|
}
|
||||||
|
if len(dbInfoStr) > 0 {
|
||||||
|
dbInfo := b.parseDBItemInfo(dbInfoStr)
|
||||||
return types.ConnectionDB{
|
return types.ConnectionDB{
|
||||||
Name: dbName,
|
Name: dbName,
|
||||||
Alias: alias,
|
Alias: alias,
|
||||||
|
@ -194,6 +194,7 @@ func (b *browserService) OpenConnection(name string) (resp types.JSResp) {
|
||||||
} else {
|
} else {
|
||||||
return types.ConnectionDB{
|
return types.ConnectionDB{
|
||||||
Name: dbName,
|
Name: dbName,
|
||||||
|
Alias: alias,
|
||||||
Index: idx,
|
Index: idx,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue