Compare commits

..

5 Commits

Author SHA1 Message Date
tiny-craft 34a0be4d08 feat: add new component "switch button"
refactor: extract the file open input as a component
2023-10-21 00:12:22 +08:00
tiny-craft f8a7567166 refactor: reformat frontend files
chore: upgrade frontedn dependencies
2023-10-21 00:11:36 +08:00
tiny-craft f3cd292af5 feat: add partial keys loading. #2 2023-10-21 00:11:35 +08:00
tiny-craft 444f643d4a perf: add loading property to icon button 2023-10-20 18:24:26 +08:00
tiny-craft 25cdfa2685 fix: error causes when close database 2023-10-19 12:00:10 +08:00
58 changed files with 1068 additions and 651 deletions

View File

@ -6,3 +6,5 @@ const DEFAULT_WINDOW_WIDTH = 1024
const DEFAULT_WINDOW_HEIGHT = 768 const DEFAULT_WINDOW_HEIGHT = 768
const MIN_WINDOW_WIDTH = 960 const MIN_WINDOW_WIDTH = 960
const MIN_WINDOW_HEIGHT = 640 const MIN_WINDOW_HEIGHT = 640
const DEFAULT_LOAD_SIZE = 10000
const DEFAULT_SCAN_SIZE = 3000

View File

