Skip to content

Commit

Permalink
Merge pull request #195 from qishibo/serialize_key
Browse files Browse the repository at this point in the history
Serialize key
  • Loading branch information
qishibo authored Apr 18, 2020
2 parents ce4d760 + ae5e4d7 commit 286d455
Show file tree
Hide file tree
Showing 7 changed files with 45 additions and 30 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ Download latest `dmg` package from [release](https://github.com/qishibo/AnotherR

## Feature Log

- 2020-04-18: Unvisible Key\Value Format Support
- 2020-04-04: Cluster Support!!!
- 2020-03-13: Dark Mode Support!!! && JsonView In Other Place
- 2020-02-16: SSH Private Key Support
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.3.3",
"version": "1.3.4",
"description": "A faster, better and more stable redis desktop manager.",
"author": "qii404.me",
"private": true,
Expand Down
41 changes: 18 additions & 23 deletions src/components/ConnectionMenu.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,33 @@
<div>
<div class="connection-opt-icons">
<!-- right menu operate icons -->
<i :title="$t('message.redis_status')" class="connection-right-icon fa fa-home" @click.stop.prevent="openStatus()"></i>
<i :title="$t('message.redis_console')" class="connection-right-icon fa fa-terminal" @click.stop.prevent="openCli()"></i>
<i :title="$t('message.edit_connection')" class="connection-right-icon el-icon-edit-outline" @click.stop.prevent="showEditConnection()"></i>
<i :title="$t('message.del_connection')" class="connection-right-icon el-icon-delete" @click.stop.prevent="deleteConnection()"></i>
<i :title="$t('message.redis_status')"
class="connection-right-icon fa fa-home"
@click.stop.prevent="openStatus">
</i>
<i :title="$t('message.redis_console')"
class="connection-right-icon fa fa-terminal"
@click.stop.prevent="openCli">
</i>
<i :title="$t('message.refresh_connection')"
class='connection-right-icon el-icon-refresh'
@click.stop.prevent="refreshConnection">
</i>

<!-- more operate menu -->
<el-dropdown
placement='bottom-start'
@command='handleMoreOperate'
:show-timeout=100
:hide-timeout=300>
<i class="connection-right-icon el-icon-menu"></i>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item command='refresh'>
<i class='el-icon-refresh'> {{ $t('message.refresh_connection') }}</i>
<el-dropdown-item @click.native='showEditConnection'>
<i class='el-icon-edit-outline'> {{ $t('message.edit_connection') }}</i>
</el-dropdown-item>
<!-- <el-dropdown-item command='batchDel'>
<i class='el-icon-delete'> Batch Delete</i>
</el-dropdown-item> -->
<el-dropdown-item command='flushDB'>
<el-dropdown-item @click.native='deleteConnection'>
<i class='el-icon-delete'> {{ $t('message.del_connection') }}</i>
</el-dropdown-item>
<el-dropdown-item @click.native='flushDB'>
<i class='fa fa-bomb'> {{ $t('message.flushdb') }}</i>
</el-dropdown-item>
</el-dropdown-menu>
Expand Down Expand Up @@ -106,18 +113,6 @@ export default {
this.$bus.$emit('openCli', this.client, this.config.connectionName);
}
},
handleMoreOperate(operate) {
switch (operate) {
case 'refresh':
this.refreshConnection();
break;
case 'flushDB':
this.flushDB();
break;
case 'batchDel':
break;
}
},
flushDB() {
if (!this.client) {
return;
Expand Down
6 changes: 4 additions & 2 deletions src/components/ConnectionWrapper.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<template>
<el-menu
ref="connectionMenu"
:collapse-transition='false'
@open="openConnection()"
class="connection-menu"
active-text-color="#ffd04b">
Expand Down Expand Up @@ -91,6 +92,7 @@ export default {
return;
}

this.$refs.connectionMenu &&
this.$refs.connectionMenu.close(this.config.connectionName);
this.$bus.$emit('removeAllTab', connectionName);

Expand All @@ -113,7 +115,7 @@ export default {
client.on('error', (err) => {
this.$message.error({
message: 'SSH Redis Client On Error: ' + err,
duration: 3000,
duration: 2500,
});

this.$bus.$emit('closeConnection');
Expand All @@ -133,7 +135,7 @@ export default {
client.on('error', (err) => {
this.$message.error({
message: 'Redis Client On Error: ' + err,
duration: 3000,
duration: 2500,
});

this.$bus.$emit('closeConnection');
Expand Down
11 changes: 11 additions & 0 deletions src/components/KeyList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,17 @@ export default {
}
});

stream.on('error', (e) => {
this.$message.error({
message: 'Stream On Error: ' + e.message,
duration: 1500,
});

setTimeout(() => {
this.$bus.$emit('closeConnection');
}, 50);
});

stream.on('end', () => {
// all nodes scan finished
if (--this.scanEndCount <= 0) {
Expand Down
4 changes: 4 additions & 0 deletions src/components/OperateItem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,10 @@ export default {
});
},
getDatabasesFromInfo() {
if (!this.client) {
return;
}

this.client.info().then((info) => {
try{
let lastDB = info.trim().split('\n').pop().match(/db(\d+)/)[1];
Expand Down
10 changes: 6 additions & 4 deletions src/components/Status.vue
Original file line number Diff line number Diff line change
Expand Up @@ -230,10 +230,12 @@ export default {
this.connectionStatus = this.initStatus(reply);
}).catch((e) => {
// info command may be disabled
this.$message.error({
message: this.$t('message.info_disabled'),
duration: 3000,
});
if (e.message == "ERR unknown command 'info'") {
this.$message.error({
message: this.$t('message.info_disabled'),
duration: 3000,
});
}
});
},
refreshInit() {
Expand Down

0 comments on commit 286d455

Please sign in to comment.