apply security audit

This commit is contained in:
Matthias Hochmeister
2026-03-11 13:51:01 +01:00
parent 93a87a7ae9
commit 3c9b7d3446
19 changed files with 247 additions and 341 deletions

View File

@@ -1,4 +1,3 @@
import { useState } from 'react';
import {
Container,
Typography,
@@ -10,35 +9,16 @@ import {
Switch,
Divider,
Box,
Button,
ToggleButtonGroup,
ToggleButton,
} from '@mui/material';
import { Settings as SettingsIcon, Notifications, Palette, Language, Save, SettingsBrightness, LightMode, DarkMode } from '@mui/icons-material';
import { Settings as SettingsIcon, Notifications, Palette, Language, SettingsBrightness, LightMode, DarkMode } from '@mui/icons-material';
import DashboardLayout from '../components/dashboard/DashboardLayout';
import { useNotification } from '../contexts/NotificationContext';
import { useThemeMode } from '../contexts/ThemeContext';
function Settings() {
const notification = useNotification();
const { themeMode, setThemeMode } = useThemeMode();
// Settings state
const [emailNotifications, setEmailNotifications] = useState(true);
const [alarmNotifications, setAlarmNotifications] = useState(true);
const [maintenanceReminders, setMaintenanceReminders] = useState(false);
const [systemNotifications, setSystemNotifications] = useState(true);
const [compactView, setCompactView] = useState(true);
const [animations, setAnimations] = useState(true);
const handleSaveSettings = () => {
try {
// In a real application, save settings to backend
notification.showSuccess('Einstellungen erfolgreich gespeichert');
} catch (error) {
notification.showError('Fehler beim Speichern der Einstellungen');
}
};
return (
<DashboardLayout>
<Container maxWidth="lg">
@@ -58,41 +38,24 @@ function Settings() {
<Divider sx={{ mb: 2 }} />
<FormGroup>
<FormControlLabel
control={
<Switch
checked={emailNotifications}
onChange={(e) => setEmailNotifications(e.target.checked)}
/>
}
control={<Switch checked={false} disabled />}
label="E-Mail-Benachrichtigungen"
/>
<FormControlLabel
control={
<Switch
checked={alarmNotifications}
onChange={(e) => setAlarmNotifications(e.target.checked)}
/>
}
control={<Switch checked={false} disabled />}
label="Einsatz-Alarme"
/>
<FormControlLabel
control={
<Switch
checked={maintenanceReminders}
onChange={(e) => setMaintenanceReminders(e.target.checked)}
/>
}
control={<Switch checked={false} disabled />}
label="Wartungserinnerungen"
/>
<FormControlLabel
control={
<Switch
checked={systemNotifications}
onChange={(e) => setSystemNotifications(e.target.checked)}
/>
}
control={<Switch checked={false} disabled />}
label="System-Benachrichtigungen"
/>
<Typography variant="caption" color="text.secondary" sx={{ mt: 1 }}>
(Bald verfügbar)
</Typography>
</FormGroup>
</CardContent>
</Card>
@@ -109,23 +72,16 @@ function Settings() {
<Divider sx={{ mb: 2 }} />
<FormGroup>
<FormControlLabel
control={
<Switch
checked={compactView}
onChange={(e) => setCompactView(e.target.checked)}
/>
}
control={<Switch checked={false} disabled />}
label="Kompakte Ansicht"
/>
<FormControlLabel
control={
<Switch
checked={animations}
onChange={(e) => setAnimations(e.target.checked)}
/>
}
control={<Switch checked={false} disabled />}
label="Animationen"
/>
<Typography variant="caption" color="text.secondary" sx={{ mt: 1 }}>
(Bald verfügbar)
</Typography>
<Box sx={{ mt: 1 }}>
<Typography variant="body2" sx={{ mb: 1 }}>
Farbschema
@@ -204,18 +160,6 @@ function Settings() {
wird in zukünftigen Updates implementiert.
</Typography>
</Box>
<Box sx={{ mt: 3, display: 'flex', justifyContent: 'flex-end' }}>
<Button
variant="contained"
color="primary"
size="large"
startIcon={<Save />}
onClick={handleSaveSettings}
>
Einstellungen speichern
</Button>
</Box>
</Container>
</DashboardLayout>
);