mirror of
https://github.com/langbot-app/LangBot.git
synced 2026-06-02 03:55:55 +00:00
feat: open pipeline edit dialog after creating
This commit is contained in:
@@ -23,6 +23,7 @@ import {
|
||||
export default function PipelineFormComponent({
|
||||
initValues,
|
||||
onFinish,
|
||||
onNewPipelineCreated,
|
||||
isEditMode,
|
||||
pipelineId,
|
||||
disableForm,
|
||||
@@ -33,6 +34,7 @@ export default function PipelineFormComponent({
|
||||
// 这里的写法很不安全不规范,未来流水线需要重新整理
|
||||
initValues?: PipelineFormEntity;
|
||||
onFinish: () => void;
|
||||
onNewPipelineCreated: (pipelineId: string) => void;
|
||||
}) {
|
||||
|
||||
const formSchema = isEditMode ? z.object({
|
||||
@@ -136,7 +138,10 @@ export default function PipelineFormComponent({
|
||||
description: values.basic.description,
|
||||
name: values.basic.name,
|
||||
};
|
||||
httpClient.createPipeline(pipeline).then(() => onFinish());
|
||||
httpClient.createPipeline(pipeline).then((resp) => {
|
||||
onFinish();
|
||||
onNewPipelineCreated(resp.uuid);
|
||||
});
|
||||
}
|
||||
|
||||
function handleModify(values: FormValues) {
|
||||
|
||||
@@ -90,6 +90,13 @@ export default function PluginConfigPage() {
|
||||
</DialogHeader>
|
||||
<div className="flex-1 overflow-y-auto px-6">
|
||||
<PipelineFormComponent
|
||||
onNewPipelineCreated={(pipelineId) => {
|
||||
setDisableForm(true);
|
||||
setIsEditForm(true);
|
||||
setModalOpen(true);
|
||||
setSelectedPipelineId(pipelineId);
|
||||
getSelectedPipelineForm(pipelineId);
|
||||
}}
|
||||
onFinish={() => {
|
||||
getPipelines();
|
||||
setModalOpen(false);
|
||||
|
||||
Reference in New Issue
Block a user