diff --git a/src/pages/Monitor.tsx b/src/pages/Monitor.tsx index a9b4bf8..2be6887 100644 --- a/src/pages/Monitor.tsx +++ b/src/pages/Monitor.tsx @@ -17,6 +17,7 @@ import { Activity, Clock, TrendingUp, + Wrench, } from 'lucide-react' // Types @@ -394,6 +395,47 @@ export default function Monitor() { )} + {/* Maintenance */} + {groupedItems.maintenance && groupedItems.maintenance[0] && (() => { + const m = groupedItems.maintenance[0] + const d = m.details || {} + const ageH = d.age_hours ?? 0 + const ageDays = Math.floor(ageH / 24) + const ageLabel = ageH < 24 ? `há ${ageH}h` : `há ${ageDays}d` + const actions = (d.logs_truncated || 0) + (d.images_removed || 0) + (d.orphan_volumes || 0) + (d.tmp_cleaned || 0) + return ( + +
+
+
+
Auto-Cleanup
+
Último: {ageLabel}
+
+ +
+
+
+
{d.disk_percent || 0}%
+
Disco Easy
+
+
+
{d.freed_mb || 0}MB
+
Libertado
+
+
+ {actions > 0 && ( +
+ {d.logs_truncated > 0 && {d.logs_truncated} logs} + {d.images_removed > 0 && {d.images_removed} images} + {d.orphan_volumes > 0 && {d.orphan_volumes} volumes} + {d.tmp_cleaned > 0 && {d.tmp_cleaned} tmp} +
+ )} +
+
+ ) + })()} + {/* WP Updates */} {groupedItems.wp_update && groupedItems.wp_update[0] && ( @@ -481,6 +523,9 @@ function getMockData(): MonitorData { wp_update: [ { id: 25, name: 'WordPress Plugins', category: 'wp_update', status: 'warning', details: { manual_updates: 3 }, last_check: '' }, ], + maintenance: [ + { id: 48558, name: 'EasyPanel Cleanup', category: 'maintenance', status: 'ok', details: { age_hours: 0, disk_percent: 15, freed_mb: 0, logs_truncated: 0, images_removed: 0, orphan_volumes: 0, tmp_cleaned: 0 }, last_check: '' }, + ], } return {