Compare commits

..

No commits in common. "bc66c63b3d6ffa439f781239516ba100f6cb754b" and "7f2fac7fe8d4b0ac77c4d02aac119f8a40035445" have entirely different histories.

34 changed files with 412 additions and 632 deletions

View File

@ -685,7 +685,6 @@ func (b *browserService) GetKeyDetail(param types.KeyDetailParam) (resp types.JS
}
var data types.KeyDetail
data.KeyType = strings.ToLower(keyType)
//var cursor uint64
matchPattern := param.MatchPattern
if len(matchPattern) <= 0 {
@ -729,7 +728,7 @@ func (b *browserService) GetKeyDetail(param types.KeyDetailParam) (resp types.JS
}
}
switch data.KeyType {
switch strings.ToLower(keyType) {
case "string":
var str string
str, err = client.Get(ctx, key).Result()
@ -2294,7 +2293,7 @@ func (b *browserService) ImportCSV(server string, db int, path string, conflict
continue
}
// get ttl
if ttl < 0 && len(line) > 2 {
if ttl < 0 {
// use previous
if expire, ttlErr := strconv.ParseInt(line[2], 10, 64); ttlErr == nil && expire > 0 {
ttlValue = time.UnixMilli(expire).Sub(time.Now())

View File

@ -31,14 +31,13 @@ type KeyDetailParam struct {
}
type KeyDetail struct {
Value any `json:"value"`
KeyType string `json:"key_type"`
Length int64 `json:"length,omitempty"`
Format string `json:"format,omitempty"`
Decode string `json:"decode,omitempty"`
Match string `json:"match,omitempty"`
Reset bool `json:"reset"`
End bool `json:"end"`
Value any `json:"value"`
Length int64 `json:"length,omitempty"`
Format string `json:"format,omitempty"`
Decode string `json:"decode,omitempty"`
Match string `json:"match,omitempty"`
Reset bool `json:"reset"`
End bool `json:"end"`
}
type SetKeyParam struct {

View File

@ -13,20 +13,20 @@
"lodash": "^4.17.21",
"monaco-editor": "^0.45.0",
"pinia": "^2.1.7",
"sass": "^1.69.7",
"vue": "^3.4.5",
"vue-i18n": "^9.9.0",
"sass": "^1.69.6",
"vue": "^3.4.3",
"vue-i18n": "^9.8.0",
"xterm": "^5.3.0",
"xterm-addon-fit": "^0.8.0"
},
"devDependencies": {
"@vitejs/plugin-vue": "^5.0.2",
"naive-ui": "^2.37.0",
"naive-ui": "^2.36.0",
"prettier": "^3.1.1",
"unplugin-auto-import": "^0.17.3",
"unplugin-icons": "^0.18.1",
"unplugin-vue-components": "^0.26.0",
"vite": "^5.0.11"
"vite": "^5.0.10"
}
},
"node_modules/@antfu/install-pkg": {
@ -572,44 +572,35 @@
}
},
"node_modules/@intlify/core-base": {
"version": "9.9.0",
"resolved": "https://registry.npmjs.org/@intlify/core-base/-/core-base-9.9.0.tgz",
"integrity": "sha512-C7UXPymDIOlMGSNjAhNLtKgzITc/8BjINK5gNKXg8GiWCTwL6n3MWr55czksxn8RM5wTMz0qcLOFT+adtaVQaA==",
"version": "9.8.0",
"resolved": "https://registry.npmmirror.com/@intlify/core-base/-/core-base-9.8.0.tgz",
"integrity": "sha512-UxaSZVZ1DwqC/CltUZrWZNaWNhfmKtfyV4BJSt/Zt4Or/fZs1iFj0B+OekYk1+MRHfIOe3+x00uXGQI4PbO/9g==",
"dependencies": {
"@intlify/message-compiler": "9.9.0",
"@intlify/shared": "9.9.0"
"@intlify/message-compiler": "9.8.0",
"@intlify/shared": "9.8.0"
},
"engines": {
"node": ">= 16"
},
"funding": {
"url": "https://github.com/sponsors/kazupon"
}
},
"node_modules/@intlify/message-compiler": {
"version": "9.9.0",
"resolved": "https://registry.npmjs.org/@intlify/message-compiler/-/message-compiler-9.9.0.tgz",
"integrity": "sha512-yDU/jdUm9KuhEzYfS+wuyja209yXgdl1XFhMlKtXEgSFTxz4COZQCRXXbbH8JrAjMsaJ7bdoPSLsKlY6mXG2iA==",
"version": "9.8.0",
"resolved": "https://registry.npmmirror.com/@intlify/message-compiler/-/message-compiler-9.8.0.tgz",
"integrity": "sha512-McnYWhcoYmDJvssVu6QGR0shqlkJuL1HHdi5lK7fNqvQqRYaQ4lSLjYmZxwc8tRNMdIe9/KUKfyPxU9M6yCtNQ==",
"dependencies": {
"@intlify/shared": "9.9.0",
"@intlify/shared": "9.8.0",
"source-map-js": "^1.0.2"
},
"engines": {
"node": ">= 16"
},
"funding": {
"url": "https://github.com/sponsors/kazupon"
}
},
"node_modules/@intlify/shared": {
"version": "9.9.0",
"resolved": "https://registry.npmjs.org/@intlify/shared/-/shared-9.9.0.tgz",
"integrity": "sha512-1ECUyAHRrzOJbOizyGufYP2yukqGrWXtkmTu4PcswVnWbkcjzk3YQGmJ0bLkM7JZ0ZYAaohLGdYvBYnTOGYJ9g==",
"version": "9.8.0",
"resolved": "https://registry.npmmirror.com/@intlify/shared/-/shared-9.8.0.tgz",
"integrity": "sha512-TmgR0RCLjzrSo+W3wT0ALf9851iFMlVI9EYNGeWvZFUQTAJx0bvfsMlPdgVtV1tDNRiAfhkFsMKu6jtUY1ZLKQ==",
"engines": {
"node": ">= 16"
},
"funding": {
"url": "https://github.com/sponsors/kazupon"
}
},
"node_modules/@jridgewell/sourcemap-codec": {
@ -877,36 +868,36 @@
}
},
"node_modules/@vue/compiler-core": {
"version": "3.4.5",
"resolved": "https://registry.npmjs.org/@vue/compiler-core/-/compiler-core-3.4.5.tgz",
"integrity": "sha512-Daka7P1z2AgKjzuueWXhwzIsKu0NkLB6vGbNVEV2iJ8GJTrzraZo/Sk4GWCMRtd/qVi3zwnk+Owbd/xSZbwHtQ==",
"version": "3.4.3",
"resolved": "https://registry.npmjs.org/@vue/compiler-core/-/compiler-core-3.4.3.tgz",
"integrity": "sha512-u8jzgFg0EDtSrb/hG53Wwh1bAOQFtc1ZCegBpA/glyvTlgHl+tq13o1zvRfLbegYUw/E4mSTGOiCnAJ9SJ+lsg==",
"dependencies": {
"@babel/parser": "^7.23.6",
"@vue/shared": "3.4.5",
"@vue/shared": "3.4.3",
"entities": "^4.5.0",
"estree-walker": "^2.0.2",
"source-map-js": "^1.0.2"
}
},
"node_modules/@vue/compiler-dom": {
"version": "3.4.5",
"resolved": "https://registry.npmjs.org/@vue/compiler-dom/-/compiler-dom-3.4.5.tgz",
"integrity": "sha512-J8YlxknJVd90SXFJ4HwGANSAXsx5I0lK30sO/zvYV7s5gXf7gZR7r/1BmZ2ju7RGH1lnc6bpBc6nL61yW+PsAQ==",
"version": "3.4.3",
"resolved": "https://registry.npmjs.org/@vue/compiler-dom/-/compiler-dom-3.4.3.tgz",
"integrity": "sha512-oGF1E9/htI6JWj/lTJgr6UgxNCtNHbM6xKVreBWeZL9QhRGABRVoWGAzxmtBfSOd+w0Zi5BY0Es/tlJrN6WgEg==",
"dependencies": {
"@vue/compiler-core": "3.4.5",
"@vue/shared": "3.4.5"
"@vue/compiler-core": "3.4.3",
"@vue/shared": "3.4.3"
}
},
"node_modules/@vue/compiler-sfc": {
"version": "3.4.5",
"resolved": "https://registry.npmjs.org/@vue/compiler-sfc/-/compiler-sfc-3.4.5.tgz",
"integrity": "sha512-jauvkDuSSUbP0ebhfNqljhShA90YEfX/0wZ+w40oZF43IjGyWYjqYaJbvMJwGOd+9+vODW6eSvnk28f0SGV7OQ==",
"version": "3.4.3",
"resolved": "https://registry.npmjs.org/@vue/compiler-sfc/-/compiler-sfc-3.4.3.tgz",
"integrity": "sha512-NuJqb5is9I4uzv316VRUDYgIlPZCG8D+ARt5P4t5UDShIHKL25J3TGZAUryY/Aiy0DsY7srJnZL5ryB6DD63Zw==",
"dependencies": {
"@babel/parser": "^7.23.6",
"@vue/compiler-core": "3.4.5",
"@vue/compiler-dom": "3.4.5",
"@vue/compiler-ssr": "3.4.5",
"@vue/shared": "3.4.5",
"@vue/compiler-core": "3.4.3",
"@vue/compiler-dom": "3.4.3",
"@vue/compiler-ssr": "3.4.3",
"@vue/shared": "3.4.3",
"estree-walker": "^2.0.2",
"magic-string": "^0.30.5",
"postcss": "^8.4.32",
@ -914,12 +905,12 @@
}
},
"node_modules/@vue/compiler-ssr": {
"version": "3.4.5",
"resolved": "https://registry.npmjs.org/@vue/compiler-ssr/-/compiler-ssr-3.4.5.tgz",
"integrity": "sha512-DDdEcDzj2lWTMfUMMtEpLDhURai9LhM0zSZ219jCt7b2Vyl0/jy3keFgCPMitG0V1S1YG4Cmws3lWHWdxHQOpg==",
"version": "3.4.3",
"resolved": "https://registry.npmjs.org/@vue/compiler-ssr/-/compiler-ssr-3.4.3.tgz",
"integrity": "sha512-wnYQtMBkeFSxgSSQbYGQeXPhQacQiog2c6AlvMldQH6DB+gSXK/0F6DVXAJfEiuBSgBhUc8dwrrG5JQcqwalsA==",
"dependencies": {
"@vue/compiler-dom": "3.4.5",
"@vue/shared": "3.4.5"
"@vue/compiler-dom": "3.4.3",
"@vue/shared": "3.4.3"
}
},
"node_modules/@vue/devtools-api": {
@ -928,29 +919,29 @@
"integrity": "sha512-o9KfBeaBmCKl10usN4crU53fYtC1r7jJwdGKjPT24t348rHxgfpZ0xL3Xm/gLUYnc0oTp8LAmrxOeLyu6tbk2Q=="
},
"node_modules/@vue/reactivity": {
"version": "3.4.5",
"resolved": "https://registry.npmjs.org/@vue/reactivity/-/reactivity-3.4.5.tgz",
"integrity": "sha512-BcWkKvjdvqJwb7BhhFkXPLDCecX4d4a6GATvCduJQDLv21PkPowAE5GKuIE5p6RC07/Lp9FMkkq4AYCTVF5KlQ==",
"version": "3.4.3",
"resolved": "https://registry.npmjs.org/@vue/reactivity/-/reactivity-3.4.3.tgz",
"integrity": "sha512-q5f9HLDU+5aBKizXHAx0w4whkIANs1Muiq9R5YXm0HtorSlflqv9u/ohaMxuuhHWCji4xqpQ1eL04WvmAmGnFg==",
"dependencies": {
"@vue/shared": "3.4.5"
"@vue/shared": "3.4.3"
}
},
"node_modules/@vue/runtime-core": {
"version": "3.4.5",
"resolved": "https://registry.npmjs.org/@vue/runtime-core/-/runtime-core-3.4.5.tgz",
"integrity": "sha512-wh9ELIOQKeWT9SaUPdLrsxRkZv14jp+SJm9aiQGWio+/MWNM3Lib0wE6CoKEqQ9+SCYyGjDBhTOTtO47kCgbkg==",
"version": "3.4.3",
"resolved": "https://registry.npmjs.org/@vue/runtime-core/-/runtime-core-3.4.3.tgz",
"integrity": "sha512-C1r6QhB1qY7D591RCSFhMULyzL9CuyrGc+3PpB0h7dU4Qqw6GNyo4BNFjHZVvsWncrUlKX3DIKg0Y7rNNr06NQ==",
"dependencies": {
"@vue/reactivity": "3.4.5",
"@vue/shared": "3.4.5"
"@vue/reactivity": "3.4.3",
"@vue/shared": "3.4.3"
}
},
"node_modules/@vue/runtime-dom": {
"version": "3.4.5",
"resolved": "https://registry.npmjs.org/@vue/runtime-dom/-/runtime-dom-3.4.5.tgz",
"integrity": "sha512-n5ewvOjyG3IEpqGBahdPXODFSpVlSz3H4LF76Sx0XAqpIOqyJ5bIb2PrdYuH2ogBMAQPh+o5tnoH4nJpBr8U0Q==",
"version": "3.4.3",
"resolved": "https://registry.npmjs.org/@vue/runtime-dom/-/runtime-dom-3.4.3.tgz",
"integrity": "sha512-wrsprg7An5Ec+EhPngWdPuzkp0BEUxAKaQtN9dPU/iZctPyD9aaXmVtehPJerdQxQale6gEnhpnfywNw3zOv2A==",
"dependencies": {
"@vue/runtime-core": "3.4.5",
"@vue/shared": "3.4.5",
"@vue/runtime-core": "3.4.3",
"@vue/shared": "3.4.3",
"csstype": "^3.1.3"
}
},
@ -960,21 +951,21 @@
"integrity": "sha512-M1uQkMl8rQK/szD0LNhtqxIPLpimGm8sOBwU7lLnCpSbTyY3yeU1Vc7l4KT5zT4s/yOxHH5O7tIuuLOCnLADRw=="
},
"node_modules/@vue/server-renderer": {
"version": "3.4.5",
"resolved": "https://registry.npmjs.org/@vue/server-renderer/-/server-renderer-3.4.5.tgz",
"integrity": "sha512-jOFc/VE87yvifQpNju12VcqimH8pBLxdcT+t3xMeiED1K6DfH9SORyhFEoZlW5TG2Vwfn3Ul5KE+1aC99xnSBg==",
"version": "3.4.3",
"resolved": "https://registry.npmjs.org/@vue/server-renderer/-/server-renderer-3.4.3.tgz",
"integrity": "sha512-BUxt8oVGMKKsqSkM1uU3d3Houyfy4WAc2SpSQRebNd+XJGATVkW/rO129jkyL+kpB/2VRKzE63zwf5RtJ3XuZw==",
"dependencies": {
"@vue/compiler-ssr": "3.4.5",
"@vue/shared": "3.4.5"
"@vue/compiler-ssr": "3.4.3",
"@vue/shared": "3.4.3"
},
"peerDependencies": {
"vue": "3.4.5"
"vue": "3.4.3"
}
},
"node_modules/@vue/shared": {
"version": "3.4.5",
"resolved": "https://registry.npmjs.org/@vue/shared/-/shared-3.4.5.tgz",
"integrity": "sha512-6XptuzlMvN4l4cDnDw36pdGEV+9njYkQ1ZE0Q6iZLwrKefKaOJyiFmcP3/KBDHbt72cJZGtllAc1GaHe6XGAyg=="
"version": "3.4.3",
"resolved": "https://registry.npmjs.org/@vue/shared/-/shared-3.4.3.tgz",
"integrity": "sha512-rIwlkkP1n4uKrRzivAKPZIEkHiuwY5mmhMJ2nZKCBLz8lTUlE73rQh4n1OnnMurXt1vcUNyH4ZPfdh8QweTjpQ=="
},
"node_modules/acorn": {
"version": "8.11.2",
@ -1545,9 +1536,9 @@
"dev": true
},
"node_modules/naive-ui": {
"version": "2.37.0",
"resolved": "https://registry.npmjs.org/naive-ui/-/naive-ui-2.37.0.tgz",
"integrity": "sha512-TcuXM1zysnK6i/7o2ZqNjcLp3QMmcdSLWWiXcpEk+xdGpkJzs53/OXNpF4CoDM/npjha7qqtB8Pl17YPN5egFw==",
"version": "2.36.0",
"resolved": "https://registry.npmjs.org/naive-ui/-/naive-ui-2.36.0.tgz",
"integrity": "sha512-r1ydtEm1Ryf/aWpbLCf32mQAGK99jd1eXgpkCtIomcBRZeAtusfy6zCtIpCppoCuIKM3BW5DMafhVxilubk/lQ==",
"dev": true,
"dependencies": {
"@css-render/plugin-bem": "^0.15.12",
@ -1557,7 +1548,6 @@
"@types/lodash-es": "^4.17.9",
"async-validator": "^4.2.5",
"css-render": "^0.15.12",
"csstype": "^3.1.3",
"date-fns": "^2.30.0",
"date-fns-tz": "^2.0.0",
"evtd": "^0.2.4",
@ -1568,18 +1558,12 @@
"treemate": "^0.3.11",
"vdirs": "^0.1.8",
"vooks": "^0.2.12",
"vueuc": "^0.4.58"
"vueuc": "^0.4.54"
},
"peerDependencies": {
"vue": "^3.0.0"
}
},
"node_modules/naive-ui/node_modules/csstype": {
"version": "3.1.3",
"resolved": "https://registry.npmjs.org/csstype/-/csstype-3.1.3.tgz",
"integrity": "sha512-M1uQkMl8rQK/szD0LNhtqxIPLpimGm8sOBwU7lLnCpSbTyY3yeU1Vc7l4KT5zT4s/yOxHH5O7tIuuLOCnLADRw==",
"dev": true
},
"node_modules/nanoid": {
"version": "3.3.7",
"resolved": "https://registry.npmmirror.com/nanoid/-/nanoid-3.3.7.tgz",
@ -1867,9 +1851,9 @@
}
},
"node_modules/sass": {
"version": "1.69.7",
"resolved": "https://registry.npmjs.org/sass/-/sass-1.69.7.tgz",
"integrity": "sha512-rzj2soDeZ8wtE2egyLXgOOHQvaC2iosZrkF6v3EUG+tBwEvhqUCzm0VP3k9gHF9LXbSrRhT5SksoI56Iw8NPnQ==",
"version": "1.69.6",
"resolved": "https://registry.npmjs.org/sass/-/sass-1.69.6.tgz",
"integrity": "sha512-qbRr3k9JGHWXCvZU77SD2OTwUlC+gNT+61JOLcmLm+XqH4h/5D+p4IIsxvpkB89S9AwJOyb5+rWNpIucaFxSFQ==",
"dependencies": {
"chokidar": ">=3.0.0 <4.0.0",
"immutable": "^4.0.0",
@ -2189,9 +2173,9 @@
}
},
"node_modules/vite": {
"version": "5.0.11",
"resolved": "https://registry.npmjs.org/vite/-/vite-5.0.11.tgz",
"integrity": "sha512-XBMnDjZcNAw/G1gEiskiM1v6yzM4GE5aMGvhWTlHAYYhxb7S3/V1s3m2LDHa8Vh6yIWYYB0iJwsEaS523c4oYA==",
"version": "5.0.10",
"resolved": "https://registry.npmjs.org/vite/-/vite-5.0.10.tgz",
"integrity": "sha512-2P8J7WWgmc355HUMlFrwofacvr98DAjoE52BfdbwQtyLH06XKwaL/FMnmKM2crF0iX4MpmMKoDlNCB1ok7zHCw==",
"dev": true,
"dependencies": {
"esbuild": "^0.19.3",
@ -2256,15 +2240,15 @@
}
},
"node_modules/vue": {
"version": "3.4.5",
"resolved": "https://registry.npmjs.org/vue/-/vue-3.4.5.tgz",
"integrity": "sha512-VH6nHFhLPjgu2oh5vEBXoNZxsGHuZNr3qf4PHClwJWw6IDqw6B3x+4J+ABdoZ0aJuT8Zi0zf3GpGlLQCrGWHrw==",
"version": "3.4.3",
"resolved": "https://registry.npmjs.org/vue/-/vue-3.4.3.tgz",
"integrity": "sha512-GjN+culMAGv/mUbkIv8zMKItno8npcj5gWlXkSxf1SPTQf8eJ4A+YfHIvQFyL1IfuJcMl3soA7SmN1fRxbf/wA==",
"dependencies": {
"@vue/compiler-dom": "3.4.5",
"@vue/compiler-sfc": "3.4.5",
"@vue/runtime-dom": "3.4.5",
"@vue/server-renderer": "3.4.5",
"@vue/shared": "3.4.5"
"@vue/compiler-dom": "3.4.3",
"@vue/compiler-sfc": "3.4.3",
"@vue/runtime-dom": "3.4.3",
"@vue/server-renderer": "3.4.3",
"@vue/shared": "3.4.3"
},
"peerDependencies": {
"typescript": "*"
@ -2276,28 +2260,25 @@
}
},
"node_modules/vue-i18n": {
"version": "9.9.0",
"resolved": "https://registry.npmjs.org/vue-i18n/-/vue-i18n-9.9.0.tgz",
"integrity": "sha512-xQ5SxszUAqK5n84N+uUyHH/PiQl9xZ24FOxyAaNonmOQgXeN+rD9z/6DStOpOxNFQn4Cgcquot05gZc+CdOujA==",
"version": "9.8.0",
"resolved": "https://registry.npmmirror.com/vue-i18n/-/vue-i18n-9.8.0.tgz",
"integrity": "sha512-Izho+6PYjejsTq2mzjcRdBZ5VLRQoSuuexvR8029h5CpN03FYqiqBrShMyf2I1DKkN6kw/xmujcbvC+4QybpsQ==",
"dependencies": {
"@intlify/core-base": "9.9.0",
"@intlify/shared": "9.9.0",
"@intlify/core-base": "9.8.0",
"@intlify/shared": "9.8.0",
"@vue/devtools-api": "^6.5.0"
},
"engines": {
"node": ">= 16"
},
"funding": {
"url": "https://github.com/sponsors/kazupon"
},
"peerDependencies": {
"vue": "^3.0.0"
}
},
"node_modules/vueuc": {
"version": "0.4.58",
"resolved": "https://registry.npmjs.org/vueuc/-/vueuc-0.4.58.tgz",
"integrity": "sha512-Wnj/N8WbPRSxSt+9ji1jtDHPzda5h2OH/0sFBhvdxDRuyCZbjGg3/cKMaKqEoe+dErTexG2R+i6Q8S/Toq1MYg==",
"version": "0.4.54",
"resolved": "https://registry.npmjs.org/vueuc/-/vueuc-0.4.54.tgz",
"integrity": "sha512-2LED7h1BSnCRPBI6AlSIf+1Yte1shN+Vb2gpspO5wHI7zWzbcq4bAu2f9nFh5yXIUKdzqmLvzRsOXDl4TrDyCw==",
"dev": true,
"dependencies": {
"@css-render/vue3-ssr": "^0.15.10",
@ -2673,27 +2654,27 @@
}
},
"@intlify/core-base": {
"version": "9.9.0",
"resolved": "https://registry.npmjs.org/@intlify/core-base/-/core-base-9.9.0.tgz",
"integrity": "sha512-C7UXPymDIOlMGSNjAhNLtKgzITc/8BjINK5gNKXg8GiWCTwL6n3MWr55czksxn8RM5wTMz0qcLOFT+adtaVQaA==",
"version": "9.8.0",
"resolved": "https://registry.npmmirror.com/@intlify/core-base/-/core-base-9.8.0.tgz",
"integrity": "sha512-UxaSZVZ1DwqC/CltUZrWZNaWNhfmKtfyV4BJSt/Zt4Or/fZs1iFj0B+OekYk1+MRHfIOe3+x00uXGQI4PbO/9g==",
"requires": {
"@intlify/message-compiler": "9.9.0",
"@intlify/shared": "9.9.0"
"@intlify/message-compiler": "9.8.0",
"@intlify/shared": "9.8.0"
}
},
"@intlify/message-compiler": {
"version": "9.9.0",
"resolved": "https://registry.npmjs.org/@intlify/message-compiler/-/message-compiler-9.9.0.tgz",
"integrity": "sha512-yDU/jdUm9KuhEzYfS+wuyja209yXgdl1XFhMlKtXEgSFTxz4COZQCRXXbbH8JrAjMsaJ7bdoPSLsKlY6mXG2iA==",
"version": "9.8.0",
"resolved": "https://registry.npmmirror.com/@intlify/message-compiler/-/message-compiler-9.8.0.tgz",
"integrity": "sha512-McnYWhcoYmDJvssVu6QGR0shqlkJuL1HHdi5lK7fNqvQqRYaQ4lSLjYmZxwc8tRNMdIe9/KUKfyPxU9M6yCtNQ==",
"requires": {
"@intlify/shared": "9.9.0",
"@intlify/shared": "9.8.0",
"source-map-js": "^1.0.2"
}
},
"@intlify/shared": {
"version": "9.9.0",
"resolved": "https://registry.npmjs.org/@intlify/shared/-/shared-9.9.0.tgz",
"integrity": "sha512-1ECUyAHRrzOJbOizyGufYP2yukqGrWXtkmTu4PcswVnWbkcjzk3YQGmJ0bLkM7JZ0ZYAaohLGdYvBYnTOGYJ9g=="
"version": "9.8.0",
"resolved": "https://registry.npmmirror.com/@intlify/shared/-/shared-9.8.0.tgz",
"integrity": "sha512-TmgR0RCLjzrSo+W3wT0ALf9851iFMlVI9EYNGeWvZFUQTAJx0bvfsMlPdgVtV1tDNRiAfhkFsMKu6jtUY1ZLKQ=="
},
"@jridgewell/sourcemap-codec": {
"version": "1.4.15",
@ -2862,36 +2843,36 @@
"requires": {}
},
"@vue/compiler-core": {
"version": "3.4.5",
"resolved": "https://registry.npmjs.org/@vue/compiler-core/-/compiler-core-3.4.5.tgz",
"integrity": "sha512-Daka7P1z2AgKjzuueWXhwzIsKu0NkLB6vGbNVEV2iJ8GJTrzraZo/Sk4GWCMRtd/qVi3zwnk+Owbd/xSZbwHtQ==",
"version": "3.4.3",
"resolved": "https://registry.npmjs.org/@vue/compiler-core/-/compiler-core-3.4.3.tgz",
"integrity": "sha512-u8jzgFg0EDtSrb/hG53Wwh1bAOQFtc1ZCegBpA/glyvTlgHl+tq13o1zvRfLbegYUw/E4mSTGOiCnAJ9SJ+lsg==",
"requires": {
"@babel/parser": "^7.23.6",
"@vue/shared": "3.4.5",
"@vue/shared": "3.4.3",
"entities": "^4.5.0",
"estree-walker": "^2.0.2",
"source-map-js": "^1.0.2"
}
},
"@vue/compiler-dom": {
"version": "3.4.5",
"resolved": "https://registry.npmjs.org/@vue/compiler-dom/-/compiler-dom-3.4.5.tgz",
"integrity": "sha512-J8YlxknJVd90SXFJ4HwGANSAXsx5I0lK30sO/zvYV7s5gXf7gZR7r/1BmZ2ju7RGH1lnc6bpBc6nL61yW+PsAQ==",
"version": "3.4.3",
"resolved": "https://registry.npmjs.org/@vue/compiler-dom/-/compiler-dom-3.4.3.tgz",
"integrity": "sha512-oGF1E9/htI6JWj/lTJgr6UgxNCtNHbM6xKVreBWeZL9QhRGABRVoWGAzxmtBfSOd+w0Zi5BY0Es/tlJrN6WgEg==",
"requires": {
"@vue/compiler-core": "3.4.5",
"@vue/shared": "3.4.5"
"@vue/compiler-core": "3.4.3",
"@vue/shared": "3.4.3"
}
},
"@vue/compiler-sfc": {
"version": "3.4.5",
"resolved": "https://registry.npmjs.org/@vue/compiler-sfc/-/compiler-sfc-3.4.5.tgz",
"integrity": "sha512-jauvkDuSSUbP0ebhfNqljhShA90YEfX/0wZ+w40oZF43IjGyWYjqYaJbvMJwGOd+9+vODW6eSvnk28f0SGV7OQ==",
"version": "3.4.3",
"resolved": "https://registry.npmjs.org/@vue/compiler-sfc/-/compiler-sfc-3.4.3.tgz",
"integrity": "sha512-NuJqb5is9I4uzv316VRUDYgIlPZCG8D+ARt5P4t5UDShIHKL25J3TGZAUryY/Aiy0DsY7srJnZL5ryB6DD63Zw==",
"requires": {
"@babel/parser": "^7.23.6",
"@vue/compiler-core": "3.4.5",
"@vue/compiler-dom": "3.4.5",
"@vue/compiler-ssr": "3.4.5",
"@vue/shared": "3.4.5",
"@vue/compiler-core": "3.4.3",
"@vue/compiler-dom": "3.4.3",
"@vue/compiler-ssr": "3.4.3",
"@vue/shared": "3.4.3",
"estree-walker": "^2.0.2",
"magic-string": "^0.30.5",
"postcss": "^8.4.32",
@ -2899,12 +2880,12 @@
}
},
"@vue/compiler-ssr": {
"version": "3.4.5",
"resolved": "https://registry.npmjs.org/@vue/compiler-ssr/-/compiler-ssr-3.4.5.tgz",
"integrity": "sha512-DDdEcDzj2lWTMfUMMtEpLDhURai9LhM0zSZ219jCt7b2Vyl0/jy3keFgCPMitG0V1S1YG4Cmws3lWHWdxHQOpg==",
"version": "3.4.3",
"resolved": "https://registry.npmjs.org/@vue/compiler-ssr/-/compiler-ssr-3.4.3.tgz",
"integrity": "sha512-wnYQtMBkeFSxgSSQbYGQeXPhQacQiog2c6AlvMldQH6DB+gSXK/0F6DVXAJfEiuBSgBhUc8dwrrG5JQcqwalsA==",
"requires": {
"@vue/compiler-dom": "3.4.5",
"@vue/shared": "3.4.5"
"@vue/compiler-dom": "3.4.3",
"@vue/shared": "3.4.3"
}
},
"@vue/devtools-api": {
@ -2913,29 +2894,29 @@
"integrity": "sha512-o9KfBeaBmCKl10usN4crU53fYtC1r7jJwdGKjPT24t348rHxgfpZ0xL3Xm/gLUYnc0oTp8LAmrxOeLyu6tbk2Q=="
},
"@vue/reactivity": {
"version": "3.4.5",
"resolved": "https://registry.npmjs.org/@vue/reactivity/-/reactivity-3.4.5.tgz",
"integrity": "sha512-BcWkKvjdvqJwb7BhhFkXPLDCecX4d4a6GATvCduJQDLv21PkPowAE5GKuIE5p6RC07/Lp9FMkkq4AYCTVF5KlQ==",
"version": "3.4.3",
"resolved": "https://registry.npmjs.org/@vue/reactivity/-/reactivity-3.4.3.tgz",
"integrity": "sha512-q5f9HLDU+5aBKizXHAx0w4whkIANs1Muiq9R5YXm0HtorSlflqv9u/ohaMxuuhHWCji4xqpQ1eL04WvmAmGnFg==",
"requires": {
"@vue/shared": "3.4.5"
"@vue/shared": "3.4.3"
}
},
"@vue/runtime-core": {
"version": "3.4.5",
"resolved": "https://registry.npmjs.org/@vue/runtime-core/-/runtime-core-3.4.5.tgz",
"integrity": "sha512-wh9ELIOQKeWT9SaUPdLrsxRkZv14jp+SJm9aiQGWio+/MWNM3Lib0wE6CoKEqQ9+SCYyGjDBhTOTtO47kCgbkg==",
"version": "3.4.3",
"resolved": "https://registry.npmjs.org/@vue/runtime-core/-/runtime-core-3.4.3.tgz",
"integrity": "sha512-C1r6QhB1qY7D591RCSFhMULyzL9CuyrGc+3PpB0h7dU4Qqw6GNyo4BNFjHZVvsWncrUlKX3DIKg0Y7rNNr06NQ==",
"requires": {
"@vue/reactivity": "3.4.5",
"@vue/shared": "3.4.5"
"@vue/reactivity": "3.4.3",
"@vue/shared": "3.4.3"
}
},
"@vue/runtime-dom": {
"version": "3.4.5",
"resolved": "https://registry.npmjs.org/@vue/runtime-dom/-/runtime-dom-3.4.5.tgz",
"integrity": "sha512-n5ewvOjyG3IEpqGBahdPXODFSpVlSz3H4LF76Sx0XAqpIOqyJ5bIb2PrdYuH2ogBMAQPh+o5tnoH4nJpBr8U0Q==",
"version": "3.4.3",
"resolved": "https://registry.npmjs.org/@vue/runtime-dom/-/runtime-dom-3.4.3.tgz",
"integrity": "sha512-wrsprg7An5Ec+EhPngWdPuzkp0BEUxAKaQtN9dPU/iZctPyD9aaXmVtehPJerdQxQale6gEnhpnfywNw3zOv2A==",
"requires": {
"@vue/runtime-core": "3.4.5",
"@vue/shared": "3.4.5",
"@vue/runtime-core": "3.4.3",
"@vue/shared": "3.4.3",
"csstype": "^3.1.3"
},
"dependencies": {
@ -2947,18 +2928,18 @@
}
},
"@vue/server-renderer": {
"version": "3.4.5",
"resolved": "https://registry.npmjs.org/@vue/server-renderer/-/server-renderer-3.4.5.tgz",
"integrity": "sha512-jOFc/VE87yvifQpNju12VcqimH8pBLxdcT+t3xMeiED1K6DfH9SORyhFEoZlW5TG2Vwfn3Ul5KE+1aC99xnSBg==",
"version": "3.4.3",
"resolved": "https://registry.npmjs.org/@vue/server-renderer/-/server-renderer-3.4.3.tgz",
"integrity": "sha512-BUxt8oVGMKKsqSkM1uU3d3Houyfy4WAc2SpSQRebNd+XJGATVkW/rO129jkyL+kpB/2VRKzE63zwf5RtJ3XuZw==",
"requires": {
"@vue/compiler-ssr": "3.4.5",
"@vue/shared": "3.4.5"
"@vue/compiler-ssr": "3.4.3",
"@vue/shared": "3.4.3"
}
},
"@vue/shared": {
"version": "3.4.5",
"resolved": "https://registry.npmjs.org/@vue/shared/-/shared-3.4.5.tgz",
"integrity": "sha512-6XptuzlMvN4l4cDnDw36pdGEV+9njYkQ1ZE0Q6iZLwrKefKaOJyiFmcP3/KBDHbt72cJZGtllAc1GaHe6XGAyg=="
"version": "3.4.3",
"resolved": "https://registry.npmjs.org/@vue/shared/-/shared-3.4.3.tgz",
"integrity": "sha512-rIwlkkP1n4uKrRzivAKPZIEkHiuwY5mmhMJ2nZKCBLz8lTUlE73rQh4n1OnnMurXt1vcUNyH4ZPfdh8QweTjpQ=="
},
"acorn": {
"version": "8.11.2",
@ -3401,9 +3382,9 @@
"dev": true
},
"naive-ui": {
"version": "2.37.0",
"resolved": "https://registry.npmjs.org/naive-ui/-/naive-ui-2.37.0.tgz",
"integrity": "sha512-TcuXM1zysnK6i/7o2ZqNjcLp3QMmcdSLWWiXcpEk+xdGpkJzs53/OXNpF4CoDM/npjha7qqtB8Pl17YPN5egFw==",
"version": "2.36.0",
"resolved": "https://registry.npmjs.org/naive-ui/-/naive-ui-2.36.0.tgz",
"integrity": "sha512-r1ydtEm1Ryf/aWpbLCf32mQAGK99jd1eXgpkCtIomcBRZeAtusfy6zCtIpCppoCuIKM3BW5DMafhVxilubk/lQ==",
"dev": true,
"requires": {
"@css-render/plugin-bem": "^0.15.12",
@ -3413,7 +3394,6 @@
"@types/lodash-es": "^4.17.9",
"async-validator": "^4.2.5",
"css-render": "^0.15.12",
"csstype": "^3.1.3",
"date-fns": "^2.30.0",
"date-fns-tz": "^2.0.0",
"evtd": "^0.2.4",
@ -3424,15 +3404,7 @@
"treemate": "^0.3.11",
"vdirs": "^0.1.8",
"vooks": "^0.2.12",
"vueuc": "^0.4.58"
},
"dependencies": {
"csstype": {
"version": "3.1.3",
"resolved": "https://registry.npmjs.org/csstype/-/csstype-3.1.3.tgz",
"integrity": "sha512-M1uQkMl8rQK/szD0LNhtqxIPLpimGm8sOBwU7lLnCpSbTyY3yeU1Vc7l4KT5zT4s/yOxHH5O7tIuuLOCnLADRw==",
"dev": true
}
"vueuc": "^0.4.54"
}
},
"nanoid": {
@ -3635,9 +3607,9 @@
}
},
"sass": {
"version": "1.69.7",
"resolved": "https://registry.npmjs.org/sass/-/sass-1.69.7.tgz",
"integrity": "sha512-rzj2soDeZ8wtE2egyLXgOOHQvaC2iosZrkF6v3EUG+tBwEvhqUCzm0VP3k9gHF9LXbSrRhT5SksoI56Iw8NPnQ==",
"version": "1.69.6",
"resolved": "https://registry.npmjs.org/sass/-/sass-1.69.6.tgz",
"integrity": "sha512-qbRr3k9JGHWXCvZU77SD2OTwUlC+gNT+61JOLcmLm+XqH4h/5D+p4IIsxvpkB89S9AwJOyb5+rWNpIucaFxSFQ==",
"requires": {
"chokidar": ">=3.0.0 <4.0.0",
"immutable": "^4.0.0",
@ -3860,9 +3832,9 @@
}
},
"vite": {
"version": "5.0.11",
"resolved": "https://registry.npmjs.org/vite/-/vite-5.0.11.tgz",
"integrity": "sha512-XBMnDjZcNAw/G1gEiskiM1v6yzM4GE5aMGvhWTlHAYYhxb7S3/V1s3m2LDHa8Vh6yIWYYB0iJwsEaS523c4oYA==",
"version": "5.0.10",
"resolved": "https://registry.npmjs.org/vite/-/vite-5.0.10.tgz",
"integrity": "sha512-2P8J7WWgmc355HUMlFrwofacvr98DAjoE52BfdbwQtyLH06XKwaL/FMnmKM2crF0iX4MpmMKoDlNCB1ok7zHCw==",
"dev": true,
"requires": {
"esbuild": "^0.19.3",
@ -3881,31 +3853,31 @@
}
},
"vue": {
"version": "3.4.5",
"resolved": "https://registry.npmjs.org/vue/-/vue-3.4.5.tgz",
"integrity": "sha512-VH6nHFhLPjgu2oh5vEBXoNZxsGHuZNr3qf4PHClwJWw6IDqw6B3x+4J+ABdoZ0aJuT8Zi0zf3GpGlLQCrGWHrw==",
"version": "3.4.3",
"resolved": "https://registry.npmjs.org/vue/-/vue-3.4.3.tgz",
"integrity": "sha512-GjN+culMAGv/mUbkIv8zMKItno8npcj5gWlXkSxf1SPTQf8eJ4A+YfHIvQFyL1IfuJcMl3soA7SmN1fRxbf/wA==",
"requires": {
"@vue/compiler-dom": "3.4.5",
"@vue/compiler-sfc": "3.4.5",
"@vue/runtime-dom": "3.4.5",
"@vue/server-renderer": "3.4.5",
"@vue/shared": "3.4.5"
"@vue/compiler-dom": "3.4.3",
"@vue/compiler-sfc": "3.4.3",
"@vue/runtime-dom": "3.4.3",
"@vue/server-renderer": "3.4.3",
"@vue/shared": "3.4.3"
}
},
"vue-i18n": {
"version": "9.9.0",
"resolved": "https://registry.npmjs.org/vue-i18n/-/vue-i18n-9.9.0.tgz",
"integrity": "sha512-xQ5SxszUAqK5n84N+uUyHH/PiQl9xZ24FOxyAaNonmOQgXeN+rD9z/6DStOpOxNFQn4Cgcquot05gZc+CdOujA==",
"version": "9.8.0",
"resolved": "https://registry.npmmirror.com/vue-i18n/-/vue-i18n-9.8.0.tgz",
"integrity": "sha512-Izho+6PYjejsTq2mzjcRdBZ5VLRQoSuuexvR8029h5CpN03FYqiqBrShMyf2I1DKkN6kw/xmujcbvC+4QybpsQ==",
"requires": {
"@intlify/core-base": "9.9.0",
"@intlify/shared": "9.9.0",
"@intlify/core-base": "9.8.0",
"@intlify/shared": "9.8.0",
"@vue/devtools-api": "^6.5.0"
}
},
"vueuc": {
"version": "0.4.58",
"resolved": "https://registry.npmjs.org/vueuc/-/vueuc-0.4.58.tgz",
"integrity": "sha512-Wnj/N8WbPRSxSt+9ji1jtDHPzda5h2OH/0sFBhvdxDRuyCZbjGg3/cKMaKqEoe+dErTexG2R+i6Q8S/Toq1MYg==",
"version": "0.4.54",
"resolved": "https://registry.npmjs.org/vueuc/-/vueuc-0.4.54.tgz",
"integrity": "sha512-2LED7h1BSnCRPBI6AlSIf+1Yte1shN+Vb2gpspO5wHI7zWzbcq4bAu2f9nFh5yXIUKdzqmLvzRsOXDl4TrDyCw==",
"dev": true,
"requires": {
"@css-render/vue3-ssr": "^0.15.10",

View File

@ -14,19 +14,19 @@
"lodash": "^4.17.21",
"monaco-editor": "^0.45.0",
"pinia": "^2.1.7",
"sass": "^1.69.7",
"vue": "^3.4.5",
"vue-i18n": "^9.9.0",
"sass": "^1.69.6",
"vue": "^3.4.3",
"vue-i18n": "^9.8.0",
"xterm": "^5.3.0",
"xterm-addon-fit": "^0.8.0"
},
"devDependencies": {
"@vitejs/plugin-vue": "^5.0.2",
"naive-ui": "^2.37.0",
"naive-ui": "^2.36.0",
"prettier": "^3.1.1",
"unplugin-auto-import": "^0.17.3",
"unplugin-icons": "^0.18.1",
"unplugin-vue-components": "^0.26.0",
"vite": "^5.0.11"
"vite": "^5.0.10"
}
}

