Compare commits

..

No commits in common. "379bb5e623983695cd52df88b493bff8fb8091de" and "2f2fa6bb02c96daa286520542cce59a9ce5c6134" have entirely different histories.

16 changed files with 211 additions and 499 deletions

View File

@ -1122,9 +1122,9 @@ func (b *browserService) SetKeyValue(param types.SetKeyParam) (resp types.JSResp
return return
} }
resp.Success = true resp.Success = true
//resp.Data = map[string]any{ resp.Data = map[string]any{
// "value": param.Value, "value": param.Value,
//} }
return return
} }

View File

@ -12,10 +12,9 @@
"dayjs": "^1.11.10", "dayjs": "^1.11.10",
"highlight.js": "^11.9.0", "highlight.js": "^11.9.0",
"lodash": "^4.17.21", "lodash": "^4.17.21",
"monaco-editor": "^0.44.0",
"pinia": "^2.1.7", "pinia": "^2.1.7",
"sass": "^1.69.5", "sass": "^1.69.5",
"vue": "^3.3.9", "vue": "^3.3.8",
"vue-i18n": "^9.7.1", "vue-i18n": "^9.7.1",
"xterm": "^5.3.0", "xterm": "^5.3.0",
"xterm-addon-fit": "^0.8.0" "xterm-addon-fit": "^0.8.0"
@ -47,9 +46,9 @@
"dev": true "dev": true
}, },
"node_modules/@babel/parser": { "node_modules/@babel/parser": {
"version": "7.23.4", "version": "7.23.0",
"resolved": "https://registry.npmmirror.com/@babel/parser/-/parser-7.23.4.tgz", "resolved": "https://registry.npmmirror.com/@babel/parser/-/parser-7.23.0.tgz",
"integrity": "sha512-vf3Xna6UEprW+7t6EtOmFpHNAuxw3xqPZghy+brsnusscJRW5BMUzzHZc5ICjULee81WeUV2jjakG09MDglJXQ==", "integrity": "sha512-vvPKKdMemU85V9WE/l5wZEmImpCtLqbnTvqDS2U1fJ96KrxoW7KrXhNsNCblQlg8Ck4b85yxdTyelsMUgFUXiw==",
"bin": { "bin": {
"parser": "bin/babel-parser.js" "parser": "bin/babel-parser.js"
}, },
@ -762,36 +761,36 @@
} }
}, },
"node_modules/@vue/compiler-core": { "node_modules/@vue/compiler-core": {
"version": "3.3.9", "version": "3.3.8",
"resolved": "https://registry.npmmirror.com/@vue/compiler-core/-/compiler-core-3.3.9.tgz", "resolved": "https://registry.npmmirror.com/@vue/compiler-core/-/compiler-core-3.3.8.tgz",
"integrity": "sha512-+/Lf68Vr/nFBA6ol4xOtJrW+BQWv3QWKfRwGSm70jtXwfhZNF4R/eRgyVJYoxFRhdCTk/F6g99BP0ffPgZihfQ==", "integrity": "sha512-hN/NNBUECw8SusQvDSqqcVv6gWq8L6iAktUR0UF3vGu2OhzRqcOiAno0FmBJWwxhYEXRlQJT5XnoKsVq1WZx4g==",
"dependencies": { "dependencies": {
"@babel/parser": "^7.23.3", "@babel/parser": "^7.23.0",
"@vue/shared": "3.3.9", "@vue/shared": "3.3.8",
"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.9", "version": "3.3.8",
"resolved": "https://registry.npmmirror.com/@vue/compiler-dom/-/compiler-dom-3.3.9.tgz", "resolved": "https://registry.npmmirror.com/@vue/compiler-dom/-/compiler-dom-3.3.8.tgz",
"integrity": "sha512-nfWubTtLXuT4iBeDSZ5J3m218MjOy42Vp2pmKVuBKo2/BLcrFUX8nCSr/bKRFiJ32R8qbdnnnBgRn9AdU5v0Sg==", "integrity": "sha512-+PPtv+p/nWDd0AvJu3w8HS0RIm/C6VGBIRe24b9hSyNWOAPEUosFZ5diwawwP8ip5sJ8n0Pe87TNNNHnvjs0FQ==",
"dependencies": { "dependencies": {
"@vue/compiler-core": "3.3.9", "@vue/compiler-core": "3.3.8",
"@vue/shared": "3.3.9" "@vue/shared": "3.3.8"
} }
}, },
"node_modules/@vue/compiler-sfc": { "node_modules/@vue/compiler-sfc": {
"version": "3.3.9", "version": "3.3.8",
"resolved": "https://registry.npmmirror.com/@vue/compiler-sfc/-/compiler-sfc-3.3.9.tgz", "resolved": "https://registry.npmmirror.com/@vue/compiler-sfc/-/compiler-sfc-3.3.8.tgz",
"integrity": "sha512-wy0CNc8z4ihoDzjASCOCsQuzW0A/HP27+0MDSSICMjVIFzk/rFViezkR3dzH+miS2NDEz8ywMdbjO5ylhOLI2A==", "integrity": "sha512-WMzbUrlTjfYF8joyT84HfwwXo+8WPALuPxhy+BZ6R4Aafls+jDBnSz8PDz60uFhuqFbl3HxRfxvDzrUf3THwpA==",
"dependencies": { "dependencies": {
"@babel/parser": "^7.23.3", "@babel/parser": "^7.23.0",
"@vue/compiler-core": "3.3.9", "@vue/compiler-core": "3.3.8",
"@vue/compiler-dom": "3.3.9", "@vue/compiler-dom": "3.3.8",
"@vue/compiler-ssr": "3.3.9", "@vue/compiler-ssr": "3.3.8",
"@vue/reactivity-transform": "3.3.9", "@vue/reactivity-transform": "3.3.8",
"@vue/shared": "3.3.9", "@vue/shared": "3.3.8",
"estree-walker": "^2.0.2", "estree-walker": "^2.0.2",
"magic-string": "^0.30.5", "magic-string": "^0.30.5",
"postcss": "^8.4.31", "postcss": "^8.4.31",
@ -799,12 +798,12 @@
} }
}, },
"node_modules/@vue/compiler-ssr": { "node_modules/@vue/compiler-ssr": {
"version": "3.3.9", "version": "3.3.8",
"resolved": "https://registry.npmmirror.com/@vue/compiler-ssr/-/compiler-ssr-3.3.9.tgz", "resolved": "https://registry.npmmirror.com/@vue/compiler-ssr/-/compiler-ssr-3.3.8.tgz",
"integrity": "sha512-NO5oobAw78R0G4SODY5A502MGnDNiDjf6qvhn7zD7TJGc8XDeIEw4fg6JU705jZ/YhuokBKz0A5a/FL/XZU73g==", "integrity": "sha512-hXCqQL/15kMVDBuoBYpUnSYT8doDNwsjvm3jTefnXr+ytn294ySnT8NlsFHmTgKNjwpuFy7XVV8yTeLtNl/P6w==",
"dependencies": { "dependencies": {
"@vue/compiler-dom": "3.3.9", "@vue/compiler-dom": "3.3.8",
"@vue/shared": "3.3.9" "@vue/shared": "3.3.8"
} }
}, },
"node_modules/@vue/devtools-api": { "node_modules/@vue/devtools-api": {
@ -813,41 +812,41 @@
"integrity": "sha512-o9KfBeaBmCKl10usN4crU53fYtC1r7jJwdGKjPT24t348rHxgfpZ0xL3Xm/gLUYnc0oTp8LAmrxOeLyu6tbk2Q==" "integrity": "sha512-o9KfBeaBmCKl10usN4crU53fYtC1r7jJwdGKjPT24t348rHxgfpZ0xL3Xm/gLUYnc0oTp8LAmrxOeLyu6tbk2Q=="
}, },
"node_modules/@vue/reactivity": { "node_modules/@vue/reactivity": {
"version": "3.3.9", "version": "3.3.8",
"resolved": "https://registry.npmmirror.com/@vue/reactivity/-/reactivity-3.3.9.tgz", "resolved": "https://registry.npmmirror.com/@vue/reactivity/-/reactivity-3.3.8.tgz",
"integrity": "sha512-VmpIqlNp+aYDg2X0xQhJqHx9YguOmz2UxuUJDckBdQCNkipJvfk9yA75woLWElCa0Jtyec3lAAt49GO0izsphw==", "integrity": "sha512-ctLWitmFBu6mtddPyOKpHg8+5ahouoTCRtmAHZAXmolDtuZXfjL2T3OJ6DL6ezBPQB1SmMnpzjiWjCiMYmpIuw==",
"dependencies": { "dependencies": {
"@vue/shared": "3.3.9" "@vue/shared": "3.3.8"
} }
}, },
"node_modules/@vue/reactivity-transform": { "node_modules/@vue/reactivity-transform": {
"version": "3.3.9", "version": "3.3.8",
"resolved": "https://registry.npmmirror.com/@vue/reactivity-transform/-/reactivity-transform-3.3.9.tgz", "resolved": "https://registry.npmmirror.com/@vue/reactivity-transform/-/reactivity-transform-3.3.8.tgz",
"integrity": "sha512-HnUFm7Ry6dFa4Lp63DAxTixUp8opMtQr6RxQCpDI1vlh12rkGIeYqMvJtK+IKyEfEOa2I9oCkD1mmsPdaGpdVg==", "integrity": "sha512-49CvBzmZNtcHua0XJ7GdGifM8GOXoUMOX4dD40Y5DxI3R8OUhMlvf2nvgUAcPxaXiV5MQQ1Nwy09ADpnLQUqRw==",
"dependencies": { "dependencies": {
"@babel/parser": "^7.23.3", "@babel/parser": "^7.23.0",
"@vue/compiler-core": "3.3.9", "@vue/compiler-core": "3.3.8",
"@vue/shared": "3.3.9", "@vue/shared": "3.3.8",
"estree-walker": "^2.0.2", "estree-walker": "^2.0.2",
"magic-string": "^0.30.5" "magic-string": "^0.30.5"
} }
}, },
"node_modules/@vue/runtime-core": { "node_modules/@vue/runtime-core": {
"version": "3.3.9", "version": "3.3.8",
"resolved": "https://registry.npmmirror.com/@vue/runtime-core/-/runtime-core-3.3.9.tgz", "resolved": "https://registry.npmmirror.com/@vue/runtime-core/-/runtime-core-3.3.8.tgz",
"integrity": "sha512-xxaG9KvPm3GTRuM4ZyU8Tc+pMVzcu6eeoSRQJ9IE7NmCcClW6z4B3Ij6L4EDl80sxe/arTtQ6YmgiO4UZqRc+w==", "integrity": "sha512-qurzOlb6q26KWQ/8IShHkMDOuJkQnQcTIp1sdP4I9MbCf9FJeGVRXJFr2mF+6bXh/3Zjr9TDgURXrsCr9bfjUw==",
"dependencies": { "dependencies": {
"@vue/reactivity": "3.3.9", "@vue/reactivity": "3.3.8",
"@vue/shared": "3.3.9" "@vue/shared": "3.3.8"
} }
}, },
"node_modules/@vue/runtime-dom": { "node_modules/@vue/runtime-dom": {
"version": "3.3.9", "version": "3.3.8",
"resolved": "https://registry.npmmirror.com/@vue/runtime-dom/-/runtime-dom-3.3.9.tgz", "resolved": "https://registry.npmmirror.com/@vue/runtime-dom/-/runtime-dom-3.3.8.tgz",
"integrity": "sha512-e7LIfcxYSWbV6BK1wQv9qJyxprC75EvSqF/kQKe6bdZEDNValzeRXEVgiX7AHI6hZ59HA4h7WT5CGvm69vzJTQ==", "integrity": "sha512-Noy5yM5UIf9UeFoowBVgghyGGPIDPy1Qlqt0yVsUdAVbqI8eeMSsTqBtauaEoT2UFXUk5S64aWVNJN4MJ2vRdA==",
"dependencies": { "dependencies": {
"@vue/runtime-core": "3.3.9", "@vue/runtime-core": "3.3.8",
"@vue/shared": "3.3.9", "@vue/shared": "3.3.8",
"csstype": "^3.1.2" "csstype": "^3.1.2"
} }
}, },
@ -857,21 +856,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.9", "version": "3.3.8",
"resolved": "https://registry.npmmirror.com/@vue/server-renderer/-/server-renderer-3.3.9.tgz", "resolved": "https://registry.npmmirror.com/@vue/server-renderer/-/server-renderer-3.3.8.tgz",
"integrity": "sha512-w0zT/s5l3Oa3ZjtLW88eO4uV6AQFqU8X5GOgzq7SkQQu6vVr+8tfm+OI2kDBplS/W/XgCBuFXiPw6T5EdwXP0A==", "integrity": "sha512-zVCUw7RFskvPuNlPn/8xISbrf0zTWsTSdYTsUTN1ERGGZGVnRxM2QZ3x1OR32+vwkkCm0IW6HmJ49IsPm7ilLg==",
"dependencies": { "dependencies": {
"@vue/compiler-ssr": "3.3.9", "@vue/compiler-ssr": "3.3.8",
"@vue/shared": "3.3.9" "@vue/shared": "3.3.8"
}, },
"peerDependencies": { "peerDependencies": {
"vue": "3.3.9" "vue": "3.3.8"
} }
}, },
"node_modules/@vue/shared": { "node_modules/@vue/shared": {
"version": "3.3.9", "version": "3.3.8",
"resolved": "https://registry.npmmirror.com/@vue/shared/-/shared-3.3.9.tgz", "resolved": "https://registry.npmmirror.com/@vue/shared/-/shared-3.3.8.tgz",
"integrity": "sha512-ZE0VTIR0LmYgeyhurPTpy4KzKsuDyQbMSdM49eKkMnT5X4VfFBLysMzjIZhLEFQYjjOVVfbvUDHckwjDFiO2eA==" "integrity": "sha512-8PGwybFwM4x8pcfgqEQFy70NaQxASvOC5DJwLQfpArw1UDfUXrJkdxD3BhVTMS+0Lef/TU7YO0Jvr0jJY8T+mw=="
}, },
"node_modules/acorn": { "node_modules/acorn": {
"version": "8.10.0", "version": "8.10.0",
@ -1415,11 +1414,6 @@
"ufo": "^1.3.0" "ufo": "^1.3.0"
} }
}, },
"node_modules/monaco-editor": {
"version": "0.44.0",
"resolved": "https://registry.npmmirror.com/monaco-editor/-/monaco-editor-0.44.0.tgz",
"integrity": "sha512-5SmjNStN6bSuSE5WPT2ZV+iYn1/yI9sd4Igtk23ChvqB7kDk9lZbB9F5frsuvpB+2njdIeGGFf2G4gbE6rCC9Q=="
},
"node_modules/ms": { "node_modules/ms": {
"version": "2.1.2", "version": "2.1.2",
"resolved": "https://registry.npmmirror.com/ms/-/ms-2.1.2.tgz", "resolved": "https://registry.npmmirror.com/ms/-/ms-2.1.2.tgz",
@ -2080,15 +2074,15 @@
} }
}, },
"node_modules/vue": { "node_modules/vue": {
"version": "3.3.9", "version": "3.3.8",
"resolved": "https://registry.npmmirror.com/vue/-/vue-3.3.9.tgz", "resolved": "https://registry.npmmirror.com/vue/-/vue-3.3.8.tgz",
"integrity": "sha512-sy5sLCTR8m6tvUk1/ijri3Yqzgpdsmxgj6n6yl7GXXCXqVbmW2RCXe9atE4cEI6Iv7L89v5f35fZRRr5dChP9w==", "integrity": "sha512-5VSX/3DabBikOXMsxzlW8JyfeLKlG9mzqnWgLQLty88vdZL7ZJgrdgBOmrArwxiLtmS+lNNpPcBYqrhE6TQW5w==",
"dependencies": { "dependencies": {
"@vue/compiler-dom": "3.3.9", "@vue/compiler-dom": "3.3.8",
"@vue/compiler-sfc": "3.3.9", "@vue/compiler-sfc": "3.3.8",
"@vue/runtime-dom": "3.3.9", "@vue/runtime-dom": "3.3.8",
"@vue/server-renderer": "3.3.9", "@vue/server-renderer": "3.3.8",
"@vue/shared": "3.3.9" "@vue/shared": "3.3.8"
}, },
"peerDependencies": { "peerDependencies": {
"typescript": "*" "typescript": "*"
@ -2204,9 +2198,9 @@
"dev": true "dev": true
}, },
"@babel/parser": { "@babel/parser": {
"version": "7.23.4", "version": "7.23.0",
"resolved": "https://registry.npmmirror.com/@babel/parser/-/parser-7.23.4.tgz", "resolved": "https://registry.npmmirror.com/@babel/parser/-/parser-7.23.0.tgz",
"integrity": "sha512-vf3Xna6UEprW+7t6EtOmFpHNAuxw3xqPZghy+brsnusscJRW5BMUzzHZc5ICjULee81WeUV2jjakG09MDglJXQ==" "integrity": "sha512-vvPKKdMemU85V9WE/l5wZEmImpCtLqbnTvqDS2U1fJ96KrxoW7KrXhNsNCblQlg8Ck4b85yxdTyelsMUgFUXiw=="
}, },
"@babel/runtime": { "@babel/runtime": {
"version": "7.23.1", "version": "7.23.1",
@ -2601,36 +2595,36 @@
"requires": {} "requires": {}
}, },
"@vue/compiler-core": { "@vue/compiler-core": {
"version": "3.3.9", "version": "3.3.8",
"resolved": "https://registry.npmmirror.com/@vue/compiler-core/-/compiler-core-3.3.9.tgz", "resolved": "https://registry.npmmirror.com/@vue/compiler-core/-/compiler-core-3.3.8.tgz",
"integrity": "sha512-+/Lf68Vr/nFBA6ol4xOtJrW+BQWv3QWKfRwGSm70jtXwfhZNF4R/eRgyVJYoxFRhdCTk/F6g99BP0ffPgZihfQ==", "integrity": "sha512-hN/NNBUECw8SusQvDSqqcVv6gWq8L6iAktUR0UF3vGu2OhzRqcOiAno0FmBJWwxhYEXRlQJT5XnoKsVq1WZx4g==",
"requires": { "requires": {
"@babel/parser": "^7.23.3", "@babel/parser": "^7.23.0",
"@vue/shared": "3.3.9", "@vue/shared": "3.3.8",
"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.9", "version": "3.3.8",
"resolved": "https://registry.npmmirror.com/@vue/compiler-dom/-/compiler-dom-3.3.9.tgz", "resolved": "https://registry.npmmirror.com/@vue/compiler-dom/-/compiler-dom-3.3.8.tgz",
"integrity": "sha512-nfWubTtLXuT4iBeDSZ5J3m218MjOy42Vp2pmKVuBKo2/BLcrFUX8nCSr/bKRFiJ32R8qbdnnnBgRn9AdU5v0Sg==", "integrity": "sha512-+PPtv+p/nWDd0AvJu3w8HS0RIm/C6VGBIRe24b9hSyNWOAPEUosFZ5diwawwP8ip5sJ8n0Pe87TNNNHnvjs0FQ==",
"requires": { "requires": {
"@vue/compiler-core": "3.3.9", "@vue/compiler-core": "3.3.8",
"@vue/shared": "3.3.9" "@vue/shared": "3.3.8"
} }
}, },
"@vue/compiler-sfc": { "@vue/compiler-sfc": {
"version": "3.3.9", "version": "3.3.8",
"resolved": "https://registry.npmmirror.com/@vue/compiler-sfc/-/compiler-sfc-3.3.9.tgz", "resolved": "https://registry.npmmirror.com/@vue/compiler-sfc/-/compiler-sfc-3.3.8.tgz",
"integrity": "sha512-wy0CNc8z4ihoDzjASCOCsQuzW0A/HP27+0MDSSICMjVIFzk/rFViezkR3dzH+miS2NDEz8ywMdbjO5ylhOLI2A==", "integrity": "sha512-WMzbUrlTjfYF8joyT84HfwwXo+8WPALuPxhy+BZ6R4Aafls+jDBnSz8PDz60uFhuqFbl3HxRfxvDzrUf3THwpA==",
"requires": { "requires": {
"@babel/parser": "^7.23.3", "@babel/parser": "^7.23.0",
"@vue/compiler-core": "3.3.9", "@vue/compiler-core": "3.3.8",
"@vue/compiler-dom": "3.3.9", "@vue/compiler-dom": "3.3.8",
"@vue/compiler-ssr": "3.3.9", "@vue/compiler-ssr": "3.3.8",
"@vue/reactivity-transform": "3.3.9", "@vue/reactivity-transform": "3.3.8",
"@vue/shared": "3.3.9", "@vue/shared": "3.3.8",
"estree-walker": "^2.0.2", "estree-walker": "^2.0.2",
"magic-string": "^0.30.5", "magic-string": "^0.30.5",
"postcss": "^8.4.31", "postcss": "^8.4.31",
@ -2638,12 +2632,12 @@
} }
}, },
"@vue/compiler-ssr": { "@vue/compiler-ssr": {
"version": "3.3.9", "version": "3.3.8",
"resolved": "https://registry.npmmirror.com/@vue/compiler-ssr/-/compiler-ssr-3.3.9.tgz", "resolved": "https://registry.npmmirror.com/@vue/compiler-ssr/-/compiler-ssr-3.3.8.tgz",
"integrity": "sha512-NO5oobAw78R0G4SODY5A502MGnDNiDjf6qvhn7zD7TJGc8XDeIEw4fg6JU705jZ/YhuokBKz0A5a/FL/XZU73g==", "integrity": "sha512-hXCqQL/15kMVDBuoBYpUnSYT8doDNwsjvm3jTefnXr+ytn294ySnT8NlsFHmTgKNjwpuFy7XVV8yTeLtNl/P6w==",
"requires": { "requires": {
"@vue/compiler-dom": "3.3.9", "@vue/compiler-dom": "3.3.8",
"@vue/shared": "3.3.9" "@vue/shared": "3.3.8"
} }
}, },
"@vue/devtools-api": { "@vue/devtools-api": {
@ -2652,41 +2646,41 @@
"integrity": "sha512-o9KfBeaBmCKl10usN4crU53fYtC1r7jJwdGKjPT24t348rHxgfpZ0xL3Xm/gLUYnc0oTp8LAmrxOeLyu6tbk2Q==" "integrity": "sha512-o9KfBeaBmCKl10usN4crU53fYtC1r7jJwdGKjPT24t348rHxgfpZ0xL3Xm/gLUYnc0oTp8LAmrxOeLyu6tbk2Q=="
}, },
"@vue/reactivity": { "@vue/reactivity": {
"version": "3.3.9", "version": "3.3.8",
"resolved": "https://registry.npmmirror.com/@vue/reactivity/-/reactivity-3.3.9.tgz", "resolved": "https://registry.npmmirror.com/@vue/reactivity/-/reactivity-3.3.8.tgz",
"integrity": "sha512-VmpIqlNp+aYDg2X0xQhJqHx9YguOmz2UxuUJDckBdQCNkipJvfk9yA75woLWElCa0Jtyec3lAAt49GO0izsphw==", "integrity": "sha512-ctLWitmFBu6mtddPyOKpHg8+5ahouoTCRtmAHZAXmolDtuZXfjL2T3OJ6DL6ezBPQB1SmMnpzjiWjCiMYmpIuw==",
"requires": { "requires": {
"@vue/shared": "3.3.9" "@vue/shared": "3.3.8"
} }
}, },
"@vue/reactivity-transform": { "@vue/reactivity-transform": {
"version": "3.3.9", "version": "3.3.8",
"resolved": "https://registry.npmmirror.com/@vue/reactivity-transform/-/reactivity-transform-3.3.9.tgz", "resolved": "https://registry.npmmirror.com/@vue/reactivity-transform/-/reactivity-transform-3.3.8.tgz",
"integrity": "sha512-HnUFm7Ry6dFa4Lp63DAxTixUp8opMtQr6RxQCpDI1vlh12rkGIeYqMvJtK+IKyEfEOa2I9oCkD1mmsPdaGpdVg==", "integrity": "sha512-49CvBzmZNtcHua0XJ7GdGifM8GOXoUMOX4dD40Y5DxI3R8OUhMlvf2nvgUAcPxaXiV5MQQ1Nwy09ADpnLQUqRw==",
"requires": { "requires": {
"@babel/parser": "^7.23.3", "@babel/parser": "^7.23.0",
"@vue/compiler-core": "3.3.9", "@vue/compiler-core": "3.3.8",
"@vue/shared": "3.3.9", "@vue/shared": "3.3.8",
"estree-walker": "^2.0.2", "estree-walker": "^2.0.2",
"magic-string": "^0.30.5" "magic-string": "^0.30.5"
} }
}, },
"@vue/runtime-core": { "@vue/runtime-core": {
"version": "3.3.9", "version": "3.3.8",
"resolved": "https://registry.npmmirror.com/@vue/runtime-core/-/runtime-core-3.3.9.tgz", "resolved": "https://registry.npmmirror.com/@vue/runtime-core/-/runtime-core-3.3.8.tgz",
"integrity": "sha512-xxaG9KvPm3GTRuM4ZyU8Tc+pMVzcu6eeoSRQJ9IE7NmCcClW6z4B3Ij6L4EDl80sxe/arTtQ6YmgiO4UZqRc+w==", "integrity": "sha512-qurzOlb6q26KWQ/8IShHkMDOuJkQnQcTIp1sdP4I9MbCf9FJeGVRXJFr2mF+6bXh/3Zjr9TDgURXrsCr9bfjUw==",
"requires": { "requires": {
"@vue/reactivity": "3.3.9", "@vue/reactivity": "3.3.8",
"@vue/shared": "3.3.9" "@vue/shared": "3.3.8"
} }
}, },
"@vue/runtime-dom": { "@vue/runtime-dom": {
"version": "3.3.9", "version": "3.3.8",
"resolved": "https://registry.npmmirror.com/@vue/runtime-dom/-/runtime-dom-3.3.9.tgz", "resolved": "https://registry.npmmirror.com/@vue/runtime-dom/-/runtime-dom-3.3.8.tgz",
"integrity": "sha512-e7LIfcxYSWbV6BK1wQv9qJyxprC75EvSqF/kQKe6bdZEDNValzeRXEVgiX7AHI6hZ59HA4h7WT5CGvm69vzJTQ==", "integrity": "sha512-Noy5yM5UIf9UeFoowBVgghyGGPIDPy1Qlqt0yVsUdAVbqI8eeMSsTqBtauaEoT2UFXUk5S64aWVNJN4MJ2vRdA==",
"requires": { "requires": {
"@vue/runtime-core": "3.3.9", "@vue/runtime-core": "3.3.8",
"@vue/shared": "3.3.9", "@vue/shared": "3.3.8",
"csstype": "^3.1.2" "csstype": "^3.1.2"
}, },
"dependencies": { "dependencies": {
@ -2698,18 +2692,18 @@
} }
}, },
"@vue/server-renderer": { "@vue/server-renderer": {
"version": "3.3.9", "version": "3.3.8",
"resolved": "https://registry.npmmirror.com/@vue/server-renderer/-/server-renderer-3.3.9.tgz", "resolved": "https://registry.npmmirror.com/@vue/server-renderer/-/server-renderer-3.3.8.tgz",
"integrity": "sha512-w0zT/s5l3Oa3ZjtLW88eO4uV6AQFqU8X5GOgzq7SkQQu6vVr+8tfm+OI2kDBplS/W/XgCBuFXiPw6T5EdwXP0A==", "integrity": "sha512-zVCUw7RFskvPuNlPn/8xISbrf0zTWsTSdYTsUTN1ERGGZGVnRxM2QZ3x1OR32+vwkkCm0IW6HmJ49IsPm7ilLg==",
"requires": { "requires": {
"@vue/compiler-ssr": "3.3.9", "@vue/compiler-ssr": "3.3.8",
"@vue/shared": "3.3.9" "@vue/shared": "3.3.8"
} }
}, },
"@vue/shared": { "@vue/shared": {
"version": "3.3.9", "version": "3.3.8",
"resolved": "https://registry.npmmirror.com/@vue/shared/-/shared-3.3.9.tgz", "resolved": "https://registry.npmmirror.com/@vue/shared/-/shared-3.3.8.tgz",
"integrity": "sha512-ZE0VTIR0LmYgeyhurPTpy4KzKsuDyQbMSdM49eKkMnT5X4VfFBLysMzjIZhLEFQYjjOVVfbvUDHckwjDFiO2eA==" "integrity": "sha512-8PGwybFwM4x8pcfgqEQFy70NaQxASvOC5DJwLQfpArw1UDfUXrJkdxD3BhVTMS+0Lef/TU7YO0Jvr0jJY8T+mw=="
}, },
"acorn": { "acorn": {
"version": "8.10.0", "version": "8.10.0",
@ -3134,11 +3128,6 @@
"ufo": "^1.3.0" "ufo": "^1.3.0"
} }
}, },
"monaco-editor": {
"version": "0.44.0",
"resolved": "https://registry.npmmirror.com/monaco-editor/-/monaco-editor-0.44.0.tgz",
"integrity": "sha512-5SmjNStN6bSuSE5WPT2ZV+iYn1/yI9sd4Igtk23ChvqB7kDk9lZbB9F5frsuvpB+2njdIeGGFf2G4gbE6rCC9Q=="
},
"ms": { "ms": {
"version": "2.1.2", "version": "2.1.2",
"resolved": "https://registry.npmmirror.com/ms/-/ms-2.1.2.tgz", "resolved": "https://registry.npmmirror.com/ms/-/ms-2.1.2.tgz",
@ -3586,15 +3575,15 @@
} }
}, },
"vue": { "vue": {
"version": "3.3.9", "version": "3.3.8",
"resolved": "https://registry.npmmirror.com/vue/-/vue-3.3.9.tgz", "resolved": "https://registry.npmmirror.com/vue/-/vue-3.3.8.tgz",
"integrity": "sha512-sy5sLCTR8m6tvUk1/ijri3Yqzgpdsmxgj6n6yl7GXXCXqVbmW2RCXe9atE4cEI6Iv7L89v5f35fZRRr5dChP9w==", "integrity": "sha512-5VSX/3DabBikOXMsxzlW8JyfeLKlG9mzqnWgLQLty88vdZL7ZJgrdgBOmrArwxiLtmS+lNNpPcBYqrhE6TQW5w==",
"requires": { "requires": {
"@vue/compiler-dom": "3.3.9", "@vue/compiler-dom": "3.3.8",
"@vue/compiler-sfc": "3.3.9", "@vue/compiler-sfc": "3.3.8",
"@vue/runtime-dom": "3.3.9", "@vue/runtime-dom": "3.3.8",
"@vue/server-renderer": "3.3.9", "@vue/server-renderer": "3.3.8",
"@vue/shared": "3.3.9" "@vue/shared": "3.3.8"
} }
}, },
"vue-i18n": { "vue-i18n": {

View File

@ -13,10 +13,9 @@
"dayjs": "^1.11.10", "dayjs": "^1.11.10",
"highlight.js": "^11.9.0", "highlight.js": "^11.9.0",
"lodash": "^4.17.21", "lodash": "^4.17.21",
"monaco-editor": "^0.44.0",
"pinia": "^2.1.7", "pinia": "^2.1.7",
"sass": "^1.69.5", "sass": "^1.69.5",
"vue": "^3.3.9", "vue": "^3.3.8",
"vue-i18n": "^9.7.1", "vue-i18n": "^9.7.1",
"xterm": "^5.3.0", "xterm": "^5.3.0",
"xterm-addon-fit": "^0.8.0" "xterm-addon-fit": "^0.8.0"

View File

@ -1 +1 @@
3dc6322e376d91c1cb4a6bd5312d176f 13b88be029994e83241098ae7c3ee1c4

View File

@ -1,159 +0,0 @@
<script setup>
import { computed, nextTick, onMounted, onUnmounted, ref, watch } from 'vue'
import * as monaco from 'monaco-editor'
import usePreferencesStore from 'stores/preferences.js'
import { useThemeVars } from 'naive-ui'
const props = defineProps({
content: {
type: String,
},
language: {
type: String,
default: 'json',
},
readonly: {
type: String,
},
loading: {
type: Boolean,
},
showLineNum: {
type: Boolean,
default: true,
},
border: {
type: Boolean,
default: false,
},
})
const emit = defineEmits(['reset', 'input'])
const themeVars = useThemeVars()
/** @type {HTMLElement|null} */
const editorRef = ref(null)
/** @type monaco.editor.IStandaloneCodeEditor */
let editorNode = null
const destroyEditor = () => {
if (editorNode != null && editorNode.dispose != null) {
const model = editorNode.getModel()
if (model != null) {
model.dispose()
}
editorNode.dispose()
editorNode = null
}
}
const readonlyValue = computed(() => {
return props.readonly || props.loading
})
const pref = usePreferencesStore()
onMounted(async () => {
if (editorRef.value != null) {
const { fontSize, fontFamily = undefined } = pref.generalFont
editorNode = monaco.editor.create(editorRef.value, {
// value: props.content,
theme: pref.isDark ? 'rdm-dark' : 'rdm-light',
language: props.language,
lineNumbers: props.showLineNum ? 'on' : 'off',
readOnly: readonlyValue.value,
colorDecorators: true,
accessibilitySupport: 'off',
wordWrap: 'on',
tabSize: 2,
fontFamily,
fontSize,
scrollBeyondLastLine: false,
automaticLayout: true,
scrollbar: {
useShadows: false,
verticalScrollbarSize: '10px',
},
// formatOnType: true,
contextmenu: false,
lineNumbersMinChars: 2,
lineDecorationsWidth: 0,
minimap: {
enabled: false,
},
selectionHighlight: false,
renderLineHighlight: 'gutter',
})
// editorNode.onDidChangeModelLanguageConfiguration(() => {
// editorNode?.getAction('editor.action.formatDocument')?.run()
// })
if (editorNode.onDidChangeModelContent) {
editorNode.onDidChangeModelContent(() => {
emit('input', editorNode.getValue())
})
}
}
})
watch(
() => props.content,
async (content) => {
if (editorNode != null) {
editorNode.setValue(content)
await nextTick(() => emit('reset', content))
}
},
)
watch(
() => readonlyValue.value,
(readOnly) => {
if (editorNode != null) {
editorNode.updateOptions({
readOnly,
})
}
},
)
watch(
() => props.language,
(language) => {
if (editorNode != null) {
const model = editorNode.getModel()
if (model != null) {
monaco.editor.setModelLanguage(model, language)
}
}
},
)
watch(
() => pref.isDark,
(dark) => {
if (editorNode != null) {
editorNode.updateOptions({
theme: dark ? 'rdm-dark' : 'rdm-light',
})
}
},
)
onUnmounted(() => {
destroyEditor()
})
</script>
<template>
<div ref="editorRef" :class="{ 'editor-border': props.border === true }" />
</template>
<style lang="scss" scoped>
.editor-border {
border: 1px solid v-bind('themeVars.borderColor');
border-radius: v-bind('themeVars.borderRadius');
padding: 3px;
box-sizing: border-box;
}
</style>

View File

@ -11,7 +11,6 @@ import FullScreen from '@/components/icons/FullScreen.vue'
import WindowClose from '@/components/icons/WindowClose.vue' import WindowClose from '@/components/icons/WindowClose.vue'
import Pin from '@/components/icons/Pin.vue' import Pin from '@/components/icons/Pin.vue'
import OffScreen from '@/components/icons/OffScreen.vue' import OffScreen from '@/components/icons/OffScreen.vue'
import ContentEditor from '@/components/content_value/ContentEditor.vue'
const props = defineProps({ const props = defineProps({
field: { field: {
@ -80,19 +79,6 @@ const displayValue = computed(() => {
} }
return viewAs.value return viewAs.value
}) })
const editingContent = ref('')
const enableSave = computed(() => {
return editingContent.value !== viewAs.value
})
const viewLanguage = computed(() => {
switch (viewAs.format) {
case formatTypes.JSON:
return 'json'
default:
return 'plaintext'
}
})
const btnStyle = computed(() => ({ const btnStyle = computed(() => ({
padding: '3px', padding: '3px',
@ -126,7 +112,7 @@ const onFormatChanged = async (decode = '', format = '') => {
format, format,
}) })
viewAs.field = props.field + '' viewAs.field = props.field + ''
editingContent.value = viewAs.value = value viewAs.value = value
viewAs.decode = decode || retDecode viewAs.decode = decode || retDecode
viewAs.format = format || retFormat viewAs.format = format || retFormat
} finally { } finally {
@ -139,10 +125,6 @@ const onUpdateValue = (value) => {
viewAs.value = value viewAs.value = value
} }
const onInput = (content) => {
editingContent.value = content
}
const onToggleFullscreen = () => { const onToggleFullscreen = () => {
emit('update:fullscreen', !!!props.fullscreen) emit('update:fullscreen', !!!props.fullscreen)
} }
@ -153,7 +135,7 @@ const onClose = () => {
} }
const onSave = () => { const onSave = () => {
emit('save', viewAs.field, editingContent.value, viewAs.decode, viewAs.format) emit('save', viewAs.field, viewAs.value, viewAs.decode, viewAs.format)
if (!isPin.value) { if (!isPin.value) {
nextTick().then(onClose) nextTick().then(onClose)
} }
@ -178,14 +160,14 @@ const onSave = () => {
<!-- value --> <!-- value -->
<div class="editor-content-item flex-box-v flex-item-expand"> <div class="editor-content-item flex-box-v flex-item-expand">
<div class="editor-content-item-label">{{ props.valueLabel }}</div> <div class="editor-content-item-label">{{ props.valueLabel }}</div>
<content-editor <n-input
:border="true" :placeholder="props.value"
:content="displayValue" :resizable="false"
:language="viewLanguage" :value="displayValue"
autofocus
class="flex-item-expand" class="flex-item-expand"
style="height: 100%" type="textarea"
@input="onInput" @update:value="onUpdateValue" />
@reset="onInput" />
<format-selector <format-selector
:decode="viewAs.decode" :decode="viewAs.decode"
:format="viewAs.format" :format="viewAs.format"
@ -220,7 +202,7 @@ const onSave = () => {
</template> </template>
<template #action> <template #action>
<n-space :wrap="false" :wrap-item="false" justify="end"> <n-space :wrap="false" :wrap-item="false" justify="end">
<n-button :disabled="!enableSave" :secondary="enableSave" type="primary" @click="onSave"> <n-button ghost @click="onSave">
<template #icon> <template #icon>
<n-icon :component="Save" /> <n-icon :component="Save" />
</template> </template>

View File

@ -162,7 +162,6 @@ const saveEdit = async (field, value, decode, format) => {
index: [currentEditRow.no - 1], index: [currentEditRow.no - 1],
}) })
if (success) { if (success) {
currentEditRow.value = value
$message.success(i18n.t('dialogue.save_value_succ')) $message.success(i18n.t('dialogue.save_value_succ'))
} else { } else {
$message.error(msg) $message.error(msg)

View File

@ -6,14 +6,15 @@ import Copy from '@/components/icons/Copy.vue'
import Save from '@/components/icons/Save.vue' import Save from '@/components/icons/Save.vue'
import { useThemeVars } from 'naive-ui' import { useThemeVars } from 'naive-ui'
import { decodeTypes, formatTypes } from '@/consts/value_view_type.js' import { decodeTypes, formatTypes } from '@/consts/value_view_type.js'
import Close from '@/components/icons/Close.vue'
import { types as redisTypes } from '@/consts/support_redis_type.js' import { types as redisTypes } from '@/consts/support_redis_type.js'
import { ClipboardSetText } from 'wailsjs/runtime/runtime.js' import { ClipboardSetText } from 'wailsjs/runtime/runtime.js'
import { isEmpty, toLower } from 'lodash' import { isEmpty, toLower } from 'lodash'
import EditFile from '@/components/icons/EditFile.vue'
import bytes from 'bytes' import bytes from 'bytes'
import useBrowserStore from 'stores/browser.js' import useBrowserStore from 'stores/browser.js'
import { decodeRedisKey } from '@/utils/key_convert.js' import { decodeRedisKey } from '@/utils/key_convert.js'
import FormatSelector from '@/components/content_value/FormatSelector.vue' import FormatSelector from '@/components/content_value/FormatSelector.vue'
import ContentEditor from '@/components/content_value/ContentEditor.vue'
const i18n = useI18n() const i18n = useI18n()
const themeVars = useThemeVars() const themeVars = useThemeVars()
@ -62,11 +63,6 @@ const viewAs = reactive({
decode: decodeTypes.NONE, decode: decodeTypes.NONE,
}) })
const editingContent = ref('')
const enableSave = computed(() => {
return editingContent.value !== viewAs.value && !props.loading
})
const displayValue = computed(() => { const displayValue = computed(() => {
if (props.loading) { if (props.loading) {
return '' return ''
@ -93,7 +89,7 @@ const onFormatChanged = async (decode = '', format = '') => {
decode, decode,
format, format,
}) })
editingContent.value = viewAs.value = value viewAs.value = value
viewAs.decode = decode || retDecode viewAs.decode = decode || retDecode
viewAs.format = format || retFormat viewAs.format = format || retFormat
} }
@ -113,17 +109,23 @@ const onCopyValue = () => {
}) })
} }
const editValue = ref('')
const inEdit = ref(false)
const onEditValue = () => {
editValue.value = displayValue.value
inEdit.value = true
}
const onCancelEdit = () => {
inEdit.value = false
}
/** /**
* Save value * Save value
*/ */
const browserStore = useBrowserStore() const browserStore = useBrowserStore()
const saving = ref(false) const saving = ref(false)
const onSaveValue = async () => {
const onInput = (content) => {
editingContent.value = content
}
const onSave = async () => {
saving.value = true saving.value = true
try { try {
const { success, msg } = await browserStore.setKey({ const { success, msg } = await browserStore.setKey({
@ -131,13 +133,13 @@ const onSave = async () => {
db: props.db, db: props.db,
key: keyName.value, key: keyName.value,
keyType: toLower(keyType), keyType: toLower(keyType),
value: editingContent.value, value: editValue.value,
ttl: -1, ttl: -1,
format: viewAs.format, format: viewAs.format,
decode: viewAs.decode, decode: viewAs.decode,
}) })
if (success) { if (success) {
// await browserStore.loadKeyDetail({ server: props.name, db: props.db, key: keyName.value }) await browserStore.loadKeyDetail({ server: props.name, db: props.db, key: keyName.value })
$message.success(i18n.t('dialogue.save_value_succ')) $message.success(i18n.t('dialogue.save_value_succ'))
} else { } else {
$message.error(msg) $message.error(msg)
@ -145,6 +147,7 @@ const onSave = async () => {
} catch (e) { } catch (e) {
$message.error(e.message) $message.error(e.message)
} finally { } finally {
inEdit.value = false
saving.value = false saving.value = false
} }
} }
@ -152,7 +155,7 @@ const onSave = async () => {
defineExpose({ defineExpose({
reset: () => { reset: () => {
viewAs.value = '' viewAs.value = ''
editingContent.value = '' inEdit.value = false
}, },
beforeShow: () => onFormatChanged(), beforeShow: () => onFormatChanged(),
}) })
@ -174,46 +177,55 @@ defineExpose({
@rename="emit('rename')" /> @rename="emit('rename')" />
<div class="tb2 value-item-part flex-box-h"> <div class="tb2 value-item-part flex-box-h">
<div class="flex-item-expand"></div> <div class="flex-item-expand"></div>
<n-button-group> <n-button-group v-if="!inEdit">
<n-button :disabled="saving" :focusable="false" @click="onCopyValue"> <n-button :focusable="false" @click="onCopyValue">
<template #icon> <template #icon>
<n-icon :component="Copy" size="18" /> <n-icon :component="Copy" size="18" />
</template> </template>
{{ $t('interface.copy_value') }} {{ $t('interface.copy_value') }}
</n-button> </n-button>
<n-button <n-button :focusable="false" plain @click="onEditValue">
:disabled="!enableSave" <template #icon>
:loading="saving" <n-icon :component="EditFile" size="18" />
:secondary="enableSave" </template>
:type="enableSave ? 'primary' : ''" {{ $t('interface.edit_value') }}
@click="onSave"> </n-button>
</n-button-group>
<n-button-group v-else>
<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('common.save') }} {{ $t('interface.save_update') }}
</n-button>
<n-button :focusable="false" :loading="saving" plain @click="onCancelEdit">
<template #icon>
<n-icon :component="Close" size="18" />
</template>
{{ $t('common.cancel') }}
</n-button> </n-button>
</n-button-group> </n-button-group>
</div> </div>
<div class="value-wrapper value-item-part flex-item-expand flex-box-v"> <div class="value-wrapper value-item-part flex-item-expand flex-box-v">
<n-spin :show="props.loading" /> <n-scrollbar v-if="!inEdit" class="flex-item-expand">
<content-editor <n-code :code="displayValue" :language="viewLanguage" style="cursor: text" word-wrap />
v-show="!props.loading" </n-scrollbar>
:content="displayValue" <n-input
:language="viewLanguage" v-else
:loading="props.loading" v-model:value="editValue"
:disabled="saving"
:resizable="false"
class="flex-item-expand" class="flex-item-expand"
style="height: 100%" type="textarea" />
@input="onInput"
@reset="onInput" />
</div> </div>
<div class="value-footer flex-box-h"> <div class="value-footer flex-box-h">
<n-text v-if="!isNaN(props.length)">{{ $t('interface.length') }}: {{ props.length }}</n-text> <n-text v-if="!isNaN(props.length)">{{ $t('interface.length') }}: {{ props.length }}</n-text>
<n-divider v-if="!isNaN(props.length)" vertical /> <n-divider v-if="!isNaN(props.length)" vertical />
<n-text v-if="!isNaN(props.size)">{{ $t('interface.memory_usage') }}: {{ bytes(props.size) }}</n-text> <n-text v-if="!isNaN(props.size)">{{ $t('interface.memory_usage') }}: {{ bytes(props.size) }}</n-text>
<div class="flex-item-expand" /> <div class="flex-item-expand"></div>
<format-selector <format-selector
:decode="viewAs.decode" :decode="viewAs.decode"
:disabled="enableSave" :disabled="inEdit"
:format="viewAs.format" :format="viewAs.format"
@format-changed="onFormatChanged" /> @format-changed="onFormatChanged" />
</div> </div>
@ -222,7 +234,7 @@ defineExpose({
<style lang="scss" scoped> <style lang="scss" scoped>
.value-wrapper { .value-wrapper {
//overflow: hidden; overflow: hidden;
border-top: v-bind('themeVars.borderColor') 1px solid; border-top: v-bind('themeVars.borderColor') 1px solid;
padding: 5px; padding: 5px;
} }

View File

@ -12,7 +12,6 @@ import { computed, onMounted, ref, watch } from 'vue'
import { isEmpty } from 'lodash' import { isEmpty } from 'lodash'
import useDialogStore from 'stores/dialog.js' import useDialogStore from 'stores/dialog.js'
import { decodeTypes, formatTypes } from '@/consts/value_view_type.js' import { decodeTypes, formatTypes } from '@/consts/value_view_type.js'
import { useI18n } from 'vue-i18n'
const themeVars = useThemeVars() const themeVars = useThemeVars()
const browserStore = useBrowserStore() const browserStore = useBrowserStore()
@ -25,7 +24,6 @@ const props = defineProps({
default: {}, default: {},
}, },
}) })
const i18n = useI18n()
/** /**
* *
@ -125,11 +123,11 @@ const onRename = () => {
} }
const onDelete = () => { const onDelete = () => {
$dialog.warning(i18n.t('dialogue.remove_tip', { name: data.value.keyPath }), () => { $dialog.warning(i18n.t('dialogue.remove_tip', { name: props.keyPath }), () => {
const { name, db } = data.value const { name, db } = data.value
browserStore.deleteKey(name, db, keyName.value).then((success) => { browserStore.deleteKey(name, db, keyName.value).then((success) => {
if (success) { if (success) {
$message.success(i18n.t('dialogue.delete_key_succ', { key: data.value.keyPath })) $message.success(i18n.t('dialogue.delete_key_succ', { key: props.keyPath }))
} }
}) })
}) })

View File

@ -3,7 +3,7 @@ import { computed, reactive, ref, watch } from 'vue'
import useDialog from 'stores/dialog' import useDialog from 'stores/dialog'
import { useI18n } from 'vue-i18n' import { useI18n } from 'vue-i18n'
import useConnectionStore from 'stores/connections.js' import useConnectionStore from 'stores/connections.js'
import { every, get, includes, isEmpty } from 'lodash' import { isEmpty } from 'lodash'
/** /**
* Dialog for create or rename group * Dialog for create or rename group
@ -13,24 +13,6 @@ const editGroup = ref('')
const groupForm = reactive({ const groupForm = reactive({
name: '', name: '',
}) })
const groupFormRef = ref(null)
const formRules = computed(() => {
const requiredMsg = i18n.t('dialogue.field_required')
const illegalChars = ['/', '\\']
return {
name: [
{ required: true, message: requiredMsg, trigger: 'input' },
{
validator: (rule, value) => {
return every(illegalChars, (c) => !includes(value, c))
},
message: i18n.t('dialogue.illegal_characters'),
trigger: 'input',
},
],
}
})
const isRenameMode = computed(() => !isEmpty(editGroup.value)) const isRenameMode = computed(() => !isEmpty(editGroup.value))
@ -48,13 +30,6 @@ watch(
const i18n = useI18n() const i18n = useI18n()
const onConfirm = async () => { const onConfirm = async () => {
try { try {
await groupFormRef.value?.validate((errs) => {
const err = get(errs, '0.0.message')
if (err != null) {
$message.error(err)
}
})
const { name } = groupForm const { name } = groupForm
if (isRenameMode.value) { if (isRenameMode.value) {
const { success, msg } = await connectionStore.renameGroup(editGroup.value, name) const { success, msg } = await connectionStore.renameGroup(editGroup.value, name)
@ -72,11 +47,9 @@ const onConfirm = async () => {
} }
} }
} catch (e) { } catch (e) {
const msg = get(e, 'message') $message.error(e.message)
if (!isEmpty(msg)) {
$message.error(msg)
}
} }
onClose()
} }
const onClose = () => { const onClose = () => {
@ -104,14 +77,8 @@ const onClose = () => {
transform-origin="center" transform-origin="center"
@positive-click="onConfirm" @positive-click="onConfirm"
@negative-click="onClose"> @negative-click="onClose">
<n-form <n-form :model="groupForm" :show-label="false" :show-require-mark="false" label-placement="top">
ref="groupFormRef" <n-form-item :label="$t('dialogue.group.name')" required>
:model="groupForm"
:rules="formRules"
:show-label="false"
:show-require-mark="false"
label-placement="top">
<n-form-item :label="$t('dialogue.group.name')" path="name" required>
<n-input v-model:value="groupForm.name" placeholder="" /> <n-input v-model:value="groupForm.name" placeholder="" />
</n-form-item> </n-form-item>
</n-form> </n-form>

View File

@ -2,7 +2,7 @@
import { computed, h, reactive, ref, watch } from 'vue' import { computed, h, reactive, ref, watch } from 'vue'
import { types, typesColor } from '@/consts/support_redis_type.js' import { types, typesColor } from '@/consts/support_redis_type.js'
import useDialog from 'stores/dialog' import useDialog from 'stores/dialog'
import { get, isEmpty, keys, map } from 'lodash' import { isEmpty, keys, map } from 'lodash'
import NewStringValue from '@/components/new_value/NewStringValue.vue' import NewStringValue from '@/components/new_value/NewStringValue.vue'
import NewHashValue from '@/components/new_value/NewHashValue.vue' import NewHashValue from '@/components/new_value/NewHashValue.vue'
import NewListValue from '@/components/new_value/NewListValue.vue' import NewListValue from '@/components/new_value/NewListValue.vue'
@ -103,20 +103,13 @@ const renderTypeLabel = (option) => {
const browserStore = useBrowserStore() const browserStore = useBrowserStore()
const tabStore = useTabStore() const tabStore = useTabStore()
const onAdd = async () => { const onAdd = async () => {
await newFormRef.value?.validate((errs) => { await newFormRef.value?.validate().catch((err) => {
const err = get(errs, '0.0.message') $message.error(err.message)
if (err != null) {
$message.error(err)
}
}) })
await subFormRef.value?.validate((errs) => { if (subFormRef.value?.validate && !subFormRef.value?.validate()) {
const err = get(errs, '0.0.message')
if (err != null) {
$message.error(err)
} else {
$message.error(i18n.t('dialogue.spec_field_required', { key: i18n.t('dialogue.field.element') })) $message.error(i18n.t('dialogue.spec_field_required', { key: i18n.t('dialogue.field.element') }))
return false
} }
})
try { try {
const { server, db, key, type, ttl } = newForm const { server, db, key, type, ttl } = newForm
let { value } = newForm let { value } = newForm
@ -139,10 +132,7 @@ const onAdd = async () => {
$message.error(msg) $message.error(msg)
} }
dialogStore.closeNewKeyDialog() dialogStore.closeNewKeyDialog()
} catch (e) { } catch (e) {}
return false
}
return true
} }
const onClose = () => { const onClose = () => {

View File

@ -9,7 +9,6 @@ import { i18n } from '@/utils/i18n.js'
import { setupDiscreteApi } from '@/utils/discrete.js' import { setupDiscreteApi } from '@/utils/discrete.js'
import usePreferencesStore from 'stores/preferences.js' import usePreferencesStore from 'stores/preferences.js'
import { loadEnvironment } from '@/utils/platform.js' import { loadEnvironment } from '@/utils/platform.js'
import { setupMonaco } from '@/utils/monaco.js'
dayjs.extend(duration) dayjs.extend(duration)
dayjs.extend(relativeTime) dayjs.extend(relativeTime)
@ -20,7 +19,6 @@ async function setupApp() {
app.use(createPinia()) app.use(createPinia())
await loadEnvironment() await loadEnvironment()
setupMonaco()
const prefStore = usePreferencesStore() const prefStore = usePreferencesStore()
await prefStore.loadPreferences() await prefStore.loadPreferences()
await setupDiscreteApi() await setupDiscreteApi()

View File

@ -979,15 +979,13 @@ const useBrowserStore = defineStore('browser', {
decode, decode,
}) })
if (success) { if (success) {
// const { value } = data const { value } = data
// update tree view data // update tree view data
const { newKey = 0 } = this._addKeyNodes(server, db, [key], true) const { newKey = 0 } = this._addKeyNodes(server, db, [key], true)
if (newKey > 0) { if (newKey > 0) {
this._tidyNode(server, db, key) this._tidyNode(server, db, key)
this._updateDBMaxKeys(server, db, newKey) this._updateDBMaxKeys(server, db, newKey)
} }
const tab = useTabStore()
tab.updateValue({ server, db, key, value })
return { return {
success, success,
nodeKey: `${server}/db${db}#${ConnectionType.RedisValue}/${key}`, nodeKey: `${server}/db${db}#${ConnectionType.RedisValue}/${key}`,

View File

@ -113,7 +113,7 @@ const usePreferencesStore = defineStore('preferences', {
/** /**
* current font selection * current font selection
* @returns {{fontSize: string, fontFamily?: string}} * @returns {{fontSize: string}}
*/ */
generalFont() { generalFont() {
const fontStyle = { const fontStyle = {
@ -128,24 +128,6 @@ const usePreferencesStore = defineStore('preferences', {
return fontStyle return fontStyle
}, },
/**
* current editor font
* @return {{fontSize: string, fontFamily?: string}}
*/
editorFont() {
const fontStyle = {
fontSize: (this.editor.fontSize || 14) + 'px',
}
if (!isEmpty(this.editor.font) && this.editor.font !== 'none') {
const font = find(this.fontList, { name: this.editor.font })
if (font != null) {
fontStyle['fontFamily'] = `${font.name}`
}
}
fontStyle['fontFamily'] = fontStyle['fontFamily'] || 'monaco'
return fontStyle
},
/** /**
* get current language setting * get current language setting
* @return {string} * @return {string}

View File

@ -212,7 +212,7 @@ const useTabStore = defineStore('tab', {
* @param {string} [format] * @param {string} [format]
* @param {string] [decode] * @param {string] [decode]
* @param {string} [matchPattern] * @param {string} [matchPattern]
* @param {boolean} [reset] * @param {boolean} reset
* @param {boolean} [end] keep end status if not set * @param {boolean} [end] keep end status if not set
*/ */
updateValue({ server, db, key, value, format, decode, matchPattern, reset, end }) { updateValue({ server, db, key, value, format, decode, matchPattern, reset, end }) {
@ -227,7 +227,7 @@ const useTabStore = defineStore('tab', {
if (typeof end === 'boolean') { if (typeof end === 'boolean') {
tabData.end = end tabData.end = end
} }
if (!!!reset && typeof value === 'object') { if (!reset && typeof value === 'object') {
if (value instanceof Array) { if (value instanceof Array) {
tabData.value = tabData.value || [] tabData.value = tabData.value || []
tabData.value.push(...value) tabData.value.push(...value)

View File

@ -1,43 +0,0 @@
import * as monaco from 'monaco-editor'
import editorWorker from 'monaco-editor/esm/vs/editor/editor.worker?worker'
import jsonWorker from 'monaco-editor/esm/vs/language/json/json.worker?worker'
import cssWorker from 'monaco-editor/esm/vs/language/css/css.worker?worker'
import htmlWorker from 'monaco-editor/esm/vs/language/html/html.worker?worker'
export const setupMonaco = () => {
window.MonacoEnvironment = {
getWorker: (_, label) => {
switch (label) {
case 'json':
return new jsonWorker()
case 'css':
case 'scss':
case 'less':
return new cssWorker()
case 'html':
return new htmlWorker()
default:
return new editorWorker()
}
},
}
// setup light theme
monaco.editor.defineTheme('rdm-light', {
base: 'vs',
inherit: true,
rules: [],
colors: {
'editorLineNumber.foreground': '#BABBBD',
'editorLineNumber.activeForeground': '#777D83',
},
})
// setup dark theme
monaco.editor.defineTheme('rdm-dark', {
base: 'vs-dark',
inherit: true,
rules: [],
colors: {},
})
}