Skip to content

Commit

Permalink
memory analysis click to key content && update version
Browse files Browse the repository at this point in the history
  • Loading branch information
qishibo committed Aug 5, 2022
1 parent 4686399 commit 74627e5
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 7 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
## Windows

- Download latest [exe](https://github.com/qishibo/AnotherRedisDesktopManager/releases) package from [release](https://github.com/qishibo/AnotherRedisDesktopManager/releases) [or [gitee](https://gitee.com/qishibo/AnotherRedisDesktopManager/releases) in China], double click to install.
- Or by [**Chocolatey**](https://chocolatey.org/): `choco install another-redis-desktop-manager`
- Or by **chocolatey**: `choco install another-redis-desktop-manager`
- Or by **winget**: `winget install qishibo.AnotherRedisDesktopManager`
- Or **sponsor** by win store, It's not free, and I will be very grateful to you.
<br/><a href="https://www.microsoft.com/store/apps/9MTD84X0JFHZ?cid=storebadge&ocid=badge"><img src="https://cdn.jsdelivr.net/gh/qishibo/img/microsoft-store.png" height="58" width="180" alt="get from microsoft store"></a>
Expand Down
2 changes: 1 addition & 1 deletion README.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
## Windows

- 可以在[github](https://github.com/qishibo/AnotherRedisDesktopManager/releases) 或者 [gitee](https://gitee.com/qishibo/AnotherRedisDesktopManager/releases)下载`exe`安装包
- 或者通过[**Chocolatey**](https://chocolatey.org/): `choco install another-redis-desktop-manager`
- 或者通过**chocolatey**: `choco install another-redis-desktop-manager`
- 或者通过**winget**: `winget install qishibo.AnotherRedisDesktopManager`
- 或者通过Win Store**赞助**,然后让Win Store帮你自动更新版本
<br/><a href="https://www.microsoft.com/store/apps/9MTD84X0JFHZ?cid=storebadge&ocid=badge"><img src="https://cdn.jsdelivr.net/gh/qishibo/img/microsoft-store.png" height="58" width="180" alt="get from microsoft store"></a>
Expand Down
2 changes: 1 addition & 1 deletion pack/electron/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "another-redis-desktop-manager",
"version": "1.5.6",
"version": "1.5.7",
"description": "A faster, better and more stable redis desktop manager.",
"author": "Another",
"private": true,
Expand Down
24 changes: 20 additions & 4 deletions src/components/MemoryAnalysis.vue
Original file line number Diff line number Diff line change
Expand Up @@ -169,11 +169,13 @@ export default {
for (const item of keysList) {
const li = document.createElement('li');
const byte = document.createElement('span');
li.textContent = item[0]; // key
// byte.textContent = item[1]; // byte
byte.textContent = this.$util.humanFileSize(item[1]); // byte
li.appendChild(byte);
const key = this.$util.bufToString(item[0]);
li.textContent = key;
li.setAttribute('key', key);
byte.textContent = this.$util.humanFileSize(item[1]);
li.appendChild(byte);
flag.appendChild(li);
}
Expand Down Expand Up @@ -228,6 +230,16 @@ export default {
const showKeys = this.keysList.slice(0, this.showMax);
this.insertIntoDom(showKeys, true);
},
initClickKey() {
// add click to ol instead of li
this.$refs.keysList.addEventListener('click', e => {
const li = e.srcElement;
if (li && li.hasAttribute('key')) {
const key = li.getAttribute('key');
this.$bus.$emit('clickedKey', this.client, this.$util.xToBuffer(key), true);
}
});
},
initShortcut() {
this.$shortcut.bind('ctrl+r,+r, f5', this.hotKeyScope, () => {
// scanning not finished, return
Expand All @@ -243,6 +255,7 @@ export default {
mounted() {
this.initKeys();
this.initShortcut();
this.initClickKey();
},
beforeDestroy() {
this.$shortcut.deleteScope(this.hotKeyScope);
Expand Down Expand Up @@ -274,6 +287,9 @@ export default {
/*keys body li*/
.memory-analysis-container .keys-body li {
border-bottom: 1px solid #d0d0d0;
cursor: pointer;
padding: 0 4px;
font-size: 92%;
}
.dark-mode .memory-analysis-container .keys-body li {
border-bottom: 1px solid #444444;
Expand Down

0 comments on commit 74627e5

Please sign in to comment.