Merge branch 'dev' into feature/20260602_connection_driver_i18n

This commit is contained in:
tianqijiuyun-latiao
2026-06-23 23:34:16 +08:00
39 changed files with 3045 additions and 1840 deletions

View File

@@ -73,6 +73,11 @@ import {
saveSavedQueryToBackend,
type SavedQueryBackend,
} from "./utils/savedQueryPersistence";
import {
deriveLegacyConnectionReadOnlyFlag,
normalizeConnectionProtectionConfig,
resolveConnectionProtectionConfig,
} from "./utils/connectionReadOnly";
export interface AppearanceSettings extends DataGridDisplaySettings {
uiVersion: "legacy" | "v2";
@@ -797,6 +802,9 @@ const sanitizeConnectionConfig = (value: unknown): ConnectionConfig => {
supportsNetworkTunnel &&
(raw.useHttpTunnel === true || raw.UseHTTPTunnel === true);
const useProxy = supportsNetworkTunnel && !!raw.useProxy && !useHttpTunnel;
const normalizedProtection = normalizeConnectionProtectionConfig(
raw.protection,
);
const safeConfig: ConnectionConfig & Record<string, unknown> = {
...raw,
@@ -809,6 +817,7 @@ const sanitizeConnectionConfig = (value: unknown): ConnectionConfig => {
savePassword,
database: toTrimmedString(raw.database),
readOnly: raw.readOnly === true,
protection: normalizedProtection,
useSSL: sslCapable ? !!raw.useSSL : false,
sslMode: sslCapable ? sslMode : "disable",
sslCAPath: sslCapable ? toTrimmedString(raw.sslCAPath) : "",
@@ -862,6 +871,10 @@ const sanitizeConnectionConfig = (value: unknown): ConnectionConfig => {
),
};
const resolvedProtection = resolveConnectionProtectionConfig(safeConfig);
safeConfig.protection = resolvedProtection;
safeConfig.readOnly = deriveLegacyConnectionReadOnlyFlag(resolvedProtection);
if (type === "redis") {
safeConfig.redisDB = normalizeIntegerInRange(
raw.redisDB,