Skip to content

Commit 11747ab

Browse files
committed
fix(Data source ): repeatedly retrieves schema
1 parent 5f49187 commit 11747ab

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

frontend/src/views/ds/DatasourceForm.vue

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -341,16 +341,13 @@ const check = () => {
341341
}
342342
})
343343
}
344-
345-
const getSchema = () => {
344+
const getSchema = debounce(() => {
346345
schemaList.value = []
347346
const requestObj = buildConf()
348347
datasourceApi.getSchema(requestObj).then((res: any) => {
349-
for (let item of res) {
350-
schemaList.value.push({ label: item, value: item })
351-
}
348+
schemaList.value = (res || []).map((item: any) => ({ label: item, value: item }))
352349
})
353-
}
350+
}, 300)
354351
355352
onBeforeUnmount(() => (saveLoading.value = false))
356353

0 commit comments

Comments
 (0)