Skip to content

Commit

Permalink
feat: add app template market
Browse files Browse the repository at this point in the history
  • Loading branch information
heheer authored and heheer committed Jul 10, 2024
1 parent e2ae571 commit 75422f1
Show file tree
Hide file tree
Showing 27 changed files with 2,487 additions and 41 deletions.
14 changes: 14 additions & 0 deletions packages/global/core/workflow/type/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,21 @@ export type WorkflowTemplateType = {
// template market
export type TemplateMarketItemType = WorkflowTemplateType & {
tags?: { id: string; label: string }[];
type: AppTypeEnum.simple | AppTypeEnum.workflow | AppTypeEnum.plugin;
authorAvatar?: string;
};
// template market list
export type TemplateMarketListItemType = {
id: string;
name: string;
intro?: string;
author?: string;
tags?: { id: string; label: string }[];
type: AppTypeEnum.simple | AppTypeEnum.workflow | AppTypeEnum.plugin;
avatar: string;
authorAvatar?: string;
};
export type TemplateMarketListType = Array<TemplateMarketListItemType>;
// system plugin
export type SystemPluginTemplateItemType = WorkflowTemplateType & {
templateType: FlowNodeTemplateTypeEnum;
Expand Down
5 changes: 5 additions & 0 deletions packages/service/core/app/template/type.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { TemplateMarketItemType, TemplateMarketListType } from '@fastgpt/global/core/workflow/type';

declare global {
var appTemplates: TemplateMarketItemType[];
}
1 change: 1 addition & 0 deletions packages/web/components/common/Icon/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ export const iconPaths = {
'core/app/type/plugin': () => import('./icons/core/app/type/plugin.svg'),
'core/app/type/pluginFill': () => import('./icons/core/app/type/pluginFill.svg'),
'core/app/type/simple': () => import('./icons/core/app/type/simple.svg'),
'core/app/type/templateFill': () => import('./icons/core/app/type/templateFill.svg'),
'core/app/type/workflow': () => import('./icons/core/app/type/workflow.svg'),
'core/app/type/workflowFill': () => import('./icons/core/app/type/workflowFill.svg'),
'core/app/variable/external': () => import('./icons/core/app/variable/external.svg'),
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
13 changes: 9 additions & 4 deletions packages/web/components/common/MyModal/index.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from 'react';
import React, { ReactElement } from 'react';
import {
Modal,
ModalOverlay,
Expand All @@ -20,6 +20,8 @@ export interface MyModalProps extends ModalContentProps {
isLoading?: boolean;
isOpen: boolean;
onClose?: () => void;
customModalHeader?: ReactElement;
headerColor?: string;
}

const MyModal = ({
Expand All @@ -32,6 +34,8 @@ const MyModal = ({
isLoading,
w = 'auto',
maxW = ['90vw', '600px'],
customModalHeader,
headerColor,
...props
}: MyModalProps) => {
const [isPc] = useMediaQuery('(min-width: 900px)');
Expand All @@ -54,12 +58,13 @@ const MyModal = ({
boxShadow={'7'}
{...props}
>
{!title && onClose && <ModalCloseButton zIndex={1} />}
{!!title && (
{!!customModalHeader && customModalHeader}
{!customModalHeader && !title && onClose && <ModalCloseButton zIndex={1} />}
{!customModalHeader && !!title && (
<ModalHeader
display={'flex'}
alignItems={'center'}
background={'#FBFBFC'}
background={headerColor||'#FBFBFC'}
borderBottom={'1px solid #F4F6F8'}
roundedTop={'lg'}
py={'10px'}
Expand Down
7 changes: 6 additions & 1 deletion packages/web/i18n/en/app.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,13 @@
"modules": {
"Title is required": "Module name cannot be empty"
},
"template": {
"Search template": "Search template",
"templateMarket": "Template market"
},
"type": {
"All": "All",
"Create http plugin tip": "Create plug-ins in batches using OpenAPI schema, compatible with GPTs format.",
"Create http plugin tip": "Create plug-ins in batches using OpenAPI schema, compatible with GPTs format",
"Create one plugin tip": "The input and output workflows can be customized",
"Create plugin bot": "Create plugin bot",
"Create simple bot": "Create simple bot",
Expand All @@ -79,6 +83,7 @@
"Http plugin": "Http plugin",
"Plugin": "Plugin",
"Simple bot": "Simple bot",
"Template": "Create by template",
"Workflow bot": "Workflow"
},
"version": {
Expand Down
3 changes: 1 addition & 2 deletions packages/web/i18n/en/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -595,8 +595,7 @@
"success": "Start syncing"
}
},
"training": {
}
"training": {}
},
"data": {
"Auxiliary Data": "Auxiliary data",
Expand Down
8 changes: 7 additions & 1 deletion packages/web/i18n/zh/app.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,18 +68,24 @@
},
"type": {
"All": "全部",
"Create http plugin tip": "通过 OpenAPI Schema 批量创建插件,兼容 GPTs 格式",
"Create http plugin tip": "通过 OpenAPI Schema 批量创建插件,兼容 GPTs 格式",
"Create one plugin tip": "可以自定义输入和输出的工作流,通常用于封装重复使用的工作流",
"Create plugin bot": "创建插件",
"Create simple bot": "创建简易应用",
"Create simple bot tip": "通过填表单形式,创建简单的 AI 应用,适合新手",
"Create template tip": "在模板市场探索更多玩法,带你理解并上手各种应用",
"Create workflow bot": "创建工作流",
"Create workflow tip": "通过低代码的方式,构建逻辑复杂的多轮对话 AI 应用,推荐高级玩家使用",
"Http plugin": "HTTP 插件",
"Plugin": "插件",
"Simple bot": "简易应用",
"Template": "通过模板创建",
"Workflow bot": "工作流"
},
"template": {
"templateMarket": "模板市场",
"Search template": "搜索模板"
},
"version": {
"Revert success": "回滚成功"
}
Expand Down
1 change: 1 addition & 0 deletions packages/web/i18n/zh/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,7 @@
"logs": {
"Source And Time": "来源 & 时间"
},
"more": "查看更多",
"navbar": {
"External": "外部使用",
"Flow mode": "高级编排",
Expand Down
1 change: 1 addition & 0 deletions projects/app/public/appTemplates/TranslateRobot/avatar.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 75422f1

Please sign in to comment.