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(web): support resource group #1444

Merged
merged 7 commits into from
Aug 9, 2023
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
1 change: 1 addition & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@
"sealos",
"signin",
"Signup",
"simplebar",
"statefulset",
"storageclass",
"tailwindcss",
Expand Down
89 changes: 89 additions & 0 deletions web/package-lock.json

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

2 changes: 2 additions & 0 deletions web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
"dayjs": "^1.11.7",
"dotenv": "^16.0.3",
"ejson-shell-parser": "^1.2.4",
"focus-visible": "^5.2.0",
"framer-motion": "^10.12.16",
"i18next": "^22.5.0",
"i18next-browser-languagedetector": "7.0.1",
Expand All @@ -50,6 +51,7 @@
"remark-gfm": "^3.0.1",
"remark-math": "^5.1.1",
"sass": "^1.62.1",
"simplebar-react": "^3.2.4",
"uuid": "^9.0.0",
"zustand": "^4.3.8"
},
Expand Down
34 changes: 29 additions & 5 deletions web/public/locales/en/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
"Copied": "copied",
"Copy": "copy",
"Create": "New application",
"Change": "Change",
"Change": "Specification",
"CreateNow": "Create Now",
"Custom": "customize",
"Days": "days",
Expand Down Expand Up @@ -115,7 +115,8 @@
"CreateFromTemplate": "More Templates",
"getCodeOnline": "Retrieve the latest released online code",
"versionHistory": "Version History",
"Restore": "Restore"
"Restore": "Restore",
"Invite": "Invite"
},
"HomePanel": {
"APP": "Android or iOS app",
Expand Down Expand Up @@ -581,10 +582,33 @@
"ClearRecycleBin": "Clear Recycle Bin",
"RestoreSuccess": "successfully restored",
"EmptySuccess": "successfully empty",
"RecycleBinEmpty": "Recycle Bin Empty",
"RecycleBinEmpty": "Recycle Bin is Empty",
"SelectOne": "At least select one",
"Apply": "apply",
"Developing": "Developing",
"Unverified": "Unverified",
"i18n tip": "中"
}
"i18n tip": "中",
"Collaborate": {
"InviteMembers": "Invite Members",
"GenerateInvitationLink": "Generate Invitation Link",
"Members": "Members",
"NoMembers": "No Members",
"Invitation": "Invitation",
"InvitationContent": "{{userName}} invite you to be the {{role}} of app <strong>{{appName}}</strong> {{appid}}.",
"Accept": "Accept",
"Accepted": "Link is used",
"Remove": "Remove",
"CopyLink": "Copy Invitation Link",
"Revoke": "Revoke",
"Invite": "Collaborate ({{number}})",
"GenerateInvitationLinkSuccess": "Generate Invitation Link Success",
"DeleteLinkSuccess": "Delete Link Success",
"JoinSuccess": "Join Success",
"RemoveSuccess": "Remove Member Success",
"Leave": "Leave",
"LeaveSuccess": "Leave Success",
"QuitSuccess": "Quit",
"Quit": "Quit"
},
"Collaborative": "Collaborative"
}
30 changes: 27 additions & 3 deletions web/public/locales/zh-CN/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,8 @@
"CreateFromTemplate": "更多模板",
"getCodeOnline": "获取线上最新发布的代码",
"versionHistory": "历史版本",
"Restore": "恢复"
"Restore": "恢复",
"Invite": "邀请"
},
"HomePanel": {
"APP": "Android or iOS 应用",
Expand Down Expand Up @@ -581,10 +582,33 @@
"ClearRecycleBin": "清空回收站",
"RestoreSuccess": "还原成功",
"EmptySuccess": "清空成功",
"RecycleBinEmpty": "回收站已清空",
"RecycleBinEmpty": "回收站为空",
"SelectOne": "请至少选择一个",
"Apply": "使用",
"Developing": "开发中",
"Unverified": "未认证",
"i18n tip": "En"
"i18n tip": "En",
"Collaborate": {
"InviteMembers": "邀请成员",
"GenerateInvitationLink": "生成邀请链接",
"Members": "成员",
"NoMembers": "暂无成员",
"Invitation": "受邀提醒",
"InvitationContent": "{{userName}} 邀请您成为应用 <strong>{{appName}}</strong> ({{appid}}) 的 {{role}}。",
"Accept": "接受",
"Accepted": "链接已被使用",
"Remove": "移除",
"CopyLink": "复制邀请链接",
"Revoke": "撤销",
"Invite": "协作 ({{number}})",
"GenerateInvitationLinkSuccess": "生成链接成功",
"DeleteLinkSuccess": "删除链接成功",
"JoinSuccess": "加入成功",
"RemoveSuccess": "成员移除成功",
"Leave": "离开",
"LeaveSuccess": "已成功离开",
"QuitSuccess": "退出成功",
"Quit": "退出"
},
"Collaborative": "协作"
}
30 changes: 27 additions & 3 deletions web/public/locales/zh/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,8 @@
"CreateFromTemplate": "更多模板",
"getCodeOnline": "获取线上最新发布的代码",
"versionHistory": "历史版本",
"Restore": "恢复"
"Restore": "恢复",
"Invite": "邀请"
},
"HomePanel": {
"APP": "Android or iOS 应用",
Expand Down Expand Up @@ -581,10 +582,33 @@
"ClearRecycleBin": "清空回收站",
"RestoreSuccess": "还原成功",
"EmptySuccess": "清空成功",
"RecycleBinEmpty": "回收站已清空",
"RecycleBinEmpty": "回收站为空",
"SelectOne": "请至少选择一个",
"Apply": "使用",
"Developing": "开发中",
"Unverified": "未认证",
"i18n tip": "En"
"i18n tip": "En",
"Collaborate": {
"InviteMembers": "邀请成员",
"GenerateInvitationLink": "生成邀请链接",
"Members": "成员",
"NoMembers": "暂无成员",
"Invitation": "受邀提醒",
"InvitationContent": "{{userName}} 邀请您成为应用 <strong>{{appName}}</strong> ({{appid}}) 的 {{role}}。",
"Accept": "接受",
"Accepted": "链接已被使用",
"Remove": "移除",
"CopyLink": "复制邀请链接",
"Revoke": "撤销",
"Invite": "协作 ({{number}})",
"GenerateInvitationLinkSuccess": "生成链接成功",
"DeleteLinkSuccess": "删除链接成功",
"JoinSuccess": "加入成功",
"RemoveSuccess": "成员移除成功",
"Leave": "离开",
"LeaveSuccess": "已成功离开",
"QuitSuccess": "退出成功",
"Quit": "退出"
},
"Collaborative": "协作"
}
8 changes: 7 additions & 1 deletion web/src/App.css
Original file line number Diff line number Diff line change
Expand Up @@ -75,4 +75,10 @@ a {
.rdp-day_selected {
background-color: #00A9A6 !important;
color: white !important;
}
}

