feat: embed Gitea via iframe in admin panel
Some checks failed
Deploy Admin Frontend / build-and-deploy (push) Failing after 5s

This commit is contained in:
WangDL 2026-05-22 14:35:26 +08:00
parent f8e5ae3b95
commit 1a55fce7e4
4 changed files with 21 additions and 1 deletions

View File

@ -10,6 +10,7 @@ import PageLoading from './components/PageLoading'
import AdminLayout from './layouts/AdminLayout' import AdminLayout from './layouts/AdminLayout'
const Login = lazy(() => import('./pages/Login')) const Login = lazy(() => import('./pages/Login'))
const GiteaEmbed = lazy(() => import('./pages/GiteaEmbed'))
const ServersPage = lazy(() => import("./pages/Servers")) const ServersPage = lazy(() => import("./pages/Servers"))
const AuditLogPage = lazy(() => import("./pages/AuditLog")) const AuditLogPage = lazy(() => import("./pages/AuditLog"))
const Dashboard = lazy(() => import('./pages/Dashboard')) const Dashboard = lazy(() => import('./pages/Dashboard'))
@ -81,6 +82,12 @@ function App() {
</PermissionGuard> </PermissionGuard>
} }
/> />
<Route
path="git"
element={
<Suspense fallback={<PageLoading />}><GiteaEmbed /></Suspense>
}
/>
<Route <Route
path="servers" path="servers"
element={ element={

View File

@ -1,5 +1,5 @@
import type React from 'react' import type React from 'react'
import { CloudServerOutlined, RobotOutlined, DashboardOutlined, import { CodeOutlined, CloudServerOutlined, RobotOutlined, DashboardOutlined,
UserOutlined, UserOutlined,
BookOutlined, BookOutlined,
ImportOutlined, ImportOutlined,
@ -47,6 +47,7 @@ export const adminMenuItems: AdminMenuItem[] = [
{ path: '/ai-costs', name: 'AI 调用与成本', icon: <CloudOutlined /> }, { path: '/ai-costs', name: 'AI 调用与成本', icon: <CloudOutlined /> },
{ path: '/files', name: '文件与 COS', icon: <FileOutlined /> }, { path: '/files', name: '文件与 COS', icon: <FileOutlined /> },
{ path: '/settings', name: '系统配置', icon: <SettingOutlined />, requiredRole: 'ADMIN' }, { path: '/settings', name: '系统配置', icon: <SettingOutlined />, requiredRole: 'ADMIN' },
{ path: '/git', name: '代码仓库', icon: <CodeOutlined /> },
{ path: '/servers', name: '服务器运维', icon: <CloudServerOutlined />, requiredRole: 'SUPER_ADMIN' }, { path: '/servers', name: '服务器运维', icon: <CloudServerOutlined />, requiredRole: 'SUPER_ADMIN' },
{ path: '/audit', name: '审计日志', icon: <SafetyOutlined />, requiredRole: 'ADMIN' }, { path: '/audit', name: '审计日志', icon: <SafetyOutlined />, requiredRole: 'ADMIN' },
] ]

View File

@ -21,6 +21,7 @@ const breadcrumbMap: Record<string, string> = {
'/ai-costs': 'AI 调用与成本', '/ai-costs': 'AI 调用与成本',
'/files': '文件与 COS', '/files': '文件与 COS',
'/settings': '系统配置', '/settings': '系统配置',
'/git': '代码仓库',
'/servers': '服务器运维', '/servers': '服务器运维',
'/audit': '审计日志', '/audit': '审计日志',
} }

11
src/pages/GiteaEmbed.tsx Normal file
View File

@ -0,0 +1,11 @@
export default function GiteaEmbed() {
return (
<div style={{ width: '100%', height: 'calc(100vh - 112px)', overflow: 'hidden' }}>
<iframe
src="https://git.admin.longde.cloud"
style={{ width: '100%', height: '100%', border: 'none' }}
title="Gitea"
/>
</div>
)
}