feat: keep alive interval in seconds

This commit is contained in:
Fabio Di Stasio 2023-09-04 16:27:50 +02:00
parent fbe271af37
commit 8d605ee287
3 changed files with 22 additions and 14 deletions

View File

@ -52,7 +52,7 @@ export default (connections: {[key: string]: antares.Client}) => {
port: conn.sshPort ? conn.sshPort : 22, port: conn.sshPort ? conn.sshPort : 22,
privateKey: conn.sshKey ? fs.readFileSync(conn.sshKey).toString() : null, privateKey: conn.sshKey ? fs.readFileSync(conn.sshKey).toString() : null,
passphrase: conn.sshPassphrase, passphrase: conn.sshPassphrase,
keepaliveInterval: conn.sshKeepAliveInterval ?? 30*60*1000 keepaliveInterval: conn.sshKeepAliveInterval ?? conn.sshKeepAliveInterval*1000
}; };
} }
@ -132,7 +132,7 @@ export default (connections: {[key: string]: antares.Client}) => {
port: conn.sshPort ? conn.sshPort : 22, port: conn.sshPort ? conn.sshPort : 22,
privateKey: conn.sshKey ? fs.readFileSync(conn.sshKey).toString() : null, privateKey: conn.sshKey ? fs.readFileSync(conn.sshKey).toString() : null,
passphrase: conn.sshPassphrase, passphrase: conn.sshPassphrase,
keepaliveInterval: conn.sshKeepAliveInterval ?? 30*60*1000 keepaliveInterval: conn.sshKeepAliveInterval ?? conn.sshKeepAliveInterval*1000
}; };
} }

View File

@ -361,12 +361,15 @@
<label class="form-label cut-text">{{ t('connection.keepAliveInterval') }}</label> <label class="form-label cut-text">{{ t('connection.keepAliveInterval') }}</label>
</div> </div>
<div class="column col-7 col-sm-12"> <div class="column col-7 col-sm-12">
<input <div class="input-group">
v-model="connection.sshKeepAliveInterval" <input
class="form-input" v-model="connection.sshKeepAliveInterval"
type="number" class="form-input"
min="1" type="number"
> min="1"
>
<span class="input-group-addon">{{ t('general.seconds') }}</span>
</div>
</div> </div>
</div> </div>
</fieldset> </fieldset>
@ -456,8 +459,10 @@ const connection = ref({
sshHost: '', sshHost: '',
sshUser: '', sshUser: '',
sshPass: '', sshPass: '',
sshPassphrase: null,
sshKey: '', sshKey: '',
sshPort: 22, sshPort: 22,
sshKeepAliveInterval: 1800,
pgConnString: '' pgConnString: ''
}) as Ref<ConnectionParams & { pgConnString: string }>; }) as Ref<ConnectionParams & { pgConnString: string }>;

View File

@ -363,12 +363,15 @@
<label class="form-label cut-text">{{ t('connection.keepAliveInterval') }}</label> <label class="form-label cut-text">{{ t('connection.keepAliveInterval') }}</label>
</div> </div>
<div class="column col-7 col-sm-12"> <div class="column col-7 col-sm-12">
<input <div class="input-group">
v-model="localConnection.sshKeepAliveInterval" <input
class="form-input" v-model="localConnection.sshKeepAliveInterval"
type="number" class="form-input"
min="1" type="number"
> min="1"
>
<span class="input-group-addon">{{ t('general.seconds') }}</span>
</div>
</div> </div>
</div> </div>
</fieldset> </fieldset>