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
2 changes: 2 additions & 0 deletions packages/global/core/app/type.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,8 @@ export type AppTemplateSchemaType = {
type: string;
author?: string;
isActive?: boolean;
isPromoted?: boolean;
recommendText?: string;
userGuide?: {
type: 'markdown' | 'link';
content?: string;
Expand Down
17 changes: 9 additions & 8 deletions packages/service/core/app/templates/register.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,15 @@ const getFileTemplates = async (): Promise<AppTemplateSchemaType[]> => {
};

const getAppTemplates = async () => {
const communityTemplates = await getFileTemplates();
const originCommunityTemplates = await getFileTemplates();
const communityTemplates = originCommunityTemplates.map((template) => {
return {
...template,
templateId: `${AppToolSourceEnum.community}-${template.templateId.split('.')[0]}`
};
});

const dbTemplates = await MongoAppTemplate.find();
const dbTemplates = await MongoAppTemplate.find().lean();

// Merge db data to community templates
const communityTemplateConfig = communityTemplates.map((template) => {
Expand All @@ -22,17 +28,12 @@ const getAppTemplates = async () => {
if (config) {
return {
...template,
isActive: config.isActive ?? template.isActive,
tags: config.tags ?? template.tags,
userGuide: config.userGuide ?? template.userGuide,
isQuickTemplate: config.isQuickTemplate ?? template.isQuickTemplate,
order: config.order ?? template.order
...config
};
}

return template;
});

const res = [
...communityTemplateConfig,
...dbTemplates.filter((t) => isCommercialTemaplte(t.templateId))
Expand Down
2 changes: 2 additions & 0 deletions packages/service/core/app/templates/templateSchema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ const AppTemplateSchema = new Schema({
},
type: String,
isActive: Boolean,
isPromoted: Boolean,
recommendText: String,
userGuide: Object,
isQuickTemplate: Boolean,
order: {
Expand Down
3 changes: 2 additions & 1 deletion packages/web/i18n/en/app.json
Original file line number Diff line number Diff line change
Expand Up @@ -319,13 +319,14 @@
"template.hard_strict_des": "Based on the question and answer template, stricter requirements are imposed on the model's answers.",
"template.qa_template": "Q&A template",
"template.qa_template_des": "A knowledge base suitable for QA question and answer structure, which allows AI to answer strictly according to preset content",
"template.recommended": "Promoted",
"template.simple_robot": "Simple robot",
"template.standard_strict": "Standard strict template",
"template.standard_strict_des": "Based on the standard template, stricter requirements are imposed on the model's answers.",
"template.standard_template": "Standard template",
"template.standard_template_des": "Standard prompt words for knowledge bases with unfixed structures.",
"templateMarket.Search_template": "Search Template",
"templateMarket.Use": "Use",
"templateMarket.Use": "Build now",
"templateMarket.no_intro": "No introduction yet~",
"templateMarket.templateTags.Recommendation": "Recommendation",
"templateMarket.template_guide": "Guide",
Expand Down
5 changes: 3 additions & 2 deletions packages/web/i18n/zh-CN/app.json
Original file line number Diff line number Diff line change
Expand Up @@ -333,16 +333,17 @@
"template.hard_strict_des": "在问答模板基础上,对模型的回答做更严格的要求。",
"template.qa_template": "问答模板",
"template.qa_template_des": "适合 QA 问答结构的知识库,可以让AI较为严格的按预设内容回答",
"template.recommended": "精选",
"template.simple_robot": "简易机器人",
"template.standard_strict": "标准严格模板",
"template.standard_strict_des": "在标准模板基础上,对模型的回答做更严格的要求。",
"template.standard_template": "标准模板",
"template.standard_template_des": "标准提示词,用于结构不固定的知识库。",
"templateMarket.Search_template": "搜索模板",
"templateMarket.Use": "使用",
"templateMarket.Use": "立即搭建",
"templateMarket.no_intro": "还没有介绍~",
"templateMarket.templateTags.Recommendation": "推荐",
"templateMarket.template_guide": "模板说明",
"templateMarket.template_guide": "说明",
"template_market": "模板市场",
"template_market_description": "在模板市场探索更多玩法,配置教程与使用引导,带你理解并上手各种应用",
"template_market_empty_data": "找不到合适的模板",
Expand Down
5 changes: 3 additions & 2 deletions packages/web/i18n/zh-Hant/app.json
Original file line number Diff line number Diff line change
Expand Up @@ -318,16 +318,17 @@
"template.hard_strict_des": "在問答範本基礎上,對模型的回答做出更嚴格的要求。",
"template.qa_template": "問答範本",
"template.qa_template_des": "適合問答結構的知識庫,可以讓 AI 較為嚴格地按照預設內容回答",
"template.recommended": "精選",
"template.simple_robot": "簡易機器人",
"template.standard_strict": "標準嚴格範本",
"template.standard_strict_des": "在標準範本基礎上,對模型的回答做出更嚴格的要求。",
"template.standard_template": "標準範本",
"template.standard_template_des": "標準提示詞,用於結構不固定的知識庫。",
"templateMarket.Search_template": "搜尋範本",
"templateMarket.Use": "使用",
"templateMarket.Use": "立即搭建",
"templateMarket.no_intro": "還沒有介紹~",
"templateMarket.templateTags.Recommendation": "推薦",
"templateMarket.template_guide": "範本說明",
"templateMarket.template_guide": "說明",
"template_market": "範本市集",
"template_market_description": "在範本市集探索更多玩法,設定教學與使用指引,帶您理解並上手各種應用程式",
"template_market_empty_data": "找不到合適的範本",
Expand Down
57 changes: 57 additions & 0 deletions projects/app/public/imgs/app/templateBg.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
45 changes: 45 additions & 0 deletions projects/app/public/imgs/app/templateCreateBg.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion projects/app/src/components/Layout/navbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ const Navbar = ({ unread }: { unread: number }) => {
w={'100%'}
userSelect={'none'}
pb={2}
bg={isSecondNavbarPage ? 'myGray.50' : 'transparent'}
bg={'white'}
>
{/* logo */}
<Box flex={'0 0 auto'} mb={3}>
Expand Down
6 changes: 3 additions & 3 deletions projects/app/src/pageComponents/dashboard/Container.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ const DashboardContainer = ({
position={'fixed'}
left={isPc ? navbarWidth : 0}
top={0}
bg={'myGray.25'}
bg={'white'}
w={`220px`}
h={'full'}
borderLeft={'1px solid'}
Expand All @@ -247,7 +247,7 @@ const DashboardContainer = ({
flexDirection={'column'}
justifyContent={'space-between'}
>
<Box>
<Box flex={1} overflowY={'auto'} sx={{ '&::-webkit-scrollbar': { display: 'none' } }}>
{groupList.map((group) => {
const selected = currentTab === group.groupId;

Expand Down Expand Up @@ -339,7 +339,7 @@ const DashboardContainer = ({
</MyBox>
)}

<Box h={'100%'} pl={isPc ? `220px` : 0} position={'relative'} bg={'myGray.25'}>
<Box h={'100%'} pl={isPc ? `220px` : 0} position={'relative'} bg={'white'}>
{children({
templateTags,
templateList,
Expand Down
Loading
Loading