Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat:template support application marketplace category feature #4583

Merged
merged 4 commits into from Mar 13, 2024
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion frontend/desktop/src/components/user_menu/github.tsx
Expand Up @@ -6,7 +6,7 @@ export default function GithubComponent(props: FlexProps) {
['getGithubStar'],
() => fetch('https://api.github.com/repos/labring/sealos').then((res) => res.json()),
{
staleTime: 60 * 60 * 1000
staleTime: 24 * 60 * 60 * 1000
}
);

Expand Down
61 changes: 6 additions & 55 deletions frontend/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion frontend/providers/template/.env.template
Expand Up @@ -5,4 +5,5 @@ TEMPLATE_REPO_URL="https://github.com/labring-actions/templates"
TEMPLATE_REPO_BRANCH="main"
# The CDN_URL environment variable is used to specify a CDN address; when set, it replaces raw.githubusercontent.com in the resource loading URL. If not set, the default address is used.
CDN_URL=
BLACKLIST_CATEGORIES=""
BLACKLIST_CATEGORIES=""
SIDEBAR_MENU_COUNT=""
1 change: 1 addition & 0 deletions frontend/providers/template/.gitignore
Expand Up @@ -42,3 +42,4 @@ yalc.lock

templates
templates.json
data/config.local.json
6 changes: 3 additions & 3 deletions frontend/providers/template/deploy/manifests/appcr.yaml.tmpl
Expand Up @@ -9,11 +9,11 @@ spec:
displayType: normal
i18n:
zh:
name: 模板市场
name: 应用商店
zh-Hans:
name: 模板市场
name: 应用商店
icon: https://template.{{ .cloudDomain }}{{ if .cloudPort }}:{{ .cloudPort }}{{ end }}/logo.svg
menuData:
nameColor: text-black
name: Templates
name: App Store
type: iframe
8 changes: 8 additions & 0 deletions frontend/providers/template/deploy/manifests/deploy.yaml.tmpl
Expand Up @@ -13,6 +13,11 @@ metadata:
data:
config.yaml: |-
addr: :3000
config.json: |-
{
"showCarousel": false,
"slideData": []
}
---
apiVersion: apps/v1
kind: Deployment
Expand Down Expand Up @@ -75,6 +80,9 @@ spec:
- name: template-frontend-volume
mountPath: /config.yaml
subPath: config.yaml
- name: template-frontend-volume
mountPath: /app/data/config.json
subPath: config.json
- name: template-data
mountPath: /app/providers/template/templates
volumes:
Expand Down
2 changes: 1 addition & 1 deletion frontend/providers/template/package.json
Expand Up @@ -59,7 +59,7 @@
"remark-unwrap-images": "^3.0.1",
"sass": "^1.68.0",
"sealos-desktop-sdk": "workspace:^",
"swiper": "^11.0.5",
"swiper": "^11.0.7",
"typescript": "5.2.2",
"zustand": "^4.4.1"
},
Expand Down
19 changes: 15 additions & 4 deletions frontend/providers/template/public/locales/en/common.json
Expand Up @@ -139,8 +139,8 @@
"Template Config": "Template Config",
"Templates": "Templates",
"One Click Deployment": "Pre-build solutions for you and experience one-click deployment of applications",
"Template Name": "Template Name",
"Template List": " Templates",
"Application Name": "Application Name",
"Application List": " Application List",
"Configure Project": "Configure Project",
"Not need to configure any parameters": "The current application does not need to configure any parameters",
"Do you want to jump to the app details page": "Do you want to jump to the app details page",
Expand All @@ -160,7 +160,18 @@
},
"SideBar": {
"Applications": "Applications",
"My App": "My Apps"
"My App": "My Apps",
"backend": "Backend",
"database": "Database",
"monitor": "Monitor",
"frontend": "Frontend",
"game": "Game",
"ai": "AI",
"tool": "Tool",
"dev-ops": "DevOps",
"blog": "Blog",
"low-code": "LowCode",
"storage": "Storage"
},
"Schedule": "Schedule",
"Last Schedule": "Last Schedule",
Expand Down Expand Up @@ -192,4 +203,4 @@
"Delete successful": "Delete successful",
"Delete Failed": "Delete Failed",
"Description": "Description"
}
}
19 changes: 15 additions & 4 deletions frontend/providers/template/public/locales/zh/common.json
Expand Up @@ -146,8 +146,8 @@
"Template Config": "模板配置",
"Templates": "模板市场",
"One Click Deployment": "为您预先构建解决方案,体验一键部署应用",
"Template Name": "模板名称",
"Template List": " 模板列表",
"Application Name": "应用名称",
"Application List": " 应用列表",
"Not need to configure any parameters": "当前应用不需要配置任何参数",
"Do you want to jump to the app details page": "您要跳转到应用详情页吗",
"Deploy on sealos": "去sealos部署",
Expand All @@ -166,7 +166,18 @@
},
"SideBar": {
"Applications": "所有应用",
"My App": "我的应用"
"My App": "我的应用",
"backend": "后端",
"database": "数据库",
"monitor": "监控",
"frontend": "前端",
"game": "游戏",
"ai": "AI",
"tool": "工具",
"dev-ops": "运维",
"blog": "博客",
"low-code": "低代码",
"storage": "存储"
},
"Schedule": "执行周期",
"Last Schedule": "上次执行",
Expand Down Expand Up @@ -198,4 +209,4 @@
"Delete successful": "删除成功",
"Delete Failed": "删除失败",
"Description": "描述"
}
}
8 changes: 8 additions & 0 deletions frontend/providers/template/src/api/platform.ts
@@ -1,6 +1,14 @@
import { EnvResponse } from '@/types/index';
import { GET } from '@/services/request';
import { SystemConfigType, TemplateType } from '@/types/app';

export const updateRepo = () => GET('/api/updateRepo');

export const getTemplates = () =>
GET<{ templates: TemplateType[]; menuKeys: string }>('/api/listTemplate');

export const getPlatformEnv = () => GET<EnvResponse>('/api/platform/getEnv');

export const getSystemConfig = () => {
return GET<SystemConfigType>('/api/platform/getSystemConfig');
};