From 6f1f4a281ab586fb240eb60a2b40a2ef4f9f1cf0 Mon Sep 17 00:00:00 2001 From: SeeLey Wang Date: Sat, 21 Sep 2024 11:19:44 +0800 Subject: [PATCH] pre release:v0.1.3 (#47) * fix element overflow for lang "de" (#43) * fix some overflow for de * add todo * update readme * refactor scroll bar (#46) * update scroll * use auto * update with auto scroll * fix dialog overflow * fix overflow scroll * fix warning dialog style * trigger on main branch --- .github/pull_request_template.md | 5 -- README.md | 12 +++++ README_zh.md | 12 +++++ .../src/app/[locale]/cases/page.tsx | 4 +- zbook_frontend/src/app/[locale]/page.tsx | 9 +++- .../(dashboards)/dashboard/@visitors/page.tsx | 6 ++- .../src/components/DialogComponent.tsx | 14 +++-- .../src/components/TableOfContent.tsx | 28 ++++++---- zbook_frontend/src/components/TimeElement.tsx | 2 +- .../src/components/WarningDialog.tsx | 52 ++++++++++--------- .../src/components/charts/AreaUserChart.tsx | 7 ++- .../components/charts/AreaVisitorChart.tsx | 1 + .../src/components/charts/EnableElement.tsx | 2 +- .../details/ListAdminCommentElement.tsx | 10 +++- .../details/ListCommentReportElement.tsx | 4 +- .../elements/details/ListElementCard.tsx | 6 ++- .../elements/details/ListRepoElement.tsx | 12 ++++- .../elements/details/ListSessionElement.tsx | 10 +++- .../elements/details/ListUserElement.tsx | 16 ++++-- .../src/components/home/FooterForHome.tsx | 32 ++++++++---- .../src/components/home/MainTabGroup.tsx | 6 ++- .../loadings/UserSideBarLoading.tsx | 6 ++- .../src/components/navbars/NavLang.tsx | 6 ++- .../src/components/navbars/NavTheme.tsx | 6 ++- .../notifications/NotificationDialog.tsx | 18 ++++--- .../src/components/parsers/CodeBlock.tsx | 6 ++- .../src/components/parsers/HtmlParser.tsx | 7 ++- .../src/components/parsers/ParserElement.tsx | 8 ++- .../src/components/searchs/SearchFooter.tsx | 2 +- .../searchs/SearchMarkdownComponent.tsx | 8 ++- .../src/components/sidebars/RepoSideBar.tsx | 6 ++- .../components/sidebars/SideBarTransition.tsx | 4 +- .../src/components/sidebars/UserSideBar.tsx | 8 ++- .../sidebars/UserSideBarProfile.tsx | 6 ++- .../components/wrappers/FormGroupWrapper.tsx | 6 ++- .../components/wrappers/FormInputWrapper.tsx | 2 +- .../src/components/wrappers/FormListBox.tsx | 6 ++- .../providers/dialogs/CreateInvitation.tsx | 7 +-- .../providers/dialogs/CreateRepoDialog.tsx | 7 +-- .../dialogs/CreateSystemNotification.tsx | 7 +-- .../src/providers/dialogs/SearchDialog.tsx | 5 +- .../providers/dialogs/UpdateRepoDialog.tsx | 7 +-- .../providers/dialogs/UpdateUserDialog.tsx | 9 ++-- zbook_frontend/tailwind.config.ts | 4 +- 44 files changed, 274 insertions(+), 127 deletions(-) diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index 6955c9c..018982f 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -13,8 +13,3 @@ - [ ] New language support - [ ] Bug fix - [ ] Other - -### New Language Support - -If you are submitting new language support, please first refer to the documentation [Language Support](https://github.com/zizdlp/zbook-docs/blob/main/Development/LanguageSupport.md) and follow the necessary procedures. You can refer to these commits: `ec05f3a1d75d3f88619489a44f77104a37295ba3`, -`92e4b2933a9e23d08c15042b9b9085f4fea556f7` diff --git a/README.md b/README.md index ab2b402..58d4aa6 100644 --- a/README.md +++ b/README.md @@ -69,6 +69,9 @@ We encourage you to contribute to ZBook to help us build the best tool for docum The ZBook UI is rendered using a set of translation files found in [`zbook_frontend/messages`](/zbook_frontend/messages/). We welcome all additional translations for the UI. +If you are submitting new language support, please first refer to the documentation [Language Support](https://github.com/zizdlp/zbook-docs/blob/main/Development/LanguageSupport.md) and follow the necessary procedures. You can refer to these commits: `ec05f3a1d75d3f88619489a44f77104a37295ba3`, +`92e4b2933a9e23d08c15042b9b9085f4fea556f7` + #### Bugs Encounter a bug or find an issue you'd like to fix? Helping us fix issues related to ZBook greatly improves the experience for everyone. Head to the issues section of this repository to learn more about the types of bugs you can already help out with. @@ -87,6 +90,15 @@ Not Support: ZBook does **not support online editing**. We believe that tools like Git in local environments such as VS Code and Typora are sufficient for editing and collaborating on content. **Online editing is not essential** in our view. Additionally, enabling online editing would require granting write permissions to Git repositories, which could pose **security risks**. +### TODO + +ZBook plans to support the following features: + +- [ ] Branch switching, allowing users to preview specific branches before merging into the main branch. +- [ ] MkDocs-style theme extensions. +- [ ] GitHub-style admonitions. +- [ ] MkDocs-style collapsible admonitions. + ## Deployment For privacy and other reasons (for private repositories, you may need to input an access token; although GitHub supports fine-grained access tokens that can grant specific permissions to specific repositories, such as read-only), we encourage you to deploy ZBook yourself. You can use docker-compose or a k8s cluster for deployment. For details, please refer to the [ZBook Documentation](https://github.com/zizdlp/zbook-docs). diff --git a/README_zh.md b/README_zh.md index 618baa0..b2a82f6 100644 --- a/README_zh.md +++ b/README_zh.md @@ -70,6 +70,9 @@ ZBook 完全开源,并建立在 [Next.js](https://nextjs.org/),[Golang](http ZBook 的用户界面使用一组翻译文件进行渲染,这些文件可以在 [`zbook_frontend/messages`](/zbook_frontend/messages/) 中找到。我们欢迎所有 UI 的额外翻译。 +如果您想提交新的语言支持,请首先参考文档 [语言支持](https://github.com/zizdlp/zbook-docs/blob/main/Development/LanguageSupport.md),跟随其中的相关步骤修改代码。此外,可以参考这些提交: `ec05f3a1d75d3f88619489a44f77104a37295ba3`, +`92e4b2933a9e23d08c15042b9b9085f4fea556f7` + #### 错误 遇到错误或找到你想修复的问题?帮助我们修复与 ZBook 相关的问题可以极大地改善所有人的体验。前往本仓库的问题部分,了解你可以帮助解决的错误类型。 @@ -88,6 +91,15 @@ ZBook 的用户界面使用一组翻译文件进行渲染,这些文件可以 ZBook 不支持**在线编辑**。我们认为 Git 在本地环境如 VS Code 和 Typora 中的工具足以用于编辑和协作内容。在线编辑不是必需的。此外,启用在线编辑需要授予 Git 仓库写权限,这可能带来**安全风险**。 +### TODO + +zbook计划支持如下功能: + +- [ ] 分支切换,动机是合并main分支之前,可以先查看特定分支的显示效果 +- [ ] 类似mkdocs的风格扩展 +- [ ] github 风格的admonition +- [ ] mkdocs 风格的折叠式admonition + ## 部署 由于隐私和其他原因(对于私人仓库,你可能需要输入访问令牌;虽然 GitHub 支持细粒度访问令牌,可以授予特定仓库的特定权限,例如只读),我们鼓励你自行部署 ZBook。你可以使用 Docker Compose 或 k8s 集群进行部署。详情请参阅 [ZBook 文档](https://github.com/zizdlp/zbook-docs)。 diff --git a/zbook_frontend/src/app/[locale]/cases/page.tsx b/zbook_frontend/src/app/[locale]/cases/page.tsx index f704144..355b4af 100644 --- a/zbook_frontend/src/app/[locale]/cases/page.tsx +++ b/zbook_frontend/src/app/[locale]/cases/page.tsx @@ -19,7 +19,9 @@ export default async function CasesPage({ return (
-
+

{t("MultiUserSection")}

{t("HomeSloganB")}

@@ -171,7 +176,7 @@ export default async function Home() { -
+
diff --git a/zbook_frontend/src/app/[locale]/workspace/[username]/(dashboards)/dashboard/@visitors/page.tsx b/zbook_frontend/src/app/[locale]/workspace/[username]/(dashboards)/dashboard/@visitors/page.tsx index bbc22a8..395f05e 100644 --- a/zbook_frontend/src/app/[locale]/workspace/[username]/(dashboards)/dashboard/@visitors/page.tsx +++ b/zbook_frontend/src/app/[locale]/workspace/[username]/(dashboards)/dashboard/@visitors/page.tsx @@ -89,7 +89,11 @@ export default async function AdminOverviewPage({
{visitors?.length ?? 0}
-

+

{t("VisitorRegion")}

diff --git a/zbook_frontend/src/components/DialogComponent.tsx b/zbook_frontend/src/components/DialogComponent.tsx index b5ea7a3..3194fd1 100644 --- a/zbook_frontend/src/components/DialogComponent.tsx +++ b/zbook_frontend/src/components/DialogComponent.tsx @@ -22,12 +22,20 @@ export default function DialogComponent(props: DialogCompentProps) { leaveFrom="opacity-100 scale-100" leaveTo="opacity-0 scale-50" > -
-
- +
+
+
+ {props.children}
+
diff --git a/zbook_frontend/src/components/TableOfContent.tsx b/zbook_frontend/src/components/TableOfContent.tsx index dc41dbc..3331f08 100644 --- a/zbook_frontend/src/components/TableOfContent.tsx +++ b/zbook_frontend/src/components/TableOfContent.tsx @@ -133,11 +133,13 @@ export default function TableOfContent(props: TableOfContentProps) { {domToReact(domNode.children, html_parser_options_list)} @@ -147,11 +149,13 @@ export default function TableOfContent(props: TableOfContentProps) { {domToReact(domNode.children, html_parser_options_list)} @@ -163,7 +167,9 @@ export default function TableOfContent(props: TableOfContentProps) { return (
{/* 确保父元素具有固定高度或最大高度 */} diff --git a/zbook_frontend/src/components/TimeElement.tsx b/zbook_frontend/src/components/TimeElement.tsx index f4e4b16..ac21f01 100644 --- a/zbook_frontend/src/components/TimeElement.tsx +++ b/zbook_frontend/src/components/TimeElement.tsx @@ -44,5 +44,5 @@ export default function TimeElement({ timeInfo }: { timeInfo: string }) { } } } - return <>{convertTime(timeInfo)}; + return {convertTime(timeInfo)}; } diff --git a/zbook_frontend/src/components/WarningDialog.tsx b/zbook_frontend/src/components/WarningDialog.tsx index d315685..fb66b61 100644 --- a/zbook_frontend/src/components/WarningDialog.tsx +++ b/zbook_frontend/src/components/WarningDialog.tsx @@ -18,34 +18,36 @@ export default function WarngingDialog({ }) { return ( -
-
-
-
-
- -
-
-
- - + {title} +
+
+ + +
diff --git a/zbook_frontend/src/components/charts/AreaUserChart.tsx b/zbook_frontend/src/components/charts/AreaUserChart.tsx index 55d8c2c..7b5d041 100644 --- a/zbook_frontend/src/components/charts/AreaUserChart.tsx +++ b/zbook_frontend/src/components/charts/AreaUserChart.tsx @@ -58,6 +58,7 @@ export default function AreaUserChart({ }).then((data) => { setActiveUserCounts(data.counts); }); + // eslint-disable-next-line react-hooks/exhaustive-deps }, []); const t = useTranslations("AdminOverView"); @@ -82,7 +83,11 @@ export default function AreaUserChart({
{t("DailyUsers")}
-
+
sum + count, 0); diff --git a/zbook_frontend/src/components/charts/EnableElement.tsx b/zbook_frontend/src/components/charts/EnableElement.tsx index 2837044..49b0c39 100644 --- a/zbook_frontend/src/components/charts/EnableElement.tsx +++ b/zbook_frontend/src/components/charts/EnableElement.tsx @@ -31,7 +31,7 @@ export default function EnableElement({ : t("TipInviation") } > -
{label}
+ {label} {username} - + {email}
diff --git a/zbook_frontend/src/components/elements/details/ListCommentReportElement.tsx b/zbook_frontend/src/components/elements/details/ListCommentReportElement.tsx index 5372ab2..01500bf 100644 --- a/zbook_frontend/src/components/elements/details/ListCommentReportElement.tsx +++ b/zbook_frontend/src/components/elements/details/ListCommentReportElement.tsx @@ -42,7 +42,9 @@ export default function ListCommentReportElement({ className="cursor-pointer" > {t("Comment")} diff --git a/zbook_frontend/src/components/elements/details/ListElementCard.tsx b/zbook_frontend/src/components/elements/details/ListElementCard.tsx index c872d9b..9160951 100644 --- a/zbook_frontend/src/components/elements/details/ListElementCard.tsx +++ b/zbook_frontend/src/components/elements/details/ListElementCard.tsx @@ -15,7 +15,11 @@ export default function ListElementCard({
{header}
-
+
{content}
diff --git a/zbook_frontend/src/components/elements/details/ListRepoElement.tsx b/zbook_frontend/src/components/elements/details/ListRepoElement.tsx index eed4317..8e343cf 100644 --- a/zbook_frontend/src/components/elements/details/ListRepoElement.tsx +++ b/zbook_frontend/src/components/elements/details/ListRepoElement.tsx @@ -47,13 +47,21 @@ export default function ListRepoElement({ className="flex-none w-8 h-8 rounded-full object-cover" /> -
+
{repo_name} diff --git a/zbook_frontend/src/components/elements/details/ListSessionElement.tsx b/zbook_frontend/src/components/elements/details/ListSessionElement.tsx index cd5f210..d2563e1 100644 --- a/zbook_frontend/src/components/elements/details/ListSessionElement.tsx +++ b/zbook_frontend/src/components/elements/details/ListSessionElement.tsx @@ -33,13 +33,19 @@ export default function ListSessionElement({
{username} - + {email}
diff --git a/zbook_frontend/src/components/elements/details/ListUserElement.tsx b/zbook_frontend/src/components/elements/details/ListUserElement.tsx index c3a8d00..851fa4c 100644 --- a/zbook_frontend/src/components/elements/details/ListUserElement.tsx +++ b/zbook_frontend/src/components/elements/details/ListUserElement.tsx @@ -49,13 +49,19 @@ export default function ListUserElement({
{username} - + {email}
@@ -99,7 +105,11 @@ export default function ListUserElement({ {listType == ListDataType.LIST_ADMIN_USER && ( + {verified ? t("Verified") : t("UnVerified")} + + } /> )}
diff --git a/zbook_frontend/src/components/home/FooterForHome.tsx b/zbook_frontend/src/components/home/FooterForHome.tsx index 50db574..28c2778 100644 --- a/zbook_frontend/src/components/home/FooterForHome.tsx +++ b/zbook_frontend/src/components/home/FooterForHome.tsx @@ -4,6 +4,7 @@ import { Link } from "@/navigation"; import { getTranslations } from "next-intl/server"; import { beian, doc_reponame, doc_username } from "@/utils/env_variable"; import { IconType } from "react-icons/lib"; +import IconItem from "../IconComponent"; const SocialLink = ({ href, @@ -97,29 +98,33 @@ export default async function FooterForHome() { { href: "https://discord.com/channels/1250069935594536960/1250069935594536963", ariaLabel: "ZBook on Discord", - icon: FaDiscord, + icon: "discord", }, { href: "https://github.com/zizdlp/zbook", ariaLabel: "ZBook on GitHub", - icon: FaGithub, + icon: "github", }, { href: "https://space.bilibili.com/1448262500", ariaLabel: "ZBook on Bilibili", - icon: FaBilibili, + icon: "bilibili", }, { href: "https://www.youtube.com/channel/UC9D6VAJRoG7bD38dz8F9CSg", ariaLabel: "ZBook on Youtube", - icon: FaYoutube, + icon: "youtube", }, ]; return (