diff --git a/backend/apps/datasource/models/datasource.py b/backend/apps/datasource/models/datasource.py index 2f5f4a45..fe7ea999 100644 --- a/backend/apps/datasource/models/datasource.py +++ b/backend/apps/datasource/models/datasource.py @@ -121,6 +121,7 @@ class DatasourceConf(BaseModel): mode: str = '' timeout: int = 30 lowVersion: bool = False + ssl: bool = False def to_dict(self): return { @@ -136,7 +137,8 @@ def to_dict(self): "sheets": self.sheets, "mode": self.mode, "timeout": self.timeout, - "lowVersion": self.lowVersion + "lowVersion": self.lowVersion, + "ssl": self.ssl } diff --git a/backend/apps/db/db.py b/backend/apps/db/db.py index a2aab2a7..bbf9e97e 100644 --- a/backend/apps/db/db.py +++ b/backend/apps/db/db.py @@ -155,7 +155,8 @@ def get_engine(ds: CoreDatasource, timeout: int = 0) -> Engine: elif equals_ignore_case(ds.type, 'oracle'): engine = create_engine(get_uri(ds), poolclass=NullPool) elif equals_ignore_case(ds.type, 'mysql'): # mysql - engine = create_engine(get_uri(ds), connect_args={"connect_timeout": conf.timeout, "ssl": {"require": True}}, poolclass=NullPool) + ssl_mode = {"require": True} if conf.ssl else None + engine = create_engine(get_uri(ds), connect_args={"connect_timeout": conf.timeout, "ssl": ssl_mode}, poolclass=NullPool) else: # ck engine = create_engine(get_uri(ds), connect_args={"connect_timeout": conf.timeout}, poolclass=NullPool) return engine diff --git a/backend/apps/mcp/mcp.py b/backend/apps/mcp/mcp.py index e8cec6de..bd5f560b 100644 --- a/backend/apps/mcp/mcp.py +++ b/backend/apps/mcp/mcp.py @@ -144,6 +144,7 @@ async def mcp_question(session: SessionDep, chat: McpQuestion): in_chat=False, stream=chat.stream) +# Cordys crm @router.post("/mcp_assistant", operation_id="mcp_assistant") async def mcp_assistant(session: SessionDep, chat: McpAssistant): session_user = BaseUserDTO(**{ diff --git a/frontend/src/i18n/en.json b/frontend/src/i18n/en.json index 9ec21098..13cb9b8c 100644 --- a/frontend/src/i18n/en.json +++ b/frontend/src/i18n/en.json @@ -391,7 +391,8 @@ }, "timeout": "Connection Timeout(second)", "address": "Address", - "low_version": "Compatible with lower versions" + "low_version": "Compatible with lower versions", + "ssl": "Enable SSL" }, "sync_fields": "Sync Fields" }, diff --git a/frontend/src/i18n/ko-KR.json b/frontend/src/i18n/ko-KR.json index 31040698..aa1b38bd 100644 --- a/frontend/src/i18n/ko-KR.json +++ b/frontend/src/i18n/ko-KR.json @@ -391,7 +391,8 @@ }, "timeout": "연결 시간 초과(초)", "address": "주소", - "low_version": "낮은 버전 호환" + "low_version": "낮은 버전 호환", + "ssl": "SSL 활성화" }, "sync_fields": "동기화된 테이블 구조" }, diff --git a/frontend/src/i18n/zh-CN.json b/frontend/src/i18n/zh-CN.json index 24f70ab6..5c7a7843 100644 --- a/frontend/src/i18n/zh-CN.json +++ b/frontend/src/i18n/zh-CN.json @@ -391,7 +391,8 @@ }, "timeout": "连接超时(秒)", "address": "地址", - "low_version": "兼容低版本" + "low_version": "兼容低版本", + "ssl": "启用 SSL" }, "sync_fields": "同步表结构" }, diff --git a/frontend/src/views/ds/DatasourceForm.vue b/frontend/src/views/ds/DatasourceForm.vue index 62d37bc7..045fb3c0 100644 --- a/frontend/src/views/ds/DatasourceForm.vue +++ b/frontend/src/views/ds/DatasourceForm.vue @@ -117,6 +117,7 @@ const form = ref({ mode: 'service_name', timeout: 30, lowVersion: false, + ssl: false, }) const close = () => { @@ -164,6 +165,10 @@ const initForm = (item: any, editTable: boolean = false) => { configuration.lowVersion !== null && configuration.lowVersion !== undefined ? configuration.lowVersion : true + form.value.ssl = + configuration.ssl !== null && configuration.ssl !== undefined + ? configuration.ssl + : false } if (editTable) { @@ -236,6 +241,7 @@ const initForm = (item: any, editTable: boolean = false) => { mode: 'service_name', timeout: 30, lowVersion: false, + ssl: false, } } dialogVisible.value = true @@ -324,6 +330,7 @@ const buildConf = () => { mode: form.value.mode, timeout: form.value.timeout, lowVersion: form.value.lowVersion, + ssl: form.value.ssl, }) ) const obj = JSON.parse(JSON.stringify(form.value)) @@ -340,6 +347,7 @@ const buildConf = () => { delete obj.mode delete obj.timeout delete obj.lowVersion + delete obj.ssl return obj } @@ -686,6 +694,13 @@ defineExpose({ > + + +