mirror of
https://github.com/Nezumi-2711/9router.git
synced 2026-09-22 13:38:31 +00:00
feat: update the content of the project
This commit is contained in:
@@ -402,7 +402,6 @@
|
||||
"Docs": "文档",
|
||||
"Documentation": "文档",
|
||||
"Domain:": "域名:",
|
||||
"Donate": "捐赠",
|
||||
"Done": "完成",
|
||||
"Download": "下载",
|
||||
"Download Backup": "下载备份",
|
||||
|
||||
@@ -491,7 +491,7 @@ export default function ProfilePage() {
|
||||
|
||||
{/* App Info */}
|
||||
<div className="text-center text-xs sm:text-sm text-text-muted py-4">
|
||||
<p>{APP_CONFIG.name} v{APP_CONFIG.version}</p>
|
||||
<p>{APP_CONFIG.name}</p>
|
||||
<p className="mt-1">Local Mode - All data stored on your machine</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -86,8 +86,8 @@ function RouterNode({ data }) {
|
||||
<Handle type="source" position={Position.Left} id="left" className="!bg-transparent !border-0 !w-0 !h-0" />
|
||||
<Handle type="source" position={Position.Right} id="right" className="!bg-transparent !border-0 !w-0 !h-0" />
|
||||
|
||||
<img src="/favicon.svg" alt="9Router" className="w-6 h-6 mr-2" />
|
||||
<span className="text-sm font-bold text-primary">9Router</span>
|
||||
<img src="/favicon.svg" alt="9Router (Remake)" className="w-6 h-6 mr-2" />
|
||||
<span className="text-sm font-bold text-primary">9Router (Remake)</span>
|
||||
{data.activeCount > 0 && (
|
||||
<span className="ml-2 px-1.5 py-0.5 rounded-full bg-primary text-white text-xs font-bold">
|
||||
{data.activeCount}
|
||||
|
||||
@@ -11,11 +11,14 @@ export default function Footer() {
|
||||
<div className="size-6 rounded bg-[#f97815] flex items-center justify-center text-white">
|
||||
<span className="material-symbols-outlined text-[16px]">hub</span>
|
||||
</div>
|
||||
<h3 className="text-white text-lg font-bold">9Router</h3>
|
||||
<h3 className="text-white text-lg font-bold">9Router (Remake)</h3>
|
||||
</div>
|
||||
<p className="text-gray-500 text-sm max-w-xs mb-6">
|
||||
The unified endpoint for AI generation. Connect, route, and manage your AI providers with ease.
|
||||
</p>
|
||||
<p className="text-gray-500 text-sm max-w-xs mb-6">
|
||||
Forked from the official 9Router project and remade by Nezumi.
|
||||
</p>
|
||||
<div className="flex gap-4">
|
||||
<a className="text-gray-400 hover:text-white transition-colors" href="https://github.com/decolua/9router" target="_blank" rel="noopener noreferrer">
|
||||
<span className="material-symbols-outlined">code</span>
|
||||
@@ -48,7 +51,7 @@ export default function Footer() {
|
||||
|
||||
{/* Bottom */}
|
||||
<div className="border-t border-[#3a2f27] pt-8 flex flex-col md:flex-row justify-between items-center gap-4">
|
||||
<p className="text-gray-600 text-sm">© 2025 9Router. All rights reserved.</p>
|
||||
<p className="text-gray-600 text-sm">© 2026 9Router (Remake). Remade by Nezumi.</p>
|
||||
<div className="flex gap-6">
|
||||
<a className="text-gray-600 hover:text-white text-sm transition-colors" href="https://github.com/decolua/9router" target="_blank" rel="noopener noreferrer">GitHub</a>
|
||||
<a className="text-gray-600 hover:text-white text-sm transition-colors" href="https://www.npmjs.com/package/9router" target="_blank" rel="noopener noreferrer">NPM</a>
|
||||
|
||||
@@ -19,7 +19,7 @@ export default function Navigation() {
|
||||
<div className="size-8 rounded bg-linear-to-br from-[#f97815] to-orange-700 flex items-center justify-center text-white">
|
||||
<span className="material-symbols-outlined text-[20px]">hub</span>
|
||||
</div>
|
||||
<h2 className="text-white text-xl font-bold tracking-tight">9Router</h2>
|
||||
<h2 className="text-white text-xl font-bold tracking-tight">9Router (Remake)</h2>
|
||||
</button>
|
||||
|
||||
{/* Desktop menu */}
|
||||
|
||||
+2
-2
@@ -17,8 +17,8 @@ const inter = Inter({
|
||||
});
|
||||
|
||||
export const metadata = {
|
||||
title: "9Router - AI Infrastructure Management",
|
||||
description: "One endpoint for all your AI providers. Manage keys, monitor usage, and scale effortlessly.",
|
||||
title: "9Router (Remake) - AI Infrastructure Management",
|
||||
description: "A Nezumi remake forked from the official 9Router project. Manage AI providers through one endpoint.",
|
||||
icons: {
|
||||
icon: "/favicon.svg",
|
||||
},
|
||||
|
||||
@@ -136,7 +136,8 @@ export default function LoginPage() {
|
||||
<div className="landing-grid absolute inset-0 pointer-events-none" aria-hidden="true" />
|
||||
<div className="relative z-10 w-full max-w-md">
|
||||
<div className="text-center mb-8">
|
||||
<h1 className="text-3xl font-bold text-primary mb-2">9Router</h1>
|
||||
<h1 className="text-3xl font-bold text-primary mb-2">9Router (Remake)</h1>
|
||||
<p className="text-xs text-text-muted mb-2">Forked from the official 9Router project and remade by Nezumi.</p>
|
||||
<p className="text-text-muted">
|
||||
{authMode === "oidc" && oidcConfigured
|
||||
? "Sign in with your OIDC provider to access the dashboard"
|
||||
|
||||
+3
-3
@@ -1,8 +1,8 @@
|
||||
export default function manifest() {
|
||||
return {
|
||||
name: '9Router - AI Infrastructure Management',
|
||||
short_name: '9Router',
|
||||
description: 'One endpoint for all your AI providers. Manage keys, monitor usage, and scale effortlessly.',
|
||||
name: '9Router (Remake) - AI Infrastructure Management',
|
||||
short_name: '9Router (Remake)',
|
||||
description: 'A Nezumi remake forked from the official 9Router project. Manage AI providers through one endpoint.',
|
||||
start_url: '/',
|
||||
display: 'standalone',
|
||||
background_color: '#0a0a0a',
|
||||
|
||||
@@ -1,136 +0,0 @@
|
||||
"use client";
|
||||
|
||||
import { useEffect, useState, useRef } from "react";
|
||||
import { createPortal } from "react-dom";
|
||||
import PropTypes from "prop-types";
|
||||
import { GITHUB_CONFIG } from "@/shared/constants/config";
|
||||
|
||||
export default function DonateModal({ isOpen, onClose }) {
|
||||
const [data, setData] = useState(null);
|
||||
const [loading, setLoading] = useState(false);
|
||||
const [error, setError] = useState("");
|
||||
const modalRef = useRef(null);
|
||||
|
||||
useEffect(() => {
|
||||
if (!isOpen || data) return;
|
||||
setLoading(true);
|
||||
setError("");
|
||||
fetch(GITHUB_CONFIG.donateUrl, { cache: "no-store" })
|
||||
.then((res) => {
|
||||
if (!res.ok) throw new Error(`HTTP ${res.status}`);
|
||||
return res.json();
|
||||
})
|
||||
.then((json) => setData(json))
|
||||
.catch((err) => setError(err.message || "Failed to load"))
|
||||
.finally(() => setLoading(false));
|
||||
}, [isOpen, data]);
|
||||
|
||||
useEffect(() => {
|
||||
const handleClickOutside = (e) => {
|
||||
if (modalRef.current && !modalRef.current.contains(e.target)) onClose();
|
||||
};
|
||||
if (isOpen) {
|
||||
document.addEventListener("mousedown", handleClickOutside);
|
||||
return () => document.removeEventListener("mousedown", handleClickOutside);
|
||||
}
|
||||
}, [isOpen, onClose]);
|
||||
|
||||
if (!isOpen || typeof document === "undefined") return null;
|
||||
|
||||
return createPortal(
|
||||
<div className="fixed inset-0 z-50 flex items-center justify-center p-4">
|
||||
<div className="absolute inset-0 bg-black/30 backdrop-blur-sm" onClick={onClose} />
|
||||
<div
|
||||
ref={modalRef}
|
||||
className="relative w-full bg-surface border border-black/10 dark:border-white/10 rounded-xl shadow-2xl animate-in fade-in zoom-in-95 duration-200 max-w-3xl flex flex-col max-h-[85vh]"
|
||||
>
|
||||
<div className="flex items-center justify-between p-3 border-b border-black/5 dark:border-white/5">
|
||||
<h2 className="text-lg font-semibold text-text-main flex items-center gap-2">
|
||||
<span className="material-symbols-outlined text-pink-500">volunteer_activism</span>
|
||||
{data?.title || "Support 9Router"}
|
||||
</h2>
|
||||
<button
|
||||
onClick={onClose}
|
||||
className="p-1.5 rounded-lg text-text-muted hover:bg-black/5 dark:hover:bg-white/5 transition-colors"
|
||||
aria-label="Close"
|
||||
>
|
||||
<span className="material-symbols-outlined text-[20px]">close</span>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div className="p-6 overflow-y-auto flex-1">
|
||||
{loading && (
|
||||
<div className="flex items-center justify-center py-10 text-text-muted">
|
||||
<span className="material-symbols-outlined animate-spin mr-2">progress_activity</span>
|
||||
Loading...
|
||||
</div>
|
||||
)}
|
||||
{error && (
|
||||
<div className="text-red-500 py-4">Failed to load donate info: {error}</div>
|
||||
)}
|
||||
{!loading && !error && data && (
|
||||
<>
|
||||
{data.message && (
|
||||
<p className="text-text-muted text-sm mb-6 text-center">{data.message}</p>
|
||||
)}
|
||||
<div className="grid grid-cols-1 sm:grid-cols-3 gap-4">
|
||||
{data.channels?.map((ch) => (
|
||||
<DonateChannelCard key={ch.id} channel={ch} />
|
||||
))}
|
||||
</div>
|
||||
</>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
</div>,
|
||||
document.body
|
||||
);
|
||||
}
|
||||
|
||||
function DonateChannelCard({ channel }) {
|
||||
const { label, description, icon, color, url, qr } = channel;
|
||||
const content = (
|
||||
<>
|
||||
<div
|
||||
className="w-12 h-12 rounded-full flex items-center justify-center mb-3"
|
||||
style={{ backgroundColor: `${color}20`, color }}
|
||||
>
|
||||
<span className="material-symbols-outlined text-[26px]">{icon}</span>
|
||||
</div>
|
||||
<div className="font-semibold text-text-main mb-1">{label}</div>
|
||||
{description && (
|
||||
<div className="text-xs text-text-muted mb-3 text-center">{description}</div>
|
||||
)}
|
||||
{qr && (
|
||||
<img
|
||||
src={qr}
|
||||
alt={`${label} QR`}
|
||||
className="w-full max-w-[180px] aspect-square object-contain rounded-lg bg-white p-1"
|
||||
/>
|
||||
)}
|
||||
</>
|
||||
);
|
||||
|
||||
return (
|
||||
<div className="flex flex-col items-center p-4 rounded-xl border border-black/10 dark:border-white/10 bg-surface/50 hover:border-pink-500/40 transition-colors">
|
||||
{content}
|
||||
{url && (
|
||||
<a
|
||||
href={url}
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
className="mt-3 inline-flex items-center gap-1 px-3 py-1.5 rounded-lg text-sm font-medium text-white hover:opacity-90 transition-opacity"
|
||||
style={{ backgroundColor: color }}
|
||||
>
|
||||
Open
|
||||
<span className="material-symbols-outlined text-[16px]">open_in_new</span>
|
||||
</a>
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
DonateModal.propTypes = {
|
||||
isOpen: PropTypes.bool.isRequired,
|
||||
onClose: PropTypes.func.isRequired,
|
||||
};
|
||||
@@ -8,7 +8,6 @@ import ProviderIcon from "@/shared/components/ProviderIcon";
|
||||
import HeaderMenu from "@/shared/components/HeaderMenu";
|
||||
import HeaderLanguage from "@/shared/components/HeaderLanguage";
|
||||
import ThemeToggle from "@/shared/components/ThemeToggle";
|
||||
import DonateModal from "@/shared/components/DonateModal";
|
||||
import { useHeaderSearchStore } from "@/store/headerSearchStore";
|
||||
import { OAUTH_PROVIDERS, APIKEY_PROVIDERS } from "@/shared/constants/config";
|
||||
import { MEDIA_PROVIDER_KINDS, AI_PROVIDERS } from "@/shared/constants/providers";
|
||||
@@ -108,7 +107,7 @@ const getPageInfo = (pathname) => {
|
||||
if (pathname.includes("/mitm"))
|
||||
return {
|
||||
title: "MITM Proxy",
|
||||
description: "Intercept CLI tool traffic and route through 9Router",
|
||||
description: "Intercept CLI tool traffic and route through 9Router (Remake)",
|
||||
icon: "security",
|
||||
breadcrumbs: [],
|
||||
};
|
||||
@@ -136,7 +135,7 @@ const getPageInfo = (pathname) => {
|
||||
if (pathname.includes("/skills"))
|
||||
return {
|
||||
title: "Agent Skills",
|
||||
description: "Copy a link and paste to your AI to use 9Router — no install needed",
|
||||
description: "Copy a link and paste to your AI to use 9Router (Remake) — no install needed",
|
||||
icon: "extension",
|
||||
breadcrumbs: [],
|
||||
};
|
||||
@@ -182,7 +181,6 @@ export default function Header({ onMenuClick, showMenuButton = true }) {
|
||||
const pathname = usePathname();
|
||||
const [displayName, setDisplayName] = useState("");
|
||||
const [loginMethod, setLoginMethod] = useState("");
|
||||
const [donateOpen, setDonateOpen] = useState(false);
|
||||
|
||||
// Memoize page info to prevent unnecessary recalculations
|
||||
const pageInfo = useMemo(() => getPageInfo(pathname), [pathname]);
|
||||
@@ -312,19 +310,10 @@ export default function Header({ onMenuClick, showMenuButton = true }) {
|
||||
</div>
|
||||
)}
|
||||
<HeaderSearch />
|
||||
<button
|
||||
onClick={() => setDonateOpen(true)}
|
||||
className="flex items-center gap-1.5 px-3 h-8 rounded-lg border border-pink-500/30 bg-pink-500/10 text-pink-600 dark:text-pink-400 hover:bg-pink-500/20 transition-colors text-sm font-medium"
|
||||
aria-label="Donate"
|
||||
>
|
||||
<span className="material-symbols-outlined text-[18px]">volunteer_activism</span>
|
||||
<span className="hidden sm:inline">Donate</span>
|
||||
</button>
|
||||
<ThemeToggle />
|
||||
<HeaderLanguage />
|
||||
<HeaderMenu onLogout={handleLogout} />
|
||||
</div>
|
||||
<DonateModal isOpen={donateOpen} onClose={() => setDonateOpen(false)} />
|
||||
</header>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -83,7 +83,6 @@ export default function Sidebar({ onClose }) {
|
||||
<h1 className="text-lg font-semibold tracking-tight text-text-main">
|
||||
{APP_CONFIG.name}
|
||||
</h1>
|
||||
<span className="text-xs text-text-muted">v{APP_CONFIG.version}</span>
|
||||
</div>
|
||||
</Link>
|
||||
</div>
|
||||
|
||||
@@ -1,17 +1,13 @@
|
||||
import pkg from "../../../package.json" with { type: "json" };
|
||||
|
||||
// App configuration
|
||||
export const APP_CONFIG = {
|
||||
name: "9Router Proxy",
|
||||
description: "AI Infrastructure Management",
|
||||
version: pkg.version,
|
||||
name: "9Router (Remake)",
|
||||
description: "A 9Router remake by Nezumi",
|
||||
defaultPort: 20128,
|
||||
};
|
||||
|
||||
// GitHub configuration
|
||||
export const GITHUB_CONFIG = {
|
||||
changelogUrl: "https://raw.githubusercontent.com/decolua/9router/refs/heads/master/CHANGELOG.md",
|
||||
donateUrl: "https://9router.com/api/donate",
|
||||
};
|
||||
|
||||
// Theme configuration
|
||||
|
||||
Reference in New Issue
Block a user