diff --git a/backend/services/browser_service.go b/backend/services/browser_service.go index 0edce5a..b5220f8 100644 --- a/backend/services/browser_service.go +++ b/backend/services/browser_service.go @@ -179,8 +179,13 @@ func (b *browserService) OpenConnection(name string) (resp types.JSResp) { dbInfoStr := info["Keyspace"][dbName] if len(dbInfoStr) > 0 { dbInfo := b.parseDBItemInfo(dbInfoStr) + var alias string + if selConn.Alias != nil { + alias = selConn.Alias[idx] + } return types.ConnectionDB{ Name: dbName, + Alias: alias, Index: idx, MaxKeys: dbInfo["keys"], Expires: dbInfo["expires"], diff --git a/backend/types/connection.go b/backend/types/connection.go index dbebb3a..dcdfb37 100644 --- a/backend/types/connection.go +++ b/backend/types/connection.go @@ -20,6 +20,7 @@ type ConnectionConfig struct { LoadSize int `json:"loadSize,omitempty" yaml:"load_size,omitempty"` MarkColor string `json:"markColor,omitempty" yaml:"mark_color,omitempty"` RefreshInterval int `json:"refreshInterval,omitempty" yaml:"refreshInterval,omitempty"` + Alias map[int]string `json:"alias,omitempty" yaml:"alias,omitempty"` SSL ConnectionSSL `json:"ssl,omitempty" yaml:"ssl,omitempty"` SSH ConnectionSSH `json:"ssh,omitempty" yaml:"ssh,omitempty"` Sentinel ConnectionSentinel `json:"sentinel,omitempty" yaml:"sentinel,omitempty"` @@ -36,6 +37,7 @@ type Connections []Connection type ConnectionDB struct { Name string `json:"name"` + Alias string `json:"alias,omitempty"` Index int `json:"index"` MaxKeys int `json:"maxKeys"` Expires int `json:"expires,omitempty"` diff --git a/frontend/src/components/dialogs/ConnectionDialog.vue b/frontend/src/components/dialogs/ConnectionDialog.vue index 511f93e..a4aad56 100644 --- a/frontend/src/components/dialogs/ConnectionDialog.vue +++ b/frontend/src/components/dialogs/ConnectionDialog.vue @@ -1,5 +1,5 @@