.simplebar-scrollbar::before {
background: #DEE0E2;
height: 6px;
transform: translateY(50%);
}
9 changes: 9 additions & 0 deletions web/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { useEffect, useState } from "react";
import { useTranslation } from "react-i18next";
import { BrowserRouter, useRoutes } from "react-router-dom";
import { ChakraProvider } from "@chakra-ui/react";
import { css, Global } from "@emotion/react";
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
import { ClickToComponent } from "click-to-react-component";

Expand All @@ -13,7 +14,14 @@ import darkTheme from "./chakraThemeDark";
import { CHAKRA_UI_COLOR_MODE_KEY } from "./constants";
import routes from "./routes";

import "simplebar-react/dist/simplebar.min.css";
import "./App.css";
const GlobalStyles = css`
.js-focus-visible :focus:not([data-focus-visible-added]) {
outline: none;
box-shadow: none;
}
`;

function RouteElement() {
const element = useRoutes(routes as any);
Expand Down Expand Up @@ -58,6 +66,7 @@ function APP() {
<QueryClientProvider client={queryClient}>
{process.env.NODE_ENV === "development" ? <ClickToComponent /> : null}
<ChakraProvider theme={colorMode === "light" ? theme : darkTheme}>
<Global styles={GlobalStyles} />
<BrowserRouter>
<RouteElement />
</BrowserRouter>
Expand Down
Loading