refactor(web): migrate from Next.js to Vite + React Router

This commit is contained in:
RockChinQ
2026-04-03 11:24:14 +08:00
parent e701daa8e0
commit 2a4ba237c4
1441 changed files with 917663 additions and 3671 deletions
+5 -5
View File
@@ -1,7 +1,7 @@
'use client';
import { useState, useEffect, useCallback, useRef } from 'react';
import { useRouter } from 'next/navigation';
import { useNavigate } from 'react-router-dom';
import { Button } from '@/components/ui/button';
import { Switch } from '@/components/ui/switch';
import { Label } from '@/components/ui/label';
@@ -30,7 +30,7 @@ import { toast } from 'sonner';
export default function MCPDetailContent({ id }: { id: string }) {
const isCreateMode = id === 'new';
const router = useRouter();
const navigate = useNavigate();
const { t } = useTranslation();
const { refreshMCPServers, mcpServers, setDetailEntityName } =
useSidebarData();
@@ -96,12 +96,12 @@ export default function MCPDetailContent({ id }: { id: string }) {
function handleServerDeleted() {
refreshMCPServers();
router.push('/home/mcp');
navigate('/home/mcp');
}
function handleNewServerCreated(serverName: string) {
refreshMCPServers();
router.push(`/home/mcp?id=${encodeURIComponent(serverName)}`);
navigate(`/home/mcp?id=${encodeURIComponent(serverName)}`);
}
function confirmDelete() {
@@ -1,4 +1,4 @@
'use client';
import React, {
useState,
+2 -2
View File
@@ -1,6 +1,6 @@
'use client';
import { useSearchParams } from 'next/navigation';
import { useSearchParams } from 'react-router-dom';
import { useTranslation } from 'react-i18next';
import MCPDetailContent from './MCPDetailContent';