Skip to content

Commit

Permalink
feat: add app template market (#2012)
Browse files Browse the repository at this point in the history
* feat: add app template market

* fix

* fix

* i18n

* fix
  • Loading branch information
newfish-cmyk authored and c121914yu committed Aug 12, 2024
1 parent 231afc4 commit 19b3b9c
Show file tree
Hide file tree
Showing 27 changed files with 2,489 additions and 16 deletions.
9 changes: 9 additions & 0 deletions packages/global/core/app/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,12 @@ export const defaultAppSelectFileConfig: AppFileSelectConfigType = {
canSelectImg: false,
maxFiles: 10
};

export enum AppTemplateTypeEnum {
recommendation = 'recommendation',
writing = 'writing',
imageGeneration = 'image-generation',
webSearch = 'web-search',
roleplay = 'roleplay',
officeServices = 'office-services'
}
16 changes: 14 additions & 2 deletions packages/global/core/workflow/type/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,21 @@ export type WorkflowTemplateType = {

// template market
export type TemplateMarketItemType = WorkflowTemplateType & {
tags?: { id: string; label: string }[];
tags: string[];
type: AppTypeEnum.simple | AppTypeEnum.workflow | AppTypeEnum.plugin;
};

// template market list
export type TemplateMarketListItemType = {
id: string;
name: string;
intro: string;
author: string;
tags: 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
1 change: 1 addition & 0 deletions packages/service/type.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,5 @@ declare global {
var systemLoadedGlobalConfig: boolean;

var workerPoll: Record<WorkerNameEnum, WorkerPool>;
var appTemplateMarketTemplates: 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.
1 change: 0 additions & 1 deletion packages/web/components/common/MyModal/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import {
Box,
Image
} from '@chakra-ui/react';
import MyIcon from '../Icon';
import MyBox from '../MyBox';
import { useSystem } from '../../../hooks/useSystem';
import Avatar from '../Avatar';
Expand Down
16 changes: 15 additions & 1 deletion packages/web/i18n/en/app.json
Original file line number Diff line number Diff line change
Expand Up @@ -84,14 +84,27 @@
"template": {
"simple_robot": "Simple Robot"
},
"templateMarket": {
"Search_template": "Search template",
"Template_market": "Template market",
"no_intro": "No intro~",
"Use": "Use",
"templateTypes": {
"Image_generation": "Image generation",
"Office_services": "Office searvices",
"Roleplay": "Roleplay",
"Web_search": "Web search",
"Writing": "Writing"
}
},
"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 +114,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
18 changes: 17 additions & 1 deletion packages/web/i18n/zh/app.json
Original file line number Diff line number Diff line change
Expand Up @@ -84,23 +84,39 @@
"template": {
"simple_robot": "简易机器人"
},
"templateMarket": {
"Use": "使用",
"Search_template": "搜索模板",
"Template_market": "模板市场",
"no_intro": "还没有介绍~",
"templateTypes": {
"Image_generation": "图片生成",
"Office_services": "办公服务",
"Recommendation": "推荐",
"Roleplay": "角色扮演",
"Web_search": "联网搜索",
"Writing": "文本创作"
}
},
"time_zone": "时区",
"tool_input_param_tip": "该插件正常运行需要配置相关信息",
"transition_to_workflow": "转成工作流",
"transition_to_workflow_create_new_placeholder": "创建一个新的应用,而不是修改当前应用",
"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
8 changes: 8 additions & 0 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
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 19b3b9c

Please sign in to comment.