mirror of
https://github.com/Syngnat/GoNavi.git
synced 2026-07-31 02:39:17 +08:00
Merge branch 'dev' into feature/20260602_connection_driver_i18n
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user