fix(postgres): 支持旧版 TLS 兼容模式

This commit is contained in:
zipg authored and t8y2 committed 2026-08-21 10:52:27 +08:00
1 parent 12da615daa
commit ab0ff28fe4
16 files changed
+537 -20

No files matched your search

@@ -60,7 +60,7 @@ import { connectionAttemptOriginalErrorMessage, connectionAttemptTimeoutMessage,
import { consulAgentAddressesMatch } from "@/lib/consul/agentTarget";
import { appendConnectionErrorHints, isJdbcMissingRuntimeDependencyError } from "@/lib/connection/connectionErrorHints";
import { preventDialogDocumentSelectAll } from "@/lib/connection/dialogTextSelection";
import { postgresTlsModeForForm } from "@/lib/connection/postgresTlsMode";
import { postgresLegacyTlsEnabled, postgresTlsModeForForm, setPostgresLegacyTlsEnabled } from "@/lib/connection/postgresTlsMode";
import { buildMqKafkaConnectionExtra, mqKafkaConnectionTarget, resolveMqKafkaConnectionSource, type MqKafkaConnectionSource } from "@/lib/connection/mqKafkaConnection";
import { assertCompleteDatabaseCategories, databaseSelectionForCategory } from "@/lib/connection/databaseCategoryOptions";
import { loadConnectionPickerView, saveConnectionPickerView, type DbPickerView } from "@/lib/connection/connectionPickerViewPreference";
@@ -3424,6 +3424,12 @@ const postgresTlsMode = computed({
form.value.url_params = setUrlParam(form.value.url_params, "sslmode", value);
},
});
const postgresLegacyTls = computed({
get: () => postgresLegacyTlsEnabled(form.value.url_params),
set: (value: boolean) => {
form.value.url_params = setPostgresLegacyTlsEnabled(form.value.url_params, value);
},
});
const postgresRootCertPath = computed({
get: () => getUrlParam(form.value.url_params, "sslrootcert"),
set: (value: string) => {
@@ -8166,6 +8172,16 @@ function openExternalUrl(url: string) {
</Select>
</div>
<div class="grid grid-cols-4 items-center gap-4">
<Label :class="connectionLabelSmallClass">{{ t("connection.postgresLegacyTls") }}</Label>
<div class="col-span-3 flex items-center gap-2">
<Switch v-model="postgresLegacyTls" :disabled="postgresTlsMode === 'disable'" />
<HelpTooltip :label="t('connection.postgresLegacyTlsHint')">
{{ t("connection.postgresLegacyTlsHint") }}
</HelpTooltip>
</div>
</div>
<div class="grid grid-cols-4 items-start gap-4">
<Label :class="connectionLabelSmallPaddedClass">
<span class="inline-flex items-center justify-end gap-1">