[优化] go 引用调整

This commit is contained in:
ryan
2026-06-06 10:26:20 +08:00
parent ee1110b752
commit 3cfefb4367
552 changed files with 1642 additions and 2185 deletions
@@ -0,0 +1,5 @@
import {AccessLogsPage} from '@/features/access-logs/components/access-logs-page';
export default function AccessLogsRoute() {
return <AccessLogsPage />;
}
@@ -0,0 +1,5 @@
import {ApplyLogsPage as ApplyLogsFeaturePage} from '@/features/apply-logs/components/apply-logs-page';
export default function ApplyLogsPage() {
return <ApplyLogsFeaturePage />;
}
@@ -0,0 +1,5 @@
import {ConfigVersionsPage} from '@/features/config-versions/components/config-versions-page';
export default function ConfigVersionsRoute() {
return <ConfigVersionsPage />;
}
@@ -0,0 +1,16 @@
import type {ReactNode} from 'react';
import {DashboardShell} from '@/components/layout/dashboard-shell';
import {DashboardAuthGuard} from '@/features/auth/components/dashboard-auth-guard';
interface DashboardLayoutProps {
children: ReactNode;
}
export default function DashboardLayout({ children }: DashboardLayoutProps) {
return (
<DashboardAuthGuard>
<DashboardShell>{children}</DashboardShell>
</DashboardAuthGuard>
);
}
@@ -0,0 +1,11 @@
'use client';
import {useSearchParams} from 'next/navigation';
import {NodeDetailPage} from '@/features/nodes/components/node-detail-page';
export default function NodeDetailRoute() {
const searchParams = useSearchParams();
return <NodeDetailPage nodeId={searchParams.get('id') ?? ''} />;
}
@@ -0,0 +1,5 @@
import {NodesPage} from '@/features/nodes/components/nodes-page';
export default function NodesRoute() {
return <NodesPage />;
}
@@ -0,0 +1,11 @@
'use client';
import {useSearchParams} from 'next/navigation';
import {OriginDetailPage} from '@/features/origins/components/origin-detail-page';
export default function OriginDetailRoute() {
const searchParams = useSearchParams();
return <OriginDetailPage originId={searchParams.get('id') ?? ''} />;
}
@@ -0,0 +1,5 @@
import {OriginsPage} from '@/features/origins/components/origins-page';
export default function OriginRoute() {
return <OriginsPage />;
}
@@ -0,0 +1,9 @@
import {DashboardOverview} from '@/features/dashboard/components/dashboard-overview';
export default function DashboardPage() {
return (
<div className="space-y-6">
<DashboardOverview />
</div>
);
}
@@ -0,0 +1,11 @@
'use client';
import {useSearchParams} from 'next/navigation';
import {PagesProjectDetailPage} from '@/features/pages/components/pages-page';
export default function PagesProjectDetailRoute() {
const searchParams = useSearchParams();
return <PagesProjectDetailPage projectId={searchParams.get('id') ?? ''} />;
}
@@ -0,0 +1,5 @@
import {PagesPage} from '@/features/pages/components/pages-page';
export default function Page() {
return <PagesPage />;
}
@@ -0,0 +1,5 @@
import {PerformancePage} from '@/features/performance/components/performance-page';
export default function PerformanceRoute() {
return <PerformancePage />;
}
@@ -0,0 +1,16 @@
'use client';
import {useSearchParams} from 'next/navigation';
import {ProxyRouteConfigPage} from '@/features/proxy-routes/components/proxy-route-config-page';
export default function ProxyRouteDetailRoute() {
const searchParams = useSearchParams();
return (
<ProxyRouteConfigPage
routeId={searchParams.get('id') ?? ''}
initialSection={searchParams.get('section') ?? 'domains'}
/>
);
}
@@ -0,0 +1,5 @@
import {ProxyRoutesPage} from '@/features/proxy-routes/components/proxy-routes-page';
export default function ProxyRoutesRoute() {
return <ProxyRoutesPage />;
}
@@ -0,0 +1,5 @@
import {SettingsPage} from '@/features/settings/components/settings-page';
export default function SettingsRoute() {
return <SettingsPage />;
}
@@ -0,0 +1,5 @@
import {UsersPage} from '@/features/users/components/users-page';
export default function UsersRoute() {
return <UsersPage />;
}
@@ -0,0 +1,5 @@
import {WAFIPGroupsPage} from '@/features/waf/components/ip-groups-page';
export default function WAFIPGroupsRoute() {
return <WAFIPGroupsPage />;
}
@@ -0,0 +1,5 @@
import {WAFPage} from '@/features/waf/components/waf-page';
export default function WAFRoute() {
return <WAFPage />;
}
@@ -0,0 +1,5 @@
import {TlsCertificatesPage} from '@/features/tls-certificates/components/tls-certificates-page';
export default function WebsiteCertificateRoute() {
return <TlsCertificatesPage />;
}
@@ -0,0 +1,11 @@
'use client';
import {useSearchParams} from 'next/navigation';
import {WebsiteDetailPage} from '@/features/websites/components/website-detail-page';
export default function WebsiteDetailRoute() {
const searchParams = useSearchParams();
return <WebsiteDetailPage websiteId={searchParams.get('id') ?? ''} />;
}
@@ -0,0 +1,5 @@
import {DnsAccountsPage} from '@/features/dns-accounts/components/dns-accounts-page';
export default function Page() {
return <DnsAccountsPage />;
}
@@ -0,0 +1,5 @@
import {WebsitesPage} from '@/features/websites/components/websites-page';
export default function WebsiteRoute() {
return <WebsitesPage />;
}
@@ -0,0 +1,5 @@
import {AboutPage} from '@/features/about/components/about-page';
export default function AboutRoute() {
return <AboutPage />;
}
@@ -0,0 +1,11 @@
import type {ReactNode} from 'react';
import {PublicShell} from '@/components/layout/public-shell';
interface PublicLayoutProps {
children: ReactNode;
}
export default function PublicLayout({ children }: PublicLayoutProps) {
return <PublicShell>{children}</PublicShell>;
}
@@ -0,0 +1,12 @@
import {Suspense} from 'react';
import {LoadingState} from '@/components/feedback/loading-state';
import {LoginForm} from '@/features/auth/components/login-form';
export default function LoginPage() {
return (
<Suspense fallback={<LoadingState />}>
<LoginForm />
</Suspense>
);
}
@@ -0,0 +1,12 @@
import {Suspense} from 'react';
import {LoadingState} from '@/components/feedback/loading-state';
import {OAuthCallback} from '@/features/auth/components/oauth-callback';
export default function OAuthSourceCallbackPage() {
return (
<Suspense fallback={<LoadingState />}>
<OAuthCallback />
</Suspense>
);
}
@@ -0,0 +1,12 @@
import {Suspense} from 'react';
import {LoadingState} from '@/components/feedback/loading-state';
import {GitHubOAuthCallback} from '@/features/auth/components/github-oauth-callback';
export default function GithubOAuthPage() {
return (
<Suspense fallback={<LoadingState />}>
<GitHubOAuthCallback />
</Suspense>
);
}
@@ -0,0 +1,5 @@
import {OAuthLinkExistingForm} from '@/features/auth/components/oauth-link-existing-form';
export default function OAuthLinkPage() {
return <OAuthLinkExistingForm />;
}
@@ -0,0 +1,12 @@
import {Suspense} from 'react';
import {LoadingState} from '@/components/feedback/loading-state';
import {PasswordResetFlow} from '@/features/auth/components/password-reset-flow';
export default function ResetPasswordPage() {
return (
<Suspense fallback={<LoadingState />}>
<PasswordResetFlow />
</Suspense>
);
}
@@ -0,0 +1,12 @@
import {Suspense} from 'react';
import {LoadingState} from '@/components/feedback/loading-state';
import {PasswordResetFlow} from '@/features/auth/components/password-reset-flow';
export default function LegacyResetPasswordPage() {
return (
<Suspense fallback={<LoadingState />}>
<PasswordResetFlow />
</Suspense>
);
}
+189
View File
@@ -0,0 +1,189 @@
@import '../styles/tokens.css';
@import 'tailwindcss';
@import '@heroui/styles';
@import 'tw-animate-css';
@import 'shadcn/tailwind.css';
@custom-variant dark (&:is(.dark *));
* {
box-sizing: border-box;
}
html {
background: var(--surface-canvas);
}
html[data-theme='light'] {
color-scheme: light;
}
html[data-theme='dark'] {
color-scheme: dark;
}
body {
min-height: 100vh;
background: var(--body-background);
color: var(--foreground-primary);
font-family:
Inter,
ui-sans-serif,
system-ui,
-apple-system,
BlinkMacSystemFont,
'Segoe UI',
sans-serif;
transition:
background 0.2s ease,
color 0.2s ease;
}
a {
color: inherit;
text-decoration: none;
}
button {
cursor: pointer;
}
::selection {
background: var(--selection-background);
color: var(--selection-foreground);
}
@theme inline {
--font-heading: var(--font-sans);
--font-sans: var(--font-sans);
--color-sidebar-ring: var(--sidebar-ring);
--color-sidebar-border: var(--sidebar-border);
--color-sidebar-accent-foreground: var(--sidebar-accent-foreground);
--color-sidebar-accent: var(--sidebar-accent);
--color-sidebar-primary-foreground: var(--sidebar-primary-foreground);
--color-sidebar-primary: var(--sidebar-primary);
--color-sidebar-foreground: var(--sidebar-foreground);
--color-sidebar: var(--sidebar);
--color-chart-5: var(--chart-5);
--color-chart-4: var(--chart-4);
--color-chart-3: var(--chart-3);
--color-chart-2: var(--chart-2);
--color-chart-1: var(--chart-1);
--color-ring: var(--ring);
--color-input: var(--input);
--color-border: var(--border);
--color-destructive: var(--destructive);
--color-accent-foreground: var(--accent-foreground);
--color-accent: var(--accent);
--color-muted-foreground: var(--muted-foreground);
--color-muted: var(--muted);
--color-secondary-foreground: var(--secondary-foreground);
--color-secondary: var(--secondary);
--color-primary-foreground: var(--primary-foreground);
--color-primary: var(--primary);
--color-popover-foreground: var(--popover-foreground);
--color-popover: var(--popover);
--color-card-foreground: var(--card-foreground);
--color-card: var(--card);
--color-foreground: var(--foreground);
--color-background: var(--background);
--radius-sm: calc(var(--radius) * 0.6);
--radius-md: calc(var(--radius) * 0.8);
--radius-lg: var(--radius);
--radius-xl: calc(var(--radius) * 1.4);
--radius-2xl: calc(var(--radius) * 1.8);
--radius-3xl: calc(var(--radius) * 2.2);
--radius-4xl: calc(var(--radius) * 2.6);
}
:root {
--background: oklch(1 0 0);
--foreground: oklch(0.145 0 0);
--card: oklch(1 0 0);
--card-foreground: oklch(0.145 0 0);
--popover: oklch(1 0 0);
--popover-foreground: oklch(0.145 0 0);
--primary: oklch(0.205 0 0);
--primary-foreground: oklch(0.985 0 0);
--secondary: oklch(0.97 0 0);
--secondary-foreground: oklch(0.205 0 0);
--muted: oklch(0.97 0 0);
--muted-foreground: oklch(0.556 0 0);
--accent: oklch(0.97 0 0);
--accent-foreground: oklch(0.205 0 0);
--destructive: oklch(0.577 0.245 27.325);
--border: oklch(0.922 0 0);
--input: oklch(0.922 0 0);
--ring: oklch(0.708 0 0);
--chart-1: oklch(0.87 0 0);
--chart-2: oklch(0.556 0 0);
--chart-3: oklch(0.439 0 0);
--chart-4: oklch(0.371 0 0);
--chart-5: oklch(0.269 0 0);
--radius: 0.625rem;
--sidebar: oklch(0.985 0 0);
--sidebar-foreground: oklch(0.145 0 0);
--sidebar-primary: oklch(0.205 0 0);
--sidebar-primary-foreground: oklch(0.985 0 0);
--sidebar-accent: oklch(0.97 0 0);
--sidebar-accent-foreground: oklch(0.205 0 0);
--sidebar-border: oklch(0.922 0 0);
--sidebar-ring: oklch(0.708 0 0);
}
.dark {
--background: oklch(0.145 0 0);
--foreground: oklch(0.985 0 0);
--card: oklch(0.205 0 0);
--card-foreground: oklch(0.985 0 0);
--popover: oklch(0.205 0 0);
--popover-foreground: oklch(0.985 0 0);
--primary: oklch(0.922 0 0);
--primary-foreground: oklch(0.205 0 0);
--secondary: oklch(0.269 0 0);
--secondary-foreground: oklch(0.985 0 0);
--muted: oklch(0.269 0 0);
--muted-foreground: oklch(0.708 0 0);
--accent: oklch(0.269 0 0);
--accent-foreground: oklch(0.985 0 0);
--destructive: oklch(0.704 0.191 22.216);
--border: oklch(1 0 0 / 10%);
--input: oklch(1 0 0 / 15%);
--ring: oklch(0.556 0 0);
--chart-1: oklch(0.87 0 0);
--chart-2: oklch(0.556 0 0);
--chart-3: oklch(0.439 0 0);
--chart-4: oklch(0.371 0 0);
--chart-5: oklch(0.269 0 0);
--sidebar: oklch(0.205 0 0);
--sidebar-foreground: oklch(0.985 0 0);
--sidebar-primary: oklch(0.488 0.243 264.376);
--sidebar-primary-foreground: oklch(0.985 0 0);
--sidebar-accent: oklch(0.269 0 0);
--sidebar-accent-foreground: oklch(0.985 0 0);
--sidebar-border: oklch(1 0 0 / 10%);
--sidebar-ring: oklch(0.556 0 0);
}
@layer base {
* {
@apply border-border outline-ring/50;
}
body {
@apply bg-background text-foreground;
}
html {
@apply font-sans;
}
}
/* Hide scrollbar for Chrome, Safari and Opera */
.no-scrollbar::-webkit-scrollbar {
display: none;
}
/* Hide scrollbar for IE, Edge and Firefox */
.no-scrollbar {
-ms-overflow-style: none; /* IE and Edge */
scrollbar-width: none; /* Firefox */
}
+42
View File
@@ -0,0 +1,42 @@
import type {Metadata} from 'next';
import Script from 'next/script';
import type {ReactNode} from 'react';
import {AppProviders} from '@/components/providers/app-providers';
import {getThemeInitScript} from '@/lib/theme/theme';
import './globals.css';
import {Geist} from 'next/font/google';
import {cn} from '@/lib/utils';
const geist = Geist({ subsets: ['latin'], variable: '--font-sans' });
export const metadata: Metadata = {
title: {
default: 'OpenFlare 控制台',
template: '%s | OpenFlare',
},
description: 'OpenFlare 管理端',
applicationName: 'OpenFlare',
};
interface RootLayoutProps {
children: ReactNode;
}
export default function RootLayout({ children }: RootLayoutProps) {
return (
<html
lang="zh-CN"
suppressHydrationWarning
className={cn('font-sans', geist.variable)}
>
<body>
<Script id="theme-init" strategy="beforeInteractive">
{getThemeInitScript()}
</Script>
<AppProviders>{children}</AppProviders>
</body>
</html>
);
}
+24
View File
@@ -0,0 +1,24 @@
import Link from 'next/link';
import {AppCard} from '@/components/ui/app-card';
export default function NotFound() {
return (
<main className="flex min-h-screen items-center justify-center px-4">
<AppCard
title="页面不存在"
description="当前请求的页面尚未接入新版管理端路由。"
>
<div className="space-y-4 text-sm leading-6 text-[var(--foreground-secondary)]">
<p>请返回总览页,或继续通过侧边导航访问已初始化的模块入口。</p>
<Link
href="/"
className="inline-flex rounded-full bg-[var(--brand-primary)] px-4 py-2 font-medium text-[var(--foreground-inverse)] transition hover:opacity-90"
>
返回总览
</Link>
</div>
</AppCard>
</main>
);
}