Skip to content

Commit

Permalink
feat: add app template market
Browse files Browse the repository at this point in the history
  • Loading branch information
newfish-cmyk committed Aug 8, 2024
1 parent c6dd307 commit 022c5ab
Show file tree
Hide file tree
Showing 27 changed files with 2,492 additions and 33 deletions.
15 changes: 14 additions & 1 deletion packages/global/core/workflow/type/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,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 @@ -93,6 +93,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 @@ -22,6 +22,8 @@ export interface MyModalProps extends ModalContentProps {
isOpen: boolean;
onClose?: () => void;
closeOnOverlayClick?: boolean;
customModalHeader?: ReactElement;
headerColor?: string;
}

const MyModal = ({
Expand All @@ -35,6 +37,8 @@ const MyModal = ({
w = 'auto',
maxW = ['90vw', '600px'],
closeOnOverlayClick = true,
customModalHeader,
headerColor,
...props
}: MyModalProps) => {
const isPc = useSystem();
Expand All @@ -58,12 +62,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
8 changes: 6 additions & 2 deletions packages/web/i18n/en/app.json
Original file line number Diff line number Diff line change
Expand Up @@ -82,16 +82,19 @@
"setting_app": "Settings",
"setting_plugin": "Setting plugin",
"template": {
"simple_robot": "Simple Robot"
"simple_robot": "Simple Robot",
"Search template": "Search template",
"templateMarket": "Template market"
},
"time_zone": "Time zone",
"tool_input_param_tip": "Configure related information before the plugin runs properly",
"transition_to_workflow": "Transition to workflow",
"transition_to_workflow_create_new_placeholder": "Create a new application instead of modifying the current one",
"transition_to_workflow_create_new_tip": "After converting to workflow, it will not be able to convert back to simple mode, please confirm!",

"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 @@ -101,6 +104,7 @@
"Http plugin": "Http plugin",
"Plugin": "Plugin",
"Simple bot": "Simple bot",
"Template": "Create by template",
"Workflow bot": "Workflow"
},
"upload_file_max_amount": "Max files",
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 @@ -596,8 +596,7 @@
"success": "Start syncing"
}
},
"training": {
}
"training": {}
},
"data": {
"Auxiliary Data": "Auxiliary data",
Expand Down
8 changes: 6 additions & 2 deletions packages/web/i18n/zh/app.json
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,9 @@
"setting_app": "应用配置",
"setting_plugin": "插件配置",
"template": {
"simple_robot": "简易机器人"
"simple_robot": "简易机器人",
"templateMarket": "模板市场",
"Search template": "搜索模板"
},
"time_zone": "时区",
"tool_input_param_tip": "该插件正常运行需要配置相关信息",
Expand All @@ -91,16 +93,18 @@
"transition_to_workflow_create_new_tip": "转化成工作流后,将无法转化回简易模式,请确认!",
"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": "工作流"
},
"upload_file_max_amount": "最大文件数量",
Expand Down
11 changes: 9 additions & 2 deletions packages/web/i18n/zh/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -361,6 +361,14 @@
},
"no_app": "还没有应用,快去创建一个吧!",
"not_published": "未发布",
"more": "查看更多",
"navbar": {
"External": "外部使用",
"Flow mode": "高级编排",
"Publish": "发布",
"Publish app": "发布应用",
"Simple mode": "简易配置"
},
"outLink": {
"Can Drag": "图标可拖拽",
"Default open": "默认打开",
Expand Down Expand Up @@ -598,8 +606,7 @@
"success": "开始同步"
}
},
"training": {
}
"training": {}
},
"data": {
"Auxiliary Data": "辅助数据",
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 022c5ab

Please sign in to comment.