From d186a989b6808ff39fcd43a9f0b478aebc4aa346 Mon Sep 17 00:00:00 2001 From: zwlucas Date: Fri, 29 May 2026 17:21:48 -0300 Subject: feat: enhance maintenance management and heartbeat history features - Updated Store interface to include methods for managing maintenances. - Modified API functions to support pagination for heartbeat history and added CRUD operations for maintenances. - Enhanced types to include paginated responses and initial log entries. - Implemented maintenance management UI in the admin panel with create, edit, and delete functionalities. - Updated service detail page to display paginated heartbeat history and improved chart rendering. - Refactored status page to accommodate new data structures and ensure consistent data handling. Signed-off-by: Lucas Faria Mendes --- backend/internal/store/store.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'backend/internal/store/store.go') diff --git a/backend/internal/store/store.go b/backend/internal/store/store.go index e5e05f6..2c34b1c 100644 --- a/backend/internal/store/store.go +++ b/backend/internal/store/store.go @@ -15,9 +15,14 @@ type Store interface { ToggleService(int) (*model.Service, error) DeleteService(int) error AddHeartbeat(model.Heartbeat) error - GetHistory(int, int) ([]model.Heartbeat, error) + GetHistory(int, int, int) ([]model.Heartbeat, error) + CountHeartbeats(int) (int, error) GetLastHeartbeat(int) (*model.Heartbeat, error) GetServiceStats(int) (*model.ServiceStats, error) GetActiveMaintenance(now time.Time) (*model.Maintenance, error) + ListMaintenances() ([]model.Maintenance, error) + AddMaintenance(model.Maintenance) (*model.Maintenance, error) + UpdateMaintenance(int, model.Maintenance) (*model.Maintenance, error) + DeleteMaintenance(int) error } -- cgit v1.2.3