Skip to content

Commit

Permalink
Merge pull request #366 from qishibo/sshtimeout
Browse files Browse the repository at this point in the history
ssh custom timeout support
  • Loading branch information
qishibo authored Nov 6, 2020
2 parents aa38cb9 + 6948a88 commit f65df0c
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 12 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ Download latest [AppImage](https://github.com/qishibo/AnotherRedisDesktopManager

## Feature Log

- 2020-11-03: Binary View Support && SSH Passparse\Timeout Support
- 2020-09-04: SSH Cluster Support && Extension Commands Support
- 2020-06-18: SSL/TLS Support!!!
- 2020-04-28: Page Zoom && Big Key Loads With Scan && Auto Json
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.8",
"version": "1.3.9",
"description": "A faster, better and more stable redis desktop manager.",
"author": "qii404.me",
"private": true,
Expand Down
54 changes: 46 additions & 8 deletions src/components/NewConnectionDialog.vue
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<template>
<el-dialog :title="dialogTitle" :visible.sync="dialogVisible" :append-to-body='true' :close-on-click-modal='false'>
<el-dialog :title="dialogTitle" :visible.sync="dialogVisible" :append-to-body='true' :close-on-click-modal='false' class='new-connection-dailog'>
<!-- redis connection form -->
<el-form :label-position="labelPosition" label-width="90px">
<el-form-item label="Host">
<el-input v-model="connection.host" autocomplete="off" placeholder="127.0.0.1"></el-input>
</el-form-item>

<el-form-item label="Port">
<el-input v-model="connection.port" autocomplete="off" placeholder="6379"></el-input>
<el-input type='number' v-model="connection.port" autocomplete="off" placeholder="6379"></el-input>
</el-form-item>

<el-form-item label="Auth">
Expand All @@ -21,21 +21,29 @@
<el-form-item label="">
<el-checkbox v-model="sshOptionsShow">SSH Tunnel</el-checkbox>
<el-checkbox v-model="sslOptionsShow">SSL</el-checkbox>
<el-checkbox v-model="connection.cluster">Cluster</el-checkbox>
<el-popover trigger="hover">
<i slot="reference" class="el-icon-question"></i>
{{ $t('message.cluster_faq') }}
</el-popover>
<!-- <el-checkbox v-model="connection.sentinel">Sentinel</el-checkbox> -->
<el-checkbox v-model="connection.cluster">
Cluster
<el-popover trigger="hover">
<i slot="reference" class="el-icon-question"></i>
{{ $t('message.cluster_faq') }}
</el-popover>
</el-checkbox>

</el-form-item>

<!-- ssh connection form -->
<el-form v-if="sshOptionsShow" v-show="sshOptionsShow" label-width="90px">
<fieldset>
<legend>SSH Tunnel</legend>
</fieldset>

<el-form-item label="Host">
<el-input v-model="connection.sshOptions.host" autocomplete="off"></el-input>
</el-form-item>

<el-form-item label="Port">
<el-input v-model="connection.sshOptions.port" autocomplete="off"></el-input>
<el-input type='number' v-model="connection.sshOptions.port" autocomplete="off"></el-input>
</el-form-item>

<el-form-item label="Username">
Expand All @@ -56,10 +64,18 @@
<el-form-item label="Passphrase">
<el-input v-model="connection.sshOptions.passphrase" type='password' autocomplete="off"></el-input>
</el-form-item>

<el-form-item label="Timeout">
<el-input type='number' v-model="connection.sshOptions.timeout" autocomplete="off" placeholder='SSH Timeout (Seconds)'></el-input>
</el-form-item>
</el-form>

<!-- SSL connection form -->
<el-form v-if="sslOptionsShow" v-show="sslOptionsShow" label-width="90px">
<fieldset>
<legend>SSL</legend>
</fieldset>

<el-form-item label="PrivateKey">
<FileInput :file.sync='connection.sslOptions.key' placeholder='SSL Private Key Pem (key)'></FileInput>
</el-form-item>
Expand Down Expand Up @@ -97,13 +113,15 @@ export default {
auth: '',
name: '',
cluster: false,
// sentinel: false,
sshOptions: {
host: '',
port: 22,
username: '',
password: '',
privatekey: '',
passphrase: '',
timeout: 30,
},
sslOptions: {
key: '',
Expand Down Expand Up @@ -188,3 +206,23 @@ export default {
},
}
</script>

<style type="text/css" scoped>
.new-connection-dailog, .el-checkbox {
margin-left: 0;
margin-right: 15px;
}

fieldset {
border-width: 2px 0 0 0;
border-color: #fff;
font-weight: bold;
color: #bdc5ce;
font-size: 105%;
margin-bottom: 3px;
}
.dark-mode fieldset {
color: #416586;
border-color: #7b95ad;
}
</style>
6 changes: 3 additions & 3 deletions src/redisClient.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export default {
password: sshOptions.password,
host: sshOptions.host,
port: sshOptions.port,
readyTimeout: 20000,
readyTimeout: (sshOptions.timeout) > 0 ? (sshOptions.timeout * 1000) : 30000,
dstHost: host,
dstPort: port,
localHost: '127.0.0.1',
Expand Down Expand Up @@ -103,7 +103,7 @@ export default {

getRedisOptions(host, port, auth, config) {
return {
connectTimeout: 20000,
connectTimeout: 30000,
retryStrategy: (times) => {return this.retryStragety(times, {host, port})},
enableReadyCheck: false,
connectionName: config.connectionName ? config.connectionName : null,
Expand All @@ -116,7 +116,7 @@ export default {
return {
connectionName: redisOptions.connectionName,
enableReadyCheck: false,
slotsRefreshTimeout: 20000,
slotsRefreshTimeout: 30000,
redisOptions: redisOptions,
natMap: natMap,
};
Expand Down

0 comments on commit f65df0c

Please sign in to comment.