mirror of
https://github.com/labring/FastGPT.git
synced 2025-07-30 10:28:42 +00:00
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:
@@ -1,6 +1,7 @@
|
||||
import { useTranslation } from 'next-i18next';
|
||||
import { useToast } from '@fastgpt/web/hooks/useToast';
|
||||
import { useCallback } from 'react';
|
||||
import { hasHttps } from '@fastgpt/web/common/system/utils';
|
||||
|
||||
/**
|
||||
* copy text data
|
||||
@@ -16,7 +17,7 @@ export const useCopyData = () => {
|
||||
duration = 1000
|
||||
) => {
|
||||
try {
|
||||
if (navigator.clipboard) {
|
||||
if (hasHttps() && navigator.clipboard) {
|
||||
await navigator.clipboard.writeText(data);
|
||||
} else {
|
||||
throw new Error('');
|
||||
|
@@ -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
|
||||
}))
|
||||
);
|
||||
|
Reference in New Issue
Block a user