Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions document/content/docs/upgrading/4-14/4141.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,7 @@ curl --location --request POST 'https://{{host}}/api/admin/initv4141' \
3. 嵌套运行 Agent 时候,跳过节点队列未初始化,导致无法正常运行。
4. 判断器右侧是 number 引用时,会出现报错。
5. 工作流工具入参为文件选择时,未出现选择框。
6. 自动保存未增加团队云端保存记录。
7. HTTP 插件无法正确处理 http 协议(非 https)接口请求。
8. 文本类型的全局变量,默认值编辑框 UI。
9. 代码节点行数超过 100 行时显示重叠。
2 changes: 1 addition & 1 deletion document/data/doc-last-modified.json
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@
"document/content/docs/upgrading/4-13/4131.mdx": "2025-09-30T15:47:06+08:00",
"document/content/docs/upgrading/4-13/4132.mdx": "2025-10-21T11:46:53+08:00",
"document/content/docs/upgrading/4-14/4140.mdx": "2025-11-06T15:43:00+08:00",
"document/content/docs/upgrading/4-14/4141.mdx": "2025-11-09T22:26:17+08:00",
"document/content/docs/upgrading/4-14/4141.mdx": "2025-11-09T22:47:27+08:00",
"document/content/docs/upgrading/4-8/40.mdx": "2025-08-02T19:38:37+08:00",
"document/content/docs/upgrading/4-8/41.mdx": "2025-08-02T19:38:37+08:00",
"document/content/docs/upgrading/4-8/42.mdx": "2025-08-02T19:38:37+08:00",
Expand Down
7 changes: 7 additions & 0 deletions packages/global/core/app/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,13 @@ export const AppFolderTypeList = [
AppTypeEnum.httpPlugin
];

export const ToolTypeList = [
AppTypeEnum.mcpToolSet,
AppTypeEnum.httpToolSet,
AppTypeEnum.workflowTool
];
export const AppTypeList = [AppTypeEnum.simple, AppTypeEnum.agent, AppTypeEnum.workflow];

export const defaultTTSConfig: AppTTSConfigType = { type: 'web' };

