diff --git a/backend/apps/chat/api/chat.py b/backend/apps/chat/api/chat.py index 1a8eaedc..4f9fbc92 100644 --- a/backend/apps/chat/api/chat.py +++ b/backend/apps/chat/api/chat.py @@ -1,8 +1,7 @@ -import json -import orjson import traceback from typing import List +import orjson from fastapi import APIRouter, HTTPException from fastapi.responses import StreamingResponse from sqlmodel import select @@ -97,7 +96,7 @@ async def stream_sql(session: SessionDep, current_user: CurrentUser, request_que detail="No available datasource configuration found" ) - request_question.engine = ds.type_name + request_question.engine = ds.type_name if ds.type != 'excel' else 'PostgreSQL' # Get available AI model aimodel = session.exec(select(AiModelDetail).where( diff --git a/frontend/src/views/ds/TableList.vue b/frontend/src/views/ds/TableList.vue index 77be2fc3..ae7af207 100644 --- a/frontend/src/views/ds/TableList.vue +++ b/frontend/src/views/ds/TableList.vue @@ -213,7 +213,14 @@ const editField = (row: any) => { const changeStatus = (row: any) => { currentField.value = row - saveField() + datasourceApi.saveField(currentField.value).then(() => { + closeField() + ElMessage({ + message: t('common.save_success'), + type: 'success', + showClose: true, + }) + }) } const closeField = () => {