feat: 添加i18n,美化界面

This commit is contained in:
2025-03-20 02:29:01 +08:00
parent 27d9bdf54e
commit c206add7eb
56 changed files with 2743 additions and 928 deletions

View File

@@ -1,33 +1,35 @@
import clsx from 'clsx';
import { useNewNavigate } from '@/modules';
const serverList = ['container', 'map'];
const serverPath = [
{
path: 'container',
links: ['edit/list', 'preview/:id', 'edit/:id'],
},
{
path: 'app',
links: ['edit/list', ':app/version/list'],
},
{
path: 'file',
links: ['edit/list'],
},
{
path: 'map',
links: ['/'],
},
{
path: 'org',
links: ['edit/list'],
},
];
import { useTranslation } from 'react-i18next';
const ServerPath = () => {
const navigate = useNewNavigate();
const { t } = useTranslation();
const serverPath = [
{
path: 'container',
links: ['edit/list', 'preview/:id', 'edit/:id'],
},
{
path: 'app',
links: ['edit/list', ':app/version/list'],
},
{
path: 'file',
links: ['edit/list'],
},
{
path: 'map',
links: ['/'],
},
{
path: 'org',
links: ['edit/list'],
},
];
return (
<div className='p-2 w-full h-full bg-gray-200'>
<h1 className='p-4 w-1/2 m-auto h1'>Site Map</h1>
<div className='p-2 w-full h-full bg-gray-200 text-primary'>
<h1 className='p-4 w-1/2 m-auto h1'>{t('Site Map')}</h1>
<div className='w-1/2 m-auto bg-white p-4 border rounded-md shadow-md min-w-[700px] max-h-[80vh] overflow-auto scrollbar'>
<div className='flex flex-col w-full'>
{serverPath.map((item) => {
@@ -42,7 +44,6 @@ const ServerPath = () => {
if (hasId) {
return;
}
console.log('link', link);
if (link === '/') {
navigate(`/${item.path}`);
return;
@@ -69,18 +70,3 @@ const ServerPath = () => {
);
};
export const App = ServerPath;
export const ServerList = () => {
return (
<div className='p-2 w-full h-full bg-gray-200'>
<div className='flex flex-col w-1/2 m-auto bg-white p-4 border rounded-md shadow-md'>
{serverList.map((item) => {
return (
<div key={item} className='flex flex-col'>
<div>{item}</div>
</div>
);
})}
</div>
</div>
);
};