View File

@ -1 +1 @@
6dd5fc2cecb3eb5a0c7297245ac11808
bae1706c9c117d6fcce2d7bd649e127f

View File

@ -16,6 +16,7 @@ const emit = defineEmits(['edit', 'delete', 'copy', 'save', 'cancel'])
</script>
<template>
<!-- TODO: support multiple save -->
<div v-if="props.editing" class="flex-box-h edit-column-func">
<icon-button :icon="Save" @click="emit('save')" />
<icon-button :icon="Close" @click="emit('cancel')" />

View File

@ -16,7 +16,6 @@ import Pub from '@/components/icons/Pub.vue'
import ContentSlog from '@/components/content_value/ContentSlog.vue'
import { decodeTypes, formatTypes } from '@/consts/value_view_type.js'
import ContentMonitor from '@/components/content_value/ContentMonitor.vue'
import { decodeRedisKey } from '@/utils/key_convert.js'
const themeVars = useThemeVars()
@ -51,7 +50,7 @@ const tabContent = computed(() => {
subTab: tab.subTab,
type: toUpper(tab.type),
db: tab.db,
keyPath: tab.keyCode != null ? decodeRedisKey(tab.keyCode) : tab.key,
keyPath: tab.key,
keyCode: tab.keyCode,
ttl: tab.ttl,
value: tab.value,

View File

@ -61,8 +61,6 @@ const columns = computed(() => [
tooltip: {
style: {
maxWidth: '80vw',
maxHeight: '60vh',
overflowY: 'scroll',
},
},
},

View File

@ -10,10 +10,8 @@ import { useI18n } from 'vue-i18n'
import IconButton from '@/components/common/IconButton.vue'
import Copy from '@/components/icons/Copy.vue'
import { ClipboardSetText } from 'wailsjs/runtime/runtime.js'
import { computed, onUnmounted, reactive, watch } from 'vue'
import { computed } from 'vue'
import { padStart } from 'lodash'
import { NIcon, useThemeVars } from 'naive-ui'
import { timeout } from '@/utils/promise.js'
const props = defineProps({
server: String,
@ -39,12 +37,6 @@ const props = defineProps({
const emit = defineEmits(['reload', 'rename', 'delete'])
const autoRefresh = reactive({
on: false,
interval: 2,
})
const themeVars = useThemeVars()
const dialogStore = useDialog()
const i18n = useI18n()
@ -69,48 +61,6 @@ const ttlString = computed(() => {
return s
})
const startAutoRefresh = async () => {
if (autoRefresh.on) {
return
}
autoRefresh.on = true
let lastExec = Date.now()
do {
if (!autoRefresh.on) {
break
}
await timeout(100)
if (props.loading || Date.now() - lastExec < autoRefresh.interval * 1000) {
continue
}
lastExec = Date.now()
emit('reload')
} while (true)
stopAutoRefresh()
}
const stopAutoRefresh = () => {
autoRefresh.on = false
}
watch(
() => props.keyPath,
() => {
stopAutoRefresh()
autoRefresh.interval = props.interval
},
)
onUnmounted(() => stopAutoRefresh())
const onToggleRefresh = (on) => {
if (on) {
startAutoRefresh()
} else {
stopAutoRefresh()
}
}
const onCopyKey = () => {
ClipboardSetText(props.keyPath)
.then((succ) => {
@ -137,48 +87,14 @@ const onTTL = () => {
<div class="content-toolbar flex-box-h">
<n-input-group>
<redis-type-tag :binary-key="binaryKey" :type="props.keyType" size="large" />
<n-input v-model:value="props.keyPath" :title="props.keyPath" readonly @dblclick="onCopyKey">
<n-input v-model:value="props.keyPath" :title="props.keyPath" readonly>
<template #suffix>
<n-popover :delay="500" keep-alive-on-hover placement="bottom" trigger="hover">
<template #trigger>
<icon-button :loading="props.loading" size="18" @click="emit('reload')">
<n-icon :size="props.size">
<component
:is="Refresh"
:class="{ 'auto-refreshing': autoRefresh.on }"
:color="autoRefresh.on ? themeVars.primaryColor : undefined"
:stroke-width="autoRefresh.on ? 5 : 3" />
</n-icon>
</icon-button>
</template>
<n-form
:show-feedback="false"
label-align="right"
label-placement="left"
label-width="auto"
size="small">
<n-form-item :label="$t('interface.auto_refresh')">
<n-switch
:loading="props.loading"
:value="autoRefresh.on"
@update:value="onToggleRefresh" />
</n-form-item>
<n-form-item :label="$t('interface.refresh_interval')">
<n-input-number
v-model:value="autoRefresh.interval"
:autofocus="false"
:disabled="autoRefresh.on"
:max="9999"
:min="1"
:show-button="false"
style="max-width: 100px">
<template #suffix>
{{ $t('common.unit_second') }}
</template>
</n-input-number>
</n-form-item>
</n-form>
</n-popover>
<icon-button
:icon="Refresh"
:loading="props.loading"
size="18"
t-tooltip="interface.reload"
@click="emit('reload')" />
</template>
</n-input>
<icon-button :icon="Copy" border size="18" t-tooltip="interface.copy_key" @click="onCopyKey" />
@ -195,13 +111,7 @@ const onTTL = () => {
</template>
TTL{{ `${ttl > 0 ? ': ' + ttl + $t('common.second') : ''}` }}
</n-tooltip>
<icon-button
:disabled="binaryKey"
:icon="Edit"
:t-tooltip="binaryKey ? 'dialogue.rename_binary_key_fail' : 'interface.rename_key'"
border
size="18"
@click="emit('rename')" />
<icon-button :icon="Edit" border size="18" t-tooltip="interface.rename_key" @click="emit('rename')" />
</n-button-group>
<n-tooltip :show-arrow="false">
<template #trigger>
@ -221,14 +131,4 @@ const onTTL = () => {
align-items: center;
gap: 5px;
}
.auto-refreshing {
animation: rotate 2s linear infinite;
}
@keyframes rotate {
100% {
transform: rotate(360deg);
}
}
</style>

View File

@ -1,6 +1,7 @@
<script setup>
import { computed, h, reactive, ref } from 'vue'
import { useI18n } from 'vue-i18n'
import ContentToolbar from './ContentToolbar.vue'
import AddLink from '@/components/icons/AddLink.vue'
import { NButton, NIcon, useThemeVars } from 'naive-ui'
import { types, types as redisTypes } from '@/consts/support_redis_type.js'
@ -53,7 +54,7 @@ const props = defineProps({
loading: Boolean,
})
const emit = defineEmits(['loadmore', 'loadall', 'reload', 'match'])
const emit = defineEmits(['loadmore', 'loadall', 'reload', 'rename', 'delete', 'match'])
/**
*
@ -91,11 +92,8 @@ const fieldColumn = computed(() => ({
tooltip: {
style: {
maxWidth: '80vw',
maxHeight: '60vh',
overflowY: 'scroll',
},
},
lineClamp: 10,
},
filterOptionValue: fieldFilterOption.value,
className: inEdit.value ? 'clickable' : '',
@ -123,8 +121,6 @@ const valueColumn = computed(() => ({
tooltip: {
style: {
maxWidth: '80vw',
maxHeight: '60vh',
overflowY: 'scroll',
},
},
},
@ -330,7 +326,18 @@ defineExpose({
<template>
<div class="content-wrapper flex-box-v">
<slot name="toolbar" />
<content-toolbar
:db="props.db"
:key-code="props.keyCode"
:key-path="props.keyPath"
:key-type="keyType"
:loading="props.loading"
:server="props.name"
:ttl="ttl"
class="value-item-part"
@delete="emit('delete')"
@reload="emit('reload')"
@rename="emit('rename')" />
<div class="tb2 value-item-part flex-box-h">
<div class="flex-box-h">
<content-search-input

View File

@ -1,6 +1,7 @@
<script setup>
import { computed, h, reactive, ref } from 'vue'
import { useI18n } from 'vue-i18n'
import ContentToolbar from './ContentToolbar.vue'
import AddLink from '@/components/icons/AddLink.vue'
import { NButton, NIcon, useThemeVars } from 'naive-ui'
import { isEmpty, size } from 'lodash'
@ -53,7 +54,7 @@ const props = defineProps({
loading: Boolean,
})
const emit = defineEmits(['loadmore', 'loadall', 'reload', 'match'])
const emit = defineEmits(['loadmore', 'loadall', 'reload', 'rename', 'delete', 'match'])
/**
*
@ -92,8 +93,6 @@ const valueColumn = computed(() => ({
tooltip: {
style: {
maxWidth: '80vw',
maxHeight: '60vh',
overflowY: 'scroll',
},
},
},
@ -298,7 +297,18 @@ defineExpose({
<template>
<div class="content-wrapper flex-box-v">
<slot name="toolbar" />
<content-toolbar
:db="props.db"
:key-code="props.keyCode"
:key-path="props.keyPath"
:key-type="keyType"
:loading="props.loading"
:server="props.name"
:ttl="ttl"
class="value-item-part"
@delete="emit('delete')"
@reload="emit('reload')"
@rename="emit('rename')" />
<div class="tb2 value-item-part flex-box-h">
<div class="flex-box-h">
<content-search-input

View File

@ -1,6 +1,7 @@
<script setup>
import { computed, h, reactive, ref } from 'vue'
import { useI18n } from 'vue-i18n'
import ContentToolbar from './ContentToolbar.vue'
import AddLink from '@/components/icons/AddLink.vue'
import { NButton, NIcon, useThemeVars } from 'naive-ui'
import { isEmpty, size } from 'lodash'
@ -52,7 +53,7 @@ const props = defineProps({
loading: Boolean,
})
const emit = defineEmits(['loadmore', 'loadall', 'reload', 'match'])
const emit = defineEmits(['loadmore', 'loadall', 'reload', 'rename', 'delete', 'match'])
/**
*
@ -91,8 +92,6 @@ const valueColumn = computed(() => ({
tooltip: {
style: {
maxWidth: '80vw',
maxHeight: '60vh',
overflowY: 'scroll',
},
},
},
@ -295,7 +294,18 @@ defineExpose({
<template>
<div class="content-wrapper flex-box-v">
<slot name="toolbar" />
<content-toolbar
:db="props.db"
:key-code="props.keyCode"
:key-path="props.keyPath"
:key-type="keyType"
:loading="props.loading"
:server="props.name"
:ttl="ttl"
class="value-item-part"
@delete="emit('delete')"
@reload="emit('reload')"
@rename="emit('rename')" />
<div class="tb2 value-item-part flex-box-h">
<div class="flex-box-h">
<content-search-input

View File

@ -1,6 +1,7 @@
<script setup>
import { computed, h, ref } from 'vue'
import { useI18n } from 'vue-i18n'
import ContentToolbar from './ContentToolbar.vue'
import AddLink from '@/components/icons/AddLink.vue'
import { NButton, NIcon, useThemeVars } from 'naive-ui'
import { types, types as redisTypes } from '@/consts/support_redis_type.js'
@ -49,7 +50,7 @@ const props = defineProps({
loading: Boolean,
})
const emit = defineEmits(['loadmore', 'loadall', 'match'])
const emit = defineEmits(['loadmore', 'loadall', 'reload', 'rename', 'delete', 'match'])
/**
*
@ -176,7 +177,18 @@ defineExpose({
<template>
<div class="content-wrapper flex-box-v">
<slot name="toolbar" />
<content-toolbar
:db="props.db"
:key-code="props.keyCode"
:key-path="props.keyPath"
:key-type="keyType"
:loading="props.loading"
:server="props.name"
:ttl="ttl"
class="value-item-part"
@delete="emit('delete')"
@reload="emit('reload')"
@rename="emit('rename')" />
<div class="tb2 value-item-part flex-box-h">
<div class="flex-box-h">
<content-search-input

View File

@ -1,6 +1,7 @@
<script setup>
import { computed, reactive, ref, watchEffect } from 'vue'
import { useI18n } from 'vue-i18n'
import ContentToolbar from './ContentToolbar.vue'
import Copy from '@/components/icons/Copy.vue'
import Save from '@/components/icons/Save.vue'
import { useThemeVars } from 'naive-ui'
@ -33,6 +34,8 @@ const props = defineProps({
loading: Boolean,
})
const emit = defineEmits(['reload', 'rename', 'delete'])
const i18n = useI18n()
const themeVars = useThemeVars()
const prefStore = usePreferencesStore()
@ -169,7 +172,18 @@ defineExpose({
<template>
<div class="content-wrapper flex-box-v">
<slot name="toolbar" />
<content-toolbar
:db="props.db"
:key-code="keyCode"
:key-path="keyPath"
:key-type="keyType"
:loading="loading"
:server="props.name"
:ttl="ttl"
class="value-item-part"
@delete="emit('delete')"
@reload="emit('reload')"
@rename="emit('rename')" />
<div class="tb2 value-item-part flex-box-h">
<div class="flex-item-expand"></div>
<n-button-group>

View File

@ -13,7 +13,6 @@ import { isEmpty } from 'lodash'
import useDialogStore from 'stores/dialog.js'
import { decodeTypes, formatTypes } from '@/consts/value_view_type.js'
import { useI18n } from 'vue-i18n'
import ContentToolbar from '@/components/content_value/ContentToolbar.vue'
const themeVars = useThemeVars()
const browserStore = useBrowserStore()
@ -43,7 +42,6 @@ const i18n = useI18n()
* format: String,
* decode: String,
* end: Boolean
* loading: Boolean
* }>}
*/
const data = computed(() => {
@ -51,10 +49,6 @@ const data = computed(() => {
})
const initializing = ref(false)
const loading = computed(() => {
return data.value.loading === true || initializing.value
})
const binaryKey = computed(() => {
return !!data.value.keyCode
})
@ -194,7 +188,7 @@ watch(() => data.value?.keyPath, initContent)
:key-code="data.keyCode"
:key-path="data.keyPath"
:length="data.length"
:loading="loading"
:loading="data.loading === true || initializing"
:name="data.name"
:size="data.size"
:ttl="data.ttl"
@ -203,22 +197,8 @@ watch(() => data.value?.keyPath, initContent)
@loadall="onLoadAll"
@loadmore="onLoadMore"
@match="onMatch"
@reload="onReload">
<template #toolbar>
<content-toolbar
:db="data.db"
:key-code="data.keyCode"
:key-path="data.keyPath"
:key-type="data.type"
:loading="loading"
:server="data.name"
:ttl="data.ttl"
class="value-item-part"
@delete="onDelete"
@reload="onReload"
@rename="onRename" />
</template>
</component>
@reload="onReload"
@rename="onRename" />
<!-- </keep-alive>-->
</template>

View File

@ -1,6 +1,7 @@
<script setup>
import { computed, h, reactive, ref } from 'vue'
import { useI18n } from 'vue-i18n'
import ContentToolbar from './ContentToolbar.vue'
import AddLink from '@/components/icons/AddLink.vue'
import { NButton, NIcon, useThemeVars } from 'naive-ui'
import { types, types as redisTypes } from '@/consts/support_redis_type.js'
@ -52,7 +53,7 @@ const props = defineProps({
loading: Boolean,
})
const emit = defineEmits(['loadmore', 'loadall', 'reload', 'match'])
const emit = defineEmits(['loadmore', 'loadall', 'reload', 'rename', 'delete', 'match'])
/**
*
@ -140,8 +141,6 @@ const valueColumn = computed(() => ({
tooltip: {
style: {
maxWidth: '80vw',
maxHeight: '60vh',
overflowY: 'scroll',
},
},
},
@ -332,7 +331,18 @@ defineExpose({
<template>
<div class="content-wrapper flex-box-v">
<slot name="toolbar" />
<content-toolbar
:db="props.db"
:key-code="props.keyCode"
:key-path="props.keyPath"
:key-type="keyType"
:loading="props.loading"
:server="props.name"
:ttl="ttl"
class="value-item-part"
@delete="emit('delete')"
@reload="emit('reload')"
@rename="emit('rename')" />
<div class="tb2 value-item-part flex-box-h">
<div class="flex-box-h">
<content-search-input

View File

@ -13,7 +13,6 @@ import { NSpace } from 'naive-ui'
import useTabStore from 'stores/tab.js'
import NewStreamValue from '@/components/new_value/NewStreamValue.vue'
import useBrowserStore from 'stores/browser.js'
import Import from '@/components/icons/Import.vue'
const i18n = useI18n()
const newForm = reactive({
@ -65,7 +64,6 @@ const defaultValue = {
}
const dialogStore = useDialog()
const scrollRef = ref(null)
watchEffect(() => {
if (dialogStore.newKeyDialogVisible) {
const { prefix, server, db } = dialogStore.newKeyParam
@ -108,12 +106,6 @@ const renderTypeLabel = (option) => {
)
}
const onAppend = () => {
nextTick(() => {
scrollRef.value?.scrollTo({ position: 'bottom' })
})
}
const onChangeType = () => {
newForm.value = null
}
@ -143,7 +135,6 @@ const onAdd = async () => {
if (value == null) {
value = defaultValue[type]
}
// await browserStore.reloadKey({server, db, key: trim(key)})
const { success, msg, nodeKey } = await browserStore.setKey({
server,
db,
@ -156,7 +147,7 @@ const onAdd = async () => {
// select current key
await nextTick()
tabStore.setSelectedKeys(server, nodeKey)
browserStore.reloadKey({ server, db, key })
browserStore.loadKeySummary({ server, db, key, clearValue: true })
} else if (!isEmpty(msg)) {
$message.error(msg)
}
@ -170,11 +161,6 @@ const onAdd = async () => {
const onClose = () => {
dialogStore.closeNewKeyDialog()
}
const onImport = () => {
dialogStore.closeNewKeyDialog()
dialogStore.openImportKeyDialog(newForm.server, newForm.db)
}
</script>
<template>
@ -183,12 +169,18 @@ const onImport = () => {
:closable="false"
:close-on-esc="false"
:mask-closable="false"
:negative-button-props="{ size: 'medium' }"
:negative-text="$t('common.cancel')"
:positive-button-props="{ size: 'medium' }"
:positive-text="$t('common.confirm')"
:show-icon="false"
:title="$t('dialogue.key.new')"
preset="dialog"
style="width: 600px"
transform-origin="center">
<n-scrollbar ref="scrollRef" style="max-height: 500px">
transform-origin="center"
@positive-click="onAdd"
@negative-click="onClose">
<n-scrollbar style="max-height: 500px">
<n-form
ref="newFormRef"
:model="newForm"
@ -226,33 +218,10 @@ const onImport = () => {
</n-button>
</n-input-group>
</n-form-item>
<component
:is="newValueComponent[newForm.type]"
ref="subFormRef"
v-model:value="newForm.value"
@append="onAppend" />
<component :is="newValueComponent[newForm.type]" ref="subFormRef" v-model:value="newForm.value" />
<!-- TODO: Add import from txt file option -->
</n-form>
</n-scrollbar>
<template #action>
<div class="flex-item-expand">
<n-button :focusable="false" size="medium" @click="onImport">
<template #icon>
<n-icon :component="Import" />
</template>
{{ $t('interface.import_key') }}
</n-button>
</div>
<div class="flex-item n-dialog__action">
<n-button :focusable="false" size="medium" @click="onClose">
{{ $t('common.cancel') }}
</n-button>
<n-button :focusable="false" size="medium" type="primary" @click="onAdd">
{{ $t('common.confirm') }}
</n-button>
</div>
</template>
</n-modal>
</template>

View File

@ -3,7 +3,7 @@ import { computed, reactive, ref, watchEffect } from 'vue'
import useDialog from 'stores/dialog'
import useBrowserStore from 'stores/browser.js'
import { useI18n } from 'vue-i18n'
import { isEmpty } from 'lodash'
import { isEmpty, size } from 'lodash'
import TtlInput from '@/components/common/TtlInput.vue'
const ttlForm = reactive({

View File

@ -8,7 +8,7 @@ import IconButton from '@/components/common/IconButton.vue'
const props = defineProps({
value: Array,
})
const emit = defineEmits(['update:value', 'append'])
const emit = defineEmits(['update:value'])
/**
* @typedef Hash
@ -46,15 +46,7 @@ defineExpose({
@update:value="onUpdate">
<template #action="{ index, create, remove, move }">
<icon-button v-if="kvList.length > 1" :icon="Delete" size="18" @click="() => remove(index)" />
<icon-button
:icon="Add"
size="18"
@click="
() => {
create(index)
emit('append')
}
" />
<icon-button :icon="Add" size="18" @click="() => create(index)" />
</template>
</n-dynamic-input>
</n-form-item>

View File

@ -8,7 +8,7 @@ import IconButton from '@/components/common/IconButton.vue'
const props = defineProps({
value: Array,
})
const emit = defineEmits(['update:value', 'append'])
const emit = defineEmits(['update:value'])
const list = ref([''])
const onUpdate = (val) => {
@ -28,15 +28,7 @@ defineExpose({
<n-dynamic-input v-model:value="list" :placeholder="$t('dialogue.field.enter_elem')" @update:value="onUpdate">
<template #action="{ index, create, remove, move }">
<icon-button v-if="list.length > 1" :icon="Delete" size="18" @click="() => remove(index)" />
<icon-button
:icon="Add"
size="18"
@click="
() => {
create(index)
emit('append')
}
" />
<icon-button :icon="Add" size="18" @click="() => create(index)" />
</template>
</n-dynamic-input>
</n-form-item>

View File

@ -8,7 +8,7 @@ import IconButton from '@/components/common/IconButton.vue'
const props = defineProps({
value: Array,
})
const emit = defineEmits(['update:value', 'append'])
const emit = defineEmits(['update:value'])
const set = ref([''])
const onUpdate = (val) => {
@ -28,15 +28,7 @@ defineExpose({
<n-dynamic-input v-model:value="set" :placeholder="$t('dialogue.field.enter_elem')" @update:value="onUpdate">
<template #action="{ index, create, remove, move }">
<icon-button v-if="set.length > 1" :icon="Delete" size="18" @click="() => remove(index)" />
<icon-button
:icon="Add"
size="18"
@click="
() => {
create(index)
emit('append')
}
" />
<icon-button :icon="Add" size="18" @click="() => create(index)" />
</template>
</n-dynamic-input>
</n-form-item>

View File

@ -12,7 +12,7 @@ defineOptions({
inheritAttrs: false,
})
const id = ref('*')
const emit = defineEmits(['update:value', 'append'])
const emit = defineEmits(['update:value'])
/**
* @typedef Hash
@ -52,15 +52,7 @@ defineExpose({
@update:value="onUpdate">
<template #action="{ index, create, remove, move }">
<icon-button v-if="kvList.length > 1" :icon="Delete" size="18" @click="() => remove(index)" />
<icon-button
:icon="Add"
size="18"
@click="
() => {
create(index)
emit('append')
}
" />
<icon-button :icon="Add" size="18" @click="() => create(index)" />
</template>
</n-dynamic-input>
</n-form-item>

View File

@ -8,7 +8,7 @@ import IconButton from '@/components/common/IconButton.vue'
const props = defineProps({
value: Array,
})
const emit = defineEmits(['update:value', 'append'])
const emit = defineEmits(['update:value'])
/**
* @typedef ZSetItem
@ -57,15 +57,7 @@ defineExpose({
</template>
<template #action="{ index, create, remove, move }">
<icon-button v-if="zset.length > 1" :icon="Delete" size="18" @click="() => remove(index)" />
<icon-button
:icon="Add"
size="18"
@click="
() => {
create(index)
emit('append')
}
" />
<icon-button :icon="Add" size="18" @click="() => create(index)" />
</template>
</n-dynamic-input>
</n-form-item>

View File

@ -25,6 +25,7 @@ import More from '@/components/icons/More.vue'
import Export from '@/components/icons/Export.vue'
import { ConnectionType } from '@/consts/connection_type.js'
import Import from '@/components/icons/Import.vue'
import Down from '@/components/icons/Down.vue'
import Checkbox from '@/components/icons/Checkbox.vue'
import Timer from '@/components/icons/Timer.vue'
@ -64,8 +65,12 @@ const dbSelectOptions = computed(() => {
})
})
const moreOptions = computed(() => [
const addOptions = computed(() => [
{ key: 'import', label: i18n.t('interface.import_key'), icon: render.renderIcon(Import, { strokeWidth: 3.5 }) },
])
const moreOptions = computed(() => [
// { key: 'import', label: i18n.t('interface.import_key'), icon: render.renderIcon(Import, { strokeWidth: 3.5 }) },
{ key: 'flush', label: i18n.t('interface.flush_db'), icon: render.renderIcon(Delete, { strokeWidth: 3.5 }) },
{ key: 'divider', type: 'divider' },
{
@ -96,9 +101,10 @@ const checkedTip = computed(() => {
const onReload = async () => {
try {
loading.value = true
// tabStore.setSelectedKeys(props.server)
tabStore.setSelectedKeys(props.server)
const db = props.db
browserStore.closeDatabase(props.server, db)
// browserTreeRef.value?.resetExpandKey(props.server, db)
let matchType = unref(filterForm.type)
if (!types.hasOwnProperty(matchType)) {
@ -194,6 +200,7 @@ const handleSelectDB = async (db) => {
await nextTick()
await connectionStore.saveLastDB(props.server, db)
tabStore.upsertTab({ server: props.server, db, clearValue: true })
// browserTreeRef.value?.resetExpandKey(props.server, db)
fullyLoaded.value = await browserStore.loadMoreKeys(props.server, db)
browserTreeRef.value?.refreshTree()
tabStore.setSelectedKeys(props.server)
@ -266,16 +273,16 @@ watch(
<redis-type-selector v-model:value="filterForm.type" @update:value="onSelectFilterType" />
</template>
</content-search-input>
<icon-button
:disabled="loading"
:icon="Refresh"
border
size="18"
small
stroke-width="4"
t-tooltip="interface.reload"
@click="onReload" />
<n-button-group>
<icon-button
:disabled="loading"
:icon="Refresh"
border
size="18"
small
stroke-width="4"
t-tooltip="interface.reload"
@click="onReload" />
<icon-button
:disabled="loading"
:icon="Plus"
@ -285,6 +292,18 @@ watch(
stroke-width="4"
t-tooltip="interface.new_key"
@click="onAddKey" />
<n-dropdown
:options="addOptions"
placement="bottom-end"
style="min-width: 130px"
trigger="click"
@select="onSelectOptions">
<n-button :focusable="false" size="small" style="padding: 0 3px">
<n-icon size="10">
<down :stroke-width="6" />
</n-icon>
</n-button>
</n-dropdown>
</n-button-group>
</div>

View File

@ -1,11 +1,11 @@
<script setup>
import { computed, h, nextTick, reactive, ref, watchEffect } from 'vue'
import { ConnectionType } from '@/consts/connection_type.js'
import { NIcon, NSpace, NText, useThemeVars } from 'naive-ui'
import { NIcon, NSpace, useThemeVars } from 'naive-ui'
import Key from '@/components/icons/Key.vue'
import Binary from '@/components/icons/Binary.vue'
import Database from '@/components/icons/Database.vue'
import { filter, find, get, includes, isEmpty, map, size, toUpper } from 'lodash'
import { filter, find, get, includes, indexOf, isEmpty, map, remove, size, startsWith, toUpper } from 'lodash'
import { useI18n } from 'vue-i18n'
import Refresh from '@/components/icons/Refresh.vue'
import CopyLink from '@/components/icons/CopyLink.vue'
@ -40,24 +40,14 @@ const props = defineProps({
const themeVars = useThemeVars()
const render = useRender()
const i18n = useI18n()
/** @type {Ref<UnwrapRef<string[]>>} */
const expandedKeys = ref([])
const connectionStore = useConnectionStore()
const browserStore = useBrowserStore()
const prefStore = usePreferencesStore()
const tabStore = useTabStore()
const dialogStore = useDialogStore()
/**
*
* @type {ComputedRef<string[]>}
*/
const expandedKeys = computed(() => {
const tab = find(tabStore.tabList, { name: props.server })
if (tab != null) {
return get(tab, 'expandedKeys', [])
}
return []
})
/**
*
* @type {ComputedRef<string[]>}
@ -178,6 +168,31 @@ const renderContextLabel = (option) => {
return h('div', { class: 'context-menu-item' }, option.label)
}
/**
*
* @param {string} key
* @param {boolean} [toggle]
*/
const expandKey = (key, toggle) => {
const idx = indexOf(expandedKeys.value, key)
if (idx === -1) {
expandedKeys.value.push(key)
} else if (toggle !== false) {
expandedKeys.value.splice(idx, 1)
}
}
const resetExpandKey = (server, db, includeDB) => {
const prefix = `${server}/db${db}`
remove(expandedKeys.value, (k) => {
if (!!!includeDB) {
return k !== prefix && startsWith(k, prefix)
} else {
return startsWith(k, prefix)
}
})
}
const handleSelectContextMenu = (key) => {
contextMenuParam.show = false
const selectedKey = get(selectedKeys.value, 0)
@ -276,14 +291,14 @@ const onUpdateSelectedKeys = (keys, options) => {
}
}
// default is load blank key to display server status
// tabStore.openBlank(props.server)
tabStore.openBlank(props.server, props.db)
} finally {
tabStore.setSelectedKeys(props.server, keys)
}
}
const onUpdateExpanded = (value, option, meta) => {
tabStore.setExpandedKeys(props.server, value)
expandedKeys.value = value
if (!meta.node) {
return
}
@ -295,13 +310,13 @@ const onUpdateExpanded = (value, option, meta) => {
switch (meta.action) {
case 'expand':
node.expanded = true
if (!includes(value, key)) {
tabStore.addExpandedKey(props.server, key)
if (!includes(expandedKeys.value, key)) {
expandedKeys.value.push(key)
}
break
case 'collapse':
node.expanded = false
tabStore.removeExpandedKey(props.server, key)
remove(expandedKeys.value, (v) => v === key)
break
}
node = node.children[0]
@ -359,7 +374,8 @@ const renderPrefix = ({ option }) => {
browserStore.loadKeyType({
server: props.server,
db: option.db,
key: option.redisKeyCode || option.redisKey,
key: option.redisKey,
keyCode: option.redisKeyCode,
})
}
switch (prefStore.keyIconType) {
@ -396,13 +412,6 @@ const renderPrefix = ({ option }) => {
const renderLabel = ({ option }) => {
switch (option.type) {
case ConnectionType.RedisKey:
if (option.label === '') {
// blank label name
return h('div', [
h(NText, { italic: true, depth: 3 }, () => '[Empty]'),
h('span', () => ` (${option.keyCount || 0})`),
])
}
return `${option.label} (${option.keyCount || 0})`
// case ConnectionType.RedisValue:
// return `[${option.keyType}]${option.label}`
@ -516,8 +525,8 @@ const nodeProps = ({ option }) => {
return
}
if (!props.checkMode) {
// default handle is toggle expand current node
nextTick().then(() => tabStore.toggleExpandKey(props.server, option.key))
// default handle is expand current node
nextTick().then(() => expandKey(option.key))
}
},
onContextmenu(e) {
@ -549,7 +558,7 @@ watchEffect(
if (!props.checkMode) {
tabStore.setCheckedKeys(props.server)
} else {
tabStore.addExpandedKey(props.server, `${ConnectionType.RedisDB}`)
expandKey(`${ConnectionType.RedisDB}`, false)
}
},
{ flush: 'post' },
@ -560,9 +569,10 @@ watchEffect(
const treeKey = ref(0)
defineExpose({
handleSelectContextMenu,
resetExpandKey,
refreshTree: () => {
treeKey.value = Date.now()
tabStore.setExpandedKeys(props.server)
expandedKeys.value = []
tabStore.setCheckedKeys(props.server)
},
deleteCheckedItems: () => {

View File

@ -246,12 +246,12 @@ const getServerMenu = (connected) => {
const getGroupMenu = () => {
return [
h(IconButton, {
tTooltip: 'interface.rename_conn_group',
tTooltip: 'interface.edit_conn',
icon: Config,
onClick: () => handleSelectContextMenu('group_rename'),
}),
h(IconButton, {
tTooltip: 'interface.remove_conn_group',
tTooltip: 'interface.remove_conn',
icon: Delete,
onClick: () => handleSelectContextMenu('group_delete'),
}),

View File

@ -13,10 +13,9 @@
"minute": "Minutes(s)",
"hour": "Hour(s)",
"day": "Day(s)",
"unit_day": "d",
"unit_hour": "h",
"unit_minute": "m",
"unit_second": "s",
"unit_day": "D",
"unit_hour": "H",
"unit_minute": "M",
"all": "All",
"key": "Key",
"value": "Value",
@ -71,15 +70,15 @@
"dup_conn": "Duplicate Connection",
"remove_conn": "Delete Connection",
"edit_conn": "Edit Connection Config",
"edit_conn_group": "Edit Group",
"rename_conn_group": "Rename Group",
"remove_conn_group": "Delete Group",
"edit_conn_group": "Edit Connection Group",
"rename_conn_group": "Rename Connection Group",
"remove_conn_group": "Delete Connection Group",
"ttl": "TTL",
"forever": "Forever",
"rename_key": "Rename Key",
"delete_key": "Delete Key",
"batch_delete_key": "Batch Delete Keys",
"import_key": "Import Key(s)",
"import_key": "Import Key",
"flush_db": "Flush Database",
"check_mode": "Check Mode",
"quit_check_mode": "Quit Check Mode",
@ -109,8 +108,6 @@
"decode_with": "Decode / Decompression",
"reload": "Reload",
"reload_disable": "Reload will enable after full loaded",
"auto_refresh": "Auto Refresh",
"refresh_interval": "Refresh Interval",
"open_connection": "Open Connection",
"copy_path": "Copy Path",
"copy_key": "Copy Key",

View File

@ -10,13 +10,12 @@
"update": "更新",
"none": "无",
"second": "秒",
"minute": "分",
"minute": "分",
"hour": "小时",
"day": "天",
"unit_day": "天",
"unit_hour": "小时",
"unit_minute": "分钟",
"unit_second": "秒",
"all": "全部",
"key": "键",
"value": "值",
@ -71,9 +70,9 @@
"dup_conn": "复制连接",
"remove_conn": "删除连接",
"edit_conn": "编辑连接配置",
"edit_conn_group": "编辑分组",
"rename_conn_group": "重命名分组",
"remove_conn_group": "删除分组",
"edit_conn_group": "编辑连接分组",
"rename_conn_group": "重命名连接分组",
"remove_conn_group": "删除连接分组",
"ttl": "TTL",
"forever": "永久",
"rename_key": "重命名键",
@ -109,8 +108,6 @@
"decode_with": "解码/解压方式",
"reload": "重新载入",
"reload_disable": "全量加载后可重新载入",
"auto_refresh": "自动刷新",
"refresh_interval": "刷新间隔",
"open_connection": "打开连接",
"copy_path": "复制路径",
"copy_key": "复制键名",

View File

@ -52,7 +52,7 @@ export class RedisServerState {
this.getRoot()
const connStore = useConnectionStore()
const keySeparator = connStore.getDefaultSeparator(name)
const { keySeparator } = connStore.getDefaultSeparator(name)
this.separator = isEmpty(keySeparator) ? ':' : keySeparator
}
@ -246,8 +246,8 @@ export class RedisServerState {
/**
* rename key to a new name
* @param {string} key
* @param {string} newKey
* @param key
* @param newKey
*/
renameKey(key, newKey) {
const oldLayer = initial(key.split(this.separator)).join(this.separator)
@ -265,11 +265,7 @@ export class RedisServerState {
const newNodeKeyName = `${ConnectionType.RedisValue}/${newKey}`
const keyNode = this.nodeMap.get(oldNodeKeyName)
keyNode.key = `${this.name}/db${this.db}#${newNodeKeyName}`
if (this.viewType === KeyViewType.Tree) {
keyNode.label = last(split(newKey, this.separator))
} else {
keyNode.label = newKey
}
keyNode.label = last(split(newKey, this.separator))
keyNode.redisKey = newKey
// not support rename binary key name yet
// keyNode.redisKeyCode = []

View File

@ -16,7 +16,6 @@ export class TabItem {
* @param {string} subTab secondary tab value
* @param {string} [title] tab title
* @param {string} [icon] tab icon
* @param {string[]} expandedKeys
* @param {string[]} selectedKeys
* @param {CheckedKey[]} checkedKeys
* @param {string} [type] key type
@ -40,9 +39,8 @@ export class TabItem {
blank,
subTab,
icon,
expandedKeys = [],
selectedKeys = [],
checkedKeys = [],
selectedKeys,
checkedKeys,
type,
value,
server,
@ -63,7 +61,6 @@ export class TabItem {
this.blank = blank
this.subTab = subTab
this.icon = icon
this.expandedKeys = expandedKeys
this.selectedKeys = selectedKeys
this.checkedKeys = checkedKeys
this.type = type

View File

@ -245,7 +245,6 @@ const useBrowserStore = defineStore('browser', {
name,
separator: this.getSeparator(name),
db: -1,
viewType: view,
})
/** @type {Object.<number,RedisDatabaseItem>} **/
const databases = {}
@ -380,7 +379,7 @@ const useBrowserStore = defineStore('browser', {
})
if (success) {
const { type, ttl, size, length } = data
const k = nativeRedisKey(key)
const k = decodeRedisKey(key)
const binaryKey = k !== key
tab.upsertTab({
subTab: BrowserTabType.KeyDetail,
@ -427,23 +426,23 @@ const useBrowserStore = defineStore('browser', {
* load key type
* @param {string} server
* @param {number} db
* @param {string|number[]} key
* @param {string} key
* @param {number[]} keyCode
* @return {Promise<void>}
*/
async loadKeyType({ server, db, key }) {
async loadKeyType({ server, db, key, keyCode }) {
/** @type {RedisServerState} **/
const serverInst = this.servers[server]
if (serverInst == null) {
return
}
const node = serverInst.getNode(ConnectionType.RedisValue, nativeRedisKey(key))
const node = serverInst.getNode(ConnectionType.RedisValue, key)
if (node == null || !isEmpty(node.redisType)) {
return
}
try {
node.redisType = 'loading'
const { data, success, msg } = await GetKeyType({ server, db, key })
const { data, success } = await GetKeyType({ server, db, key: keyCode || key })
if (success) {
const { type } = data || {}
node.redisType = type
@ -505,19 +504,11 @@ const useBrowserStore = defineStore('browser', {
lite: true,
})
if (success) {
const {
value,
keyType,
decode: retDecode,
format: retFormat,
match: retMatch,
reset: retReset,
end,
} = data
const { value, decode: retDecode, format: retFormat, match: retMatch, reset: retReset, end } = data
tab.updateValue({
server,
db,
key: nativeRedisKey(key),
key: decodeRedisKey(key),
value,
decode: retDecode,
format: retFormat,
@ -766,10 +757,10 @@ const useBrowserStore = defineStore('browser', {
serverInst.updateDBKeyCount(db, newKey)
}
}
// const tab = useTabStore()
// tab.updateValue({ server, db, key, value })
const tab = useTabStore()
tab.updateValue({ server, db, key, value })
// this.loadKeySummary({ server, db, key })
this.loadKeySummary({ server, db, key })
return {
success,
nodeKey: `${server}/db${db}#${ConnectionType.RedisValue}/${key}`,
@ -1506,7 +1497,7 @@ const useBrowserStore = defineStore('browser', {
tabStore.updateTTL({
server,
db,
key: nativeRedisKey(key),
key,
ttl,
})
}
@ -1815,7 +1806,6 @@ const useBrowserStore = defineStore('browser', {
tab.emptyTab(server)
tab.setSelectedKeys(server)
tab.setCheckedKeys(server)
tab.setExpandedKeys(server)
return true
}
} finally {

View File

@ -364,8 +364,8 @@ const useConnectionStore = defineStore('connections', {
* @return {string}
*/
getDefaultSeparator(name) {
const { keySeparator = ':' } = this.serverProfile[name] || {}
return keySeparator
const { defaultSeparator = ':' } = this.serverProfile[name] || {}
return defaultSeparator
},
},
})

View File

@ -1,6 +1,7 @@
import { assign, find, findIndex, get, indexOf, isEmpty, pullAt, remove, set, size } from 'lodash'
import { assign, find, findIndex, get, isEmpty, pullAt, remove, set, size } from 'lodash'
import { defineStore } from 'pinia'
import { TabItem } from '@/objects/tabItem.js'
import { decodeRedisKey } from '@/utils/key_convert.js'
const useTabStore = defineStore('tab', {
/**
@ -542,11 +543,11 @@ const useTabStore = defineStore('tab', {
* update ttl in tab
* @param {string} server
* @param {number} db
* @param {string} key
* @param {string|number[]} key
* @param {number} ttl
*/
updateTTL({ server, db, key, ttl }) {
let tab = find(this.tabList, { name: server, db, key })
let tab = find(this.tabList, { name: server, db, key: decodeRedisKey(key) })
if (tab == null) {
return
}
@ -637,73 +638,11 @@ const useTabStore = defineStore('tab', {
},
/**
* set expanded keys for server
* @param {string} server
* @param {string[]} keys
*/
setExpandedKeys(server, keys = []) {
/** @type TabItem**/
let tab = find(this.tabList, { name: server })
if (tab != null) {
if (isEmpty(keys)) {
tab.expandedKeys = []
} else {
tab.expandedKeys = keys
}
}
},
/**
*
* @param {string} server
* @param {string} key
*/
addExpandedKey(server, key) {
/** @type TabItem**/
let tab = find(this.tabList, { name: server })
if (tab != null) {
tab.expandedKeys.push(key)
}
},
/**
*
* @param {string} server
* @param {string} key
*/
toggleExpandKey(server, key) {
/** @type TabItem**/
let tab = find(this.tabList, { name: server })
if (tab != null) {
const idx = indexOf(tab.expandedKeys, key)
if (idx === -1) {
tab.expandedKeys.push(key)
} else {
tab.expandedKeys.splice(idx, 1)
}
}
},
/**
*
* @param {string} server
* @param {string} key
*/
removeExpandedKey(server, key) {
/** @type TabItem**/
let tab = find(this.tabList, { name: server })
if (tab != null) {
remove(tab.expandedKeys, (v) => v === key)
}
},
/**
* set selected keys for server
* set selected keys in current display browser tree
* @param {string} server
* @param {string|string[]} [keys]
*/
setSelectedKeys(server, keys = null) {
/** @type TabItem**/
let tab = find(this.tabList, { name: server })
if (tab != null) {
if (keys == null) {
@ -723,7 +662,6 @@ const useTabStore = defineStore('tab', {
* @returns {CheckedKey[]}
*/
getCheckedKeys(server) {
/** @type TabItem**/
let tab = find(this.tabList, { name: server })
if (tab != null) {
return tab.checkedKeys || []
@ -732,12 +670,11 @@ const useTabStore = defineStore('tab', {
},
/**
* set checked keys for server
* set checked keys in current display browser tree
* @param {string} server
* @param {CheckedKey[]} [keys]
*/
setCheckedKeys(server, keys = null) {
/** @type TabItem**/
let tab = find(this.tabList, { name: server })
if (tab != null) {
if (isEmpty(keys)) {

View File

@ -91,9 +91,6 @@ const _darkThemeOverrides = {
Dropdown: {
color: '#272727',
},
Popover: {
color: '#2C2C32',
},
}
export const darkThemeOverrides = merge({}, themeOverrides, _darkThemeOverrides)