Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion backend/apps/datasource/models/datasource.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ class DatasourceConf(BaseModel):
mode: str = ''
timeout: int = 30
lowVersion: bool = False
ssl: bool = False

def to_dict(self):
return {
Expand All @@ -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
}


Expand Down
3 changes: 2 additions & 1 deletion backend/apps/db/db.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions backend/apps/mcp/mcp.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(**{
Expand Down
3 changes: 2 additions & 1 deletion frontend/src/i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
},
Expand Down
3 changes: 2 additions & 1 deletion frontend/src/i18n/ko-KR.json
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,8 @@
},
"timeout": "연결 시간 초과(초)",
"address": "주소",
"low_version": "낮은 버전 호환"
"low_version": "낮은 버전 호환",
"ssl": "SSL 활성화"
},
"sync_fields": "동기화된 테이블 구조"
},
Expand Down
3 changes: 2 additions & 1 deletion frontend/src/i18n/zh-CN.json
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,8 @@
},
"timeout": "连接超时(秒)",
"address": "地址",
"low_version": "兼容低版本"
"low_version": "兼容低版本",
"ssl": "启用 SSL"
},
"sync_fields": "同步表结构"
},
Expand Down
15 changes: 15 additions & 0 deletions frontend/src/views/ds/DatasourceForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ const form = ref<any>({
mode: 'service_name',
timeout: 30,
lowVersion: false,
ssl: false,
})

const close = () => {
Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -236,6 +241,7 @@ const initForm = (item: any, editTable: boolean = false) => {
mode: 'service_name',
timeout: 30,
lowVersion: false,
ssl: false,
}
}
dialogVisible.value = true
Expand Down Expand Up @@ -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))
Expand All @@ -340,6 +347,7 @@ const buildConf = () => {
delete obj.mode
delete obj.timeout
delete obj.lowVersion
delete obj.ssl
return obj
}

Expand Down Expand Up @@ -686,6 +694,13 @@ defineExpose({
>
<el-checkbox v-model="form.lowVersion" :label="t('ds.form.low_version')" />
</el-form-item>
<el-form-item
v-if="form.type === 'mysql'"
:label="t('ds.form.ssl')"
prop="ssl"
>
<el-switch v-model="form.ssl" />
</el-form-item>
<el-form-item v-if="form.type !== 'es'" :label="t('ds.form.extra_jdbc')">
<el-input
v-model="form.extraJdbc"
Expand Down
Loading