Skip to content

Open-source LLM knowledge platform: turn raw documents into a queryable RAG, an autonomous reasoning agent, and a self-maintaining Wiki.

fix: skip credential validation when editing data source

langcaiye3c2ee171cb1e
diff --git a/frontend/src/views/knowledge/settings/DataSourceEditorDialog.vue b/frontend/src/views/knowledge/settings/DataSourceEditorDialog.vue
index 1ce900387..6f4b6ef10 100644
--- a/frontend/src/views/knowledge/settings/DataSourceEditorDialog.vue
+++ b/frontend/src/views/knowledge/settings/DataSourceEditorDialog.vue
@@ -311,12 +311,14 @@ function selectType(def: ConnectorDef) {
// --- Test connection (stateless, no DB write) ---
async function testConnection() {
- const fields = currentDef.value?.fields || []
- for (const f of fields) {
- if (f.optional) continue
- if (!form.value.config.credentials[f.key]) {
- MessagePlugin.warning(`${t(f.labelKey)} ${t('datasource.isRequired')}`)
- return
+ if (!isEdit.value || !credentialsConfigured.value || replaceCredentialsMode.value) {
+ const fields = currentDef.value?.fields || []
+ for (const f of fields) {
+ if (f.optional) continue
+ if (!form.value.config.credentials[f.key]) {
+ MessagePlugin.warning(`${t(f.labelKey)} ${t('datasource.isRequired')}`)
+ return
+ }
}
}
@@ -441,6 +443,10 @@ function toggleResource(id: string) {
}
function validateStep1Fields(): boolean {
+ if (isEdit.value && credentialsConfigured.value && !replaceCredentialsMode.value) {
+ return true
+ }
+
const fields = currentDef.value?.fields || []
for (const f of fields) {
if (f.optional) continue