mirror of
https://github.com/Syngnat/GoNavi.git
synced 2026-08-03 12:18:48 +08:00
✨ feat(connection): 支持生产连接多项保护策略
- 新增数据编辑、结构编辑、脚本执行和数据导入四类连接级保护配置 - 升级生产连接保护弹窗为多选卡片,并修复选项对齐与勾选态显示 - 按保护类型收口 QueryEditor、DataGrid、表设计、导入与同步目标入口 - 后端统一拦截 SQL 或 Mongo 写操作、结果编辑、结构变更和导入写入 - AI 本地工具与 RPC 执行链路透传连接保护配置并复用后端守卫 - 补充多语言文案、定向测试与需求追踪记录
This commit is contained in:
@@ -62,6 +62,7 @@ import {
|
||||
import { getCustomConnectionDsnValidationMessage } from "../utils/customConnectionDsn";
|
||||
import { mergeParsedUriValuesForForm } from "../utils/connectionUriMerge";
|
||||
import { buildRpcConnectionConfig } from "../utils/connectionRpcConfig";
|
||||
import { resolveConnectionProtectionConfig } from "../utils/connectionReadOnly";
|
||||
import { getCustomConnectionDriverHelp } from "../utils/driverImportGuidance";
|
||||
import { isBackendCancelledResult } from "../utils/connectionExport";
|
||||
import {
|
||||
@@ -1379,6 +1380,7 @@ const ConnectionModal: React.FC<{
|
||||
: Number(config.timeout || 30);
|
||||
const hasHttpTunnel = !!config.useHttpTunnel;
|
||||
const hasProxy = !hasHttpTunnel && !!config.useProxy;
|
||||
const protection = resolveConnectionProtectionConfig(config);
|
||||
form.setFieldsValue({
|
||||
type: configType,
|
||||
name: initialValues.name,
|
||||
@@ -1387,7 +1389,11 @@ const ConnectionModal: React.FC<{
|
||||
user: config.user,
|
||||
password: config.password,
|
||||
database: config.database,
|
||||
readOnly: config.readOnly === true,
|
||||
restrictDataEdit: protection.restrictDataEdit === true,
|
||||
restrictStructureEdit: protection.restrictStructureEdit === true,
|
||||
restrictScriptExecution:
|
||||
protection.restrictScriptExecution === true,
|
||||
restrictDataImport: protection.restrictDataImport === true,
|
||||
uri: config.uri || "",
|
||||
connectionParams:
|
||||
config.connectionParams ||
|
||||
|
||||
Reference in New Issue
Block a user