Merge pull request #104 from R0m1k3/1.1

Add management capability for system backups to the platform
This commit is contained in:
LogiFlow authored and GitHub committed 2025-08-13 23:11:52 +02:00
commit 0c11afb71c
3 files changed
+6 -6

No files matched your search

+1 -1
View File
@@ -1,7 +1,7 @@
// Système de permissions hardcodé par module
// Remplace l'ancien système flexible basé sur la base de données
export type Permission = 'view' | 'create' | 'edit' | 'delete' | 'validate';
export type Permission = 'view' | 'create' | 'edit' | 'delete' | 'validate' | 'manage';
export type Role = 'admin' | 'directeur' | 'manager' | 'employee';
export type Module =
| 'dashboard'
+1 -1
View File
@@ -264,7 +264,7 @@ export default function BackupManager() {
</div>
) : (
<div className="space-y-2">
{backups.map((backup) => (
{backups.map((backup: BackupFile) => (
<div
key={backup.id}
className="flex items-center justify-between p-4 border rounded-lg hover:bg-gray-50"
+4 -4
View File
@@ -2340,7 +2340,7 @@ RÉSUMÉ DU SCAN
});
// Backup management routes (Admin only)
app.get('/api/backups', isAuthenticated, requireAdmin, async (req: any, res) => {
app.get('/api/backups', isAuthenticated, requireAdmin, async (req: any, res: any) => {
try {
const backups = await backupService.getBackupList();
res.json(backups);
@@ -2350,7 +2350,7 @@ RÉSUMÉ DU SCAN
}
});
app.post('/api/backups', isAuthenticated, requireAdmin, async (req: any, res) => {
app.post('/api/backups', isAuthenticated, requireAdmin, async (req: any, res: any) => {
try {
const user = await storage.getUserWithGroups(req.user.claims ? req.user.claims.sub : req.user.id);
if (!user) {
@@ -2365,7 +2365,7 @@ RÉSUMÉ DU SCAN
}
});
app.get('/api/backups/:filename/download', isAuthenticated, requireAdmin, async (req: any, res) => {
app.get('/api/backups/:filename/download', isAuthenticated, requireAdmin, async (req: any, res: any) => {
try {
const { filename } = req.params;
const filepath = await backupService.downloadBackup(filename);
@@ -2382,7 +2382,7 @@ RÉSUMÉ DU SCAN
}
});
app.delete('/api/backups/:filename', isAuthenticated, requireAdmin, async (req: any, res) => {
app.delete('/api/backups/:filename', isAuthenticated, requireAdmin, async (req: any, res: any) => {
try {
const { filename } = req.params;
await backupService.deleteBackup(filename);