diff --git a/apps/desktop/src/components/connection/ConnectionDialog.vue b/apps/desktop/src/components/connection/ConnectionDialog.vue index a3e543c911..732a716bf8 100644 --- a/apps/desktop/src/components/connection/ConnectionDialog.vue +++ b/apps/desktop/src/components/connection/ConnectionDialog.vue @@ -112,6 +112,7 @@ const defaultForm = (): ConnectionForm => ({ connect_timeout_secs: 5, query_timeout_secs: 30, idle_timeout_secs: 60, + keepalive_interval_secs: 0, ssl: false, ca_cert_path: "", client_cert_path: "", @@ -249,6 +250,17 @@ function sshLayersForConfig(config: LegacyConnectionConfig): SshTunnelConfig[] { } const form = ref(defaultForm()); +const keepaliveEnabled = computed({ + get: () => Number(form.value.keepalive_interval_secs) > 0, + set: (enabled: boolean) => { + if (enabled) { + const current = Number(form.value.keepalive_interval_secs); + form.value.keepalive_interval_secs = Number.isFinite(current) && current > 0 ? current : 30; + } else { + form.value.keepalive_interval_secs = 0; + } + }, +}); const selectedTransportLayerId = ref(null); const draggedTransportLayerId = ref(null); const selectedType = ref("mysql"); @@ -579,6 +591,7 @@ watch( connect_timeout_secs: config.connect_timeout_secs || 5, query_timeout_secs: config.query_timeout_secs ?? 30, idle_timeout_secs: config.idle_timeout_secs ?? 60, + keepalive_interval_secs: config.keepalive_interval_secs ?? 0, ssl: config.ssl || false, ca_cert_path: config.ca_cert_path || "", client_cert_path: config.client_cert_path || "", @@ -1101,6 +1114,8 @@ function connectionConfigForSubmit(id: string): ConnectionConfig { config.query_timeout_secs = Number.isFinite(queryTimeout) && queryTimeout >= 0 ? queryTimeout : 30; const idleTimeout = Number(config.idle_timeout_secs); config.idle_timeout_secs = Number.isFinite(idleTimeout) && idleTimeout >= 0 ? idleTimeout : 60; + const keepaliveInterval = Number(config.keepalive_interval_secs); + config.keepalive_interval_secs = Number.isFinite(keepaliveInterval) && keepaliveInterval >= 0 ? keepaliveInterval : 0; if (config.db_type === "manticoresearch") { config.url_params = ""; } @@ -2977,6 +2992,13 @@ function openExternalUrl(url: string) { +
+ +
+ + +
+