diff --git a/apps/desktop/src/components/connection/ConnectionDialog.vue b/apps/desktop/src/components/connection/ConnectionDialog.vue index bb571bf3c..0a7532747 100644 --- a/apps/desktop/src/components/connection/ConnectionDialog.vue +++ b/apps/desktop/src/components/connection/ConnectionDialog.vue @@ -40,6 +40,7 @@ import { MQ_PINNED_VERSION_OPTIONS, pinnedVersionToSelection, selectionToPinnedV import { mongodbAuthFailureHint, mongoUrlParam, mongoUrlParamIsTrue, normalizeMongoTlsFormState, setMongoUrlParam, setMongoUrlParamBoolean } from "@/lib/mongo/mongoConnectionOptions"; import { mysqlCleartextPasswordAuthEnabled, setMysqlCleartextPasswordAuthEnabled } from "@/lib/database/mysqlConnectionOptions"; import { applyDamengSslUrlParams, damengSslFormConfig } from "@/lib/database/damengSslOptions"; +import { DamengJvmSystemPropertyError, damengJvmSystemPropertiesText, parseDamengJvmSystemProperties } from "@/lib/database/damengJvmOptions"; import { copyToClipboard } from "@/lib/common/clipboard"; import { configuredDatabaseProductName, connectionConfigFingerprint, databaseInfoCopyText, databaseInfoRows, normalizeDatabaseConnectionInfo, type DatabaseInfoField } from "@/lib/connection/connectionDatabaseInfo"; import { agentDriverInstallKey, appendAgentDriverUpdateHint, hasAgentDriverUpdate, showAgentDriverInstallHint, type AgentDriverInstallState, type DriverStoreFocus } from "@/lib/connection/agentDriverInstallHint"; @@ -532,6 +533,7 @@ const hiveKrb5ConfPath = ref(""); const hiveJaasConfigPath = ref(""); const hiveUseSubjectCredsOnlyFalse = ref(false); const hiveExtraJavaOptions = ref(""); +const damengJvmOptions = ref(""); const dialogStep = ref("select"); const dbPickerView = ref(loadConnectionPickerView()); const dbSearchQuery = ref(""); @@ -1180,6 +1182,10 @@ function resetHiveKerberosFields(config?: Pick) { + damengJvmOptions.value = damengJvmSystemPropertiesText(config?.agent_java_options); +} + function buildInfluxDbExternalConfig(): InfluxDbExternalConfig { if (influxDbVersion.value !== "2") return { version: "1" }; const org = influxDbOrg.value.trim(); @@ -1850,6 +1856,7 @@ function applyProfile(val: string, preserveConnectionFields = false) { form.value.username = profile.user; form.value.url_params = profile.urlParams || ""; form.value.agent_java_options = []; + damengJvmOptions.value = ""; if (profile.host) { form.value.host = profile.host; } @@ -2013,6 +2020,7 @@ watch( } resetElasticsearchProxyFields(config.db_type === "elasticsearch" ? config.external_config : undefined); resetHiveKerberosFields(config.db_type === "hive" ? config : undefined); + resetDamengJvmOptions(config.db_type === "dameng" ? config : undefined); h2ConnectionMode.value = h2ConnectionModeForConfig(config); customColorInput.value = config.color || ""; selectedTransportLayerId.value = form.value.transport_layers?.[0]?.id || null; @@ -2050,6 +2058,7 @@ watch( resetInfluxDbFields(); resetElasticsearchProxyFields(); resetHiveKerberosFields(); + resetDamengJvmOptions(); oceanbaseSubMode.value = "mysql"; h2ConnectionMode.value = "file"; dremioConnectionMode.value = "legacy"; @@ -3137,6 +3146,15 @@ function connectionConfigForSubmit(id: string, generatedName = ""): ConnectionCo }); config.url_params = hiveKerberos.urlParams; config.agent_java_options = hiveKerberos.agentJavaOptions; + } else if (config.db_type === "dameng") { + try { + config.agent_java_options = parseDamengJvmSystemProperties(damengJvmOptions.value); + } catch (error) { + if (error instanceof DamengJvmSystemPropertyError) { + throw new Error(t("connection.damengJvmOptionsInvalid", { line: error.lineNumber })); + } + throw error; + } } else if (!(config.db_type === "jdbc" && config.driver_profile === JDBCX_DRIVER_PROFILE)) { config.agent_java_options = undefined; } @@ -6080,6 +6098,20 @@ function openExternalUrl(url: string) { +
+ +
+