export const defaultAutoExecuteConfig: AppAutoExecuteConfigType = {
Expand Down
5 changes: 4 additions & 1 deletion packages/service/core/app/http.ts
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,10 @@ export const runHTTPTool = async ({

const { data } = await axios({
method: method.toUpperCase(),
baseURL: baseUrl.startsWith('https://') ? baseUrl : `https://${baseUrl}`,
baseURL:
baseUrl.startsWith('http://') || baseUrl.startsWith('https://')
? baseUrl
: `https://${baseUrl}`,
url: toolPath,
headers,
data: body,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ const options = {
horizontalScrollbarSize: 8,
alwaysConsumeMouseWheel: false
},
lineNumbersMinChars: 0,
lineNumbersMinChars: 4,
fontSize: 14,
scrollBeyondLastLine: false,
folding: true,
Expand Down Expand Up @@ -129,7 +129,6 @@ const MyEditor = ({
py={1}
height={height}
position={'relative'}
pl={2}
{...props}
>
<Editor
Expand Down
1 change: 1 addition & 0 deletions packages/web/i18n/en/app.json
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@
"find_more_tools": "Explore more",
"go_to_chat": "Go to Conversation",
"go_to_run": "Go to Execution",
"has_no_create_per": "You do not have permission to create in the current directory.",
"hide_templates": "Collapse",
"http_toolset_add_tips": "Click the \"Add\" button to add tools",
"http_toolset_config_tips": "Click \"Start Configuration\" to add tools",
Expand Down
1 change: 1 addition & 0 deletions packages/web/i18n/zh-CN/app.json
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@
"find_more_tools": "探索更多",
"go_to_chat": "去对话",
"go_to_run": "去运行",
"has_no_create_per": "当前目录您无新建权限",
"hide_templates": "隐藏模板",
"http_toolset_add_tips": "点击添加按钮来添加工具",
"http_toolset_config_tips": "点击开始配置来添加工具",
Expand Down
1 change: 1 addition & 0 deletions packages/web/i18n/zh-Hant/app.json
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@
"find_more_tools": "探索更多",
"go_to_chat": "前往對話",
"go_to_run": "前往執行",
"has_no_create_per": "當前目錄您無新建權限",
"hide_templates": "隱藏模板",
"http_toolset_add_tips": "點擊添加按鈕來添加工具",
"http_toolset_config_tips": "點擊開始配置來添加工具",
Expand Down
1 change: 1 addition & 0 deletions projects/app/src/components/Layout/navbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ const Navbar = ({ unread }: { unread: number }) => {
link: `/dashboard/agent`,
activeLink: [
'/dashboard/agent',
'/dashboard/create',
'/app/detail',
'/dashboard/tool',
'/dashboard/systemTool',
Expand Down
73 changes: 38 additions & 35 deletions projects/app/src/components/common/Textarea/MyTextarea/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -123,42 +123,45 @@ const Editor = React.memo(function Editor({
}, []);

return (
<Box h={'100%'} w={'100%'} position={'relative'}>
<Textarea
ref={textareaRef}
maxW={'100%'}
as={autoHeight ? ResizeTextarea : undefined}
sx={
!showResize
? {
'::-webkit-resizer': {
display: 'none'
<Box h={'100%'} w={'100%'}>
<Box position={'relative'}>
<Textarea
ref={textareaRef}
maxW={'100%'}
as={autoHeight ? ResizeTextarea : undefined}
resize={showResize ? 'vertical' : 'none'}
sx={
!showResize
? {
'::-webkit-resizer': {
display: 'none !important'
}
}
}
: {}
}
{...props}
maxH={`${maxH}px`}
minH={`${minH}px`}
onChange={handleChange}
/>
{onOpenModal &&
maxH &&
textareaRef.current &&
textareaRef.current.scrollHeight > Number(maxH) && (
<Box
zIndex={1}
position={'absolute'}
bottom={1}
right={2}
cursor={'pointer'}
onClick={onOpenModal}
>
<MyTooltip label={t('common:ui.textarea.Magnifying')}>
<MyIcon name={'common/fullScreenLight'} w={'14px'} color={'myGray.600'} />
</MyTooltip>
</Box>
)}
: {}
}
{...props}
maxH={`${maxH}px`}
minH={`${minH}px`}
onChange={handleChange}
/>
{onOpenModal &&
maxH &&
textareaRef.current &&
textareaRef.current.scrollHeight > Number(maxH) && (
<Box
zIndex={1}
position={'absolute'}
bottom={1}
right={2}
cursor={'pointer'}
onClick={onOpenModal}
>
<MyTooltip label={t('common:ui.textarea.Magnifying')}>
<MyIcon name={'common/fullScreenLight'} w={'14px'} color={'myGray.600'} />
</MyTooltip>
</Box>
)}
</Box>
</Box>
);
});
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,7 @@ const InputTypeConfig = ({
bg={'myGray.50'}
placeholder={t('workflow:field_description_placeholder')}
rows={3}
minH={10}
{...register('description', {
required: showIsToolInput && isToolInput ? true : false
})}
Expand Down Expand Up @@ -498,9 +499,11 @@ const InputTypeConfig = ({
inputType === VariableInputEnum.internal) &&
valueType === WorkflowIOValueTypeEnum.string)) && (
<MyTextarea
{...register('defaultValue')}
value={defaultValue}
onChange={(e) => setValue('defaultValue', e.target.value)}
bg={'myGray.50'}
autoHeight
title={t('common:core.module.Default Value')}
minH={40}
maxH={100}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ const TeamPlanStatusCard = () => {
const { teamPlanStatus } = useUserStore();
const { operationalAd, loadOperationalAd } = useSystemStore();
const router = useRouter();
if (!teamPlanStatus?.standardConstants) return null;

useEffect(() => {
if (!operationalAd) {
Expand All @@ -29,9 +28,9 @@ const TeamPlanStatusCard = () => {
});

const planName = useMemo(() => {
if (!teamPlanStatus.standard?.currentSubLevel) return '';
return standardSubLevelMap[teamPlanStatus.standard?.currentSubLevel].label;
}, [teamPlanStatus.standard?.currentSubLevel]);
if (!teamPlanStatus?.standard?.currentSubLevel) return '';
return standardSubLevelMap[teamPlanStatus.standard.currentSubLevel].label;
}, [teamPlanStatus?.standard?.currentSubLevel]);

const aiPointsUsageMap = useMemo(() => {
if (!teamPlanStatus) {
Expand Down Expand Up @@ -65,6 +64,8 @@ const TeamPlanStatusCard = () => {
setHiddenUntil(hideUntilTime);
}, [setHiddenUntil]);

if (!teamPlanStatus?.standardConstants) return null;

return (
<Box
p={2}
Expand Down
87 changes: 80 additions & 7 deletions projects/app/src/pageComponents/dashboard/agent/List.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import MyBox from '@fastgpt/web/components/common/MyBox';
import { useRequest2 } from '@fastgpt/web/hooks/useRequest';
import { useContextSelector } from 'use-context-selector';
import { AppListContext } from './context';
import { AppFolderTypeList, AppTypeEnum } from '@fastgpt/global/core/app/constants';
import { AppFolderTypeList, AppTypeEnum, ToolTypeList } from '@fastgpt/global/core/app/constants';
import { useFolderDrag } from '@/components/common/folder/useFolderDrag';
import dynamic from 'next/dynamic';
import type { EditResourceInfoFormType } from '@/components/common/Modal/EditResourceModal';
Expand All @@ -35,7 +35,8 @@ import { ReadRoleVal } from '@fastgpt/global/support/permission/constant';
import { useToast } from '@fastgpt/web/hooks/useToast';
import { getWebReqUrl } from '@fastgpt/web/common/system/utils';
import { createAppTypeMap } from '@/pageComponents/app/constants';
import { ToolTypeList, type CreateAppType } from '@/pages/dashboard/create';
import { type CreateAppType } from '@/pages/dashboard/create';
import { useUserStore } from '@/web/support/user/useUserStore';

const EditResourceModal = dynamic(() => import('@/components/common/Modal/EditResourceModal'));
const ConfigPerModal = dynamic(() => import('@/components/support/permission/ConfigPerModal'));
Expand All @@ -46,6 +47,7 @@ const List = () => {
const { parentId = null } = router.query;
const { isPc } = useSystem();
const { toast } = useToast();
const { userInfo } = useUserStore();

const { openConfirm: openMoveConfirm, ConfirmModal: MoveConfirmModal } = useConfirm({
type: 'common',
Expand All @@ -64,6 +66,10 @@ const List = () => {
setSearchKey
} = useContextSelector(AppListContext, (v) => v);

const hasCreatePer = folderDetail
? folderDetail.permission.hasWritePer && folderDetail?.type !== AppTypeEnum.httpPlugin
: userInfo?.team.permission.hasAppCreatePer;

const [editedApp, setEditedApp] = useState<EditResourceInfoFormType>();
const [editPerAppId, setEditPerAppId] = useState<string>();

Expand Down Expand Up @@ -144,12 +150,21 @@ const List = () => {
return (
<>
{myApps.length === 0 && !folderDetail ? (
isPc ? (
isPc && hasCreatePer ? (
<CreateButton appType={appType} />
) : (
<Box pt={4}>
<ListCreateButton appType={appType} />
</Box>
<Grid
py={4}
gridTemplateColumns={
folderDetail
? ['1fr', 'repeat(2,1fr)', 'repeat(2,1fr)', 'repeat(3,1fr)']
: ['1fr', 'repeat(2,1fr)', 'repeat(2,1fr)', 'repeat(3,1fr)', 'repeat(4,1fr)']
}
gridGap={5}
alignItems={'stretch'}
>
{hasCreatePer ? <ListCreateButton appType={appType} /> : <ForbiddenCreateButton />}
</Grid>
)
) : (
<Grid
Expand All @@ -162,7 +177,7 @@ const List = () => {
gridGap={5}
alignItems={'stretch'}
>
<ListCreateButton appType={appType} />
{hasCreatePer ? <ListCreateButton appType={appType} /> : <ForbiddenCreateButton />}
{myApps.map((app, index) => {
return (
<MyTooltip
Expand Down Expand Up @@ -619,5 +634,63 @@ const ListCreateButton = ({ appType }: { appType: AppTypeEnum | 'all' }) => {
</MyBox>
);
};
const ForbiddenCreateButton = () => {
const { t } = useTranslation();
return (
<MyBox
py={4}
px={5}
cursor={'not-allowed'}
border={'base'}
bg={'white'}
borderRadius={'10px'}
position={'relative'}
display={'flex'}
flexDirection={'column'}
>
<Box color={'myGray.900'} fontWeight={'medium'}>
{t('common:new_create')}
</Box>
<Box
mt={4}
mb={2}
h={'100%'}
w={'100%'}
display={'flex'}
alignItems={'center'}
justifyContent={'center'}
position={'relative'}
flex={'1 0 56px'}
>
<Box
position={'absolute'}
top={'1px'}
left={'1px'}
right={'1px'}
bottom={'1px'}
bg={'myGray.50'}
borderRadius={'14px'}
/>
<Box
w={'100%'}
h={'100%'}
display={'flex'}
flexDirection={'column'}
alignItems={'center'}
justifyContent={'center'}
sx={{
background: `url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100%25' height='100%25' viewBox='0 0 330 56' preserveAspectRatio='none'%3E%3Crect x='0.5' y='0.5' width='329' height='55' rx='12' fill='none' stroke='%23D7D7D7' stroke-width='1' stroke-dasharray='6 6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat center`,
backgroundSize: '100% 100%'
}}
>
<MyIcon name={'common/disable'} w={'34px'} color={'#DFE2EA'} zIndex={1} />
<Box color={'myGray.500'} fontSize={'11px'} fontWeight={'medium'} zIndex={1}>
{t('app:has_no_create_per')}
</Box>
</Box>
</Box>
</MyBox>
);
};

export default List;
15 changes: 13 additions & 2 deletions projects/app/src/pages/api/core/app/create.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import { NextAPI } from '@/service/middleware/entry';
import { CommonErrEnum } from '@fastgpt/global/common/error/code/common';
import type { ParentIdType } from '@fastgpt/global/common/parentFolder/type';
import { parseParentIdInMongo } from '@fastgpt/global/common/parentFolder/utils';
import type { AppTypeEnum } from '@fastgpt/global/core/app/constants';
import { AppFolderTypeList } from '@fastgpt/global/core/app/constants';
import { AppTypeEnum } from '@fastgpt/global/core/app/constants';
import { AppFolderTypeList, ToolTypeList, AppTypeList } from '@fastgpt/global/core/app/constants';
import type { AppSchema } from '@fastgpt/global/core/app/type';
import { type ShortUrlParams } from '@fastgpt/global/support/marketing/type';
import {
Expand Down Expand Up @@ -57,6 +57,17 @@ async function handler(req: ApiRequestProps<CreateAppBody>) {
? await authApp({ req, appId: parentId, per: WritePermissionVal, authToken: true })
: await authUserPer({ req, authToken: true, per: TeamAppCreatePermissionVal });

if (parentId) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

放到 onCreateApp 方法里

const parentApp = await MongoApp.findById(parentId, 'type').lean();

if (ToolTypeList.includes(type) && parentApp?.type !== AppTypeEnum.toolFolder) {
return Promise.reject('tool type can only be created in tool folder');
}
if (AppTypeList.includes(type) && parentApp?.type !== AppTypeEnum.folder) {
return Promise.reject('agent type can only be created in agent folder');
}
}

// 上限校验
await checkTeamAppLimit(teamId);
const tmb = await MongoTeamMember.findById({ _id: tmbId }, 'userId')
Expand Down
Loading
Loading