@ -16,6 +16,7 @@ import (
"sync" "sync"
"sync/atomic" "sync/atomic"
"time" "time"
"tinyrdm/backend/consts"
. "tinyrdm/backend/storage" . "tinyrdm/backend/storage"
"tinyrdm/backend/types" "tinyrdm/backend/types"
"tinyrdm/backend/utils/coll" "tinyrdm/backend/utils/coll"
@ -43,6 +44,8 @@ type connectionItem struct {
client redis.UniversalClient client redis.UniversalClient
ctx context.Context ctx context.Context
cancelFunc context.CancelFunc cancelFunc context.CancelFunc
cursor map[int]uint64 // current cursor of databases
stepSize int64
} }
type keyItem struct { type keyItem struct {
@ -390,12 +393,13 @@ func (c *connectionService) DeleteGroup(name string, includeConn bool) (resp typ
// OpenConnection open redis server connection // OpenConnection open redis server connection
func (c *connectionService) OpenConnection(name string) (resp types.JSResp) { func (c *connectionService) OpenConnection(name string) (resp types.JSResp) {
client, ctx, err := c.getRedisClient(name, 0) item, err := c.getRedisClient(name, 0)
if err != nil { if err != nil {
resp.Msg = err.Error() resp.Msg = err.Error()
return return
} }
client, ctx := item.client, item.ctx
// get connection config // get connection config
selConn := c.conns.GetConnection(name) selConn := c.conns.GetConnection(name)
@ -522,18 +526,18 @@ func (c *connectionService) CloseConnection(name string) (resp types.JSResp) {
return return
} }
// get redis client from local cache or create a new open // get a redis client from local cache or create a new open
// if db >= 0, will also switch to db index // if db >= 0, will also switch to db index
func (c *connectionService) getRedisClient(connName string, db int) (redis.UniversalClient, context.Context, error) { func (c *connectionService) getRedisClient(connName string, db int) (item connectionItem, err error) {
item, ok := c.connMap[connName] var ok bool
var client redis.UniversalClient var client redis.UniversalClient
var ctx context.Context if item, ok = c.connMap[connName]; ok {
if ok { client = item.client
client, ctx = item.client, item.ctx
} else { } else {
selConn := c.conns.GetConnection(connName) selConn := c.conns.GetConnection(connName)
if selConn == nil { if selConn == nil {
return nil, nil, fmt.Errorf("no match connection \"%s\"", connName) err = fmt.Errorf("no match connection \"%s\"", connName)
return
} }
hook := redis2.NewHook(connName, func(cmd string, cost int64) { hook := redis2.NewHook(connName, func(cmd string, cost int64) {
@ -550,10 +554,10 @@ func (c *connectionService) getRedisClient(connName string, db int) (redis.Unive
}) })
}) })
var err error
client, err = c.createRedisClient(selConn.ConnectionConfig) client, err = c.createRedisClient(selConn.ConnectionConfig)
if err != nil { if err != nil {
return nil, nil, fmt.Errorf("create conenction error: %s", err.Error()) err = fmt.Errorf("create conenction error: %s", err.Error())
return
} }
// add hook to each node in cluster mode // add hook to each node in cluster mode
var cluster *redis.ClusterClient var cluster *redis.ClusterClient
@ -563,33 +567,51 @@ func (c *connectionService) getRedisClient(connName string, db int) (redis.Unive
return nil return nil
}) })
if err != nil { if err != nil {
return nil, nil, fmt.Errorf("get cluster nodes error: %s", err.Error()) err = fmt.Errorf("get cluster nodes error: %s", err.Error())
return
} }
} else { } else {
client.AddHook(hook) client.AddHook(hook)
} }
if _, err = client.Ping(c.ctx).Result(); err != nil && err != redis.Nil { if _, err = client.Ping(c.ctx).Result(); err != nil && err != redis.Nil {
return nil, nil, errors.New("can not connect to redis server:" + err.Error()) err = errors.New("can not connect to redis server:" + err.Error())
return
} }
var cancelFunc context.CancelFunc ctx, cancelFunc := context.WithCancel(c.ctx)
ctx, cancelFunc = context.WithCancel(c.ctx) item = connectionItem{
c.connMap[connName] = connectionItem{
client: client, client: client,
ctx: ctx, ctx: ctx,
cancelFunc: cancelFunc, cancelFunc: cancelFunc,
cursor: map[int]uint64{},
stepSize: int64(selConn.LoadSize),
} }
if item.stepSize <= 0 {
item.stepSize = consts.DEFAULT_LOAD_SIZE
}
c.connMap[connName] = item
} }
if db >= 0 { if db >= 0 {
var rdb *redis.Client var rdb *redis.Client
if rdb, ok = client.(*redis.Client); ok && rdb != nil { if rdb, ok = client.(*redis.Client); ok && rdb != nil {
if err := rdb.Do(ctx, "select", strconv.Itoa(db)).Err(); err != nil { if err = rdb.Do(item.ctx, "select", strconv.Itoa(db)).Err(); err != nil {
return nil, nil, err return
} }
} }
} }
return client, ctx, nil return
}
// save current scan cursor
func (c *connectionService) setClientCursor(connName string, db int, cursor uint64) {
if _, ok := c.connMap[connName]; ok {
if cursor == 0 {
delete(c.connMap[connName].cursor, db)
} else {
c.connMap[connName].cursor[db] = cursor
}
}
} }
// parse command response content which use "redis info" // parse command response content which use "redis info"
@ -631,12 +653,13 @@ func (c *connectionService) parseDBItemInfo(info string) map[string]int {
// ServerInfo get server info // ServerInfo get server info
func (c *connectionService) ServerInfo(name string) (resp types.JSResp) { func (c *connectionService) ServerInfo(name string) (resp types.JSResp) {
client, ctx, err := c.getRedisClient(name, 0) item, err := c.getRedisClient(name, 0)
if err != nil { if err != nil {
resp.Msg = err.Error() resp.Msg = err.Error()
return return
} }
client, ctx := item.client, item.ctx
// get database info // get database info
res, err := client.Info(ctx).Result() res, err := client.Info(ctx).Result()
if err != nil { if err != nil {
@ -652,31 +675,43 @@ func (c *connectionService) ServerInfo(name string) (resp types.JSResp) {
// OpenDatabase open select database, and list all keys // OpenDatabase open select database, and list all keys
// @param path contain connection name and db name // @param path contain connection name and db name
func (c *connectionService) OpenDatabase(connName string, db int, match string, keyType string) (resp types.JSResp) { func (c *connectionService) OpenDatabase(connName string, db int, match string, keyType string) (resp types.JSResp) {
return c.ScanKeys(connName, db, match, keyType) c.setClientCursor(connName, db, 0)
return c.LoadNextKeys(connName, db, match, keyType)
} }
// ScanKeys scan all keys // scan keys
func (c *connectionService) ScanKeys(connName string, db int, match, keyType string) (resp types.JSResp) { // @return loaded keys
client, ctx, err := c.getRedisClient(connName, db) // @return next cursor
// @return scan error
func (c *connectionService) scanKeys(ctx context.Context, client redis.UniversalClient, match, keyType string, cursor uint64, count int64) ([]any, uint64, error) {
var err error
filterType := len(keyType) > 0
scanSize := int64(Preferences().GetScanSize())
// define sub scan function
scan := func(ctx context.Context, cli redis.UniversalClient, appendFunc func(k []any)) error {
var loadedKey []string
var scanCount int64
for {
if filterType {
loadedKey, cursor, err = cli.ScanType(ctx, cursor, match, scanSize, keyType).Result()
} else {
loadedKey, cursor, err = cli.Scan(ctx, cursor, match, scanSize).Result()
}
if err != nil { if err != nil {
resp.Msg = err.Error() return err
return } else {
ks := sliceutil.Map(loadedKey, func(i int) any {
return strutil.EncodeRedisKey(loadedKey[i])
})
scanCount += int64(len(ks))
appendFunc(ks)
} }
filterType := len(keyType) > 0 if (count > 0 && scanCount > count) || cursor == 0 {
var countPerScan int64 = 10000 break
// define sub scan function
scan := func(ctx context.Context, cli redis.UniversalClient, appendFunc func(k any)) error {
var iter *redis.ScanIterator
if filterType {
iter = cli.ScanType(ctx, 0, match, countPerScan, keyType).Iterator()
} else {
iter = cli.Scan(ctx, 0, match, countPerScan).Iterator()
} }
for iter.Next(ctx) {
appendFunc(strutil.EncodeRedisKey(iter.Val()))
} }
return iter.Err() return nil
} }
var keys []any var keys []any
@ -684,22 +719,64 @@ func (c *connectionService) ScanKeys(connName string, db int, match, keyType str
// cluster mode // cluster mode
var mutex sync.Mutex var mutex sync.Mutex
err = cluster.ForEachMaster(ctx, func(ctx context.Context, cli *redis.Client) error { err = cluster.ForEachMaster(ctx, func(ctx context.Context, cli *redis.Client) error {
return scan(ctx, cli, func(k any) { return scan(ctx, cli, func(k []any) {
mutex.Lock() mutex.Lock()
keys = append(keys, k) keys = append(keys, k...)
mutex.Unlock() mutex.Unlock()
}) })
}) })
} else { } else {
err = scan(ctx, client, func(k any) { err = scan(ctx, client, func(k []any) {
keys = append(keys, k) keys = append(keys, k...)
}) })
} }
if err != nil {
return nil, cursor, err
}
return keys, cursor, nil
}
// LoadNextKeys load next key from saved cursor
func (c *connectionService) LoadNextKeys(connName string, db int, match, keyType string) (resp types.JSResp) {
item, err := c.getRedisClient(connName, db)
if err != nil { if err != nil {
resp.Msg = err.Error() resp.Msg = err.Error()
return return
} }
client, ctx, count := item.client, item.ctx, item.stepSize
cursor := item.cursor[db]
keys, cursor, err := c.scanKeys(ctx, client, match, keyType, cursor, count)
if err != nil {
resp.Msg = err.Error()
return
}
c.setClientCursor(connName, db, cursor)
resp.Success = true
resp.Data = map[string]any{
"keys": keys,
"end": cursor == 0,
}
return
}
// LoadAllKeys load all keys
func (c *connectionService) LoadAllKeys(connName string, db int, match, keyType string) (resp types.JSResp) {
item, err := c.getRedisClient(connName, db)
if err != nil {
resp.Msg = err.Error()
return
}
client, ctx := item.client, item.ctx
keys, _, err := c.scanKeys(ctx, client, match, keyType, 0, 0)
if err != nil {
resp.Msg = err.Error()
return
}
c.setClientCursor(connName, db, 0)
resp.Success = true resp.Success = true
resp.Data = map[string]any{ resp.Data = map[string]any{
"keys": keys, "keys": keys,
@ -709,12 +786,13 @@ func (c *connectionService) ScanKeys(connName string, db int, match, keyType str
// GetKeyValue get value by key // GetKeyValue get value by key
func (c *connectionService) GetKeyValue(connName string, db int, k any, viewAs string) (resp types.JSResp) { func (c *connectionService) GetKeyValue(connName string, db int, k any, viewAs string) (resp types.JSResp) {
client, ctx, err := c.getRedisClient(connName, db) item, err := c.getRedisClient(connName, db)
if err != nil { if err != nil {
resp.Msg = err.Error() resp.Msg = err.Error()
return return
} }
client, ctx := item.client, item.ctx
key := strutil.DecodeRedisKey(k) key := strutil.DecodeRedisKey(k)
var keyType string var keyType string
var dur time.Duration var dur time.Duration
@ -755,9 +833,10 @@ func (c *connectionService) GetKeyValue(connName string, db int, k any, viewAs s
case "hash": case "hash":
//value, err = client.HGetAll(ctx, key).Result() //value, err = client.HGetAll(ctx, key).Result()
items := map[string]string{} items := map[string]string{}
scanSize := int64(Preferences().GetScanSize())
for { for {
var loadedVal []string var loadedVal []string
loadedVal, cursor, err = client.HScan(ctx, key, cursor, "*", 10000).Result() loadedVal, cursor, err = client.HScan(ctx, key, cursor, "*", scanSize).Result()
if err != nil { if err != nil {
resp.Msg = err.Error() resp.Msg = err.Error()
return return
@ -774,9 +853,10 @@ func (c *connectionService) GetKeyValue(connName string, db int, k any, viewAs s
case "set": case "set":
//value, err = client.SMembers(ctx, key).Result() //value, err = client.SMembers(ctx, key).Result()
items := []string{} items := []string{}
scanSize := int64(Preferences().GetScanSize())
for { for {
var loadedKey []string var loadedKey []string
loadedKey, cursor, err = client.SScan(ctx, key, cursor, "*", 10000).Result() loadedKey, cursor, err = client.SScan(ctx, key, cursor, "*", scanSize).Result()
if err != nil { if err != nil {
resp.Msg = err.Error() resp.Msg = err.Error()
return return
@ -791,9 +871,10 @@ func (c *connectionService) GetKeyValue(connName string, db int, k any, viewAs s
case "zset": case "zset":
//value, err = client.ZRangeWithScores(ctx, key, 0, -1).Result() //value, err = client.ZRangeWithScores(ctx, key, 0, -1).Result()
var items []types.ZSetItem var items []types.ZSetItem
scanSize := int64(Preferences().GetScanSize())
for { for {
var loadedVal []string var loadedVal []string
loadedVal, cursor, err = client.ZScan(ctx, key, cursor, "*", 10000).Result() loadedVal, cursor, err = client.ZScan(ctx, key, cursor, "*", scanSize).Result()
if err != nil { if err != nil {
resp.Msg = err.Error() resp.Msg = err.Error()
return return
@ -848,12 +929,13 @@ func (c *connectionService) GetKeyValue(connName string, db int, k any, viewAs s
// SetKeyValue set value by key // SetKeyValue set value by key
// @param ttl <= 0 means keep current ttl // @param ttl <= 0 means keep current ttl
func (c *connectionService) SetKeyValue(connName string, db int, k any, keyType string, value any, ttl int64, viewAs string) (resp types.JSResp) { func (c *connectionService) SetKeyValue(connName string, db int, k any, keyType string, value any, ttl int64, viewAs string) (resp types.JSResp) {
client, ctx, err := c.getRedisClient(connName, db) item, err := c.getRedisClient(connName, db)
if err != nil { if err != nil {
resp.Msg = err.Error() resp.Msg = err.Error()
return return
} }
client, ctx := item.client, item.ctx
key := strutil.DecodeRedisKey(k) key := strutil.DecodeRedisKey(k)
var expiration time.Duration var expiration time.Duration
if ttl < 0 { if ttl < 0 {
@ -971,12 +1053,13 @@ func (c *connectionService) SetKeyValue(connName string, db int, k any, keyType
// SetHashValue set hash field // SetHashValue set hash field
func (c *connectionService) SetHashValue(connName string, db int, k any, field, newField, value string) (resp types.JSResp) { func (c *connectionService) SetHashValue(connName string, db int, k any, field, newField, value string) (resp types.JSResp) {
client, ctx, err := c.getRedisClient(connName, db) item, err := c.getRedisClient(connName, db)
if err != nil { if err != nil {
resp.Msg = err.Error() resp.Msg = err.Error()
return return
} }
client, ctx := item.client, item.ctx
key := strutil.DecodeRedisKey(k) key := strutil.DecodeRedisKey(k)
var removedField []string var removedField []string
updatedField := map[string]string{} updatedField := map[string]string{}
@ -1017,12 +1100,13 @@ func (c *connectionService) SetHashValue(connName string, db int, k any, field,
// AddHashField add or update hash field // AddHashField add or update hash field
func (c *connectionService) AddHashField(connName string, db int, k any, action int, fieldItems []any) (resp types.JSResp) { func (c *connectionService) AddHashField(connName string, db int, k any, action int, fieldItems []any) (resp types.JSResp) {
client, ctx, err := c.getRedisClient(connName, db) item, err := c.getRedisClient(connName, db)
if err != nil { if err != nil {
resp.Msg = err.Error() resp.Msg = err.Error()
return return
} }
client, ctx := item.client, item.ctx
key := strutil.DecodeRedisKey(k) key := strutil.DecodeRedisKey(k)
updated := map[string]any{} updated := map[string]any{}
switch action { switch action {
@ -1063,12 +1147,13 @@ func (c *connectionService) AddHashField(connName string, db int, k any, action
// AddListItem add item to list or remove from it // AddListItem add item to list or remove from it
func (c *connectionService) AddListItem(connName string, db int, k any, action int, items []any) (resp types.JSResp) { func (c *connectionService) AddListItem(connName string, db int, k any, action int, items []any) (resp types.JSResp) {
client, ctx, err := c.getRedisClient(connName, db) item, err := c.getRedisClient(connName, db)
if err != nil { if err != nil {
resp.Msg = err.Error() resp.Msg = err.Error()
return return
} }
client, ctx := item.client, item.ctx
key := strutil.DecodeRedisKey(k) key := strutil.DecodeRedisKey(k)
var leftPush, rightPush []any var leftPush, rightPush []any
switch action { switch action {
@ -1096,12 +1181,13 @@ func (c *connectionService) AddListItem(connName string, db int, k any, action i
// SetListItem update or remove list item by index // SetListItem update or remove list item by index
func (c *connectionService) SetListItem(connName string, db int, k any, index int64, value string) (resp types.JSResp) { func (c *connectionService) SetListItem(connName string, db int, k any, index int64, value string) (resp types.JSResp) {
client, ctx, err := c.getRedisClient(connName, db) item, err := c.getRedisClient(connName, db)
if err != nil { if err != nil {
resp.Msg = err.Error() resp.Msg = err.Error()
return return
} }
client, ctx := item.client, item.ctx
key := strutil.DecodeRedisKey(k) key := strutil.DecodeRedisKey(k)
var removed []int64 var removed []int64
updated := map[int64]string{} updated := map[int64]string{}
@ -1139,12 +1225,13 @@ func (c *connectionService) SetListItem(connName string, db int, k any, index in
// SetSetItem add members to set or remove from set // SetSetItem add members to set or remove from set
func (c *connectionService) SetSetItem(connName string, db int, k any, remove bool, members []any) (resp types.JSResp) { func (c *connectionService) SetSetItem(connName string, db int, k any, remove bool, members []any) (resp types.JSResp) {
client, ctx, err := c.getRedisClient(connName, db) item, err := c.getRedisClient(connName, db)
if err != nil { if err != nil {
resp.Msg = err.Error() resp.Msg = err.Error()
return return
} }
client, ctx := item.client, item.ctx
key := strutil.DecodeRedisKey(k) key := strutil.DecodeRedisKey(k)
if remove { if remove {
_, err = client.SRem(ctx, key, members...).Result() _, err = client.SRem(ctx, key, members...).Result()
@ -1162,12 +1249,13 @@ func (c *connectionService) SetSetItem(connName string, db int, k any, remove bo
// UpdateSetItem replace member of set // UpdateSetItem replace member of set
func (c *connectionService) UpdateSetItem(connName string, db int, k any, value, newValue string) (resp types.JSResp) { func (c *connectionService) UpdateSetItem(connName string, db int, k any, value, newValue string) (resp types.JSResp) {
client, ctx, err := c.getRedisClient(connName, db) item, err := c.getRedisClient(connName, db)
if err != nil { if err != nil {
resp.Msg = err.Error() resp.Msg = err.Error()
return return
} }
client, ctx := item.client, item.ctx
key := strutil.DecodeRedisKey(k) key := strutil.DecodeRedisKey(k)
_, _ = client.SRem(ctx, key, value).Result() _, _ = client.SRem(ctx, key, value).Result()
_, err = client.SAdd(ctx, key, newValue).Result() _, err = client.SAdd(ctx, key, newValue).Result()
@ -1182,12 +1270,13 @@ func (c *connectionService) UpdateSetItem(connName string, db int, k any, value,
// UpdateZSetValue update value of sorted set member // UpdateZSetValue update value of sorted set member
func (c *connectionService) UpdateZSetValue(connName string, db int, k any, value, newValue string, score float64) (resp types.JSResp) { func (c *connectionService) UpdateZSetValue(connName string, db int, k any, value, newValue string, score float64) (resp types.JSResp) {
client, ctx, err := c.getRedisClient(connName, db) item, err := c.getRedisClient(connName, db)
if err != nil { if err != nil {
resp.Msg = err.Error() resp.Msg = err.Error()
return return
} }
client, ctx := item.client, item.ctx
key := strutil.DecodeRedisKey(k) key := strutil.DecodeRedisKey(k)
updated := map[string]any{} updated := map[string]any{}
var removed []string var removed []string
@ -1233,12 +1322,13 @@ func (c *connectionService) UpdateZSetValue(connName string, db int, k any, valu
// AddZSetValue add item to sorted set // AddZSetValue add item to sorted set
func (c *connectionService) AddZSetValue(connName string, db int, k any, action int, valueScore map[string]float64) (resp types.JSResp) { func (c *connectionService) AddZSetValue(connName string, db int, k any, action int, valueScore map[string]float64) (resp types.JSResp) {
client, ctx, err := c.getRedisClient(connName, db) item, err := c.getRedisClient(connName, db)
if err != nil { if err != nil {
resp.Msg = err.Error() resp.Msg = err.Error()
return return
} }
client, ctx := item.client, item.ctx
key := strutil.DecodeRedisKey(k) key := strutil.DecodeRedisKey(k)
members := maputil.ToSlice(valueScore, func(k string) redis.Z { members := maputil.ToSlice(valueScore, func(k string) redis.Z {
return redis.Z{ return redis.Z{
@ -1266,12 +1356,13 @@ func (c *connectionService) AddZSetValue(connName string, db int, k any, action
// AddStreamValue add stream field // AddStreamValue add stream field
func (c *connectionService) AddStreamValue(connName string, db int, k any, ID string, fieldItems []any) (resp types.JSResp) { func (c *connectionService) AddStreamValue(connName string, db int, k any, ID string, fieldItems []any) (resp types.JSResp) {
client, ctx, err := c.getRedisClient(connName, db) item, err := c.getRedisClient(connName, db)
if err != nil { if err != nil {
resp.Msg = err.Error() resp.Msg = err.Error()
return return
} }
client, ctx := item.client, item.ctx
key := strutil.DecodeRedisKey(k) key := strutil.DecodeRedisKey(k)
_, err = client.XAdd(ctx, &redis.XAddArgs{ _, err = client.XAdd(ctx, &redis.XAddArgs{
Stream: key, Stream: key,
@ -1289,12 +1380,13 @@ func (c *connectionService) AddStreamValue(connName string, db int, k any, ID st
// RemoveStreamValues remove stream values by id // RemoveStreamValues remove stream values by id
func (c *connectionService) RemoveStreamValues(connName string, db int, k any, IDs []string) (resp types.JSResp) { func (c *connectionService) RemoveStreamValues(connName string, db int, k any, IDs []string) (resp types.JSResp) {
client, ctx, err := c.getRedisClient(connName, db) item, err := c.getRedisClient(connName, db)
if err != nil { if err != nil {
resp.Msg = err.Error() resp.Msg = err.Error()
return return
} }
client, ctx := item.client, item.ctx
key := strutil.DecodeRedisKey(k) key := strutil.DecodeRedisKey(k)
_, err = client.XDel(ctx, key, IDs...).Result() _, err = client.XDel(ctx, key, IDs...).Result()
resp.Success = true resp.Success = true
@ -1303,12 +1395,13 @@ func (c *connectionService) RemoveStreamValues(connName string, db int, k any, I
// SetKeyTTL set ttl of key // SetKeyTTL set ttl of key
func (c *connectionService) SetKeyTTL(connName string, db int, k any, ttl int64) (resp types.JSResp) { func (c *connectionService) SetKeyTTL(connName string, db int, k any, ttl int64) (resp types.JSResp) {
client, ctx, err := c.getRedisClient(connName, db) item, err := c.getRedisClient(connName, db)
if err != nil { if err != nil {
resp.Msg = err.Error() resp.Msg = err.Error()
return return
} }
client, ctx := item.client, item.ctx
key := strutil.DecodeRedisKey(k) key := strutil.DecodeRedisKey(k)
var expiration time.Duration var expiration time.Duration
if ttl < 0 { if ttl < 0 {
@ -1330,12 +1423,13 @@ func (c *connectionService) SetKeyTTL(connName string, db int, k any, ttl int64)
// DeleteKey remove redis key // DeleteKey remove redis key
func (c *connectionService) DeleteKey(connName string, db int, k any, async bool) (resp types.JSResp) { func (c *connectionService) DeleteKey(connName string, db int, k any, async bool) (resp types.JSResp) {
client, ctx, err := c.getRedisClient(connName, db) item, err := c.getRedisClient(connName, db)
if err != nil { if err != nil {
resp.Msg = err.Error() resp.Msg = err.Error()
return return
} }
client, ctx := item.client, item.ctx
key := strutil.DecodeRedisKey(k) key := strutil.DecodeRedisKey(k)
var deletedKeys []string var deletedKeys []string
if strings.HasSuffix(key, "*") { if strings.HasSuffix(key, "*") {
@ -1360,7 +1454,8 @@ func (c *connectionService) DeleteKey(connName string, db int, k any, async bool
return nil return nil
} }
iter := cli.Scan(ctx, 0, key, 10000).Iterator() scanSize := int64(Preferences().GetScanSize())
iter := cli.Scan(ctx, 0, key, scanSize).Iterator()
resultKeys := make([]string, 0, 100) resultKeys := make([]string, 0, 100)
for iter.Next(ctx) { for iter.Next(ctx) {
resultKeys = append(resultKeys, iter.Val()) resultKeys = append(resultKeys, iter.Val())
@ -1414,12 +1509,13 @@ func (c *connectionService) DeleteKey(connName string, db int, k any, async bool
// RenameKey rename key // RenameKey rename key
func (c *connectionService) RenameKey(connName string, db int, key, newKey string) (resp types.JSResp) { func (c *connectionService) RenameKey(connName string, db int, key, newKey string) (resp types.JSResp) {
client, ctx, err := c.getRedisClient(connName, db) item, err := c.getRedisClient(connName, db)
if err != nil { if err != nil {
resp.Msg = err.Error() resp.Msg = err.Error()
return return
} }
client, ctx := item.client, item.ctx
if _, ok := client.(*redis.ClusterClient); ok { if _, ok := client.(*redis.ClusterClient); ok {
resp.Msg = "RENAME not support in cluster mode yet" resp.Msg = "RENAME not support in cluster mode yet"
return return

View File

@ -133,6 +133,15 @@ func (p *preferencesService) GetWindowSize() (width, height int) {
return return
} }
func (p *preferencesService) GetScanSize() int {
data := p.pref.GetPreferences()
size := data.General.ScanSize
if size <= 0 {
size = consts.DEFAULT_SCAN_SIZE
}
return size
}
type latestRelease struct { type latestRelease struct {
Name string `json:"name"` Name string `json:"name"`
TagName string `json:"tag_name"` TagName string `json:"tag_name"`

View File

@ -4,6 +4,7 @@ import (
"errors" "errors"
"gopkg.in/yaml.v3" "gopkg.in/yaml.v3"
"sync" "sync"
"tinyrdm/backend/consts"
"tinyrdm/backend/types" "tinyrdm/backend/types"
sliceutil "tinyrdm/backend/utils/slice" sliceutil "tinyrdm/backend/utils/slice"
) )
@ -36,6 +37,7 @@ func (c *ConnectionsStorage) defaultConnectionItem() types.ConnectionConfig {
ExecTimeout: 60, ExecTimeout: 60,
DBFilterType: "none", DBFilterType: "none",
DBFilterList: []int{}, DBFilterList: []int{},
LoadSize: consts.DEFAULT_LOAD_SIZE,
MarkColor: "", MarkColor: "",
Sentinel: types.ConnectionSentinel{ Sentinel: types.ConnectionSentinel{
Master: "mymaster", Master: "mymaster",

View File

@ -46,6 +46,7 @@ func (p *PreferencesStorage) GetPreferences() (ret types.Preferences) {
defer p.mutex.Unlock() defer p.mutex.Unlock()
ret = p.getPreferences() ret = p.getPreferences()
ret.General.ScanSize = max(ret.General.ScanSize, consts.DEFAULT_SCAN_SIZE)
ret.Behavior.AsideWidth = max(ret.Behavior.AsideWidth, consts.DEFAULT_ASIDE_WIDTH) ret.Behavior.AsideWidth = max(ret.Behavior.AsideWidth, consts.DEFAULT_ASIDE_WIDTH)
ret.Behavior.WindowWidth = max(ret.Behavior.WindowWidth, consts.MIN_WINDOW_WIDTH) ret.Behavior.WindowWidth = max(ret.Behavior.WindowWidth, consts.MIN_WINDOW_WIDTH)
ret.Behavior.WindowHeight = max(ret.Behavior.WindowHeight, consts.MIN_WINDOW_HEIGHT) ret.Behavior.WindowHeight = max(ret.Behavior.WindowHeight, consts.MIN_WINDOW_HEIGHT)

View File

@ -15,6 +15,7 @@ type ConnectionConfig struct {
ExecTimeout int `json:"execTimeout,omitempty" yaml:"exec_timeout,omitempty"` ExecTimeout int `json:"execTimeout,omitempty" yaml:"exec_timeout,omitempty"`
DBFilterType string `json:"dbFilterType" yaml:"db_filter_type,omitempty"` DBFilterType string `json:"dbFilterType" yaml:"db_filter_type,omitempty"`
DBFilterList []int `json:"dbFilterList" yaml:"db_filter_list,omitempty"` DBFilterList []int `json:"dbFilterList" yaml:"db_filter_list,omitempty"`
LoadSize int `json:"loadSize,omitempty" yaml:"load_size,omitempty"`
MarkColor string `json:"markColor,omitempty" yaml:"mark_color,omitempty"` MarkColor string `json:"markColor,omitempty" yaml:"mark_color,omitempty"`
SSL ConnectionSSL `json:"ssl,omitempty" yaml:"ssl,omitempty"` SSL ConnectionSSL `json:"ssl,omitempty" yaml:"ssl,omitempty"`
SSH ConnectionSSH `json:"ssh,omitempty" yaml:"ssh,omitempty"` SSH ConnectionSSH `json:"ssh,omitempty" yaml:"ssh,omitempty"`

View File

@ -19,6 +19,7 @@ func NewPreferences() Preferences {
Theme: "auto", Theme: "auto",
Language: "auto", Language: "auto",
FontSize: consts.DEFAULT_FONT_SIZE, FontSize: consts.DEFAULT_FONT_SIZE,
ScanSize: consts.DEFAULT_SCAN_SIZE,
CheckUpdate: true, CheckUpdate: true,
}, },
Editor: PreferencesEditor{ Editor: PreferencesEditor{
@ -38,6 +39,7 @@ type PreferencesGeneral struct {
Language string `json:"language" yaml:"language"` Language string `json:"language" yaml:"language"`
Font string `json:"font" yaml:"font,omitempty"` Font string `json:"font" yaml:"font,omitempty"`
FontSize int `json:"fontSize" yaml:"font_size"` FontSize int `json:"fontSize" yaml:"font_size"`
ScanSize int `json:"scanSize" yaml:"scan_size"`
UseSysProxy bool `json:"useSysProxy" yaml:"use_sys_proxy,omitempty"` UseSysProxy bool `json:"useSysProxy" yaml:"use_sys_proxy,omitempty"`
UseSysProxyHttp bool `json:"useSysProxyHttp" yaml:"use_sys_proxy_http,omitempty"` UseSysProxyHttp bool `json:"useSysProxyHttp" yaml:"use_sys_proxy_http,omitempty"`
CheckUpdate bool `json:"checkUpdate" yaml:"check_update"` CheckUpdate bool `json:"checkUpdate" yaml:"check_update"`

View File

@ -12,8 +12,8 @@
"highlight.js": "^11.9.0", "highlight.js": "^11.9.0",
"lodash": "^4.17.21", "lodash": "^4.17.21",
"pinia": "^2.1.7", "pinia": "^2.1.7",
"sass": "^1.69.3", "sass": "^1.69.4",
"vue": "^3.3.4", "vue": "^3.3.6",
"vue-i18n": "^9.5.0" "vue-i18n": "^9.5.0"
}, },
"devDependencies": { "devDependencies": {
@ -21,9 +21,9 @@
"naive-ui": "^2.35.0", "naive-ui": "^2.35.0",
"prettier": "^3.0.3", "prettier": "^3.0.3",
"unplugin-auto-import": "^0.16.6", "unplugin-auto-import": "^0.16.6",
"unplugin-icons": "^0.17.0", "unplugin-icons": "^0.17.1",
"unplugin-vue-components": "^0.25.2", "unplugin-vue-components": "^0.25.2",
"vite": "^4.4.11" "vite": "^4.5.0"
} }
}, },
"node_modules/@antfu/install-pkg": { "node_modules/@antfu/install-pkg": {
@ -43,9 +43,9 @@
"dev": true "dev": true
}, },
"node_modules/@babel/parser": { "node_modules/@babel/parser": {
"version": "7.22.16", "version": "7.23.0",
"resolved": "https://registry.npmmirror.com/@babel/parser/-/parser-7.22.16.tgz", "resolved": "https://registry.npmmirror.com/@babel/parser/-/parser-7.23.0.tgz",
"integrity": "sha512-+gPfKv8UWeKKeJTUxe59+OobVcrYHETCsORl61EmSkmgymguYk/X5bp7GuUIXaFsc6y++v8ZxPsLSSuujqDphA==", "integrity": "sha512-vvPKKdMemU85V9WE/l5wZEmImpCtLqbnTvqDS2U1fJ96KrxoW7KrXhNsNCblQlg8Ck4b85yxdTyelsMUgFUXiw==",
"bin": { "bin": {
"parser": "bin/babel-parser.js" "parser": "bin/babel-parser.js"
}, },
@ -448,9 +448,9 @@
"dev": true "dev": true
}, },
"node_modules/@iconify/utils": { "node_modules/@iconify/utils": {
"version": "2.1.9", "version": "2.1.11",
"resolved": "https://registry.npmmirror.com/@iconify/utils/-/utils-2.1.9.tgz", "resolved": "https://registry.npmmirror.com/@iconify/utils/-/utils-2.1.11.tgz",
"integrity": "sha512-mo+A4n3MwLlWlg1SoSO+Dt6pOPWKElk9sSJ6ZpuzbB9OcjxN8RUWxU3ulPwB1nglErWKRam2x4BAohbYF7FiFA==", "integrity": "sha512-M/w3PkN8zQYXi8N6qK/KhnYMfEbbb6Sk8RZVn8g+Pmmu5ybw177RpsaGwpziyHeUsu4etrexYSWq3rwnIqzYCg==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"@antfu/install-pkg": "^0.1.1", "@antfu/install-pkg": "^0.1.1",
@ -602,49 +602,49 @@
} }
}, },
"node_modules/@vue/compiler-core": { "node_modules/@vue/compiler-core": {
"version": "3.3.4", "version": "3.3.6",
"resolved": "https://registry.npmmirror.com/@vue/compiler-core/-/compiler-core-3.3.4.tgz", "resolved": "https://registry.npmmirror.com/@vue/compiler-core/-/compiler-core-3.3.6.tgz",
"integrity": "sha512-cquyDNvZ6jTbf/+x+AgM2Arrp6G4Dzbb0R64jiG804HRMfRiFXWI6kqUVqZ6ZR0bQhIoQjB4+2bhNtVwndW15g==", "integrity": "sha512-2JNjemwaNwf+MkkatATVZi7oAH1Hx0B04DdPH3ZoZ8vKC1xZVP7nl4HIsk8XYd3r+/52sqqoz9TWzYc3yE9dqA==",
"dependencies": { "dependencies": {
"@babel/parser": "^7.21.3", "@babel/parser": "^7.23.0",
"@vue/shared": "3.3.4", "@vue/shared": "3.3.6",
"estree-walker": "^2.0.2", "estree-walker": "^2.0.2",
"source-map-js": "^1.0.2" "source-map-js": "^1.0.2"
} }
}, },
"node_modules/@vue/compiler-dom": { "node_modules/@vue/compiler-dom": {
"version": "3.3.4", "version": "3.3.6",
"resolved": "https://registry.npmmirror.com/@vue/compiler-dom/-/compiler-dom-3.3.4.tgz", "resolved": "https://registry.npmmirror.com/@vue/compiler-dom/-/compiler-dom-3.3.6.tgz",
"integrity": "sha512-wyM+OjOVpuUukIq6p5+nwHYtj9cFroz9cwkfmP9O1nzH68BenTTv0u7/ndggT8cIQlnBeOo6sUT/gvHcIkLA5w==", "integrity": "sha512-1MxXcJYMHiTPexjLAJUkNs/Tw2eDf2tY3a0rL+LfuWyiKN2s6jvSwywH3PWD8bKICjfebX3GWx2Os8jkRDq3Ng==",
"dependencies": { "dependencies": {
"@vue/compiler-core": "3.3.4", "@vue/compiler-core": "3.3.6",
"@vue/shared": "3.3.4" "@vue/shared": "3.3.6"
} }
}, },
"node_modules/@vue/compiler-sfc": { "node_modules/@vue/compiler-sfc": {
"version": "3.3.4", "version": "3.3.6",
"resolved": "https://registry.npmmirror.com/@vue/compiler-sfc/-/compiler-sfc-3.3.4.tgz", "resolved": "https://registry.npmmirror.com/@vue/compiler-sfc/-/compiler-sfc-3.3.6.tgz",
"integrity": "sha512-6y/d8uw+5TkCuzBkgLS0v3lSM3hJDntFEiUORM11pQ/hKvkhSKZrXW6i69UyXlJQisJxuUEJKAWEqWbWsLeNKQ==", "integrity": "sha512-/Kms6du2h1VrXFreuZmlvQej8B1zenBqIohP0690IUBkJjsFvJxY0crcvVRJ0UhMgSR9dewB+khdR1DfbpArJA==",
"dependencies": { "dependencies": {
"@babel/parser": "^7.20.15", "@babel/parser": "^7.23.0",
"@vue/compiler-core": "3.3.4", "@vue/compiler-core": "3.3.6",
"@vue/compiler-dom": "3.3.4", "@vue/compiler-dom": "3.3.6",
"@vue/compiler-ssr": "3.3.4", "@vue/compiler-ssr": "3.3.6",
"@vue/reactivity-transform": "3.3.4", "@vue/reactivity-transform": "3.3.6",
"@vue/shared": "3.3.4", "@vue/shared": "3.3.6",
"estree-walker": "^2.0.2", "estree-walker": "^2.0.2",
"magic-string": "^0.30.0", "magic-string": "^0.30.5",
"postcss": "^8.1.10", "postcss": "^8.4.31",
"source-map-js": "^1.0.2" "source-map-js": "^1.0.2"
} }
}, },
"node_modules/@vue/compiler-ssr": { "node_modules/@vue/compiler-ssr": {
"version": "3.3.4", "version": "3.3.6",
"resolved": "https://registry.npmmirror.com/@vue/compiler-ssr/-/compiler-ssr-3.3.4.tgz", "resolved": "https://registry.npmmirror.com/@vue/compiler-ssr/-/compiler-ssr-3.3.6.tgz",
"integrity": "sha512-m0v6oKpup2nMSehwA6Uuu+j+wEwcy7QmwMkVNVfrV9P2qE5KshC6RwOCq8fjGS/Eak/uNb8AaWekfiXxbBB6gQ==", "integrity": "sha512-QTIHAfDCHhjXlYGkUg5KH7YwYtdUM1vcFl/FxFDlD6d0nXAmnjizka3HITp8DGudzHndv2PjKVS44vqqy0vP4w==",
"dependencies": { "dependencies": {
"@vue/compiler-dom": "3.3.4", "@vue/compiler-dom": "3.3.6",
"@vue/shared": "3.3.4" "@vue/shared": "3.3.6"
} }
}, },
"node_modules/@vue/devtools-api": { "node_modules/@vue/devtools-api": {
@ -653,42 +653,42 @@
"integrity": "sha512-o9KfBeaBmCKl10usN4crU53fYtC1r7jJwdGKjPT24t348rHxgfpZ0xL3Xm/gLUYnc0oTp8LAmrxOeLyu6tbk2Q==" "integrity": "sha512-o9KfBeaBmCKl10usN4crU53fYtC1r7jJwdGKjPT24t348rHxgfpZ0xL3Xm/gLUYnc0oTp8LAmrxOeLyu6tbk2Q=="
}, },
"node_modules/@vue/reactivity": { "node_modules/@vue/reactivity": {
"version": "3.3.4", "version": "3.3.6",
"resolved": "https://registry.npmmirror.com/@vue/reactivity/-/reactivity-3.3.4.tgz", "resolved": "https://registry.npmmirror.com/@vue/reactivity/-/reactivity-3.3.6.tgz",
"integrity": "sha512-kLTDLwd0B1jG08NBF3R5rqULtv/f8x3rOFByTDz4J53ttIQEDmALqKqXY0J+XQeN0aV2FBxY8nJDf88yvOPAqQ==", "integrity": "sha512-gtChAumfQz5lSy5jZXfyXbKrIYPf9XEOrIr6rxwVyeWVjFhJwmwPLtV6Yis+M9onzX++I5AVE9j+iPH60U+B8Q==",
"dependencies": { "dependencies": {
"@vue/shared": "3.3.4" "@vue/shared": "3.3.6"
} }
}, },
"node_modules/@vue/reactivity-transform": { "node_modules/@vue/reactivity-transform": {
"version": "3.3.4", "version": "3.3.6",
"resolved": "https://registry.npmmirror.com/@vue/reactivity-transform/-/reactivity-transform-3.3.4.tgz", "resolved": "https://registry.npmmirror.com/@vue/reactivity-transform/-/reactivity-transform-3.3.6.tgz",
"integrity": "sha512-MXgwjako4nu5WFLAjpBnCj/ieqcjE2aJBINUNQzkZQfzIZA4xn+0fV1tIYBJvvva3N3OvKGofRLvQIwEQPpaXw==", "integrity": "sha512-RlJl4dHfeO7EuzU1iJOsrlqWyJfHTkJbvYz/IOJWqu8dlCNWtxWX377WI0VsbAgBizjwD+3ZjdnvSyyFW1YVng==",
"dependencies": { "dependencies": {
"@babel/parser": "^7.20.15", "@babel/parser": "^7.23.0",
"@vue/compiler-core": "3.3.4", "@vue/compiler-core": "3.3.6",
"@vue/shared": "3.3.4", "@vue/shared": "3.3.6",
"estree-walker": "^2.0.2", "estree-walker": "^2.0.2",
"magic-string": "^0.30.0" "magic-string": "^0.30.5"
} }
}, },
"node_modules/@vue/runtime-core": { "node_modules/@vue/runtime-core": {
"version": "3.3.4", "version": "3.3.6",
"resolved": "https://registry.npmmirror.com/@vue/runtime-core/-/runtime-core-3.3.4.tgz", "resolved": "https://registry.npmmirror.com/@vue/runtime-core/-/runtime-core-3.3.6.tgz",
"integrity": "sha512-R+bqxMN6pWO7zGI4OMlmvePOdP2c93GsHFM/siJI7O2nxFRzj55pLwkpCedEY+bTMgp5miZ8CxfIZo3S+gFqvA==", "integrity": "sha512-qp7HTP1iw1UW2ZGJ8L3zpqlngrBKvLsDAcq5lA6JvEXHmpoEmjKju7ahM9W2p/h51h0OT5F2fGlP/gMhHOmbUA==",
"dependencies": { "dependencies": {
"@vue/reactivity": "3.3.4", "@vue/reactivity": "3.3.6",
"@vue/shared": "3.3.4" "@vue/shared": "3.3.6"
} }
}, },
"node_modules/@vue/runtime-dom": { "node_modules/@vue/runtime-dom": {
"version": "3.3.4", "version": "3.3.6",
"resolved": "https://registry.npmmirror.com/@vue/runtime-dom/-/runtime-dom-3.3.4.tgz", "resolved": "https://registry.npmmirror.com/@vue/runtime-dom/-/runtime-dom-3.3.6.tgz",
"integrity": "sha512-Aj5bTJ3u5sFsUckRghsNjVTtxZQ1OyMWCr5dZRAPijF/0Vy4xEoRCwLyHXcj4D0UFbJ4lbx3gPTgg06K/GnPnQ==", "integrity": "sha512-AoX3Cp8NqMXjLbIG9YR6n/pPLWE9TiDdk6wTJHFnl2GpHzDFH1HLBC9wlqqQ7RlnvN3bVLpzPGAAH00SAtOxHg==",
"dependencies": { "dependencies": {
"@vue/runtime-core": "3.3.4", "@vue/runtime-core": "3.3.6",
"@vue/shared": "3.3.4", "@vue/shared": "3.3.6",
"csstype": "^3.1.1" "csstype": "^3.1.2"
} }
}, },
"node_modules/@vue/runtime-dom/node_modules/csstype": { "node_modules/@vue/runtime-dom/node_modules/csstype": {
@ -697,21 +697,21 @@
"integrity": "sha512-I7K1Uu0MBPzaFKg4nI5Q7Vs2t+3gWWW648spaF+Rg7pI9ds18Ugn+lvg4SHczUdKlHI5LWBXyqfS8+DufyBsgQ==" "integrity": "sha512-I7K1Uu0MBPzaFKg4nI5Q7Vs2t+3gWWW648spaF+Rg7pI9ds18Ugn+lvg4SHczUdKlHI5LWBXyqfS8+DufyBsgQ=="
}, },
"node_modules/@vue/server-renderer": { "node_modules/@vue/server-renderer": {
"version": "3.3.4", "version": "3.3.6",
"resolved": "https://registry.npmmirror.com/@vue/server-renderer/-/server-renderer-3.3.4.tgz", "resolved": "https://registry.npmmirror.com/@vue/server-renderer/-/server-renderer-3.3.6.tgz",
"integrity": "sha512-Q6jDDzR23ViIb67v+vM1Dqntu+HUexQcsWKhhQa4ARVzxOY2HbC7QRW/ggkDBd5BU+uM1sV6XOAP0b216o34JQ==", "integrity": "sha512-kgLoN43W4ERdZ6dpyy+gnk2ZHtcOaIr5Uc/WUP5DRwutgvluzu2pudsZGoD2b7AEJHByUVMa9k6Sho5lLRCykw==",
"dependencies": { "dependencies": {
"@vue/compiler-ssr": "3.3.4", "@vue/compiler-ssr": "3.3.6",
"@vue/shared": "3.3.4" "@vue/shared": "3.3.6"
}, },
"peerDependencies": { "peerDependencies": {
"vue": "3.3.4" "vue": "3.3.6"
} }
}, },
"node_modules/@vue/shared": { "node_modules/@vue/shared": {
"version": "3.3.4", "version": "3.3.6",
"resolved": "https://registry.npmmirror.com/@vue/shared/-/shared-3.3.4.tgz", "resolved": "https://registry.npmmirror.com/@vue/shared/-/shared-3.3.6.tgz",
"integrity": "sha512-7OjdcV8vQ74eiz1TZLzZP4JwqM5fA94K6yntPS5Z25r9HDuGNzaGdgvwKYq6S+MxwF0TFRwe50fIR/MYnakdkQ==" "integrity": "sha512-Xno5pEqg8SVhomD0kTSmfh30ZEmV/+jZtyh39q6QflrjdJCXah5lrnOLi9KB6a5k5aAHXMXjoMnxlzUkCNfWLQ=="
}, },
"node_modules/acorn": { "node_modules/acorn": {
"version": "8.10.0", "version": "8.10.0",
@ -1176,9 +1176,9 @@
"dev": true "dev": true
}, },
"node_modules/magic-string": { "node_modules/magic-string": {
"version": "0.30.3", "version": "0.30.5",
"resolved": "https://registry.npmmirror.com/magic-string/-/magic-string-0.30.3.tgz", "resolved": "https://registry.npmmirror.com/magic-string/-/magic-string-0.30.5.tgz",
"integrity": "sha512-B7xGbll2fG/VjP+SWg4sX3JynwIU0mjoTc6MPpKNuIvftk6u6vqhDnk1R80b8C2GBR6ywqy+1DcKBrevBg+bmw==", "integrity": "sha512-7xlpfBaQaP/T6Vh8MO/EqXSW5En6INHEvEXQiuff7Gku0PWjU3uf6w/j9o7O+SpB5fOAkrI5HeoNgwjEO0pFsA==",
"dependencies": { "dependencies": {
"@jridgewell/sourcemap-codec": "^1.4.15" "@jridgewell/sourcemap-codec": "^1.4.15"
}, },
@ -1448,9 +1448,9 @@
} }
}, },
"node_modules/postcss": { "node_modules/postcss": {
"version": "8.4.29", "version": "8.4.31",
"resolved": "https://registry.npmmirror.com/postcss/-/postcss-8.4.29.tgz", "resolved": "https://registry.npmmirror.com/postcss/-/postcss-8.4.31.tgz",
"integrity": "sha512-cbI+jaqIeu/VGqXEarWkRCCffhjgXc0qjBtXpqJhTBohMUjUQnbBr0xqX3vEKudc4iviTewcJo5ajcec5+wdJw==", "integrity": "sha512-PS08Iboia9mts/2ygV3eLpY5ghnUcfLV/EXTOW1E2qYxJKGGBUtNjN76FYHnMs36RmARn41bC0AZmn+rR0OVpQ==",
"dependencies": { "dependencies": {
"nanoid": "^3.3.6", "nanoid": "^3.3.6",
"picocolors": "^1.0.0", "picocolors": "^1.0.0",
@ -1545,9 +1545,9 @@
} }
}, },
"node_modules/sass": { "node_modules/sass": {
"version": "1.69.3", "version": "1.69.4",
"resolved": "https://registry.npmmirror.com/sass/-/sass-1.69.3.tgz", "resolved": "https://registry.npmmirror.com/sass/-/sass-1.69.4.tgz",
"integrity": "sha512-X99+a2iGdXkdWn1akFPs0ZmelUzyAQfvqYc2P/MPTrJRuIRoTffGzT9W9nFqG00S+c8hXzVmgxhUuHFdrwxkhQ==", "integrity": "sha512-+qEreVhqAy8o++aQfCJwp0sklr2xyEzkm9Pp/Igu9wNPoe7EZEQ8X/MBvvXggI2ql607cxKg/RKOwDj6pp2XDA==",
"dependencies": { "dependencies": {
"chokidar": ">=3.0.0 <4.0.0", "chokidar": ">=3.0.0 <4.0.0",
"immutable": "^4.0.0", "immutable": "^4.0.0",
@ -1677,12 +1677,12 @@
} }
}, },
"node_modules/unplugin": { "node_modules/unplugin": {
"version": "1.4.0", "version": "1.5.0",
"resolved": "https://registry.npmmirror.com/unplugin/-/unplugin-1.4.0.tgz", "resolved": "https://registry.npmmirror.com/unplugin/-/unplugin-1.5.0.tgz",
"integrity": "sha512-5x4eIEL6WgbzqGtF9UV8VEC/ehKptPXDS6L2b0mv4FRMkJxRtjaJfOWDd6a8+kYbqsjklix7yWP0N3SUepjXcg==", "integrity": "sha512-9ZdRwbh/4gcm1JTOkp9lAkIDrtOyOxgHmY7cjuwI8L/2RTikMcVG25GsZwNAgRuap3iDw2jeq7eoqtAsz5rW3A==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"acorn": "^8.9.0", "acorn": "^8.10.0",
"chokidar": "^3.5.3", "chokidar": "^3.5.3",
"webpack-sources": "^3.2.3", "webpack-sources": "^3.2.3",
"webpack-virtual-modules": "^0.5.0" "webpack-virtual-modules": "^0.5.0"
@ -1720,18 +1720,18 @@
} }
}, },
"node_modules/unplugin-icons": { "node_modules/unplugin-icons": {
"version": "0.17.0", "version": "0.17.1",
"resolved": "https://registry.npmmirror.com/unplugin-icons/-/unplugin-icons-0.17.0.tgz", "resolved": "https://registry.npmmirror.com/unplugin-icons/-/unplugin-icons-0.17.1.tgz",
"integrity": "sha512-gMv66eY/Hj64heM55XrfDH3LUCWI51mtkBVUPVl9VkpvLgAYhdVe9nRuzu6p+idmCLSQVq7xiPxQcD4aXCgW5A==", "integrity": "sha512-KsWejBPCHokYCNDQUzGu6R3E3XDYH/YpewgQwrVBXgpl1iR0RdW1NEGNdjlbuapwVnZXVgA5eiDTfNaQCawSdg==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"@antfu/install-pkg": "^0.1.1", "@antfu/install-pkg": "^0.1.1",
"@antfu/utils": "^0.7.6", "@antfu/utils": "^0.7.6",
"@iconify/utils": "^2.1.9", "@iconify/utils": "^2.1.11",
"debug": "^4.3.4", "debug": "^4.3.4",
"kolorist": "^1.8.0", "kolorist": "^1.8.0",
"local-pkg": "^0.4.3", "local-pkg": "^0.5.0",
"unplugin": "^1.4.0" "unplugin": "^1.5.0"
}, },
"peerDependencies": { "peerDependencies": {
"@svgr/core": ">=7.0.0", "@svgr/core": ">=7.0.0",
@ -1758,6 +1758,19 @@
} }
} }
}, },
"node_modules/unplugin-icons/node_modules/local-pkg": {
"version": "0.5.0",
"resolved": "https://registry.npmmirror.com/local-pkg/-/local-pkg-0.5.0.tgz",
"integrity": "sha512-ok6z3qlYyCDS4ZEU27HaU6x/xZa9Whf8jD4ptH5UZTQYZVYeb9bnZ3ojVhiJNLiXK1Hfc0GNbLXcmZ5plLDDBg==",
"dev": true,
"dependencies": {
"mlly": "^1.4.2",
"pkg-types": "^1.0.3"
},
"engines": {
"node": ">=14"
}
},
"node_modules/unplugin-vue-components": { "node_modules/unplugin-vue-components": {
"version": "0.25.2", "version": "0.25.2",
"resolved": "https://registry.npmmirror.com/unplugin-vue-components/-/unplugin-vue-components-0.25.2.tgz", "resolved": "https://registry.npmmirror.com/unplugin-vue-components/-/unplugin-vue-components-0.25.2.tgz",
@ -1805,9 +1818,9 @@
} }
}, },
"node_modules/vite": { "node_modules/vite": {
"version": "4.4.11", "version": "4.5.0",
"resolved": "https://registry.npmmirror.com/vite/-/vite-4.4.11.tgz", "resolved": "https://registry.npmmirror.com/vite/-/vite-4.5.0.tgz",
"integrity": "sha512-ksNZJlkcU9b0lBwAGZGGaZHCMqHsc8OpgtoYhsQ4/I2v5cnpmmmqe5pM4nv/4Hn6G/2GhTdj0DhZh2e+Er1q5A==", "integrity": "sha512-ulr8rNLA6rkyFAlVWw2q5YJ91v098AFQ2R0PRFwPzREXOUJQPtFUG0t+/ZikhaOCDqFoDhN6/v8Sq0o4araFAw==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"esbuild": "^0.18.10", "esbuild": "^0.18.10",
@ -1869,15 +1882,23 @@
} }
}, },
"node_modules/vue": { "node_modules/vue": {
"version": "3.3.4", "version": "3.3.6",
"resolved": "https://registry.npmmirror.com/vue/-/vue-3.3.4.tgz", "resolved": "https://registry.npmmirror.com/vue/-/vue-3.3.6.tgz",
"integrity": "sha512-VTyEYn3yvIeY1Py0WaYGZsXnz3y5UnGi62GjVEqvEGPl6nxbOrCXbVOTQWBEJUqAyTUk2uJ5JLVnYJ6ZzGbrSw==", "integrity": "sha512-jJIDETeWJnoY+gfn4ZtMPMS5KtbP4ax+CT4dcQFhTnWEk8xMupFyQ0JxL28nvT/M4+p4a0ptxaV2WY0LiIxvRg==",
"dependencies": { "dependencies": {
"@vue/compiler-dom": "3.3.4", "@vue/compiler-dom": "3.3.6",
"@vue/compiler-sfc": "3.3.4", "@vue/compiler-sfc": "3.3.6",
"@vue/runtime-dom": "3.3.4", "@vue/runtime-dom": "3.3.6",
"@vue/server-renderer": "3.3.4", "@vue/server-renderer": "3.3.6",
"@vue/shared": "3.3.4" "@vue/shared": "3.3.6"
},
"peerDependencies": {
"typescript": "*"
},
"peerDependenciesMeta": {
"typescript": {
"optional": true
}
} }
}, },
"node_modules/vue-i18n": { "node_modules/vue-i18n": {
@ -1972,9 +1993,9 @@
"dev": true "dev": true
}, },
"@babel/parser": { "@babel/parser": {
"version": "7.22.16", "version": "7.23.0",
"resolved": "https://registry.npmmirror.com/@babel/parser/-/parser-7.22.16.tgz", "resolved": "https://registry.npmmirror.com/@babel/parser/-/parser-7.23.0.tgz",
"integrity": "sha512-+gPfKv8UWeKKeJTUxe59+OobVcrYHETCsORl61EmSkmgymguYk/X5bp7GuUIXaFsc6y++v8ZxPsLSSuujqDphA==" "integrity": "sha512-vvPKKdMemU85V9WE/l5wZEmImpCtLqbnTvqDS2U1fJ96KrxoW7KrXhNsNCblQlg8Ck4b85yxdTyelsMUgFUXiw=="
}, },
"@babel/runtime": { "@babel/runtime": {
"version": "7.23.1", "version": "7.23.1",
@ -2166,9 +2187,9 @@
"dev": true "dev": true
}, },
"@iconify/utils": { "@iconify/utils": {
"version": "2.1.9", "version": "2.1.11",
"resolved": "https://registry.npmmirror.com/@iconify/utils/-/utils-2.1.9.tgz", "resolved": "https://registry.npmmirror.com/@iconify/utils/-/utils-2.1.11.tgz",
"integrity": "sha512-mo+A4n3MwLlWlg1SoSO+Dt6pOPWKElk9sSJ6ZpuzbB9OcjxN8RUWxU3ulPwB1nglErWKRam2x4BAohbYF7FiFA==", "integrity": "sha512-M/w3PkN8zQYXi8N6qK/KhnYMfEbbb6Sk8RZVn8g+Pmmu5ybw177RpsaGwpziyHeUsu4etrexYSWq3rwnIqzYCg==",
"dev": true, "dev": true,
"requires": { "requires": {
"@antfu/install-pkg": "^0.1.1", "@antfu/install-pkg": "^0.1.1",
@ -2285,49 +2306,49 @@
"requires": {} "requires": {}
}, },
"@vue/compiler-core": { "@vue/compiler-core": {
"version": "3.3.4", "version": "3.3.6",
"resolved": "https://registry.npmmirror.com/@vue/compiler-core/-/compiler-core-3.3.4.tgz", "resolved": "https://registry.npmmirror.com/@vue/compiler-core/-/compiler-core-3.3.6.tgz",
"integrity": "sha512-cquyDNvZ6jTbf/+x+AgM2Arrp6G4Dzbb0R64jiG804HRMfRiFXWI6kqUVqZ6ZR0bQhIoQjB4+2bhNtVwndW15g==", "integrity": "sha512-2JNjemwaNwf+MkkatATVZi7oAH1Hx0B04DdPH3ZoZ8vKC1xZVP7nl4HIsk8XYd3r+/52sqqoz9TWzYc3yE9dqA==",
"requires": { "requires": {
"@babel/parser": "^7.21.3", "@babel/parser": "^7.23.0",
"@vue/shared": "3.3.4", "@vue/shared": "3.3.6",
"estree-walker": "^2.0.2", "estree-walker": "^2.0.2",
"source-map-js": "^1.0.2" "source-map-js": "^1.0.2"
} }
}, },
"@vue/compiler-dom": { "@vue/compiler-dom": {
"version": "3.3.4", "version": "3.3.6",
"resolved": "https://registry.npmmirror.com/@vue/compiler-dom/-/compiler-dom-3.3.4.tgz", "resolved": "https://registry.npmmirror.com/@vue/compiler-dom/-/compiler-dom-3.3.6.tgz",
"integrity": "sha512-wyM+OjOVpuUukIq6p5+nwHYtj9cFroz9cwkfmP9O1nzH68BenTTv0u7/ndggT8cIQlnBeOo6sUT/gvHcIkLA5w==", "integrity": "sha512-1MxXcJYMHiTPexjLAJUkNs/Tw2eDf2tY3a0rL+LfuWyiKN2s6jvSwywH3PWD8bKICjfebX3GWx2Os8jkRDq3Ng==",
"requires": { "requires": {
"@vue/compiler-core": "3.3.4", "@vue/compiler-core": "3.3.6",
"@vue/shared": "3.3.4" "@vue/shared": "3.3.6"
} }
}, },
"@vue/compiler-sfc": { "@vue/compiler-sfc": {
"version": "3.3.4", "version": "3.3.6",
"resolved": "https://registry.npmmirror.com/@vue/compiler-sfc/-/compiler-sfc-3.3.4.tgz", "resolved": "https://registry.npmmirror.com/@vue/compiler-sfc/-/compiler-sfc-3.3.6.tgz",
"integrity": "sha512-6y/d8uw+5TkCuzBkgLS0v3lSM3hJDntFEiUORM11pQ/hKvkhSKZrXW6i69UyXlJQisJxuUEJKAWEqWbWsLeNKQ==", "integrity": "sha512-/Kms6du2h1VrXFreuZmlvQej8B1zenBqIohP0690IUBkJjsFvJxY0crcvVRJ0UhMgSR9dewB+khdR1DfbpArJA==",
"requires": { "requires": {
"@babel/parser": "^7.20.15", "@babel/parser": "^7.23.0",
"@vue/compiler-core": "3.3.4", "@vue/compiler-core": "3.3.6",
"@vue/compiler-dom": "3.3.4", "@vue/compiler-dom": "3.3.6",
"@vue/compiler-ssr": "3.3.4", "@vue/compiler-ssr": "3.3.6",
"@vue/reactivity-transform": "3.3.4", "@vue/reactivity-transform": "3.3.6",
"@vue/shared": "3.3.4", "@vue/shared": "3.3.6",
"estree-walker": "^2.0.2", "estree-walker": "^2.0.2",
"magic-string": "^0.30.0", "magic-string": "^0.30.5",
"postcss": "^8.1.10", "postcss": "^8.4.31",
"source-map-js": "^1.0.2" "source-map-js": "^1.0.2"
} }
}, },
"@vue/compiler-ssr": { "@vue/compiler-ssr": {
"version": "3.3.4", "version": "3.3.6",
"resolved": "https://registry.npmmirror.com/@vue/compiler-ssr/-/compiler-ssr-3.3.4.tgz", "resolved": "https://registry.npmmirror.com/@vue/compiler-ssr/-/compiler-ssr-3.3.6.tgz",
"integrity": "sha512-m0v6oKpup2nMSehwA6Uuu+j+wEwcy7QmwMkVNVfrV9P2qE5KshC6RwOCq8fjGS/Eak/uNb8AaWekfiXxbBB6gQ==", "integrity": "sha512-QTIHAfDCHhjXlYGkUg5KH7YwYtdUM1vcFl/FxFDlD6d0nXAmnjizka3HITp8DGudzHndv2PjKVS44vqqy0vP4w==",
"requires": { "requires": {
"@vue/compiler-dom": "3.3.4", "@vue/compiler-dom": "3.3.6",
"@vue/shared": "3.3.4" "@vue/shared": "3.3.6"
} }
}, },
"@vue/devtools-api": { "@vue/devtools-api": {
@ -2336,42 +2357,42 @@
"integrity": "sha512-o9KfBeaBmCKl10usN4crU53fYtC1r7jJwdGKjPT24t348rHxgfpZ0xL3Xm/gLUYnc0oTp8LAmrxOeLyu6tbk2Q==" "integrity": "sha512-o9KfBeaBmCKl10usN4crU53fYtC1r7jJwdGKjPT24t348rHxgfpZ0xL3Xm/gLUYnc0oTp8LAmrxOeLyu6tbk2Q=="
}, },
"@vue/reactivity": { "@vue/reactivity": {
"version": "3.3.4", "version": "3.3.6",
"resolved": "https://registry.npmmirror.com/@vue/reactivity/-/reactivity-3.3.4.tgz", "resolved": "https://registry.npmmirror.com/@vue/reactivity/-/reactivity-3.3.6.tgz",
"integrity": "sha512-kLTDLwd0B1jG08NBF3R5rqULtv/f8x3rOFByTDz4J53ttIQEDmALqKqXY0J+XQeN0aV2FBxY8nJDf88yvOPAqQ==", "integrity": "sha512-gtChAumfQz5lSy5jZXfyXbKrIYPf9XEOrIr6rxwVyeWVjFhJwmwPLtV6Yis+M9onzX++I5AVE9j+iPH60U+B8Q==",
"requires": { "requires": {
"@vue/shared": "3.3.4" "@vue/shared": "3.3.6"
} }
}, },
"@vue/reactivity-transform": { "@vue/reactivity-transform": {
"version": "3.3.4", "version": "3.3.6",
"resolved": "https://registry.npmmirror.com/@vue/reactivity-transform/-/reactivity-transform-3.3.4.tgz", "resolved": "https://registry.npmmirror.com/@vue/reactivity-transform/-/reactivity-transform-3.3.6.tgz",
"integrity": "sha512-MXgwjako4nu5WFLAjpBnCj/ieqcjE2aJBINUNQzkZQfzIZA4xn+0fV1tIYBJvvva3N3OvKGofRLvQIwEQPpaXw==", "integrity": "sha512-RlJl4dHfeO7EuzU1iJOsrlqWyJfHTkJbvYz/IOJWqu8dlCNWtxWX377WI0VsbAgBizjwD+3ZjdnvSyyFW1YVng==",
"requires": { "requires": {
"@babel/parser": "^7.20.15", "@babel/parser": "^7.23.0",
"@vue/compiler-core": "3.3.4", "@vue/compiler-core": "3.3.6",
"@vue/shared": "3.3.4", "@vue/shared": "3.3.6",
"estree-walker": "^2.0.2", "estree-walker": "^2.0.2",
"magic-string": "^0.30.0" "magic-string": "^0.30.5"
} }
}, },
"@vue/runtime-core": { "@vue/runtime-core": {
"version": "3.3.4", "version": "3.3.6",
"resolved": "https://registry.npmmirror.com/@vue/runtime-core/-/runtime-core-3.3.4.tgz", "resolved": "https://registry.npmmirror.com/@vue/runtime-core/-/runtime-core-3.3.6.tgz",
"integrity": "sha512-R+bqxMN6pWO7zGI4OMlmvePOdP2c93GsHFM/siJI7O2nxFRzj55pLwkpCedEY+bTMgp5miZ8CxfIZo3S+gFqvA==", "integrity": "sha512-qp7HTP1iw1UW2ZGJ8L3zpqlngrBKvLsDAcq5lA6JvEXHmpoEmjKju7ahM9W2p/h51h0OT5F2fGlP/gMhHOmbUA==",
"requires": { "requires": {
"@vue/reactivity": "3.3.4", "@vue/reactivity": "3.3.6",
"@vue/shared": "3.3.4" "@vue/shared": "3.3.6"
} }
}, },
"@vue/runtime-dom": { "@vue/runtime-dom": {
"version": "3.3.4", "version": "3.3.6",
"resolved": "https://registry.npmmirror.com/@vue/runtime-dom/-/runtime-dom-3.3.4.tgz", "resolved": "https://registry.npmmirror.com/@vue/runtime-dom/-/runtime-dom-3.3.6.tgz",
"integrity": "sha512-Aj5bTJ3u5sFsUckRghsNjVTtxZQ1OyMWCr5dZRAPijF/0Vy4xEoRCwLyHXcj4D0UFbJ4lbx3gPTgg06K/GnPnQ==", "integrity": "sha512-AoX3Cp8NqMXjLbIG9YR6n/pPLWE9TiDdk6wTJHFnl2GpHzDFH1HLBC9wlqqQ7RlnvN3bVLpzPGAAH00SAtOxHg==",
"requires": { "requires": {
"@vue/runtime-core": "3.3.4", "@vue/runtime-core": "3.3.6",
"@vue/shared": "3.3.4", "@vue/shared": "3.3.6",
"csstype": "^3.1.1" "csstype": "^3.1.2"
}, },
"dependencies": { "dependencies": {
"csstype": { "csstype": {
@ -2382,18 +2403,18 @@
} }
}, },
"@vue/server-renderer": { "@vue/server-renderer": {
"version": "3.3.4", "version": "3.3.6",
"resolved": "https://registry.npmmirror.com/@vue/server-renderer/-/server-renderer-3.3.4.tgz", "resolved": "https://registry.npmmirror.com/@vue/server-renderer/-/server-renderer-3.3.6.tgz",
"integrity": "sha512-Q6jDDzR23ViIb67v+vM1Dqntu+HUexQcsWKhhQa4ARVzxOY2HbC7QRW/ggkDBd5BU+uM1sV6XOAP0b216o34JQ==", "integrity": "sha512-kgLoN43W4ERdZ6dpyy+gnk2ZHtcOaIr5Uc/WUP5DRwutgvluzu2pudsZGoD2b7AEJHByUVMa9k6Sho5lLRCykw==",
"requires": { "requires": {
"@vue/compiler-ssr": "3.3.4", "@vue/compiler-ssr": "3.3.6",
"@vue/shared": "3.3.4" "@vue/shared": "3.3.6"
} }
}, },
"@vue/shared": { "@vue/shared": {
"version": "3.3.4", "version": "3.3.6",
"resolved": "https://registry.npmmirror.com/@vue/shared/-/shared-3.3.4.tgz", "resolved": "https://registry.npmmirror.com/@vue/shared/-/shared-3.3.6.tgz",
"integrity": "sha512-7OjdcV8vQ74eiz1TZLzZP4JwqM5fA94K6yntPS5Z25r9HDuGNzaGdgvwKYq6S+MxwF0TFRwe50fIR/MYnakdkQ==" "integrity": "sha512-Xno5pEqg8SVhomD0kTSmfh30ZEmV/+jZtyh39q6QflrjdJCXah5lrnOLi9KB6a5k5aAHXMXjoMnxlzUkCNfWLQ=="
}, },
"acorn": { "acorn": {
"version": "8.10.0", "version": "8.10.0",
@ -2757,9 +2778,9 @@
"dev": true "dev": true
}, },
"magic-string": { "magic-string": {
"version": "0.30.3", "version": "0.30.5",
"resolved": "https://registry.npmmirror.com/magic-string/-/magic-string-0.30.3.tgz", "resolved": "https://registry.npmmirror.com/magic-string/-/magic-string-0.30.5.tgz",
"integrity": "sha512-B7xGbll2fG/VjP+SWg4sX3JynwIU0mjoTc6MPpKNuIvftk6u6vqhDnk1R80b8C2GBR6ywqy+1DcKBrevBg+bmw==", "integrity": "sha512-7xlpfBaQaP/T6Vh8MO/EqXSW5En6INHEvEXQiuff7Gku0PWjU3uf6w/j9o7O+SpB5fOAkrI5HeoNgwjEO0pFsA==",
"requires": { "requires": {
"@jridgewell/sourcemap-codec": "^1.4.15" "@jridgewell/sourcemap-codec": "^1.4.15"
} }
@ -2954,9 +2975,9 @@
} }
}, },
"postcss": { "postcss": {
"version": "8.4.29", "version": "8.4.31",
"resolved": "https://registry.npmmirror.com/postcss/-/postcss-8.4.29.tgz", "resolved": "https://registry.npmmirror.com/postcss/-/postcss-8.4.31.tgz",
"integrity": "sha512-cbI+jaqIeu/VGqXEarWkRCCffhjgXc0qjBtXpqJhTBohMUjUQnbBr0xqX3vEKudc4iviTewcJo5ajcec5+wdJw==", "integrity": "sha512-PS08Iboia9mts/2ygV3eLpY5ghnUcfLV/EXTOW1E2qYxJKGGBUtNjN76FYHnMs36RmARn41bC0AZmn+rR0OVpQ==",
"requires": { "requires": {
"nanoid": "^3.3.6", "nanoid": "^3.3.6",
"picocolors": "^1.0.0", "picocolors": "^1.0.0",
@ -3025,9 +3046,9 @@
} }
}, },
"sass": { "sass": {
"version": "1.69.3", "version": "1.69.4",
"resolved": "https://registry.npmmirror.com/sass/-/sass-1.69.3.tgz", "resolved": "https://registry.npmmirror.com/sass/-/sass-1.69.4.tgz",
"integrity": "sha512-X99+a2iGdXkdWn1akFPs0ZmelUzyAQfvqYc2P/MPTrJRuIRoTffGzT9W9nFqG00S+c8hXzVmgxhUuHFdrwxkhQ==", "integrity": "sha512-+qEreVhqAy8o++aQfCJwp0sklr2xyEzkm9Pp/Igu9wNPoe7EZEQ8X/MBvvXggI2ql607cxKg/RKOwDj6pp2XDA==",
"requires": { "requires": {
"chokidar": ">=3.0.0 <4.0.0", "chokidar": ">=3.0.0 <4.0.0",
"immutable": "^4.0.0", "immutable": "^4.0.0",
@ -3133,12 +3154,12 @@
} }
}, },
"unplugin": { "unplugin": {
"version": "1.4.0", "version": "1.5.0",
"resolved": "https://registry.npmmirror.com/unplugin/-/unplugin-1.4.0.tgz", "resolved": "https://registry.npmmirror.com/unplugin/-/unplugin-1.5.0.tgz",
"integrity": "sha512-5x4eIEL6WgbzqGtF9UV8VEC/ehKptPXDS6L2b0mv4FRMkJxRtjaJfOWDd6a8+kYbqsjklix7yWP0N3SUepjXcg==", "integrity": "sha512-9ZdRwbh/4gcm1JTOkp9lAkIDrtOyOxgHmY7cjuwI8L/2RTikMcVG25GsZwNAgRuap3iDw2jeq7eoqtAsz5rW3A==",
"dev": true, "dev": true,
"requires": { "requires": {
"acorn": "^8.9.0", "acorn": "^8.10.0",
"chokidar": "^3.5.3", "chokidar": "^3.5.3",
"webpack-sources": "^3.2.3", "webpack-sources": "^3.2.3",
"webpack-virtual-modules": "^0.5.0" "webpack-virtual-modules": "^0.5.0"
@ -3161,18 +3182,30 @@
} }
}, },
"unplugin-icons": { "unplugin-icons": {
"version": "0.17.0", "version": "0.17.1",
"resolved": "https://registry.npmmirror.com/unplugin-icons/-/unplugin-icons-0.17.0.tgz", "resolved": "https://registry.npmmirror.com/unplugin-icons/-/unplugin-icons-0.17.1.tgz",
"integrity": "sha512-gMv66eY/Hj64heM55XrfDH3LUCWI51mtkBVUPVl9VkpvLgAYhdVe9nRuzu6p+idmCLSQVq7xiPxQcD4aXCgW5A==", "integrity": "sha512-KsWejBPCHokYCNDQUzGu6R3E3XDYH/YpewgQwrVBXgpl1iR0RdW1NEGNdjlbuapwVnZXVgA5eiDTfNaQCawSdg==",
"dev": true, "dev": true,
"requires": { "requires": {
"@antfu/install-pkg": "^0.1.1", "@antfu/install-pkg": "^0.1.1",
"@antfu/utils": "^0.7.6", "@antfu/utils": "^0.7.6",
"@iconify/utils": "^2.1.9", "@iconify/utils": "^2.1.11",
"debug": "^4.3.4", "debug": "^4.3.4",
"kolorist": "^1.8.0", "kolorist": "^1.8.0",
"local-pkg": "^0.4.3", "local-pkg": "^0.5.0",
"unplugin": "^1.4.0" "unplugin": "^1.5.0"
},
"dependencies": {
"local-pkg": {
"version": "0.5.0",
"resolved": "https://registry.npmmirror.com/local-pkg/-/local-pkg-0.5.0.tgz",
"integrity": "sha512-ok6z3qlYyCDS4ZEU27HaU6x/xZa9Whf8jD4ptH5UZTQYZVYeb9bnZ3ojVhiJNLiXK1Hfc0GNbLXcmZ5plLDDBg==",
"dev": true,
"requires": {
"mlly": "^1.4.2",
"pkg-types": "^1.0.3"
}
}
} }
}, },
"unplugin-vue-components": { "unplugin-vue-components": {
@ -3203,9 +3236,9 @@
} }
}, },
"vite": { "vite": {
"version": "4.4.11", "version": "4.5.0",
"resolved": "https://registry.npmmirror.com/vite/-/vite-4.4.11.tgz", "resolved": "https://registry.npmmirror.com/vite/-/vite-4.5.0.tgz",
"integrity": "sha512-ksNZJlkcU9b0lBwAGZGGaZHCMqHsc8OpgtoYhsQ4/I2v5cnpmmmqe5pM4nv/4Hn6G/2GhTdj0DhZh2e+Er1q5A==", "integrity": "sha512-ulr8rNLA6rkyFAlVWw2q5YJ91v098AFQ2R0PRFwPzREXOUJQPtFUG0t+/ZikhaOCDqFoDhN6/v8Sq0o4araFAw==",
"dev": true, "dev": true,
"requires": { "requires": {
"esbuild": "^0.18.10", "esbuild": "^0.18.10",
@ -3224,15 +3257,15 @@
} }
}, },
"vue": { "vue": {
"version": "3.3.4", "version": "3.3.6",
"resolved": "https://registry.npmmirror.com/vue/-/vue-3.3.4.tgz", "resolved": "https://registry.npmmirror.com/vue/-/vue-3.3.6.tgz",
"integrity": "sha512-VTyEYn3yvIeY1Py0WaYGZsXnz3y5UnGi62GjVEqvEGPl6nxbOrCXbVOTQWBEJUqAyTUk2uJ5JLVnYJ6ZzGbrSw==", "integrity": "sha512-jJIDETeWJnoY+gfn4ZtMPMS5KtbP4ax+CT4dcQFhTnWEk8xMupFyQ0JxL28nvT/M4+p4a0ptxaV2WY0LiIxvRg==",
"requires": { "requires": {
"@vue/compiler-dom": "3.3.4", "@vue/compiler-dom": "3.3.6",
"@vue/compiler-sfc": "3.3.4", "@vue/compiler-sfc": "3.3.6",
"@vue/runtime-dom": "3.3.4", "@vue/runtime-dom": "3.3.6",
"@vue/server-renderer": "3.3.4", "@vue/server-renderer": "3.3.6",
"@vue/shared": "3.3.4" "@vue/shared": "3.3.6"
} }
}, },
"vue-i18n": { "vue-i18n": {

View File

@ -13,8 +13,8 @@
"highlight.js": "^11.9.0", "highlight.js": "^11.9.0",
"lodash": "^4.17.21", "lodash": "^4.17.21",
"pinia": "^2.1.7", "pinia": "^2.1.7",
"sass": "^1.69.3", "sass": "^1.69.4",
"vue": "^3.3.4", "vue": "^3.3.6",
"vue-i18n": "^9.5.0" "vue-i18n": "^9.5.0"
}, },
"devDependencies": { "devDependencies": {
@ -22,8 +22,8 @@
"naive-ui": "^2.35.0", "naive-ui": "^2.35.0",
"prettier": "^3.0.3", "prettier": "^3.0.3",
"unplugin-auto-import": "^0.16.6", "unplugin-auto-import": "^0.16.6",
"unplugin-icons": "^0.17.0", "unplugin-icons": "^0.17.1",
"unplugin-vue-components": "^0.25.2", "unplugin-vue-components": "^0.25.2",
"vite": "^4.4.11" "vite": "^4.5.0"
} }
} }

View File

@ -1 +1 @@
3b7cabd69c1c3dad11dea0682b3c6bef bc30c6eabdfdaebcae482c47907c6546

View File

@ -128,21 +128,21 @@ onMounted(async () => {
<!-- app content--> <!-- app content-->
<n-spin <n-spin
:show="props.loading" :show="props.loading"
:theme-overrides="{ opacitySpinning: 0 }" :style="{ backgroundColor: themeVars.bodyColor, borderRadius: `${borderRadius}px`, border }"
:style="{ backgroundColor: themeVars.bodyColor, borderRadius: `${borderRadius}px`, border }"> :theme-overrides="{ opacitySpinning: 0 }">
<div <div
id="app-content-wrapper" id="app-content-wrapper"
class="flex-box-v"
:style="{ :style="{
backgroundColor: themeVars.bodyColor, backgroundColor: themeVars.bodyColor,
color: themeVars.textColorBase, color: themeVars.textColorBase,
}"> }"
class="flex-box-v">
<!-- title bar --> <!-- title bar -->
<div <div
id="app-toolbar" id="app-toolbar"
:style="{ height: data.toolbarHeight + 'px' }"
class="flex-box-h" class="flex-box-h"
style="--wails-draggable: drag" style="--wails-draggable: drag"
:style="{ height: data.toolbarHeight + 'px' }"
@dblclick="WindowToggleMaximise"> @dblclick="WindowToggleMaximise">
<!-- title --> <!-- title -->
<div <div
@ -151,11 +151,11 @@ onMounted(async () => {
width: `${data.navMenuWidth + prefStore.behavior.asideWidth - 4}px`, width: `${data.navMenuWidth + prefStore.behavior.asideWidth - 4}px`,
paddingLeft: `${logoPaddingLeft}px`, paddingLeft: `${logoPaddingLeft}px`,
}"> }">
<n-space align="center" :wrap-item="false" :wrap="false" :size="3"> <n-space :size="3" :wrap="false" :wrap-item="false" align="center">
<n-avatar :src="iconUrl" color="#0000" :size="35" style="min-width: 35px" /> <n-avatar :size="35" :src="iconUrl" color="#0000" style="min-width: 35px" />
<div style="min-width: 68px; font-weight: 800">Tiny RDM</div> <div style="min-width: 68px; font-weight: 800">Tiny RDM</div>
<transition name="fade"> <transition name="fade">
<n-text v-if="tabStore.nav === 'browser'" strong class="ellipsis" style="font-size: 13px"> <n-text v-if="tabStore.nav === 'browser'" class="ellipsis" strong style="font-size: 13px">
- {{ get(tabStore.currentTab, 'name') }} - {{ get(tabStore.currentTab, 'name') }}
</n-text> </n-text>
</transition> </transition>
@ -178,8 +178,8 @@ onMounted(async () => {
<!-- simulate window control buttons --> <!-- simulate window control buttons -->
<toolbar-control-widget <toolbar-control-widget
v-if="!isMacOS()" v-if="!isMacOS()"
:size="data.toolbarHeight"
:maximised="maximised" :maximised="maximised"
:size="data.toolbarHeight"
style="align-self: flex-start" /> style="align-self: flex-start" />
</div> </div>
@ -187,8 +187,8 @@ onMounted(async () => {
<div <div
id="app-content" id="app-content"
:style="prefStore.generalFont" :style="prefStore.generalFont"
style="--wails-draggable: none" class="flex-box-h flex-item-expand"
class="flex-box-h flex-item-expand"> style="--wails-draggable: none">
<nav-menu v-model:value="tabStore.nav" :width="data.navMenuWidth" /> <nav-menu v-model:value="tabStore.nav" :width="data.navMenuWidth" />
<!-- browser page --> <!-- browser page -->
<div v-show="tabStore.nav === 'browser'" :class="{ dragging }" class="flex-box-h flex-item-expand"> <div v-show="tabStore.nav === 'browser'" :class="{ dragging }" class="flex-box-h flex-item-expand">

View File

@ -0,0 +1,31 @@
<script setup>
import { SelectFile } from 'wailsjs/go/services/systemService.js'
import { get } from 'lodash'
const props = defineProps({
value: String,
placeholder: String,
disabled: Boolean,
})
const emit = defineEmits(['update:value'])
const handleSelectFile = async () => {
const { success, data } = await SelectFile()
if (success) {
const path = get(data, 'path', '')
emit('update:value', path)
} else {
emit('update:value', '')
}
}
</script>
<template>
<n-input-group>
<n-input v-model:value="props.value" :disabled="props.disabled" :placeholder="placeholder" clearable />
<n-button :disabled="props.disabled" :focusable="false" @click="handleSelectFile">...</n-button>
</n-input-group>
</template>
<style scoped lang="scss"></style>

View File

@ -20,6 +20,7 @@ const props = defineProps({
type: [Number, String], type: [Number, String],
default: 3, default: 3,
}, },
loading: Boolean,
border: Boolean, border: Boolean,
disabled: Boolean, disabled: Boolean,
}) })
@ -30,20 +31,35 @@ const hasTooltip = computed(() => {
</script> </script>
<template> <template>
<n-tooltip v-if="hasTooltip"> <n-tooltip v-if="hasTooltip" :show-arrow="false">
<template #trigger> <template #trigger>
<n-button :disabled="disabled" :text="!border" :focusable="false" @click.prevent="emit('click')"> <n-button
:disabled="disabled"
:focusable="false"
:loading="loading"
:text="!border"
@click.prevent="emit('click')">
<template #icon>
<n-icon :color="props.color" :size="props.size"> <n-icon :color="props.color" :size="props.size">
<component :is="props.icon" :stroke-width="props.strokeWidth" /> <component :is="props.icon" :stroke-width="props.strokeWidth" />
</n-icon> </n-icon>
</template>
</n-button> </n-button>
</template> </template>
{{ props.tTooltip ? $t(props.tTooltip) : props.tooltip }} {{ props.tTooltip ? $t(props.tTooltip) : props.tooltip }}
</n-tooltip> </n-tooltip>
<n-button v-else :disabled="disabled" :text="!border" :focusable="false" @click.prevent="emit('click')"> <n-button
v-else
:disabled="disabled"
:focusable="false"
:loading="loading"
:text="!border"
@click.prevent="emit('click')">
<template #icon>
<n-icon :color="props.color" :size="props.size"> <n-icon :color="props.color" :size="props.size">
<component :is="props.icon" :stroke-width="props.strokeWidth" /> <component :is="props.icon" :stroke-width="props.strokeWidth" />
</n-icon> </n-icon>
</template>
</n-button> </n-button>
</template> </template>

View File

@ -0,0 +1,59 @@
<script setup>
import { NIcon } from 'naive-ui'
const props = defineProps({
value: {
type: Number,
default: 0,
},
size: {
type: String,
default: 'small',
},
icons: Array,
tTooltips: Array,
iconSize: {
type: [Number, String],
default: 20,
},
color: {
type: String,
default: 'currentColor',
},
strokeWidth: {
type: [Number, String],
default: 3,
},
})
const emit = defineEmits(['update:value'])
const handleSwitch = (idx) => {
if (idx !== props.value) {
emit('update:value', idx)
}
}
</script>
<template>
<n-button-group>
<n-tooltip
:show-arrow="false"
v-for="(icon, i) in props.icons"
:key="i"
:disabled="!(props.tTooltips && props.tTooltips[i])">
<template #trigger>
<n-button :tertiary="i !== props.value" :focusable="false" :size="props.size" @click="handleSwitch(i)">
<template #icon>
<n-icon :size="props.iconSize">
<component :is="icon" :stroke-width="props.strokeWidth" />
</n-icon>
</template>
</n-button>
</template>
{{ props.tTooltips ? $t(props.tTooltips[i]) : '' }}
</n-tooltip>
</n-button-group>
</template>
<style scoped lang="scss"></style>

View File

@ -36,8 +36,8 @@ const handleClose = () => {
</script> </script>
<template> <template>
<n-space :wrap-item="false" align="center" justify="center" :size="0"> <n-space :size="0" :wrap-item="false" align="center" justify="center">
<n-tooltip :show-arrow="false" :delay="1000"> <n-tooltip :delay="1000" :show-arrow="false">
{{ $t('menu.minimise') }} {{ $t('menu.minimise') }}
<template #trigger> <template #trigger>
<div class="btn-wrapper" @click="handleMinimise"> <div class="btn-wrapper" @click="handleMinimise">
@ -45,7 +45,7 @@ const handleClose = () => {
</div> </div>
</template> </template>
</n-tooltip> </n-tooltip>
<n-tooltip :show-arrow="false" :delay="1000" v-if="maximised"> <n-tooltip v-if="maximised" :delay="1000" :show-arrow="false">
{{ $t('menu.restore') }} {{ $t('menu.restore') }}
<template #trigger> <template #trigger>
<div class="btn-wrapper" @click="handleMaximise"> <div class="btn-wrapper" @click="handleMaximise">
@ -53,7 +53,7 @@ const handleClose = () => {
</div> </div>
</template> </template>
</n-tooltip> </n-tooltip>
<n-tooltip :show-arrow="false" :delay="1000" v-else> <n-tooltip v-else :delay="1000" :show-arrow="false">
{{ $t('menu.maximise') }} {{ $t('menu.maximise') }}
<template #trigger> <template #trigger>
<div class="btn-wrapper" @click="handleMaximise"> <div class="btn-wrapper" @click="handleMaximise">
@ -61,7 +61,7 @@ const handleClose = () => {
</div> </div>
</template> </template>
</n-tooltip> </n-tooltip>
<n-tooltip :show-arrow="false" :delay="1000"> <n-tooltip :delay="1000" :show-arrow="false">
{{ $t('menu.close') }} {{ $t('menu.close') }}
<template #trigger> <template #trigger>
<div class="btn-wrapper" @click="handleClose"> <div class="btn-wrapper" @click="handleClose">
@ -72,7 +72,7 @@ const handleClose = () => {
</n-space> </n-space>
</template> </template>
<style scoped lang="scss"> <style lang="scss" scoped>
.btn-wrapper { .btn-wrapper {
width: v-bind('buttonSize'); width: v-bind('buttonSize');
height: v-bind('buttonSize'); height: v-bind('buttonSize');

View File

@ -69,8 +69,8 @@ defineExpose({
<template> <template>
<n-card <n-card
:title="$t('log.launch_log')"
:bordered="false" :bordered="false"
:title="$t('log.launch_log')"
class="content-container flex-box-v" class="content-container flex-box-v"
content-style="display: flex;flex-direction: column; overflow: hidden;"> content-style="display: flex;flex-direction: column; overflow: hidden;">
<n-form :disabled="data.loading" class="flex-item" inline> <n-form :disabled="data.loading" class="flex-item" inline>

View File

@ -200,9 +200,9 @@ const onReloadKey = async () => {
<!-- select nothing or select server node, display server status --> <!-- select nothing or select server node, display server status -->
<content-server-status <content-server-status
v-model:auto-refresh="currentServer.autoRefresh" v-model:auto-refresh="currentServer.autoRefresh"
:auto-loading="currentServer.autoLoading"
:info="currentServer.info" :info="currentServer.info"
:loading="currentServer.loading" :loading="currentServer.loading"
:auto-loading="currentServer.autoLoading"
:server="currentServer.name" :server="currentServer.name"
@refresh="refreshInfo(currentServer.name, true)" /> @refresh="refreshInfo(currentServer.name, true)" />
</div> </div>
@ -217,12 +217,12 @@ const onReloadKey = async () => {
:is="valueComponents[tabContent.type]" :is="valueComponents[tabContent.type]"
v-else v-else
:db="tabContent.db" :db="tabContent.db"
:key-path="tabContent.keyPath"
:key-code="tabContent.keyCode" :key-code="tabContent.keyCode"
:key-path="tabContent.keyPath"
:name="tabContent.name" :name="tabContent.name"
:size="tabContent.size"
:ttl="tabContent.ttl" :ttl="tabContent.ttl"
:value="tabContent.value" :value="tabContent.value"
:size="tabContent.size"
:view-as="tabContent.viewAs" /> :view-as="tabContent.viewAs" />
</div> </div>
</template> </template>

View File

@ -58,10 +58,6 @@ const tab = computed(() =>
borderLeftColor: themeVars.borderColor, borderLeftColor: themeVars.borderColor,
borderRightColor: themeVars.borderColor, borderRightColor: themeVars.borderColor,
}" }"
size="small"
type="card"
@close="onCloseTab"
@update:value="(tabIndex) => tabStore.switchTab(tabIndex)"
:theme-overrides="{ :theme-overrides="{
tabFontWeightActive: 800, tabFontWeightActive: 800,
tabBorderRadius: 0, tabBorderRadius: 0,
@ -72,16 +68,20 @@ const tab = computed(() =>
// tabBorderColor: themeVars.borderColor, // tabBorderColor: themeVars.borderColor,
tabBorderColor: '#0000', tabBorderColor: '#0000',
tabTextColorCard: themeVars.closeIconColor, tabTextColorCard: themeVars.closeIconColor,
}"> }"
size="small"
type="card"
@close="onCloseTab"
@update:value="(tabIndex) => tabStore.switchTab(tabIndex)">
<n-tab <n-tab
v-for="(t, i) in tab" v-for="(t, i) in tab"
:key="i" :key="i"
:name="i"
:closable="tabStore.activatedIndex === i" :closable="tabStore.activatedIndex === i"
:name="i"
:style="tabStore.activatedIndex === i ? activeTabStyle : inactiveTabStyle" :style="tabStore.activatedIndex === i ? activeTabStyle : inactiveTabStyle"
style="--wails-draggable: none" style="--wails-draggable: none"
@dblclick.stop="() => {}"> @dblclick.stop="() => {}">
<n-space align="center" justify="center" :wrap-item="false" :size="5" inline> <n-space :size="5" :wrap-item="false" align="center" inline justify="center">
<n-icon :component="ToggleServer" size="18" /> <n-icon :component="ToggleServer" size="18" />
<n-ellipsis style="max-width: 150px">{{ t.label }}</n-ellipsis> <n-ellipsis style="max-width: 150px">{{ t.label }}</n-ellipsis>
</n-space> </n-space>
@ -89,4 +89,4 @@ const tab = computed(() =>
</n-tabs> </n-tabs>
</template> </template>
<style scoped lang="scss"></style> <style lang="scss" scoped></style>

View File

@ -104,18 +104,18 @@ const infoFilter = ref('')
<n-space align="center" inline> <n-space align="center" inline>
{{ $t('status.auto_refresh') }} {{ $t('status.auto_refresh') }}
<n-switch <n-switch
:value="props.autoRefresh"
:loading="props.autoLoading" :loading="props.autoLoading"
:value="props.autoRefresh"
@update:value="(v) => emit('update:autoRefresh', v)" /> @update:value="(v) => emit('update:autoRefresh', v)" />
<n-tooltip> <n-tooltip>
{{ $t('status.refresh') }} {{ $t('status.refresh') }}
<template #trigger> <template #trigger>
<n-button <n-button
:loading="props.autoLoading"
circle circle
size="small" size="small"
tertiary tertiary
@click="emit('refresh')" @click="emit('refresh')">
:loading="props.autoLoading">
<template #icon> <template #icon>
<n-icon :component="Refresh" /> <n-icon :component="Refresh" />
</template> </template>

View File

@ -106,7 +106,7 @@ const onDeleteKey = () => {
<template> <template>
<div class="content-toolbar flex-box-h"> <div class="content-toolbar flex-box-h">
<n-input-group> <n-input-group>
<redis-type-tag :type="props.keyType" :binary-key="binaryKey" size="large" /> <redis-type-tag :binary-key="binaryKey" :type="props.keyType" size="large" />
<n-input v-model:value="props.keyPath"> <n-input v-model:value="props.keyPath">
<template #suffix> <template #suffix>
<icon-button :icon="Refresh" size="18" t-tooltip="interface.reload" @click="onReloadKey" /> <icon-button :icon="Refresh" size="18" t-tooltip="interface.reload" @click="onReloadKey" />

View File

@ -255,8 +255,8 @@ const onUpdateFilter = (filters, sourceColumn) => {
<div class="content-wrapper flex-box-v"> <div class="content-wrapper flex-box-v">
<content-toolbar <content-toolbar
:db="props.db" :db="props.db"
:key-path="props.keyPath"
:key-code="props.keyCode" :key-code="props.keyCode"
:key-path="props.keyPath"
:key-type="keyType" :key-type="keyType"
:server="props.name" :server="props.name"
:ttl="ttl" /> :ttl="ttl" />
@ -280,7 +280,7 @@ const onUpdateFilter = (filters, sourceColumn) => {
<div class="tb2-extra-info flex-item-expand"> <div class="tb2-extra-info flex-item-expand">
<n-tag size="large">{{ $t('interface.total', { size: props.size }) }}</n-tag> <n-tag size="large">{{ $t('interface.total', { size: props.size }) }}</n-tag>
</div> </div>
<n-button plain :focusable="false" @click="onAddRow"> <n-button :focusable="false" plain @click="onAddRow">
<template #icon> <template #icon>
<n-icon :component="AddLink" size="18" /> <n-icon :component="AddLink" size="18" />
</template> </template>
@ -290,12 +290,12 @@ const onUpdateFilter = (filters, sourceColumn) => {
<div class="value-wrapper fill-height flex-box-h"> <div class="value-wrapper fill-height flex-box-h">
<n-data-table <n-data-table
:key="(row) => row.no" :key="(row) => row.no"
:bordered="false"
:bottom-bordered="false"
:columns="columns" :columns="columns"
:data="tableData" :data="tableData"
:single-column="true" :single-column="true"
:single-line="false" :single-line="false"
:bordered="false"
:bottom-bordered="false"
flex-height flex-height
max-height="100%" max-height="100%"
size="small" size="small"

View File

@ -187,8 +187,8 @@ const onUpdateFilter = (filters, sourceColumn) => {
<div class="content-wrapper flex-box-v"> <div class="content-wrapper flex-box-v">
<content-toolbar <content-toolbar
:db="props.db" :db="props.db"
:key-path="props.keyPath"
:key-code="props.keyCode" :key-code="props.keyCode"
:key-path="props.keyPath"
:key-type="keyType" :key-type="keyType"
:server="props.name" :server="props.name"
:ttl="ttl" /> :ttl="ttl" />
@ -204,7 +204,7 @@ const onUpdateFilter = (filters, sourceColumn) => {
<div class="tb2-extra-info flex-item-expand"> <div class="tb2-extra-info flex-item-expand">
<n-tag size="large">{{ $t('interface.total', { size: props.size }) }}</n-tag> <n-tag size="large">{{ $t('interface.total', { size: props.size }) }}</n-tag>
</div> </div>
<n-button plain :focusable="false" @click="onAddValue"> <n-button :focusable="false" plain @click="onAddValue">
<template #icon> <template #icon>
<n-icon :component="AddLink" size="18" /> <n-icon :component="AddLink" size="18" />
</template> </template>
@ -214,12 +214,12 @@ const onUpdateFilter = (filters, sourceColumn) => {
<div class="value-wrapper fill-height flex-box-h"> <div class="value-wrapper fill-height flex-box-h">
<n-data-table <n-data-table
:key="(row) => row.no" :key="(row) => row.no"
:bordered="false"
:bottom-bordered="false"
:columns="columns" :columns="columns"
:data="tableData" :data="tableData"
:single-column="true" :single-column="true"
:single-line="false" :single-line="false"
:bordered="false"
:bottom-bordered="false"
flex-height flex-height
max-height="100%" max-height="100%"
size="small" size="small"

View File

@ -182,8 +182,8 @@ const onUpdateFilter = (filters, sourceColumn) => {
<div class="content-wrapper flex-box-v"> <div class="content-wrapper flex-box-v">
<content-toolbar <content-toolbar
:db="props.db" :db="props.db"
:key-path="props.keyPath"
:key-code="props.keyCode" :key-code="props.keyCode"
:key-path="props.keyPath"
:key-type="keyType" :key-type="keyType"
:server="props.name" :server="props.name"
:ttl="ttl" /> :ttl="ttl" />
@ -199,7 +199,7 @@ const onUpdateFilter = (filters, sourceColumn) => {
<div class="tb2-extra-info flex-item-expand"> <div class="tb2-extra-info flex-item-expand">
<n-tag size="large">{{ $t('interface.total', { size: props.size }) }}</n-tag> <n-tag size="large">{{ $t('interface.total', { size: props.size }) }}</n-tag>
</div> </div>
<n-button plain :focusable="false" @click="onAddValue"> <n-button :focusable="false" plain @click="onAddValue">
<template #icon> <template #icon>
<n-icon :component="AddLink" size="18" /> <n-icon :component="AddLink" size="18" />
</template> </template>
@ -209,12 +209,12 @@ const onUpdateFilter = (filters, sourceColumn) => {
<div class="value-wrapper fill-height flex-box-h"> <div class="value-wrapper fill-height flex-box-h">
<n-data-table <n-data-table
:key="(row) => row.no" :key="(row) => row.no"
:bordered="false"
:bottom-bordered="false"
:columns="columns" :columns="columns"
:data="tableData" :data="tableData"
:single-column="true" :single-column="true"
:single-line="false" :single-line="false"
:bordered="false"
:bottom-bordered="false"
flex-height flex-height
max-height="100%" max-height="100%"
size="small" size="small"

View File

@ -167,8 +167,8 @@ const onUpdateFilter = (filters, sourceColumn) => {
<div class="content-wrapper flex-box-v"> <div class="content-wrapper flex-box-v">
<content-toolbar <content-toolbar
:db="props.db" :db="props.db"
:key-path="props.keyPath"
:key-code="props.keyCode" :key-code="props.keyCode"
:key-path="props.keyPath"
:key-type="keyType" :key-type="keyType"
:server="props.name" :server="props.name"
:ttl="ttl" /> :ttl="ttl" />
@ -192,7 +192,7 @@ const onUpdateFilter = (filters, sourceColumn) => {
<div class="tb2-extra-info flex-item-expand"> <div class="tb2-extra-info flex-item-expand">
<n-tag size="large">{{ $t('interface.total', { size: props.size }) }}</n-tag> <n-tag size="large">{{ $t('interface.total', { size: props.size }) }}</n-tag>
</div> </div>
<n-button plain :focusable="false" @click="onAddRow"> <n-button :focusable="false" plain @click="onAddRow">
<template #icon> <template #icon>
<n-icon :component="AddLink" size="18" /> <n-icon :component="AddLink" size="18" />
</template> </template>
@ -202,12 +202,12 @@ const onUpdateFilter = (filters, sourceColumn) => {
<div class="value-wrapper fill-height flex-box-h"> <div class="value-wrapper fill-height flex-box-h">
<n-data-table <n-data-table
:key="(row) => row.id" :key="(row) => row.id"
:bordered="false"
:bottom-bordered="false"
:columns="columns" :columns="columns"
:data="tableData" :data="tableData"
:single-column="true" :single-column="true"
:single-line="false" :single-line="false"
:bordered="false"
:bottom-bordered="false"
flex-height flex-height
max-height="100%" max-height="100%"
size="small" size="small"

View File

@ -153,18 +153,18 @@ const onSaveValue = async () => {
<div class="content-wrapper flex-box-v"> <div class="content-wrapper flex-box-v">
<content-toolbar <content-toolbar
:db="props.db" :db="props.db"
:key-path="keyPath"
:key-code="keyCode" :key-code="keyCode"
:key-path="keyPath"
:key-type="keyType" :key-type="keyType"
:server="props.name" :server="props.name"
:ttl="ttl" /> :ttl="ttl" />
<div class="tb2 flex-box-h"> <div class="tb2 flex-box-h">
<n-text>{{ $t('interface.view_as') }}</n-text> <n-text>{{ $t('interface.view_as') }}</n-text>
<n-select <n-select
:value="props.viewAs"
:options="viewOption" :options="viewOption"
style="width: 160px" :value="props.viewAs"
filterable filterable
style="width: 160px"
@update:value="onViewTypeUpdate" /> @update:value="onViewTypeUpdate" />
<div class="flex-item-expand"></div> <div class="flex-item-expand"></div>
<n-button-group v-if="!inEdit"> <n-button-group v-if="!inEdit">
@ -174,7 +174,7 @@ const onSaveValue = async () => {
</template> </template>
{{ $t('interface.copy_value') }} {{ $t('interface.copy_value') }}
</n-button> </n-button>
<n-button plain :focusable="false" @click="onEditValue"> <n-button :focusable="false" plain @click="onEditValue">
<template #icon> <template #icon>
<n-icon :component="Edit" size="18" /> <n-icon :component="Edit" size="18" />
</template> </template>
@ -182,13 +182,13 @@ const onSaveValue = async () => {
</n-button> </n-button>
</n-button-group> </n-button-group>
<n-button-group v-else> <n-button-group v-else>
<n-button :loading="saving" :focusable="false" plain @click="onSaveValue"> <n-button :focusable="false" :loading="saving" plain @click="onSaveValue">
<template #icon> <template #icon>
<n-icon :component="Save" size="18" /> <n-icon :component="Save" size="18" />
</template> </template>
{{ $t('interface.save_update') }} {{ $t('interface.save_update') }}
</n-button> </n-button>
<n-button :loading="saving" :focusable="false" plain @click="onCancelEdit"> <n-button :focusable="false" :loading="saving" plain @click="onCancelEdit">
<template #icon> <template #icon>
<n-icon :component="Close" size="18" /> <n-icon :component="Close" size="18" />
</template> </template>

View File

@ -280,8 +280,8 @@ const onUpdateFilter = (filters, sourceColumn) => {
<div class="content-wrapper flex-box-v"> <div class="content-wrapper flex-box-v">
<content-toolbar <content-toolbar
:db="props.db" :db="props.db"
:key-path="props.keyPath"
:key-code="props.keyCode" :key-code="props.keyCode"
:key-path="props.keyPath"
:key-type="keyType" :key-type="keyType"
:server="props.name" :server="props.name"
:ttl="ttl" /> :ttl="ttl" />
@ -310,7 +310,7 @@ const onUpdateFilter = (filters, sourceColumn) => {
<div class="tb2-extra-info flex-item-expand"> <div class="tb2-extra-info flex-item-expand">
<n-tag size="large">{{ $t('interface.total', { size: props.size }) }}</n-tag> <n-tag size="large">{{ $t('interface.total', { size: props.size }) }}</n-tag>
</div> </div>
<n-button plain :focusable="false" @click="onAddRow"> <n-button :focusable="false" plain @click="onAddRow">
<template #icon> <template #icon>
<n-icon :component="AddLink" size="18" /> <n-icon :component="AddLink" size="18" />
</template> </template>
@ -320,12 +320,12 @@ const onUpdateFilter = (filters, sourceColumn) => {
<div class="value-wrapper fill-height flex-box-h"> <div class="value-wrapper fill-height flex-box-h">
<n-data-table <n-data-table
:key="(row) => row.no" :key="(row) => row.no"
:bordered="false"
:bottom-bordered="false"
:columns="columns" :columns="columns"
:data="tableData" :data="tableData"
:single-column="true" :single-column="true"
:single-line="false" :single-line="false"
:bordered="false"
:bottom-bordered="false"
flex-height flex-height
max-height="100%" max-height="100%"
size="small" size="small"

View File

@ -4,7 +4,7 @@ import useDialog from 'stores/dialog.js'
import { useThemeVars } from 'naive-ui' import { useThemeVars } from 'naive-ui'
import { BrowserOpenURL } from 'wailsjs/runtime/runtime.js' import { BrowserOpenURL } from 'wailsjs/runtime/runtime.js'
import { GetAppVersion } from 'wailsjs/go/services/preferencesService.js' import { GetAppVersion } from 'wailsjs/go/services/preferencesService.js'
import { ref, onMounted } from 'vue' import { onMounted, ref } from 'vue'
const themeVars = useThemeVars() const themeVars = useThemeVars()
const dialogStore = useDialog() const dialogStore = useDialog()
@ -27,23 +27,23 @@ const onOpenWebsite = () => {
<template> <template>
<n-modal v-model:show="dialogStore.aboutDialogVisible" :show-icon="false" preset="dialog" transform-origin="center"> <n-modal v-model:show="dialogStore.aboutDialogVisible" :show-icon="false" preset="dialog" transform-origin="center">
<n-space vertical align="center" :wrap-item="false" :wrap="false" :size="10"> <n-space :size="10" :wrap="false" :wrap-item="false" align="center" vertical>
<n-avatar :size="120" color="#0000" :src="iconUrl"></n-avatar> <n-avatar :size="120" :src="iconUrl" color="#0000"></n-avatar>
<div class="about-app-title">Tiny RDM</div> <div class="about-app-title">Tiny RDM</div>
<n-text>{{ version }}</n-text> <n-text>{{ version }}</n-text>
<n-space align="center" :wrap-item="false" :wrap="false" :size="5"> <n-space :size="5" :wrap="false" :wrap-item="false" align="center">
<n-text class="about-link" @click="onOpenSource">{{ $t('dialogue.about.source') }}</n-text> <n-text class="about-link" @click="onOpenSource">{{ $t('dialogue.about.source') }}</n-text>
<n-divider vertical /> <n-divider vertical />
<n-text class="about-link" @click="onOpenWebsite">{{ $t('dialogue.about.website') }}</n-text> <n-text class="about-link" @click="onOpenWebsite">{{ $t('dialogue.about.website') }}</n-text>
</n-space> </n-space>
<div class="about-copyright" :style="{ color: themeVars.textColor3 }"> <div :style="{ color: themeVars.textColor3 }" class="about-copyright">
Copyright © 2023 Tinycraft.cc All rights reserved Copyright © 2023 Tinycraft.cc All rights reserved
</div> </div>
</n-space> </n-space>
</n-modal> </n-modal>
</template> </template>
<style scoped lang="scss"> <style lang="scss" scoped>
.about-app-title { .about-app-title {
font-weight: bold; font-weight: bold;
font-size: 18px; font-size: 18px;

View File

@ -6,7 +6,7 @@ import { ListSentinelMasters, TestConnection } from 'wailsjs/go/services/connect
import useDialog, { ConnDialogType } from 'stores/dialog' import useDialog, { ConnDialogType } from 'stores/dialog'
import Close from '@/components/icons/Close.vue' import Close from '@/components/icons/Close.vue'
import useConnectionStore from 'stores/connections.js' import useConnectionStore from 'stores/connections.js'
import { SelectFile } from 'wailsjs/go/services/systemService.js' import FileOpenInput from '@/components/common/FileOpenInput.vue'
/** /**
* Dialog for new or edit connection * Dialog for new or edit connection
@ -83,39 +83,6 @@ const sshLoginType = computed(() => {
return get(generalForm.value, 'ssh.loginType', 'pwd') return get(generalForm.value, 'ssh.loginType', 'pwd')
}) })
const onSSHChooseKey = async () => {
const { success, data } = await SelectFile()
const path = get(data, 'path', '')
if (!isEmpty(path)) {
generalForm.value.ssh.pkFile = path
}
}
const onSSLChooseCert = async () => {
const { success, data } = await SelectFile()
const path = get(data, 'path', '')
if (!isEmpty(path)) {
generalForm.value.ssl.certFile = path
}
}
const onSSLChooseKey = async () => {
const { success, data } = await SelectFile()
const path = get(data, 'path', '')
if (!isEmpty(path)) {
generalForm.value.ssl.keyFile = path
}
}
const onSSLChooseCA = async () => {
const { success, data } = await SelectFile()
if (!success) {
generalForm.value.ssl.caFile = ''
} else {
generalForm.value.ssl.caFile = get(data, 'path', '')
}
}
const loadingSentinelMaster = ref(false) const loadingSentinelMaster = ref(false)
const masterNameOptions = ref([]) const masterNameOptions = ref([])
const onLoadSentinelMasters = async () => { const onLoadSentinelMasters = async () => {
@ -335,24 +302,24 @@ const onClose = () => {
label-placement="top"> label-placement="top">
<n-grid :x-gap="10"> <n-grid :x-gap="10">
<n-form-item-gi <n-form-item-gi
:span="12"
:label="$t('dialogue.connection.advn.filter')" :label="$t('dialogue.connection.advn.filter')"
:span="12"
path="defaultFilter"> path="defaultFilter">
<n-input <n-input
v-model:value="generalForm.defaultFilter" v-model:value="generalForm.defaultFilter"
:placeholder="$t('dialogue.connection.advn.filter_tip')" /> :placeholder="$t('dialogue.connection.advn.filter_tip')" />
</n-form-item-gi> </n-form-item-gi>
<n-form-item-gi <n-form-item-gi
:span="12"
:label="$t('dialogue.connection.advn.separator')" :label="$t('dialogue.connection.advn.separator')"
:span="12"
path="keySeparator"> path="keySeparator">
<n-input <n-input
v-model:value="generalForm.keySeparator" v-model:value="generalForm.keySeparator"
:placeholder="$t('dialogue.connection.advn.separator_tip')" /> :placeholder="$t('dialogue.connection.advn.separator_tip')" />
</n-form-item-gi> </n-form-item-gi>
<n-form-item-gi <n-form-item-gi
:span="12"
:label="$t('dialogue.connection.advn.conn_timeout')" :label="$t('dialogue.connection.advn.conn_timeout')"
:span="12"
path="connTimeout"> path="connTimeout">
<n-input-number v-model:value="generalForm.connTimeout" :max="999999" :min="1"> <n-input-number v-model:value="generalForm.connTimeout" :max="999999" :min="1">
<template #suffix> <template #suffix>
@ -361,8 +328,8 @@ const onClose = () => {
</n-input-number> </n-input-number>
</n-form-item-gi> </n-form-item-gi>
<n-form-item-gi <n-form-item-gi
:span="12"
:label="$t('dialogue.connection.advn.exec_timeout')" :label="$t('dialogue.connection.advn.exec_timeout')"
:span="12"
path="execTimeout"> path="execTimeout">
<n-input-number v-model:value="generalForm.execTimeout" :max="999999" :min="1"> <n-input-number v-model:value="generalForm.execTimeout" :max="999999" :min="1">
<template #suffix> <template #suffix>
@ -370,7 +337,10 @@ const onClose = () => {
</template> </template>
</n-input-number> </n-input-number>
</n-form-item-gi> </n-form-item-gi>
<n-form-item-gi :span="24" :label="$t('dialogue.connection.advn.dbfilter_type')"> <n-form-item-gi :label="$t('dialogue.connection.advn.load_size')" :span="12">
<n-input-number v-model:value="generalForm.loadSize" :min="0" />
</n-form-item-gi>
<n-form-item-gi :label="$t('dialogue.connection.advn.dbfilter_type')" :span="24">
<n-radio-group <n-radio-group
v-model:value="generalForm.dbFilterType" v-model:value="generalForm.dbFilterType"
@update:value="onUpdateDBFilterType"> @update:value="onUpdateDBFilterType">
@ -385,22 +355,22 @@ const onClose = () => {
</n-form-item-gi> </n-form-item-gi>
<n-form-item-gi <n-form-item-gi
v-show="generalForm.dbFilterType !== 'none'" v-show="generalForm.dbFilterType !== 'none'"
:span="24" :label="$t('dialogue.connection.advn.dbfilter_input')"
:label="$t('dialogue.connection.advn.dbfilter_input')"> :span="24">
<n-select <n-select
v-model:value="dbFilterList" v-model:value="dbFilterList"
:clearable="true"
:disabled="generalForm.dbFilterType === 'none'" :disabled="generalForm.dbFilterType === 'none'"
:placeholder="$t('dialogue.connection.advn.dbfilter_input_tip')"
:show="false"
:show-arrow="false"
filterable filterable
multiple multiple
tag tag />
:placeholder="$t('dialogue.connection.advn.dbfilter_input_tip')"
:show-arrow="false"
:show="false"
:clearable="true" />
</n-form-item-gi> </n-form-item-gi>
<n-form-item-gi <n-form-item-gi
:span="24"
:label="$t('dialogue.connection.advn.mark_color')" :label="$t('dialogue.connection.advn.mark_color')"
:span="24"
path="markColor"> path="markColor">
<div <div
v-for="color in predefineColors" v-for="color in predefineColors"
@ -426,48 +396,27 @@ const onClose = () => {
</n-checkbox> </n-checkbox>
</n-form-item> </n-form-item>
<n-form <n-form
:disabled="!generalForm.ssl.enable"
:model="generalForm.ssl" :model="generalForm.ssl"
:show-require-mark="false" :show-require-mark="false"
:disabled="!generalForm.ssl.enable"
label-placement="top"> label-placement="top">
<n-form-item :label="$t('dialogue.connection.ssl.cert_file')"> <n-form-item :label="$t('dialogue.connection.ssl.cert_file')">
<n-input-group> <file-open-input
<n-input
v-model:value="generalForm.ssl.certFile" v-model:value="generalForm.ssl.certFile"
:placeholder="$t('dialogue.connection.ssl.cert_file_tip')" :placeholder="$t('dialogue.connection.ssl.cert_file_tip')"
clearable /> :disabled="!generalForm.ssl.enable" />
<n-button
:focusable="false"
:disabled="!generalForm.ssl.enable"
@click="onSSLChooseCert">
...
</n-button>
</n-input-group>
</n-form-item> </n-form-item>
<n-form-item :label="$t('dialogue.connection.ssl.key_file')"> <n-form-item :label="$t('dialogue.connection.ssl.key_file')">
<n-input-group> <file-open-input
<n-input
v-model:value="generalForm.ssl.keyFile" v-model:value="generalForm.ssl.keyFile"
:placeholder="$t('dialogue.connection.ssl.key_file_tip')" :placeholder="$t('dialogue.connection.ssl.key_file_tip')"
clearable /> :disabled="!generalForm.ssl.enable" />
<n-button
:focusable="false"
:disabled="!generalForm.ssl.enable"
@click="onSSLChooseKey">
...
</n-button>
</n-input-group>
</n-form-item> </n-form-item>
<n-form-item :label="$t('dialogue.connection.ssl.ca_file')"> <n-form-item :label="$t('dialogue.connection.ssl.ca_file')">
<n-input-group> <file-open-input
<n-input
v-model:value="generalForm.ssl.caFile" v-model:value="generalForm.ssl.caFile"
:placeholder="$t('dialogue.connection.ssl.ca_file_tip')" :placeholder="$t('dialogue.connection.ssl.ca_file_tip')"
clearable /> :disabled="!generalForm.ssl.enable" />
<n-button :focusable="false" :disabled="!generalForm.ssl.enable" @click="onSSLChooseCA">
...
</n-button>
</n-input-group>
</n-form-item> </n-form-item>
</n-form> </n-form>
</n-tab-pane> </n-tab-pane>
@ -480,9 +429,9 @@ const onClose = () => {
</n-checkbox> </n-checkbox>
</n-form-item> </n-form-item>
<n-form <n-form
:disabled="!generalForm.ssh.enable"
:model="generalForm.ssh" :model="generalForm.ssh"
:show-require-mark="false" :show-require-mark="false"
:disabled="!generalForm.ssh.enable"
label-placement="top"> label-placement="top">
<n-form-item :label="$t('dialogue.connection.addr')" required> <n-form-item :label="$t('dialogue.connection.addr')" required>
<n-input <n-input
@ -516,18 +465,10 @@ const onClose = () => {
type="password" /> type="password" />
</n-form-item> </n-form-item>
<n-form-item v-if="sshLoginType === 'pkfile'" :label="$t('dialogue.connection.ssh.pkfile')"> <n-form-item v-if="sshLoginType === 'pkfile'" :label="$t('dialogue.connection.ssh.pkfile')">
<n-input-group> <file-open-input
<n-input
v-model:value="generalForm.ssh.pkFile" v-model:value="generalForm.ssh.pkFile"
:placeholder="$t('dialogue.connection.ssh.pkfile_tip')" /> :placeholder="$t('dialogue.connection.ssh.pkfile_tip')"
<n-button :disabled="!generalForm.ssh.enable" />
:focusable="false"
:disabled="!generalForm.ssh.enable"
@click="onSSHChooseKey"
clearable>
...
</n-button>
</n-input-group>
</n-form-item> </n-form-item>
<n-form-item v-if="sshLoginType === 'pkfile'" :label="$t('dialogue.connection.ssh.passphrase')"> <n-form-item v-if="sshLoginType === 'pkfile'" :label="$t('dialogue.connection.ssh.passphrase')">
<n-input <n-input
@ -547,17 +488,17 @@ const onClose = () => {
</n-checkbox> </n-checkbox>
</n-form-item> </n-form-item>
<n-form <n-form
:disabled="!generalForm.sentinel.enable"
:model="generalForm.sentinel" :model="generalForm.sentinel"
:show-require-mark="false" :show-require-mark="false"
:disabled="!generalForm.sentinel.enable"
label-placement="top"> label-placement="top">
<n-form-item :label="$t('dialogue.connection.sentinel.master')"> <n-form-item :label="$t('dialogue.connection.sentinel.master')">
<n-input-group> <n-input-group>
<n-select <n-select
v-model:value="generalForm.sentinel.master" v-model:value="generalForm.sentinel.master"
:options="masterNameOptions"
filterable filterable
tag tag />
:options="masterNameOptions" />
<n-button :loading="loadingSentinelMaster" @click="onLoadSentinelMasters"> <n-button :loading="loadingSentinelMaster" @click="onLoadSentinelMasters">
{{ $t('dialogue.connection.sentinel.auto_discover') }} {{ $t('dialogue.connection.sentinel.auto_discover') }}
</n-button> </n-button>
@ -597,10 +538,10 @@ const onClose = () => {
<!-- test result alert--> <!-- test result alert-->
<n-alert <n-alert
v-if="showTestResult" v-if="showTestResult"
:on-close="() => (showTestResult = false)"
:title="isEmpty(testResult) ? '' : $t('dialogue.connection.test_fail')" :title="isEmpty(testResult) ? '' : $t('dialogue.connection.test_fail')"
:type="isEmpty(testResult) ? 'success' : 'error'" :type="isEmpty(testResult) ? 'success' : 'error'"
closable closable>
:on-close="() => (showTestResult = false)">
<template v-if="isEmpty(testResult)">{{ $t('dialogue.connection.test_succ') }}</template> <template v-if="isEmpty(testResult)">{{ $t('dialogue.connection.test_succ') }}</template>
<template v-else>{{ testResult }}</template> <template v-else>{{ testResult }}</template>
</n-alert> </n-alert>
@ -608,15 +549,15 @@ const onClose = () => {
<template #action> <template #action>
<div class="flex-item-expand"> <div class="flex-item-expand">
<n-button :focusable="false" :disabled="closingConnection" :loading="testing" @click="onTestConnection"> <n-button :disabled="closingConnection" :focusable="false" :loading="testing" @click="onTestConnection">
{{ $t('dialogue.connection.test') }} {{ $t('dialogue.connection.test') }}
</n-button> </n-button>
</div> </div>
<div class="flex-item n-dialog__action"> <div class="flex-item n-dialog__action">
<n-button :focusable="false" :disabled="closingConnection" @click="onClose"> <n-button :disabled="closingConnection" :focusable="false" @click="onClose">
{{ $t('common.cancel') }} {{ $t('common.cancel') }}
</n-button> </n-button>
<n-button :focusable="false" :disabled="closingConnection" type="primary" @click="onSaveConnection"> <n-button :disabled="closingConnection" :focusable="false" type="primary" @click="onSaveConnection">
{{ isEditMode ? $t('preferences.general.update') : $t('common.confirm') }} {{ isEditMode ? $t('preferences.general.update') : $t('common.confirm') }}
</n-button> </n-button>
</div> </div>

View File

@ -105,13 +105,13 @@ const onClose = () => {
<template #action> <template #action>
<div class="flex-item n-dialog__action"> <div class="flex-item n-dialog__action">
<n-button :focusable="false" @click="onClose">{{ $t('common.cancel') }}</n-button> <n-button :focusable="false" @click="onClose">{{ $t('common.cancel') }}</n-button>
<n-button v-if="!deleteForm.showAffected" type="primary" :focusable="false" @click="scanAffectedKey"> <n-button v-if="!deleteForm.showAffected" :focusable="false" type="primary" @click="scanAffectedKey">
{{ $t('dialogue.key.show_affected_key') }} {{ $t('dialogue.key.show_affected_key') }}
</n-button> </n-button>
<n-button <n-button
v-else v-else
:focusable="false"
:disabled="isEmpty(deleteForm.affectedKeys)" :disabled="isEmpty(deleteForm.affectedKeys)"
:focusable="false"
type="error" type="error"
@click="onConfirmDelete"> @click="onConfirmDelete">
{{ $t('dialogue.key.confirm_delete_key', { num: size(deleteForm.affectedKeys) }) }} {{ $t('dialogue.key.confirm_delete_key', { num: size(deleteForm.affectedKeys) }) }}

View File

@ -74,11 +74,11 @@ const onClose = () => {
:show-require-mark="false" :show-require-mark="false"
label-placement="top" label-placement="top"
style="padding-right: 15px"> style="padding-right: 15px">
<n-form-item :label="$t('server')" path="key"> <n-form-item :label="$t('dialogue.key.server')" path="key">
<n-text>{{ filterForm.server }}</n-text> <n-input :value="filterForm.server" readonly></n-input>
</n-form-item> </n-form-item>
<n-form-item :label="$t('dialogue.key.db_index')" path="db"> <n-form-item :label="$t('dialogue.key.db_index')" path="db">
<n-text>{{ filterForm.db }}</n-text> <n-input :value="filterForm.db + ''" readonly></n-input>
</n-form-item> </n-form-item>
<n-form-item :label="$t('interface.type')" path="type" required> <n-form-item :label="$t('interface.type')" path="type" required>
<n-select v-model:value="filterForm.type" :options="typeOptions" /> <n-select v-model:value="filterForm.type" :options="typeOptions" />
@ -87,11 +87,14 @@ const onClose = () => {
<n-input-group> <n-input-group>
<n-tooltip trigger="focus"> <n-tooltip trigger="focus">
<template #trigger> <template #trigger>
<n-input v-model:value="filterForm.pattern" clearable placeholder="Filter Pattern" /> <n-input
v-model:value="filterForm.pattern"
:placeholder="$t('dialogue.filter.filter_pattern')"
clearable />
</template> </template>
<div class="text-block">{{ $t('dialogue.filter.filter_pattern_tip') }}</div> <div class="text-block">{{ $t('dialogue.filter.filter_pattern_tip') }}</div>
</n-tooltip> </n-tooltip>
<n-button secondary type="primary" :focusable="false" @click="filterForm.pattern = '*'"> <n-button :focusable="false" secondary type="primary" @click="filterForm.pattern = '*'">
{{ $t('preferences.restore_defaults') }} {{ $t('preferences.restore_defaults') }}
</n-button> </n-button>
</n-input-group> </n-input-group>

View File

@ -187,7 +187,7 @@ const onClose = () => {
{{ $t('common.second') }} {{ $t('common.second') }}
</template> </template>
</n-input-number> </n-input-number>
<n-button secondary type="primary" :focusable="false" @click="() => (newForm.ttl = -1)"> <n-button :focusable="false" secondary type="primary" @click="() => (newForm.ttl = -1)">
{{ $t('dialogue.key.persist_key') }} {{ $t('dialogue.key.persist_key') }}
</n-button> </n-button>
</n-input-group> </n-input-group>

View File

@ -60,32 +60,43 @@ const onClose = () => {
:show-icon="false" :show-icon="false"
:title="$t('preferences.name')" :title="$t('preferences.name')"
preset="dialog" preset="dialog"
style="width: 500px"
transform-origin="center"> transform-origin="center">
<!-- FIXME: set loading will slow down appear animation of dialog in linux --> <!-- FIXME: set loading will slow down appear animation of dialog in linux -->
<!-- <n-spin :show="loading"> --> <!-- <n-spin :show="loading"> -->
<n-tabs v-model:value="tab" animated type="line"> <n-tabs v-model:value="tab" animated type="line">
<n-tab-pane :tab="$t('preferences.general.name')" display-directive="show" name="general"> <n-tab-pane :tab="$t('preferences.general.name')" display-directive="show" name="general">
<n-form :disabled="loading" :model="prefStore.general" :show-require-mark="false" label-placement="top"> <n-form :disabled="loading" :model="prefStore.general" :show-require-mark="false" label-placement="top">
<n-form-item :label="$t('preferences.general.theme')" required> <n-grid :x-gap="10">
<n-form-item-gi :label="$t('preferences.general.theme')" :span="24" required>
<n-radio-group v-model:value="prefStore.general.theme" name="theme" size="medium"> <n-radio-group v-model:value="prefStore.general.theme" name="theme" size="medium">
<n-radio-button v-for="opt in prefStore.themeOption" :key="opt.value" :value="opt.value"> <n-radio-button
v-for="opt in prefStore.themeOption"
:key="opt.value"
:value="opt.value">
{{ opt.label }} {{ opt.label }}
</n-radio-button> </n-radio-button>
</n-radio-group> </n-radio-group>
</n-form-item> </n-form-item-gi>
<n-form-item :label="$t('preferences.general.language')" required> <n-form-item-gi :label="$t('preferences.general.language')" :span="24" required>
<n-select <n-select
v-model:value="prefStore.general.language" v-model:value="prefStore.general.language"
:options="prefStore.langOption" :options="prefStore.langOption"
filterable /> filterable />
</n-form-item> </n-form-item-gi>
<n-form-item :label="$t('preferences.general.font')" required> <n-form-item-gi :label="$t('preferences.general.font')" :span="12" required>
<n-select v-model:value="prefStore.general.font" :options="prefStore.fontOption" filterable /> <n-select
</n-form-item> v-model:value="prefStore.general.font"
<n-form-item :label="$t('preferences.general.font_size')"> :options="prefStore.fontOption"
filterable />
</n-form-item-gi>
<n-form-item-gi :label="$t('preferences.general.font_size')" :span="12">
<n-input-number v-model:value="prefStore.general.fontSize" :max="65535" :min="1" /> <n-input-number v-model:value="prefStore.general.fontSize" :max="65535" :min="1" />
</n-form-item> </n-form-item-gi>
<n-form-item :label="$t('preferences.general.proxy')"> <n-form-item-gi :label="$t('preferences.general.scan_size')" :span="12">
<n-input-number v-model:value="prefStore.general.scanSize" :min="1" />
</n-form-item-gi>
<n-form-item-gi :label="$t('preferences.general.proxy')" :span="24">
<n-space> <n-space>
<n-checkbox v-model:checked="prefStore.general.useSysProxy"> <n-checkbox v-model:checked="prefStore.general.useSysProxy">
{{ $t('preferences.general.use_system_proxy') }} {{ $t('preferences.general.use_system_proxy') }}
@ -94,12 +105,13 @@ const onClose = () => {
{{ $t('preferences.general.use_system_proxy_http') }} {{ $t('preferences.general.use_system_proxy_http') }}
</n-checkbox> </n-checkbox>
</n-space> </n-space>
</n-form-item> </n-form-item-gi>
<n-form-item :label="$t('preferences.general.update')"> <n-form-item-gi :label="$t('preferences.general.update')" :span="24">
<n-checkbox v-model:checked="prefStore.general.checkUpdate"> <n-checkbox v-model:checked="prefStore.general.checkUpdate">
{{ $t('preferences.general.auto_check_update') }} {{ $t('preferences.general.auto_check_update') }}
</n-checkbox> </n-checkbox>
</n-form-item> </n-form-item-gi>
</n-grid>
</n-form> </n-form>
</n-tab-pane> </n-tab-pane>

View File

@ -66,8 +66,8 @@ const onClose = () => {
@negative-click="onClose"> @negative-click="onClose">
<n-form <n-form
:model="renameForm" :model="renameForm"
:show-require-mark="false"
:show-label="false" :show-label="false"
:show-require-mark="false"
label-align="left" label-align="left"
label-placement="top"> label-placement="top">
<n-form-item :label="$t('dialogue.key.new_name')" required> <n-form-item :label="$t('dialogue.key.new_name')" required>

View File

@ -1,5 +1,5 @@
<script setup> <script setup>
import { reactive, ref, watch } from 'vue' import { reactive, watch } from 'vue'
import useDialog from 'stores/dialog' import useDialog from 'stores/dialog'
import useTabStore from 'stores/tab.js' import useTabStore from 'stores/tab.js'
import useConnectionStore from 'stores/connections.js' import useConnectionStore from 'stores/connections.js'
@ -105,7 +105,7 @@ const onConfirm = async () => {
</div> </div>
<div class="flex-item n-dialog__action"> <div class="flex-item n-dialog__action">
<n-button :focusable="false" @click="onClose">{{ $t('common.cancel') }}</n-button> <n-button :focusable="false" @click="onClose">{{ $t('common.cancel') }}</n-button>
<n-button type="primary" :focusable="false" @click="onConfirm">{{ $t('common.save') }}</n-button> <n-button :focusable="false" type="primary" @click="onConfirm">{{ $t('common.save') }}</n-button>
</div> </div>
</template> </template>
</n-modal> </n-modal>

View File

@ -2,17 +2,17 @@
<template> <template>
<svg <svg
xmlns="http://www.w3.org/2000/svg"
width="24"
height="24"
viewBox="0 0 24 24"
fill="none" fill="none"
height="24"
stroke="currentColor" stroke="currentColor"
stroke-width="2"
stroke-linecap="round" stroke-linecap="round"
stroke-linejoin="round"> stroke-linejoin="round"
<rect x="14" y="14" width="4" height="6" rx="2" /> stroke-width="2"
<rect x="6" y="4" width="4" height="6" rx="2" /> viewBox="0 0 24 24"
width="24"
xmlns="http://www.w3.org/2000/svg">
<rect height="6" rx="2" width="4" x="14" y="14" />
<rect height="6" rx="2" width="4" x="6" y="4" />
<path d="M6 20h4" /> <path d="M6 20h4" />
<path d="M14 10h4" /> <path d="M14 10h4" />
<path d="M6 14h2v6" /> <path d="M6 14h2v6" />

View File

@ -9,13 +9,13 @@ const props = defineProps({
<template> <template>
<svg <svg
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 24 24"
fill="none" fill="none"
stroke="currentColor" stroke="currentColor"
stroke-width="1.4"
stroke-linecap="round" stroke-linecap="round"
stroke-linejoin="round"> stroke-linejoin="round"
stroke-width="1.4"
viewBox="0 0 24 24"
xmlns="http://www.w3.org/2000/svg">
<path :fill="props.fillColor" d="M2 18v3c0 .6.4 1 1 1h4v-3h3v-3h2l1.4-1.4a6.5 6.5 0 1 0-4-4Z" /> <path :fill="props.fillColor" d="M2 18v3c0 .6.4 1 1 1h4v-3h3v-3h2l1.4-1.4a6.5 6.5 0 1 0-4-4Z" />
<circle cx="16.5" cy="7.5" r="1.5" /> <circle cx="16.5" cy="7.5" r="1.5" />
</svg> </svg>

View File

@ -13,16 +13,16 @@ const props = defineProps({
<template> <template>
<svg <svg
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 24 24"
stroke="currentColor" stroke="currentColor"
stroke-width="1.5"
stroke-linecap="round" stroke-linecap="round"
stroke-linejoin="round"> stroke-linejoin="round"
stroke-width="1.5"
viewBox="0 0 24 24"
xmlns="http://www.w3.org/2000/svg">
<path <path
d="M10 20H4a2 2 0 0 1-2-2V5c0-1.1.9-2 2-2h3.93a2 2 0 0 1 1.66.9l.82 1.2a2 2 0 0 0 1.66.9H20a2 2 0 0 1 2 2v2" :fill="props.fillColor"
:fill="props.fillColor" /> d="M10 20H4a2 2 0 0 1-2-2V5c0-1.1.9-2 2-2h3.93a2 2 0 0 1 1.66.9l.82 1.2a2 2 0 0 0 1.66.9H20a2 2 0 0 1 2 2v2" />
<circle cx="16" cy="20" r="2" :fill="props.fillColor" /> <circle :fill="props.fillColor" cx="16" cy="20" r="2" />
<path d="m22 14-4.5 4.5" /> <path d="m22 14-4.5 4.5" />
<path d="m21 15 1 1" /> <path d="m21 15 1 1" />
</svg> </svg>

View File

@ -0,0 +1,25 @@
<script setup>
const props = defineProps({
strokeWidth: {
type: [Number, String],
default: 3,
},
})
</script>
<template>
<svg fill="none" viewBox="0 0 48 48" xmlns="http://www.w3.org/2000/svg">
<path
:stroke-width="props.strokeWidth"
clip-rule="evenodd"
d="M23.9999 29.0001L12 17.0001L19.9999 17.0001L19.9999 6.00011L27.9999 6.00011L27.9999 17.0001L35.9999 17.0001L23.9999 29.0001Z"
fill="none"
fill-rule="evenodd"
stroke="currentColor"
stroke-linecap="round"
stroke-linejoin="round" />
<path :stroke-width="props.strokeWidth" d="M42 37L6 37" stroke="currentColor" stroke-linecap="round" />
</svg>
</template>
<style lang="scss" scoped></style>

View File

@ -0,0 +1,51 @@
<script setup>
const props = defineProps({
strokeWidth: {
type: [Number, String],
default: 3,
},
})
</script>
<template>
<svg fill="none" viewBox="0 0 48 48" xmlns="http://www.w3.org/2000/svg">
<path
:stroke-width="props.strokeWidth"
d="M8 28H24"
stroke="currentColor"
stroke-linecap="round"
stroke-linejoin="round" />
<path
:stroke-width="props.strokeWidth"
d="M8 37H24"
stroke="currentColor"
stroke-linecap="round"
stroke-linejoin="round" />
<path
:stroke-width="props.strokeWidth"
d="M8 19H40"
stroke="currentColor"
stroke-linecap="round"
stroke-linejoin="round" />
<path
:stroke-width="props.strokeWidth"
d="M8 10H40"
stroke="currentColor"
stroke-linecap="round"
stroke-linejoin="round" />
<path
:stroke-width="props.strokeWidth"
d="M37 40V28"
stroke="currentColor"
stroke-linecap="round"
stroke-linejoin="round" />
<path
:stroke-width="props.strokeWidth"
d="M33 36L37 40L41 36"
stroke="currentColor"
stroke-linecap="round"
stroke-linejoin="round" />
</svg>
</template>
<style lang="scss" scoped></style>

View File

@ -0,0 +1,24 @@
<script setup>
const props = defineProps({
strokeWidth: {
type: [Number, String],
default: 3,
},
})
</script>
<template>
<svg fill="none" viewBox="0 0 48 48" xmlns="http://www.w3.org/2000/svg">
<path
:stroke-width="strokeWidth"
d="M24 44C35.0457 44 44 35.0457 44 24C44 12.9543 35.0457 4 24 4C12.9543 4 4 12.9543 4 24C4 35.0457 12.9543 44 24 44Z"
fill="none"
stroke="currentColor"
stroke-linejoin="round" />
<circle cx="14" cy="24" fill="currentColor" r="3" />
<circle cx="24" cy="24" fill="currentColor" r="3" />
<circle cx="34" cy="24" fill="currentColor" r="3" />
</svg>
</template>
<style lang="scss" scoped></style>

View File

@ -8,23 +8,23 @@ const props = defineProps({
</script> </script>
<template> <template>
<svg viewBox="0 0 48 48" fill="none" xmlns="http://www.w3.org/2000/svg"> <svg fill="none" viewBox="0 0 48 48" xmlns="http://www.w3.org/2000/svg">
<path <path
:stroke-width="strokeWidth"
d="M5.81836 6.72729V14H13.0911" d="M5.81836 6.72729V14H13.0911"
stroke="currentColor" stroke="currentColor"
:stroke-width="strokeWidth"
stroke-linecap="round" stroke-linecap="round"
stroke-linejoin="round" /> stroke-linejoin="round" />
<path <path
:stroke-width="strokeWidth"
d="M4 24C4 35.0457 12.9543 44 24 44V44C35.0457 44 44 35.0457 44 24C44 12.9543 35.0457 4 24 4C16.598 4 10.1351 8.02111 6.67677 13.9981" d="M4 24C4 35.0457 12.9543 44 24 44V44C35.0457 44 44 35.0457 44 24C44 12.9543 35.0457 4 24 4C16.598 4 10.1351 8.02111 6.67677 13.9981"
stroke="currentColor" stroke="currentColor"
:stroke-width="strokeWidth"
stroke-linecap="round" stroke-linecap="round"
stroke-linejoin="round" /> stroke-linejoin="round" />
<path <path
:stroke-width="strokeWidth"
d="M24.005 12L24.0038 24.0088L32.4832 32.4882" d="M24.005 12L24.0038 24.0088L32.4832 32.4882"
stroke="currentColor" stroke="currentColor"
:stroke-width="strokeWidth"
stroke-linecap="round" stroke-linecap="round"
stroke-linejoin="round" /> stroke-linejoin="round" />
</svg> </svg>

View File

@ -8,34 +8,34 @@ const props = defineProps({
</script> </script>
<template> <template>
<svg viewBox="0 0 48 48" fill="none" xmlns="http://www.w3.org/2000/svg"> <svg fill="none" viewBox="0 0 48 48" xmlns="http://www.w3.org/2000/svg">
<rect <rect
x="4" :stroke-width="props.strokeWidth"
y="6" fill="none"
width="40"
height="36" height="36"
rx="2" rx="2"
fill="none"
stroke="currentColor" stroke="currentColor"
:stroke-width="props.strokeWidth"
stroke-linecap="round" stroke-linecap="round"
stroke-linejoin="round" /> stroke-linejoin="round"
width="40"
x="4"
y="6" />
<path <path
:stroke-width="props.strokeWidth"
d="M32 25V32" d="M32 25V32"
stroke="currentColor" stroke="currentColor"
:stroke-width="props.strokeWidth"
stroke-linecap="round" stroke-linecap="round"
stroke-linejoin="round" /> stroke-linejoin="round" />
<path <path
:stroke-width="props.strokeWidth"
d="M24 16V32" d="M24 16V32"
stroke="currentColor" stroke="currentColor"
:stroke-width="props.strokeWidth"
stroke-linecap="round" stroke-linecap="round"
stroke-linejoin="round" /> stroke-linejoin="round" />
<path <path
:stroke-width="props.strokeWidth"
d="M16 20V32" d="M16 20V32"
stroke="currentColor" stroke="currentColor"
:stroke-width="props.strokeWidth"
stroke-linecap="round" stroke-linecap="round"
stroke-linejoin="round" /> stroke-linejoin="round" />
</svg> </svg>

View File

@ -18,167 +18,167 @@ const props = defineProps({
</script> </script>
<template> <template>
<svg v-if="props.modelValue" viewBox="0 0 48 48" fill="none" xmlns="http://www.w3.org/2000/svg"> <svg v-if="props.modelValue" fill="none" viewBox="0 0 48 48" xmlns="http://www.w3.org/2000/svg">
<rect <rect
:fill="props.fillColor"
:stroke="props.fillColor"
:stroke-width="props.strokeWidth"
height="8"
stroke-linecap="round"
stroke-linejoin="round"
width="8"
x="4" x="4"
y="34" y="34" />
width="8" <rect
height="8"
:fill="props.fillColor" :fill="props.fillColor"
:stroke="props.fillColor" :stroke="props.fillColor"
:stroke-width="props.strokeWidth" :stroke-width="props.strokeWidth"
stroke-linecap="round"
stroke-linejoin="round" />
<rect
x="8"
y="6"
width="32"
height="12" height="12"
:fill="props.fillColor" stroke-linecap="round"
stroke-linejoin="round"
width="32"
x="8"
y="6" />
<path
:stroke="props.fillColor" :stroke="props.fillColor"
:stroke-width="props.strokeWidth" :stroke-width="props.strokeWidth"
stroke-linecap="round"
stroke-linejoin="round" />
<path
d="M24 34V18" d="M24 34V18"
:stroke="props.fillColor"
:stroke-width="props.strokeWidth"
stroke-linecap="round" stroke-linecap="round"
stroke-linejoin="round" /> stroke-linejoin="round" />
<path <path
:stroke="props.fillColor"
:stroke-width="props.strokeWidth"
d="M8 34V26H40V34" d="M8 34V26H40V34"
:stroke="props.fillColor"
:stroke-width="props.strokeWidth"
stroke-linecap="round" stroke-linecap="round"
stroke-linejoin="round" /> stroke-linejoin="round" />
<rect <rect
:fill="props.fillColor"
:stroke="props.fillColor"
:stroke-width="props.strokeWidth"
height="8"
stroke-linecap="round"
stroke-linejoin="round"
width="8"
x="36" x="36"
y="34" y="34" />
width="8"
height="8"
:fill="props.fillColor"
:stroke="props.fillColor"
:stroke-width="props.strokeWidth"
stroke-linecap="round"
stroke-linejoin="round" />
<rect <rect
x="20"
y="34"
width="8"
height="8"
:fill="props.fillColor" :fill="props.fillColor"
:stroke="props.fillColor" :stroke="props.fillColor"
:stroke-width="props.strokeWidth" :stroke-width="props.strokeWidth"
height="8"
stroke-linecap="round" stroke-linecap="round"
stroke-linejoin="round" /> stroke-linejoin="round"
width="8"
x="20"
y="34" />
<path <path
:stroke-width="props.strokeWidth"
d="M14 12H16" d="M14 12H16"
stroke="#FFF" stroke="#FFF"
:stroke-width="props.strokeWidth"
stroke-linecap="round" stroke-linecap="round"
stroke-linejoin="round" /> stroke-linejoin="round" />
</svg> </svg>
<svg v-else viewBox="0 0 48 48" fill="none" xmlns="http://www.w3.org/2000/svg"> <svg v-else fill="none" viewBox="0 0 48 48" xmlns="http://www.w3.org/2000/svg">
<path <path
:stroke-width="props.strokeWidth"
d="M5 24L43 24" d="M5 24L43 24"
stroke="currentColor" stroke="currentColor"
:stroke-width="props.strokeWidth"
stroke-linecap="round" stroke-linecap="round"
stroke-linejoin="round" /> stroke-linejoin="round" />
<path <path
:stroke-width="props.strokeWidth"
d="M28 4H20C18.8954 4 18 4.89543 18 6V14C18 15.1046 18.8954 16 20 16H28C29.1046 16 30 15.1046 30 14V6C30 4.89543 29.1046 4 28 4Z" d="M28 4H20C18.8954 4 18 4.89543 18 6V14C18 15.1046 18.8954 16 20 16H28C29.1046 16 30 15.1046 30 14V6C30 4.89543 29.1046 4 28 4Z"
fill="none" fill="none"
stroke="currentColor" stroke="currentColor"
:stroke-width="props.strokeWidth"
stroke-linejoin="round" /> stroke-linejoin="round" />
<path <path
:stroke-width="props.strokeWidth"
d="M16 32H8C6.89543 32 6 32.8954 6 34V42C6 43.1046 6.89543 44 8 44H16C17.1046 44 18 43.1046 18 42V34C18 32.8954 17.1046 32 16 32Z" d="M16 32H8C6.89543 32 6 32.8954 6 34V42C6 43.1046 6.89543 44 8 44H16C17.1046 44 18 43.1046 18 42V34C18 32.8954 17.1046 32 16 32Z"
fill="none" fill="none"
stroke="currentColor" stroke="currentColor"
:stroke-width="props.strokeWidth"
stroke-linejoin="round" /> stroke-linejoin="round" />
<path <path
:stroke-width="props.strokeWidth"
d="M40 32H32C30.8954 32 30 32.8954 30 34V42C30 43.1046 30.8954 44 32 44H40C41.1046 44 42 43.1046 42 42V34C42 32.8954 41.1046 32 40 32Z" d="M40 32H32C30.8954 32 30 32.8954 30 34V42C30 43.1046 30.8954 44 32 44H40C41.1046 44 42 43.1046 42 42V34C42 32.8954 41.1046 32 40 32Z"
fill="none" fill="none"
stroke="currentColor" stroke="currentColor"
:stroke-width="props.strokeWidth"
stroke-linejoin="round" /> stroke-linejoin="round" />
<path <path
:stroke-width="props.strokeWidth"
d="M24 24V16" d="M24 24V16"
stroke="currentColor" stroke="currentColor"
:stroke-width="props.strokeWidth"
stroke-linecap="round" stroke-linecap="round"
stroke-linejoin="round" /> stroke-linejoin="round" />
<path <path
:stroke-width="props.strokeWidth"
d="M36 32V24" d="M36 32V24"
stroke="currentColor" stroke="currentColor"
:stroke-width="props.strokeWidth"
stroke-linecap="round" stroke-linecap="round"
stroke-linejoin="round" /> stroke-linejoin="round" />
<path <path
:stroke-width="props.strokeWidth"
d="M12 32V24" d="M12 32V24"
stroke="currentColor" stroke="currentColor"
:stroke-width="props.strokeWidth"
stroke-linecap="round" stroke-linecap="round"
stroke-linejoin="round" /> stroke-linejoin="round" />
</svg> </svg>
<svg v-else viewBox="0 0 48 48" fill="none" xmlns="http://www.w3.org/2000/svg"> <svg v-else fill="none" viewBox="0 0 48 48" xmlns="http://www.w3.org/2000/svg">
<rect <rect
x="4" :stroke-width="props.strokeWidth"
y="34" fill="none"
width="8"
height="8" height="8"
fill="none"
stroke="currentColor" stroke="currentColor"
:stroke-width="props.strokeWidth"
stroke-linecap="round" stroke-linecap="round"
stroke-linejoin="round" /> stroke-linejoin="round"
width="8"
x="4"
y="34" />
<rect <rect
x="8"
y="6"
width="32"
height="12"
fill="none"
stroke="currentColor"
:stroke-width="props.strokeWidth" :stroke-width="props.strokeWidth"
fill="none"
height="12"
stroke="currentColor"
stroke-linecap="round" stroke-linecap="round"
stroke-linejoin="round" /> stroke-linejoin="round"
width="32"
x="8"
y="6" />
<path <path
:stroke-width="props.strokeWidth"
d="M24 34V18" d="M24 34V18"
stroke="currentColor" stroke="currentColor"
:stroke-width="props.strokeWidth"
stroke-linecap="round" stroke-linecap="round"
stroke-linejoin="round" /> stroke-linejoin="round" />
<path <path
:stroke-width="props.strokeWidth"
d="M8 34V26H40V34" d="M8 34V26H40V34"
stroke="currentColor" stroke="currentColor"
:stroke-width="props.strokeWidth"
stroke-linecap="round" stroke-linecap="round"
stroke-linejoin="round" /> stroke-linejoin="round" />
<rect <rect
:stroke-width="props.strokeWidth"
fill="none"
height="8"
stroke="currentColor"
stroke-linecap="round"
stroke-linejoin="round"
width="8"
x="36" x="36"
y="34" y="34" />
width="8"
height="8"
fill="none"
stroke="currentColor"
:stroke-width="props.strokeWidth"
stroke-linecap="round"
stroke-linejoin="round" />
<rect <rect
x="20"
y="34"
width="8"
height="8"
fill="none"
stroke="currentColor"
:stroke-width="props.strokeWidth" :stroke-width="props.strokeWidth"
fill="none"
height="8"
stroke="currentColor"
stroke-linecap="round" stroke-linecap="round"
stroke-linejoin="round" /> stroke-linejoin="round"
width="8"
x="20"
y="34" />
<path <path
:stroke-width="props.strokeWidth"
d="M14 12H16" d="M14 12H16"
stroke="currentColor" stroke="currentColor"
:stroke-width="props.strokeWidth"
stroke-linecap="round" stroke-linecap="round"
stroke-linejoin="round" /> stroke-linejoin="round" />
</svg> </svg>

View File

@ -8,29 +8,29 @@ const props = defineProps({
</script> </script>
<template> <template>
<svg viewBox="0 0 48 48" fill="none" xmlns="http://www.w3.org/2000/svg"> <svg fill="none" viewBox="0 0 48 48" xmlns="http://www.w3.org/2000/svg">
<path <path
:stroke-width="strokeWidth"
d="M25.8927 16.0307L18.1145 8.2525C15.2506 5.38866 10.7031 5.29302 7.9572 8.0389C5.21132 10.7848 5.30696 15.3323 8.1708 18.1962L15.949 25.9744" d="M25.8927 16.0307L18.1145 8.2525C15.2506 5.38866 10.7031 5.29302 7.9572 8.0389C5.21132 10.7848 5.30696 15.3323 8.1708 18.1962L15.949 25.9744"
stroke="currentColor" stroke="currentColor"
:stroke-width="strokeWidth"
stroke-linecap="round" stroke-linecap="round"
stroke-linejoin="round" /> stroke-linejoin="round" />
<path <path
:stroke-width="strokeWidth"
d="M31.9161 22.0707L39.6943 29.8489C42.5581 32.7127 42.9291 37.1233 39.9079 40.0062C36.8867 42.8891 32.6144 42.6564 29.7506 39.7926L21.9724 32.0144" d="M31.9161 22.0707L39.6943 29.8489C42.5581 32.7127 42.9291 37.1233 39.9079 40.0062C36.8867 42.8891 32.6144 42.6564 29.7506 39.7926L21.9724 32.0144"
stroke="currentColor" stroke="currentColor"
:stroke-width="strokeWidth"
stroke-linecap="round" stroke-linecap="round"
stroke-linejoin="round" /> stroke-linejoin="round" />
<path <path
:stroke-width="strokeWidth"
d="M21.2384 21.0759L17.3493 17.1868" d="M21.2384 21.0759L17.3493 17.1868"
stroke="currentColor" stroke="currentColor"
:stroke-width="strokeWidth"
stroke-linecap="round" stroke-linecap="round"
stroke-linejoin="round" /> stroke-linejoin="round" />
<path <path
:stroke-width="strokeWidth"
d="M30.3131 30.1504L26.424 26.2613" d="M30.3131 30.1504L26.424 26.2613"
stroke="currentColor" stroke="currentColor"
:stroke-width="strokeWidth"
stroke-linecap="round" stroke-linecap="round"
stroke-linejoin="round" /> stroke-linejoin="round" />
</svg> </svg>

View File

@ -8,9 +8,9 @@ const props = defineProps({
</script> </script>
<template> <template>
<svg :width="props.size" :height="props.size" viewBox="0 0 48 48" fill="none"> <svg :height="props.size" :width="props.size" fill="none" viewBox="0 0 48 48">
<path d="M8 8L40 40" stroke="currentColor" stroke-width="4" stroke-linecap="round" stroke-linejoin="round" /> <path d="M8 8L40 40" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="4" />
<path d="M8 40L40 8" stroke="currentColor" stroke-width="4" stroke-linecap="round" stroke-linejoin="round" /> <path d="M8 40L40 8" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="4" />
</svg> </svg>
</template> </template>

View File

@ -8,7 +8,7 @@ const props = defineProps({
</script> </script>
<template> <template>
<svg :width="props.size" :height="props.size" viewBox="0 0 48 48" fill="none"> <svg :height="props.size" :width="props.size" fill="none" viewBox="0 0 48 48">
<path <path
d="M39 6H9C7.34315 6 6 7.34315 6 9V39C6 40.6569 7.34315 42 9 42H39C40.6569 42 42 40.6569 42 39V9C42 7.34315 40.6569 6 39 6Z" d="M39 6H9C7.34315 6 6 7.34315 6 9V39C6 40.6569 7.34315 42 9 42H39C40.6569 42 42 40.6569 42 39V9C42 7.34315 40.6569 6 39 6Z"
fill="none" fill="none"

View File

@ -8,8 +8,8 @@ const props = defineProps({
</script> </script>
<template> <template>
<svg :width="props.size" :height="props.size" viewBox="0 0 48 48" fill="none"> <svg :height="props.size" :width="props.size" fill="none" viewBox="0 0 48 48">
<path d="M8 24L40 24" stroke="currentColor" stroke-width="4" stroke-linecap="round" stroke-linejoin="round" /> <path d="M8 24L40 24" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="4" />
</svg> </svg>
</template> </template>

View File

@ -8,19 +8,19 @@ const props = defineProps({
</script> </script>
<template> <template>
<svg :width="props.size" :height="props.size" viewBox="0 0 48 48" fill="none"> <svg :height="props.size" :width="props.size" fill="none" viewBox="0 0 48 48">
<path <path
d="M13 12.4316V7.8125C13 6.2592 14.2592 5 15.8125 5H40.1875C41.7408 5 43 6.2592 43 7.8125V32.1875C43 33.7408 41.7408 35 40.1875 35H35.5163" d="M13 12.4316V7.8125C13 6.2592 14.2592 5 15.8125 5H40.1875C41.7408 5 43 6.2592 43 7.8125V32.1875C43 33.7408 41.7408 35 40.1875 35H35.5163"
stroke="currentColor" stroke="currentColor"
stroke-width="4"
stroke-linecap="round" stroke-linecap="round"
stroke-linejoin="round" /> stroke-linejoin="round"
stroke-width="4" />
<path <path
d="M32.1875 13H7.8125C6.2592 13 5 14.2592 5 15.8125V40.1875C5 41.7408 6.2592 43 7.8125 43H32.1875C33.7408 43 35 41.7408 35 40.1875V15.8125C35 14.2592 33.7408 13 32.1875 13Z" d="M32.1875 13H7.8125C6.2592 13 5 14.2592 5 15.8125V40.1875C5 41.7408 6.2592 43 7.8125 43H32.1875C33.7408 43 35 41.7408 35 40.1875V15.8125C35 14.2592 33.7408 13 32.1875 13Z"
fill="none" fill="none"
stroke="currentColor" stroke="currentColor"
stroke-width="4" stroke-linejoin="round"
stroke-linejoin="round" /> stroke-width="4" />
</svg> </svg>
</template> </template>

View File

@ -1,6 +1,5 @@
<script setup> <script setup>
import { useThemeVars } from 'naive-ui' import { useThemeVars } from 'naive-ui'
import AddLink from '@/components/icons/AddLink.vue'
import BrowserTree from './BrowserTree.vue' import BrowserTree from './BrowserTree.vue'
import IconButton from '@/components/common/IconButton.vue' import IconButton from '@/components/common/IconButton.vue'
import useTabStore from 'stores/tab.js' import useTabStore from 'stores/tab.js'
@ -74,7 +73,7 @@ const filterTypeOptions = computed(() => {
:options="filterTypeOptions" :options="filterTypeOptions"
style="width: 120px" /> style="width: 120px" />
<n-input clearable placeholder="" /> <n-input clearable placeholder="" />
<n-button ghost :focusable="false"> <n-button :focusable="false" ghost>
<template #icon> <template #icon>
<n-icon :component="Search" /> <n-icon :component="Search" />
</template> </template>

View File

@ -23,6 +23,8 @@ import { typesBgColor, typesColor } from '@/consts/support_redis_type.js'
import useTabStore from 'stores/tab.js' import useTabStore from 'stores/tab.js'
import IconButton from '@/components/common/IconButton.vue' import IconButton from '@/components/common/IconButton.vue'
import { parseHexColor } from '@/utils/rgb.js' import { parseHexColor } from '@/utils/rgb.js'
import LoadList from '@/components/icons/LoadList.vue'
import LoadAll from '@/components/icons/LoadAll.vue'
const props = defineProps({ const props = defineProps({
server: String, server: String,
@ -146,11 +148,11 @@ const menuOptions = {
} }
}, },
[ConnectionType.RedisKey]: () => [ [ConnectionType.RedisKey]: () => [
{ // {
key: 'key_reload', // key: 'key_reload',
label: i18n.t('interface.reload'), // label: i18n.t('interface.reload'),
icon: renderIcon(Refresh), // icon: renderIcon(Refresh),
}, // },
{ {
key: 'key_newkey', key: 'key_newkey',
label: i18n.t('interface.new_key'), label: i18n.t('interface.new_key'),
@ -223,9 +225,9 @@ const handleSelectContextMenu = (key) => {
return return
} }
const node = connectionStore.getNode(selectedKey) const node = connectionStore.getNode(selectedKey)
const { db, key: nodeKey } = node || {} const { db = 0, key: nodeKey, redisKey: rk = '', redisKeyCode: rkc, label } = node || {}
const redisKey = node.redisKeyCode || node.redisKey const redisKey = rkc || rk
const redisKeyName = !!node.redisKeyCode ? node.label : redisKey const redisKeyName = !!rkc ? label : redisKey
switch (key) { switch (key) {
case 'server_info': case 'server_info':
tabStore.setSelectedKeys(props.server) tabStore.setSelectedKeys(props.server)
@ -259,9 +261,9 @@ const handleSelectContextMenu = (key) => {
const { match: pattern, type } = connectionStore.getKeyFilter(props.server, db) const { match: pattern, type } = connectionStore.getKeyFilter(props.server, db)
dialogStore.openKeyFilterDialog(props.server, db, pattern, type) dialogStore.openKeyFilterDialog(props.server, db, pattern, type)
break break
case 'key_reload': // case 'key_reload':
connectionStore.loadKeys(props.server, db, redisKey) // connectionStore.loadKeys(props.server, db, redisKey)
break // break
case 'value_reload': case 'value_reload':
connectionStore.loadKeyValue(props.server, db, redisKey) connectionStore.loadKeyValue(props.server, db, redisKey)
break break
@ -289,6 +291,38 @@ const handleSelectContextMenu = (key) => {
$message.error(e.message) $message.error(e.message)
}) })
break break
case 'db_loadmore':
if (node != null && !!!node.loading && !!!node.fullLoaded) {
node.loading = true
connectionStore
.loadMoreKeys(props.server, db)
.then((end) => {
// fully loaded
node.fullLoaded = end === true
})
.catch((e) => {
$message.error(e.message)
})
.finally(() => {
delete node.loading
})
}
break
case 'db_loadall':
if (node != null && !!!node.loading) {
node.loading = true
connectionStore
.loadAllKeys(props.server, db)
.catch((e) => {
$message.error(e.message)
})
.finally(() => {
delete node.loading
node.fullLoaded = true
})
}
break
case 'more_action':
default: default:
console.warn('TODO: handle context menu:' + key) console.warn('TODO: handle context menu:' + key)
} }
@ -389,9 +423,14 @@ const renderLabel = ({ option }) => {
case ConnectionType.Server: case ConnectionType.Server:
return h('b', {}, { default: () => option.label }) return h('b', {}, { default: () => option.label })
case ConnectionType.RedisDB: case ConnectionType.RedisDB:
const { name: server, db } = option const { name: server, db, opened = false } = option
let { match: matchPattern, type: typeFilter } = connectionStore.getKeyFilter(server, db) let { match: matchPattern, type: typeFilter } = connectionStore.getKeyFilter(server, db)
const items = [`${option.label} (${option.keys || 0})`] const items = []
if (opened) {
items.push(`${option.label} (${option.keys || 0}/${Math.max(option.maxKeys || 0, option.keys || 0)})`)
} else {
items.push(`${option.label} (${Math.max(option.maxKeys || 0, option.keys || 0)})`)
}
// show filter tag after label // show filter tag after label
// type filter tag // type filter tag
if (!isEmpty(typeFilter)) { if (!isEmpty(typeFilter)) {
@ -460,30 +499,53 @@ const renderIconMenu = (items) => {
) )
} }
const getDatabaseMenu = (opened) => { const getDatabaseMenu = (opened, loading, end) => {
const btns = [] const btns = []
if (opened) { if (opened) {
btns.push( btns.push(
h(IconButton, { h(IconButton, {
tTooltip: 'interface.filter_key', tTooltip: 'interface.filter_key',
icon: Filter, icon: Filter,
disabled: loading === true,
onClick: () => handleSelectContextMenu('db_filter'), onClick: () => handleSelectContextMenu('db_filter'),
}), }),
h(IconButton, { h(IconButton, {
tTooltip: 'interface.reload', tTooltip: 'interface.reload',
icon: Refresh, icon: Refresh,
disabled: loading === true,
onClick: () => handleSelectContextMenu('db_reload'), onClick: () => handleSelectContextMenu('db_reload'),
}), }),
h(IconButton, { h(IconButton, {
tTooltip: 'interface.new_key', tTooltip: 'interface.new_key',
icon: Add, icon: Add,
disabled: loading === true,
onClick: () => handleSelectContextMenu('db_newkey'), onClick: () => handleSelectContextMenu('db_newkey'),
}), }),
h(IconButton, {
tTooltip: 'interface.load_more',
icon: LoadList,
disabled: end === true,
loading: loading === true,
onClick: () => handleSelectContextMenu('db_loadmore'),
}),
h(IconButton, {
tTooltip: 'interface.load_all',
icon: LoadAll,
disabled: end === true,
loading: loading === true,
onClick: () => handleSelectContextMenu('db_loadall'),
}),
h(IconButton, { h(IconButton, {
tTooltip: 'interface.batch_delete', tTooltip: 'interface.batch_delete',
icon: Delete, icon: Delete,
disabled: loading === true,
onClick: () => handleSelectContextMenu('key_remove'), onClick: () => handleSelectContextMenu('key_remove'),
}), }),
// h(IconButton, {
// tTooltip: 'interface.more_action',
// icon: More,
// onClick: () => handleSelectContextMenu('more_action'),
// }),
) )
} else { } else {
btns.push( btns.push(
@ -499,11 +561,12 @@ const getDatabaseMenu = (opened) => {
const getLayerMenu = () => { const getLayerMenu = () => {
return [ return [
h(IconButton, { // disable reload by layer, due to conflict with partial loading keys
tTooltip: 'interface.reload', // h(IconButton, {
icon: Refresh, // tTooltip: 'interface.reload',
onClick: () => handleSelectContextMenu('key_reload'), // icon: Refresh,
}), // onClick: () => handleSelectContextMenu('key_reload'),
// }),
h(IconButton, { h(IconButton, {
tTooltip: 'interface.new_key', tTooltip: 'interface.new_key',
icon: Add, icon: Add,
@ -532,7 +595,7 @@ const renderSuffix = ({ option }) => {
if ((option.type === ConnectionType.RedisDB && option.opened) || includes(selectedKeys.value, option.key)) { if ((option.type === ConnectionType.RedisDB && option.opened) || includes(selectedKeys.value, option.key)) {
switch (option.type) { switch (option.type) {
case ConnectionType.RedisDB: case ConnectionType.RedisDB:
return renderIconMenu(getDatabaseMenu(option.opened)) return renderIconMenu(getDatabaseMenu(option.opened, option.loading, option.fullLoaded))
case ConnectionType.RedisKey: case ConnectionType.RedisKey:
return renderIconMenu(getLayerMenu()) return renderIconMenu(getLayerMenu())
case ConnectionType.RedisValue: case ConnectionType.RedisValue:

View File

@ -519,7 +519,7 @@ const onCancelOpen = () => {
<template #description> <template #description>
<n-space vertical> <n-space vertical>
<n-text strong>{{ $t('dialogue.opening_connection') }}</n-text> <n-text strong>{{ $t('dialogue.opening_connection') }}</n-text>
<n-button secondary size="small" :focusable="false" @click="onCancelOpen"> <n-button :focusable="false" secondary size="small" @click="onCancelOpen">
{{ $t('dialogue.interrupt_connection') }} {{ $t('dialogue.interrupt_connection') }}
</n-button> </n-button>
</n-space> </n-space>

View File

@ -10,7 +10,6 @@ import useDialogStore from 'stores/dialog.js'
import Github from '@/components/icons/Github.vue' import Github from '@/components/icons/Github.vue'
import { BrowserOpenURL } from 'wailsjs/runtime/runtime.js' import { BrowserOpenURL } from 'wailsjs/runtime/runtime.js'
import useConnectionStore from 'stores/connections.js' import useConnectionStore from 'stores/connections.js'
import Help from '@/components/icons/Help.vue'
import usePreferencesStore from 'stores/preferences.js' import usePreferencesStore from 'stores/preferences.js'
import Record from '@/components/icons/Record.vue' import Record from '@/components/icons/Record.vue'

View File

@ -31,6 +31,7 @@
"default": "Default", "default": "Default",
"font": "Font", "font": "Font",
"font_size": "Font Size", "font_size": "Font Size",
"scan_size": "Default Size for SCAN Command",
"proxy": "Proxy", "proxy": "Proxy",
"use_system_proxy": "Use system proxy", "use_system_proxy": "Use system proxy",
"use_system_proxy_http": "Use system proxy only for HTTP(S) request", "use_system_proxy_http": "Use system proxy only for HTTP(S) request",
@ -82,7 +83,10 @@
"copy_key": "Copy Key", "copy_key": "Copy Key",
"binary_key": "Binary Key Name", "binary_key": "Binary Key Name",
"remove_key": "Remove Key", "remove_key": "Remove Key",
"new_key": "Add New Key", "new_key": "Add Key",
"load_more": "Load More Keys",
"load_all": "Load All Keys",
"more_action": "More Action",
"nonexist_tab_content": "Selected key does not exist. Please retry", "nonexist_tab_content": "Selected key does not exist. Please retry",
"empty_server_content": "Select and open a connection from the left", "empty_server_content": "Select and open a connection from the left",
"empty_server_list": "No redis server", "empty_server_list": "No redis server",
@ -134,7 +138,7 @@
"filter": "Default Key Filter Pattern", "filter": "Default Key Filter Pattern",
"filter_tip": "Pattern which defines loaded keys from redis server", "filter_tip": "Pattern which defines loaded keys from redis server",
"separator": "Key Separator", "separator": "Key Separator",
"separator_tip":"Separator for key path item", "separator_tip": "Separator for key path item",
"conn_timeout": "Connection Timeout", "conn_timeout": "Connection Timeout",
"exec_timeout": "Execution Timeout", "exec_timeout": "Execution Timeout",
"dbfilter_type": "Database Filter", "dbfilter_type": "Database Filter",
@ -145,6 +149,7 @@
"dbfilter_hide_title": "Select the Databases to Hide", "dbfilter_hide_title": "Select the Databases to Hide",
"dbfilter_input": "Input Database Index", "dbfilter_input": "Input Database Index",
"dbfilter_input_tip": "Press Enter to confirm", "dbfilter_input_tip": "Press Enter to confirm",
"load_size": "Size of Keys Per Load",
"mark_color": "Mark Color" "mark_color": "Mark Color"
}, },
"ssl": { "ssl": {
@ -153,7 +158,7 @@
"cert_file": "Public Key", "cert_file": "Public Key",
"key_file": "Private Key", "key_file": "Private Key",
"ca_file": "Authority", "ca_file": "Authority",
"cert_file_tip":"Public Key File in PEM format(Cert)", "cert_file_tip": "Public Key File in PEM format(Cert)",
"key_file_tip": "Private Key File in PEM format(Key)", "key_file_tip": "Private Key File in PEM format(Key)",
"ca_file_tip": "Certificate Authority File in PEM format(CA)" "ca_file_tip": "Certificate Authority File in PEM format(CA)"
}, },

View File

@ -31,6 +31,7 @@
"default": "默认", "default": "默认",
"font": "字体", "font": "字体",
"font_size": "字体尺寸", "font_size": "字体尺寸",
"scan_size": "SCAN命令默认数量",
"proxy": "代理", "proxy": "代理",
"use_system_proxy": "使用系统代理", "use_system_proxy": "使用系统代理",
"use_system_proxy_http": "仅在HTTP请求时使用系统代理", "use_system_proxy_http": "仅在HTTP请求时使用系统代理",
@ -83,6 +84,9 @@
"binary_key": "二进制键名", "binary_key": "二进制键名",
"remove_key": "删除键", "remove_key": "删除键",
"new_key": "添加新键", "new_key": "添加新键",
"load_more": "加载更多键",
"load_all": "加载所有键",
"more_action": "更多操作",
"nonexist_tab_content": "所选键不存在,请尝试刷新重试", "nonexist_tab_content": "所选键不存在,请尝试刷新重试",
"empty_server_content": "可以从左边选择并打开连接", "empty_server_content": "可以从左边选择并打开连接",
"empty_server_list": "还没添加Redis服务器", "empty_server_list": "还没添加Redis服务器",
@ -145,6 +149,7 @@
"dbfilter_hide_title": "需要隐藏的数据库", "dbfilter_hide_title": "需要隐藏的数据库",
"dbfilter_input": "输入数据库索引", "dbfilter_input": "输入数据库索引",
"dbfilter_input_tip": "按回车确认", "dbfilter_input_tip": "按回车确认",
"load_size": "单次加载键数量",
"mark_color": "标记颜色" "mark_color": "标记颜色"
}, },
"ssl": { "ssl": {
@ -153,7 +158,7 @@
"cert_file": "公钥文件", "cert_file": "公钥文件",
"key_file": "私钥文件", "key_file": "私钥文件",
"ca_file": "授权文件", "ca_file": "授权文件",
"cert_file_tip":"PEM格式公钥文件(Cert)", "cert_file_tip": "PEM格式公钥文件(Cert)",
"key_file_tip": "PEM格式私钥文件(Key)", "key_file_tip": "PEM格式私钥文件(Key)",
"ca_file_tip": "PEM格式授权文件(CA)" "ca_file_tip": "PEM格式授权文件(CA)"
}, },

View File

@ -5,7 +5,6 @@ import {
get, get,
isEmpty, isEmpty,
join, join,
map,
remove, remove,
size, size,
slice, slice,
@ -30,6 +29,8 @@ import {
GetConnection, GetConnection,
GetKeyValue, GetKeyValue,
ListConnection, ListConnection,
LoadAllKeys,
LoadNextKeys,
OpenConnection, OpenConnection,
OpenDatabase, OpenDatabase,
RemoveStreamValues, RemoveStreamValues,
@ -37,7 +38,6 @@ import {
RenameKey, RenameKey,
SaveConnection, SaveConnection,
SaveSortedConnection, SaveSortedConnection,
ScanKeys,
ServerInfo, ServerInfo,
SetHashValue, SetHashValue,
SetKeyTTL, SetKeyTTL,
@ -77,6 +77,8 @@ const useConnectionStore = defineStore('connections', {
* @property {boolean} [opened] - redis db is opened, type == ConnectionType.RedisDB only * @property {boolean} [opened] - redis db is opened, type == ConnectionType.RedisDB only
* @property {boolean} [expanded] - current node is expanded * @property {boolean} [expanded] - current node is expanded
* @property {DatabaseItem[]} [children] * @property {DatabaseItem[]} [children]
* @property {boolean} [loading] - indicated that is loading children now
* @property {boolean} [fullLoaded] - indicated that all children already loaded
*/ */
/** /**
@ -230,6 +232,7 @@ const useConnectionStore = defineStore('connections', {
execTimeout: 60, execTimeout: 60,
dbFilterType: 'none', dbFilterType: 'none',
dbFilterList: [], dbFilterList: [],
loadSize: 10000,
markColor: '', markColor: '',
ssl: { ssl: {
enable: false, enable: false,
@ -407,7 +410,8 @@ const useConnectionStore = defineStore('connections', {
key: `${name}/${db[i].name}`, key: `${name}/${db[i].name}`,
label: db[i].name, label: db[i].name,
name: name, name: name,
keys: db[i].keys, keys: 0,
maxKeys: db[i].keys,
db: db[i].index, db: db[i].index,
type: ConnectionType.RedisDB, type: ConnectionType.RedisDB,
isLeaf: false, isLeaf: false,
@ -535,13 +539,14 @@ const useConnectionStore = defineStore('connections', {
if (!success) { if (!success) {
throw new Error(msg) throw new Error(msg)
} }
const { keys = [] } = data const { keys = [], end = false } = data
const selDB = this.getDatabase(connName, db) const selDB = this.getDatabase(connName, db)
if (selDB == null) { if (selDB == null) {
return return
} }
selDB.opened = true selDB.opened = true
selDB.fullLoaded = end
if (isEmpty(keys)) { if (isEmpty(keys)) {
selDB.children = [] selDB.children = []
} else { } else {
@ -658,44 +663,77 @@ const useConnectionStore = defineStore('connections', {
* scan keys with prefix * scan keys with prefix
* @param {string} connName * @param {string} connName
* @param {number} db * @param {number} db
* @param {string} [prefix] full reload database if prefix is null * @param {string} match
* @returns {Promise<{keys: string[]}>} * @param {string} matchType
* @param {boolean} [full]
* @returns {Promise<{keys: string[], end: boolean}>}
*/ */
async scanKeys(connName, db, prefix) { async scanKeys(connName, db, match, matchType, full) {
const { data, success, msg } = await ScanKeys(connName, db, prefix || '*') let resp
if (full) {
resp = await LoadAllKeys(connName, db, match || '*', matchType)
} else {
resp = await LoadNextKeys(connName, db, match || '*', matchType)
}
const { data, success, msg } = resp || {}
if (!success) { if (!success) {
throw new Error(msg) throw new Error(msg)
} }
const { keys = [] } = data const { keys = [], end } = data
return { keys, success } return { keys, end, success }
}, },
/** /**
* load keys with prefix *
* @param {string} connName * @param {string} connName
* @param {number} db * @param {number} db
* @param {string} [prefix] * @param {string|null} prefix
* @returns {Promise<void>} * @param {string|null} matchType
* @param {boolean} [all]
* @return {Promise<{keys: Array<string|number[]>, end: boolean}>}
* @private
*/ */
async loadKeys(connName, db, prefix) { async _loadKeys(connName, db, prefix, matchType, all) {
let scanPrefix = prefix let match = prefix
if (isEmpty(scanPrefix)) { if (isEmpty(match)) {
scanPrefix = '*' match = '*'
} else { } else {
const separator = this._getSeparator(connName) const separator = this._getSeparator(connName)
if (!endsWith(prefix, separator + '*')) { if (!endsWith(prefix, separator + '*')) {
scanPrefix = prefix + separator + '*' match = prefix + separator + '*'
} }
} }
const { keys, success } = await this.scanKeys(connName, db, scanPrefix) return this.scanKeys(connName, db, match, matchType, all)
if (!success) { },
return
}
/**
* load more keys within the database
* @param {string} connName
* @param {number} db
* @return {Promise<boolean>}
*/
async loadMoreKeys(connName, db) {
const { match, type: keyType } = this.getKeyFilter(connName, db)
const { keys, end } = await this._loadKeys(connName, db, match, keyType, false)
// remove current keys below prefix // remove current keys below prefix
this._deleteKeyNode(connName, db, prefix, true)
this._addKeyNodes(connName, db, keys) this._addKeyNodes(connName, db, keys)
this._tidyNode(connName, db, prefix) this._tidyNode(connName, db, '')
return end
},
/**
* load all left keys within the database
* @param {string} connName
* @param {number} db
* @return {Promise<void>}
*/
async loadAllKeys(connName, db) {
const { match, type: keyType } = this.getKeyFilter(connName, db)
const { keys } = await this._loadKeys(connName, db, match, keyType, true)
// remove current keys below prefix
this._deleteKeyNode(connName, db, '', true)
this._addKeyNodes(connName, db, keys)
this._tidyNode(connName, db, '')
}, },
/** /**

View File

@ -1,6 +1,5 @@
import { defineStore } from 'pinia' import { defineStore } from 'pinia'
import useConnectionStore from './connections.js' import useConnectionStore from './connections.js'
import { assignWith, isEmpty } from 'lodash'
/** /**
* connection dialog type * connection dialog type

View File

@ -42,6 +42,7 @@ const usePreferencesStore = defineStore('preferences', {
language: 'auto', language: 'auto',
font: '', font: '',
fontSize: 14, fontSize: 14,
scanSize: 3000,
useSysProxy: false, useSysProxy: false,
useSysProxyHttp: false, useSysProxyHttp: false,
checkUpdate: false, checkUpdate: false,

View File

@ -1,5 +1,5 @@
import usePreferencesStore from 'stores/preferences.js' import usePreferencesStore from 'stores/preferences.js'
import { createDiscreteApi, darkTheme, useDialog } from 'naive-ui' import { createDiscreteApi, darkTheme } from 'naive-ui'
import { themeOverrides } from '@/utils/theme.js' import { themeOverrides } from '@/utils/theme.js'
import { i18nGlobal } from '@/utils/i18n.js' import { i18nGlobal } from '@/utils/i18n.js'
import { computed } from 'vue' import { computed } from 'vue'