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 {
|
||||
dbName := "db" + strconv.Itoa(idx)
|
||||
dbInfoStr := info["Keyspace"][dbName]
|
||||
if len(dbInfoStr) > 0 {
|
||||
dbInfo := b.parseDBItemInfo(dbInfoStr)
|
||||
var alias string
|
||||
if selConn.Alias != nil {
|
||||
alias = selConn.Alias[idx]
|
||||
}
|
||||
if len(dbInfoStr) > 0 {
|
||||
dbInfo := b.parseDBItemInfo(dbInfoStr)
|
||||
return types.ConnectionDB{
|
||||
Name: dbName,
|
||||
Alias: alias,
|
||||
|
@ -194,6 +194,7 @@ func (b *browserService) OpenConnection(name string) (resp types.JSResp) {
|
|||
} else {
|
||||
return types.ConnectionDB{
|
||||
Name: dbName,
|
||||
Alias: alias,
|
||||
Index: idx,
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue