resolve issues with new features
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import { useState, useEffect } from 'react';
|
||||
import { Box, Tabs, Tab, Typography } from '@mui/material';
|
||||
import { Navigate, useSearchParams } from 'react-router-dom';
|
||||
import { Navigate, useNavigate, useSearchParams } from 'react-router-dom';
|
||||
import DashboardLayout from '../components/dashboard/DashboardLayout';
|
||||
import ServiceManagerTab from '../components/admin/ServiceManagerTab';
|
||||
import SystemHealthTab from '../components/admin/SystemHealthTab';
|
||||
@@ -24,6 +24,7 @@ function TabPanel({ children, value, index }: TabPanelProps) {
|
||||
const ADMIN_TAB_COUNT = 6;
|
||||
|
||||
function AdminDashboard() {
|
||||
const navigate = useNavigate();
|
||||
const [searchParams] = useSearchParams();
|
||||
const [tab, setTab] = useState(() => {
|
||||
const t = Number(searchParams.get('tab'));
|
||||
@@ -47,7 +48,7 @@ function AdminDashboard() {
|
||||
<Typography variant="h4" sx={{ mb: 3 }}>Administration</Typography>
|
||||
|
||||
<Box sx={{ borderBottom: 1, borderColor: 'divider' }}>
|
||||
<Tabs value={tab} onChange={(_e, v) => setTab(v)}>
|
||||
<Tabs value={tab} onChange={(_e, v) => { setTab(v); navigate(`/admin?tab=${v}`, { replace: true }); }}>
|
||||
<Tab label="Services" />
|
||||
<Tab label="System" />
|
||||
<Tab label="Benutzer" />
|
||||
|
||||
Reference in New Issue
Block a user