mirror of
https://github.com/csunny/DB-GPT.git
synced 2025-09-13 21:21:08 +00:00
Merge branch 'feat/dev-0.6' of https://github.com/eosphoros-ai/DB-GPT into feat/dev-0.6
This commit is contained in:
@@ -153,9 +153,11 @@ const ChatSider: React.FC<{
|
||||
listLoading: boolean;
|
||||
order: React.MutableRefObject<number>;
|
||||
}> = ({ dialogueList = [], refresh, historyLoading, listLoading, order }) => {
|
||||
const searchParams = useSearchParams();
|
||||
const scene = searchParams?.get('scene') ?? '';
|
||||
const { t } = useTranslation();
|
||||
const { mode } = useContext(ChatContext);
|
||||
const [collapsed, setCollapsed] = useState<boolean>(true);
|
||||
const [collapsed, setCollapsed] = useState<boolean>(scene === 'chat_dashboard');
|
||||
|
||||
// 展开或收起列表按钮样式
|
||||
const triggerStyle: React.CSSProperties = useMemo(() => {
|
||||
@@ -207,7 +209,7 @@ const ChatSider: React.FC<{
|
||||
item={{
|
||||
label: t('assistant'),
|
||||
key: 'default',
|
||||
icon: <Image src="/logo_s_latest.png" alt="default" width={24} height={24} />,
|
||||
icon: <Image src="/LOGO_SMALL.png" alt="default" width={24} height={24} className='flex-1' />,
|
||||
default: true,
|
||||
}}
|
||||
order={order}
|
||||
|
@@ -177,10 +177,18 @@ const Canvas: React.FC<Props> = () => {
|
||||
}
|
||||
|
||||
async function handleSaveFlow() {
|
||||
const { name, label, description = '', editable = false } = form.getFieldsValue();
|
||||
const { name, label, description = '', editable = false, deploy = false } = form.getFieldsValue();
|
||||
const reactFlowObject = mapHumpToUnderline(reactFlow.toObject() as IFlowData);
|
||||
if (id) {
|
||||
const [, , res] = await apiInterceptors(updateFlowById(id, { name, label, description, editable, uid: id, flow_data: reactFlowObject }));
|
||||
const [, , res] = await apiInterceptors(updateFlowById(id, {
|
||||
name,
|
||||
label,
|
||||
description,
|
||||
editable,
|
||||
uid: id,
|
||||
flow_data: reactFlowObject,
|
||||
state: deploy ? 'deployed' : 'developing',
|
||||
}));
|
||||
setIsModalVisible(false);
|
||||
if (res?.success) {
|
||||
message.success('编辑成功');
|
||||
@@ -190,7 +198,7 @@ const Canvas: React.FC<Props> = () => {
|
||||
message.error(res?.err_msg);
|
||||
}
|
||||
} else {
|
||||
const [_, res] = await apiInterceptors(addFlow({ name, label, description, editable, flow_data: reactFlowObject }));
|
||||
const [_, res] = await apiInterceptors(addFlow({ name, label, description, editable, flow_data: reactFlowObject, state: deploy ? 'deployed' : 'developing' }));
|
||||
setIsModalVisible(false);
|
||||
replace('/construct/flow');
|
||||
message.success('创建成功');
|
||||
@@ -274,7 +282,7 @@ const Canvas: React.FC<Props> = () => {
|
||||
<Form.Item label="Editable" name="editable" initialValue={id ? flowInfo?.editable : true} valuePropName="checked">
|
||||
<Checkbox></Checkbox>
|
||||
</Form.Item>
|
||||
<Form.Item label="Deploy" name="deploy" initialValue={id ? flowInfo?.deploy : true} valuePropName="checked">
|
||||
<Form.Item label="Deploy" name="deploy" initialValue={id ? (flowInfo?.state === 'deployed' || flowInfo?.state === 'running') : true} valuePropName="checked">
|
||||
<Checkbox></Checkbox>
|
||||
</Form.Item>
|
||||
<Form.Item wrapperCol={{ offset: 8, span: 16 }}>
|
||||
|
Reference in New Issue
Block a user