|
|
@@ -42,7 +42,7 @@ const DONATE_URL = 'https://donate.sanaei.dev/';
|
|
|
const REPO_URL = 'https://github.com/MHSanaei/3x-ui';
|
|
|
const LOGOUT_KEY = '__logout__';
|
|
|
|
|
|
-type IconName = 'dashboard' | 'inbound' | 'team' | 'groups' | 'setting' | 'tool' | 'cluster' | 'hosts' | 'logout' | 'apidocs' | 'outbound';
|
|
|
+type IconName = 'dashboard' | 'inbound' | 'team' | 'groups' | 'setting' | 'tool' | 'cluster' | 'hosts' | 'logout' | 'apidocs' | 'outbound' | 'routing';
|
|
|
|
|
|
const iconByName: Record<IconName, ComponentType> = {
|
|
|
dashboard: DashboardOutlined,
|
|
|
@@ -56,6 +56,7 @@ const iconByName: Record<IconName, ComponentType> = {
|
|
|
logout: LogoutOutlined,
|
|
|
apidocs: ApiOutlined,
|
|
|
outbound: ExportOutlined,
|
|
|
+ routing: SwapOutlined,
|
|
|
};
|
|
|
|
|
|
function readCollapsed(): boolean {
|
|
|
@@ -142,7 +143,8 @@ export default function AppSidebar() {
|
|
|
{ key: '/groups', icon: 'groups', title: t('menu.groups') },
|
|
|
{ key: '/nodes', icon: 'cluster', title: t('menu.nodes') },
|
|
|
{ key: '/hosts', icon: 'hosts', title: t('menu.hosts') },
|
|
|
- { key: '/xray#outbound', icon: 'outbound', title: t('pages.xray.Outbounds') },
|
|
|
+ { key: '/outbound', icon: 'outbound', title: t('menu.outbounds') },
|
|
|
+ { key: '/routing', icon: 'routing', title: t('menu.routing') },
|
|
|
{ key: '/settings', icon: 'setting', title: t('menu.settings') },
|
|
|
{ key: '/xray', icon: 'tool', title: t('menu.xray') },
|
|
|
{ key: '/api-docs', icon: 'apidocs', title: t('menu.apiDocs') },
|
|
|
@@ -168,7 +170,6 @@ export default function AppSidebar() {
|
|
|
|
|
|
const xrayChildren = useMemo<NonNullable<MenuProps['items']>>(() => [
|
|
|
{ key: '/xray#basic', icon: <SettingOutlined />, label: t('pages.xray.basicTemplate') },
|
|
|
- { key: '/xray#routing', icon: <SwapOutlined />, label: t('pages.xray.Routings') },
|
|
|
{ key: '/xray#balancer', icon: <ClusterOutlined />, label: t('pages.xray.Balancers') },
|
|
|
{ key: '/xray#dns', icon: <DatabaseOutlined />, label: 'DNS' },
|
|
|
{ key: '/xray#advanced', icon: <CodeOutlined />, label: t('pages.xray.advancedTemplate') },
|
|
|
@@ -182,9 +183,7 @@ export default function AppSidebar() {
|
|
|
? `/xray${hash || '#basic'}`
|
|
|
: (pathname === '' ? '/' : pathname);
|
|
|
|
|
|
- // The Outbounds top-level item lives on /xray#outbound, so don't auto-open the
|
|
|
- // Xray Configs submenu for it.
|
|
|
- const openSubmenu = settingsActive ? '/settings' : xrayActive && hash !== '#outbound' ? '/xray' : null;
|
|
|
+ const openSubmenu = settingsActive ? '/settings' : xrayActive ? '/xray' : null;
|
|
|
const [openKeys, setOpenKeys] = useState<string[]>(() => (openSubmenu ? [openSubmenu] : []));
|
|
|
useEffect(() => {
|
|
|
if (openSubmenu) {
|