🎨 feat(UI): Add Lucide icons to settings tabs for improved navigation
- Add icons to each settings tab to enhance visual recognition - Import necessary Lucide React icons (Settings, Calculator, Gauge, Shapes, etc.) - Create consistent tab styling with icons aligned next to text - Reorder tabs to place "Other Settings" as the last option - Improve overall settings page UI with better visual hierarchy
This commit is contained in:
@@ -2,6 +2,15 @@ import React, { useEffect, useState } from 'react';
|
|||||||
import { Layout, TabPane, Tabs } from '@douyinfe/semi-ui';
|
import { Layout, TabPane, Tabs } from '@douyinfe/semi-ui';
|
||||||
import { useNavigate, useLocation } from 'react-router-dom';
|
import { useNavigate, useLocation } from 'react-router-dom';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
|
import {
|
||||||
|
Settings,
|
||||||
|
Calculator,
|
||||||
|
Gauge,
|
||||||
|
Shapes,
|
||||||
|
Cog,
|
||||||
|
MoreHorizontal,
|
||||||
|
LayoutDashboard
|
||||||
|
} from 'lucide-react';
|
||||||
|
|
||||||
import SystemSetting from '../../components/settings/SystemSetting.js';
|
import SystemSetting from '../../components/settings/SystemSetting.js';
|
||||||
import { isRoot } from '../../helpers';
|
import { isRoot } from '../../helpers';
|
||||||
@@ -21,40 +30,75 @@ const Setting = () => {
|
|||||||
|
|
||||||
if (isRoot()) {
|
if (isRoot()) {
|
||||||
panes.push({
|
panes.push({
|
||||||
tab: t('运营设置'),
|
tab: (
|
||||||
|
<span style={{ display: 'flex', alignItems: 'center', gap: '5px' }}>
|
||||||
|
<Settings size={18} />
|
||||||
|
{t('运营设置')}
|
||||||
|
</span>
|
||||||
|
),
|
||||||
content: <OperationSetting />,
|
content: <OperationSetting />,
|
||||||
itemKey: 'operation',
|
itemKey: 'operation',
|
||||||
});
|
});
|
||||||
panes.push({
|
panes.push({
|
||||||
tab: t('倍率设置'),
|
tab: (
|
||||||
|
<span style={{ display: 'flex', alignItems: 'center', gap: '5px' }}>
|
||||||
|
<Calculator size={18} />
|
||||||
|
{t('倍率设置')}
|
||||||
|
</span>
|
||||||
|
),
|
||||||
content: <RatioSetting />,
|
content: <RatioSetting />,
|
||||||
itemKey: 'ratio',
|
itemKey: 'ratio',
|
||||||
});
|
});
|
||||||
panes.push({
|
panes.push({
|
||||||
tab: t('速率限制设置'),
|
tab: (
|
||||||
|
<span style={{ display: 'flex', alignItems: 'center', gap: '5px' }}>
|
||||||
|
<Gauge size={18} />
|
||||||
|
{t('速率限制设置')}
|
||||||
|
</span>
|
||||||
|
),
|
||||||
content: <RateLimitSetting />,
|
content: <RateLimitSetting />,
|
||||||
itemKey: 'ratelimit',
|
itemKey: 'ratelimit',
|
||||||
});
|
});
|
||||||
panes.push({
|
panes.push({
|
||||||
tab: t('模型相关设置'),
|
tab: (
|
||||||
|
<span style={{ display: 'flex', alignItems: 'center', gap: '5px' }}>
|
||||||
|
<Shapes size={18} />
|
||||||
|
{t('模型相关设置')}
|
||||||
|
</span>
|
||||||
|
),
|
||||||
content: <ModelSetting />,
|
content: <ModelSetting />,
|
||||||
itemKey: 'models',
|
itemKey: 'models',
|
||||||
});
|
});
|
||||||
panes.push({
|
panes.push({
|
||||||
tab: t('系统设置'),
|
tab: (
|
||||||
|
<span style={{ display: 'flex', alignItems: 'center', gap: '5px' }}>
|
||||||
|
<Cog size={18} />
|
||||||
|
{t('系统设置')}
|
||||||
|
</span>
|
||||||
|
),
|
||||||
content: <SystemSetting />,
|
content: <SystemSetting />,
|
||||||
itemKey: 'system',
|
itemKey: 'system',
|
||||||
});
|
});
|
||||||
panes.push({
|
panes.push({
|
||||||
tab: t('其他设置'),
|
tab: (
|
||||||
content: <OtherSetting />,
|
<span style={{ display: 'flex', alignItems: 'center', gap: '5px' }}>
|
||||||
itemKey: 'other',
|
<LayoutDashboard size={18} />
|
||||||
});
|
{t('仪表盘设置')}
|
||||||
panes.push({
|
</span>
|
||||||
tab: t('仪表盘设置'),
|
),
|
||||||
content: <DashboardSetting />,
|
content: <DashboardSetting />,
|
||||||
itemKey: 'dashboard',
|
itemKey: 'dashboard',
|
||||||
});
|
});
|
||||||
|
panes.push({
|
||||||
|
tab: (
|
||||||
|
<span style={{ display: 'flex', alignItems: 'center', gap: '5px' }}>
|
||||||
|
<MoreHorizontal size={18} />
|
||||||
|
{t('其他设置')}
|
||||||
|
</span>
|
||||||
|
),
|
||||||
|
content: <OtherSetting />,
|
||||||
|
itemKey: 'other',
|
||||||
|
});
|
||||||
}
|
}
|
||||||
const onChangeTab = (key) => {
|
const onChangeTab = (key) => {
|
||||||
setTabActiveKey(key);
|
setTabActiveKey(key);
|
||||||
@@ -74,7 +118,7 @@ const Setting = () => {
|
|||||||
<Layout>
|
<Layout>
|
||||||
<Layout.Content>
|
<Layout.Content>
|
||||||
<Tabs
|
<Tabs
|
||||||
type='line'
|
type='card'
|
||||||
activeKey={tabActiveKey}
|
activeKey={tabActiveKey}
|
||||||
onChange={(key) => onChangeTab(key)}
|
onChange={(key) => onChangeTab(key)}
|
||||||
>
|
>
|
||||||
|
|||||||
Reference in New Issue
Block a user