mirror of
https://github.com/R0m1k3/LogiFlow.git
synced 2026-10-11 17:27:31 +02:00
Merge pull request #104 from R0m1k3/1.1
Add management capability for system backups to the platform
This commit is contained in:
3 files changed
+6
-6
No files matched your search
@@ -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'
|
||||
|
||||
@@ -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
@@ -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);
|
||||
|
||||
Reference in new issue
Block a user