-
- NapCat
-
- }
- >
+
+
+
NapCat
{error ? (
error.message
) : loading ? (
) : (
- data?.version
+
)}
-
+
)
}
export default function AboutPage() {
+ const { isDark } = useTheme()
+
+ const imageUrls = useMemo(
+ () => [
+ 'https://next.ossinsight.io/widgets/official/compose-recent-active-contributors/thumbnail.png?repo_id=777721566&limit=30&image_size=auto&color_scheme=light',
+ 'https://next.ossinsight.io/widgets/official/compose-recent-active-contributors/thumbnail.png?repo_id=777721566&limit=30&image_size=auto&color_scheme=dark',
+ 'https://next.ossinsight.io/widgets/official/compose-activity-trends/thumbnail.png?repo_id=41986369&image_size=auto&color_scheme=light',
+ 'https://next.ossinsight.io/widgets/official/compose-activity-trends/thumbnail.png?repo_id=41986369&image_size=auto&color_scheme=dark'
+ ],
+ []
+ )
+
+ const { loadedUrls, isLoading } = usePreloadImages(imageUrls)
+
+ const getImageUrl = useMemo(
+ () => (baseUrl: string) => {
+ const theme = isDark ? 'dark' : 'light'
+ const fullUrl = baseUrl.replace(
+ /color_scheme=(?:light|dark)/,
+ `color_scheme=${theme}`
+ )
+ return isLoading ? null : loadedUrls[fullUrl] ? fullUrl : null
+ },
+ [isDark, isLoading, loadedUrls]
+ )
+
+ const renderImage = useMemo(
+ () => (baseUrl: string, alt: string) => {
+ const imageUrl = getImageUrl(baseUrl)
+
+ if (!imageUrl) {
+ return (
+
+
+
+ )
+ }
+
+ return (
+
+ )
+ },
+ [getImageUrl]
+ )
+
return (
<>
关于 NapCat WebUI
-
-
-
-
+
+
+
+
-
-
-
- NapCat Contributors
-
-
+
+
+
+
NapCat 是什么?
+
+ 基于TypeScript构建的Bot框架,通过相应的启动器或者框架,主动调用QQ
+ Node模块提供给客户端的接口,实现Bot的功能.
+
+
魔法版介绍
+
+ 猫猫框架通过魔法的手段获得了 QQ 的发送消息、接收消息等接口。
+ 为了方便使用,猫猫框架将通过一种名为 OneBot 的约定将你的 HTTP /
+ WebSocket 请求按照规范读取,
+ 再去调用猫猫框架所获得的QQ发送接口之类的接口。
+
+
+
+
+
+
+
+
+
+ 官方社群1
+
+
+
+
+
+
+
+
+ 官方社群2
+
+
+
+
+
+
+
+
+ Telegram
+
+
+
+
+
+
+
+
+ 使用文档
+
+
+
+
+
+ {renderImage(
+ 'https://next.ossinsight.io/widgets/official/compose-recent-active-contributors/thumbnail.png?repo_id=777721566&limit=30&image_size=auto&color_scheme=light',
+ 'Contributors'
+ )}
+ {renderImage(
+ 'https://next.ossinsight.io/widgets/official/compose-activity-trends/thumbnail.png?repo_id=41986369&image_size=auto&color_scheme=light',
+ 'Activity Trends'
+ )}
+
+
diff --git a/napcat.webui/src/pages/index.tsx b/napcat.webui/src/pages/index.tsx
index 8a94ec5a..88ebec7f 100644
--- a/napcat.webui/src/pages/index.tsx
+++ b/napcat.webui/src/pages/index.tsx
@@ -1,46 +1,35 @@
+import { Spinner } from '@heroui/spinner'
import { AnimatePresence, motion } from 'motion/react'
-import { Route, Routes, useLocation } from 'react-router-dom'
+import { Suspense } from 'react'
+import { Outlet, useLocation } from 'react-router-dom'
import DefaultLayout from '@/layouts/default'
-import DashboardIndexPage from './dashboard'
-import AboutPage from './dashboard/about'
-import ConfigPage from './dashboard/config'
-import DebugPage from './dashboard/debug'
-import HttpDebug from './dashboard/debug/http'
-import WSDebug from './dashboard/debug/websocket'
-import FileManagerPage from './dashboard/file_manager'
-import LogsPage from './dashboard/logs'
-import NetworkPage from './dashboard/network'
-import TerminalPage from './dashboard/terminal'
-
export default function IndexPage() {
const location = useLocation()
return (
-
-
-
- } path="/" />
- } path="/network" />
- } path="/config" />
- } path="/logs" />
- } path="/debug">
- } />
- } />
-
- } path="/file_manager" />
- } path="/terminal" />
- } path="/about" />
-
-
-
+
+
+
+ }
+ >
+
+
+
+
+
+
)
}