feat(admin): centralize tool & module settings in Werkzeuge tab with per-tool permissions, DB-backed config, connection tests, and cog-button navigation
This commit is contained in:
@@ -1,10 +1,14 @@
|
||||
import React from 'react';
|
||||
import Box from '@mui/material/Box';
|
||||
import Typography from '@mui/material/Typography';
|
||||
import { Link } from 'react-router-dom';
|
||||
import IconButton from '@mui/material/IconButton';
|
||||
import Tooltip from '@mui/material/Tooltip';
|
||||
import { Link, useNavigate } from 'react-router-dom';
|
||||
import { useQueryClient } from '@tanstack/react-query';
|
||||
import { Settings } from '@mui/icons-material';
|
||||
import DashboardLayout from '../components/dashboard/DashboardLayout';
|
||||
import { useChat } from '../contexts/ChatContext';
|
||||
import { usePermissionContext } from '../contexts/PermissionContext';
|
||||
import { nextcloudApi } from '../services/nextcloud';
|
||||
import { notificationsApi } from '../services/notifications';
|
||||
import ChatRoomList from '../components/chat/ChatRoomList';
|
||||
@@ -12,6 +16,8 @@ import ChatMessageView from '../components/chat/ChatMessageView';
|
||||
|
||||
const ChatContent: React.FC = () => {
|
||||
const { rooms, selectedRoomToken, connected } = useChat();
|
||||
const { hasPermission } = usePermissionContext();
|
||||
const navigate = useNavigate();
|
||||
const queryClient = useQueryClient();
|
||||
const markedRoomsRef = React.useRef(new Set<string>());
|
||||
|
||||
@@ -44,16 +50,27 @@ const ChatContent: React.FC = () => {
|
||||
}, [selectedRoomToken, queryClient]);
|
||||
|
||||
return (
|
||||
<Box
|
||||
sx={{
|
||||
height: 'calc(100vh - 112px)',
|
||||
display: 'flex',
|
||||
border: 1,
|
||||
borderColor: 'divider',
|
||||
borderRadius: 1,
|
||||
overflow: 'hidden',
|
||||
}}
|
||||
>
|
||||
<Box sx={{ display: 'flex', flexDirection: 'column', height: 'calc(100vh - 112px)' }}>
|
||||
{hasPermission('nextcloud:configure') && (
|
||||
<Box sx={{ display: 'flex', justifyContent: 'flex-end', px: 1 }}>
|
||||
<Tooltip title="Einstellungen">
|
||||
<IconButton size="small" onClick={() => navigate('/admin/settings?tab=1&subtab=nextcloud')}>
|
||||
<Settings fontSize="small" />
|
||||
</IconButton>
|
||||
</Tooltip>
|
||||
</Box>
|
||||
)}
|
||||
<Box
|
||||
sx={{
|
||||
flex: 1,
|
||||
display: 'flex',
|
||||
border: 1,
|
||||
borderColor: 'divider',
|
||||
borderRadius: 1,
|
||||
overflow: 'hidden',
|
||||
minHeight: 0,
|
||||
}}
|
||||
>
|
||||
{!connected ? (
|
||||
<Box sx={{ p: 3, display: 'flex', alignItems: 'center' }}>
|
||||
<Typography variant="body1" color="text.secondary">
|
||||
@@ -89,6 +106,7 @@ const ChatContent: React.FC = () => {
|
||||
</Box>
|
||||
</>
|
||||
)}
|
||||
</Box>
|
||||
</Box>
|
||||
);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user