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
46 changes: 0 additions & 46 deletions apps/web/src/components/deepwiki-link.tsx

This file was deleted.

39 changes: 39 additions & 0 deletions apps/web/src/components/docs-link.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
import { useTranslation } from "react-i18next"
import { IconBook2 } from "@tabler/icons-react"

import { buttonVariants } from "@admin/ui/components/button"
import { Tooltip, TooltipContent, TooltipTrigger } from "@admin/ui/components/tooltip"
import { cn } from "@admin/ui/lib/utils"

import { BRAND } from "@/lib/brand"

/**
* 顶栏的文档站入口。DeepWiki 这类第三方解析挂在文档站的顶栏上,后台不再单独摆图标——
* 那些地址改了只改文档站一处。GitHub 仓库入口照旧在旁边(`github-link.tsx`)。
*
* 界面是英文时直接进英文版(文档站中文在根路径、英文在 `/en/`)。
*/
export function DocsLink() {
const { t, i18n } = useTranslation()
const label = t("查看文档")
const href = i18n.language?.startsWith("en") ? `${BRAND.docsUrl}en/` : BRAND.docsUrl
return (
<Tooltip>
<TooltipTrigger
render={
<a
href={href}
target="_blank"
rel="noopener noreferrer"
data-testid="docs-link"
aria-label={label}
className={cn(buttonVariants({ variant: "ghost", size: "icon" }), "size-7")}
/>
}
>
<IconBook2 className="size-4" />
</TooltipTrigger>
<TooltipContent>{label}</TooltipContent>
</Tooltip>
)
}
7 changes: 5 additions & 2 deletions apps/web/src/lib/brand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@ export const BRAND = {
commit: import.meta.env.VITE_GIT_SHA || null,
/** 仓库地址。顶栏的 GitHub 图标(`components/github-link.tsx`)读它,fork 出去改这一处就行 */
repoUrl: "https://github.com/yile2020/fastapi-react-admin",
/** DeepWiki 的项目解析页,给演示站访客一个 AI 架构导览入口 */
deepwikiUrl: "https://deepwiki.com/yile2020/fastapi-react-admin",
/**
* 文档站地址(以 `/` 结尾,英文版在其下的 `en/`)。顶栏的文档图标(`components/docs-link.tsx`)读它,
* fork 出去改这一处就行。DeepWiki 的入口在文档站顶栏上,后台不再单独挂
*/
docsUrl: "https://yile2020.github.io/fastapi-react-admin/",
} as const
4 changes: 2 additions & 2 deletions apps/web/src/routes/_auth.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ import { NotificationBell } from "@admin/platform/pages/notification/bell"
import { NoticeBanner } from "@admin/platform/pages/notice/banner"
import { NoticePopupHost } from "@admin/platform/pages/notice/popup-host"
import { AiDrawer, AiDrawerTrigger } from "@admin/platform/pages/ai-chat/drawer"
import { DocsLink } from "@/components/docs-link"
import { GithubLink } from "@/components/github-link"
import { DeepWikiLink } from "@/components/deepwiki-link"
import { UserMenu } from "@/components/user-menu"

export const Route = createFileRoute("/_auth")({
Expand Down Expand Up @@ -129,7 +129,7 @@ function AuthLayout() {
{/* 命令面板入口:⌘K 也能开,但快捷键不摆出来就等于只有作者知道 */}
<div className="ms-auto flex items-center gap-2">
<CommandTrigger />
<DeepWikiLink />
<DocsLink />
<GithubLink />
{/* 帮助:重看功能引导 / 快捷键清单。没有这个按钮,那两样只有知道的人才找得到 */}
<HelpMenu about={{ name: BRAND.wordmark, version: BRAND.version, commit: BRAND.commit }} />
Expand Down
2 changes: 1 addition & 1 deletion packages/i18n/src/locales/en-US.json
Original file line number Diff line number Diff line change
Expand Up @@ -1985,6 +1985,7 @@
"查看全部审批单,处理卡住的待办。": "View all approval requests and handle stuck tasks.",
"查看全部通知": "View all notifications",
"查看已装插件、启停与打包下载。": "Inspect installed plugins, toggle them, download a bundle.",
"查看文档": "Documentation",
"查看详情": "View details",
"查询": "Query",
"标准": "Standard",
Expand Down Expand Up @@ -2260,7 +2261,6 @@
"生成一把新密钥。旧的那把还会一起签名 24 小时,对方在这一天里换成新的就不会丢事件。": "A new secret will be generated. The old one keeps signing alongside it for 24 hours, so the receiver loses no events as long as it switches within that day.",
"生成中": "Generating",
"生成中,通常要半分钟左右。关掉弹窗就不要这次的结果。": "Generating, usually takes about half a minute. Closing the dialog discards this result.",
"用 DeepWiki 理解项目": "Explore the project with DeepWiki",
"用 {{name}} 验证身份": "Verify with {{name}}",
"用于发布系统内部通知、公告": "Publishes internal notices and announcements",
"用于安全审计:确认是谁、从哪里、用什么设备登录,失败时看清原因。": "For security audits: who signed in, from where, on what device, and why it failed.",
Expand Down
2 changes: 1 addition & 1 deletion packages/i18n/src/locales/zh-CN.json
Original file line number Diff line number Diff line change
Expand Up @@ -1985,6 +1985,7 @@
"查看全部审批单,处理卡住的待办。": "查看全部审批单,处理卡住的待办。",
"查看全部通知": "查看全部通知",
"查看已装插件、启停与打包下载。": "查看已装插件、启停与打包下载。",
"查看文档": "查看文档",
"查看详情": "查看详情",
"查询": "查询",
"标准": "标准",
Expand Down Expand Up @@ -2260,7 +2261,6 @@
"生成一把新密钥。旧的那把还会一起签名 24 小时,对方在这一天里换成新的就不会丢事件。": "生成一把新密钥。旧的那把还会一起签名 24 小时,对方在这一天里换成新的就不会丢事件。",
"生成中": "生成中",
"生成中,通常要半分钟左右。关掉弹窗就不要这次的结果。": "生成中,通常要半分钟左右。关掉弹窗就不要这次的结果。",
"用 DeepWiki 理解项目": "用 DeepWiki 理解项目",
"用 {{name}} 验证身份": "用 {{name}} 验证身份",
"用于发布系统内部通知、公告": "用于发布系统内部通知、公告",
"用于安全审计:确认是谁、从哪里、用什么设备登录,失败时看清原因。": "用于安全审计:确认是谁、从哪里、用什么设备登录,失败时看清原因。",
Expand Down
Loading