App run node update (#2542)

* feat(workflow): allow apps to be invoked like plugins (#2521)

* feat(workflow): allow apps to be invoked like plugins

* fix type

* Encapsulate SSE response methods (#2530)

* perf: sse response fn

* perf: sse response

* fix: ts

* perf: not ssl copy

* perf: myselect auto scroll

* perf: run app code

* fix: app plugin (#2538)

---------

Co-authored-by: heheer <heheer@sealos.io>
This commit is contained in:
Archer
2024-08-27 16:43:19 +08:00
committed by GitHub
parent 67445b40bc
commit 450167c951
67 changed files with 706 additions and 4899 deletions

View File

@@ -7,7 +7,7 @@ import type {
} from '@fastgpt/global/core/workflow/type/node';
import { getMyApps } from '../api';
import type { ListAppBody } from '@/pages/api/core/app/list';
import { FlowNodeTypeEnum } from '@fastgpt/global/core/workflow/node/constant';
import { defaultNodeVersion, FlowNodeTypeEnum } from '@fastgpt/global/core/workflow/node/constant';
import { FlowNodeTemplateTypeEnum } from '@fastgpt/global/core/workflow/constants';
import type { GetPreviewNodeQuery } from '@/pages/api/core/app/plugin/getPreviewNode';
import { AppTypeEnum } from '@fastgpt/global/core/app/constants';
@@ -23,12 +23,15 @@ export const getTeamPlugTemplates = (data?: ListAppBody) =>
pluginId: app._id,
isFolder: app.type === AppTypeEnum.folder || app.type === AppTypeEnum.httpPlugin,
templateType: FlowNodeTemplateTypeEnum.teamApp,
flowNodeType: FlowNodeTypeEnum.pluginModule,
flowNodeType:
app.type === AppTypeEnum.workflow
? FlowNodeTypeEnum.appModule
: FlowNodeTypeEnum.pluginModule,
avatar: app.avatar,
name: app.name,
intro: app.intro,
showStatus: false,
version: app.pluginData?.nodeVersion || '481',
version: app.pluginData?.nodeVersion || defaultNodeVersion,
isTool: true
}))
);