2

Simplify the dashboard recent IP view

This commit is contained in:
2026-03-12 02:15:45 +01:00
parent 7bd3933215
commit a82421ba3f
8 changed files with 404 additions and 57 deletions

View File

@@ -76,6 +76,23 @@ func (s *Service) ListIPs(ctx context.Context, limit int, state string) ([]model
return s.store.ListIPStates(ctx, limit, state)
}
func (s *Service) ListRecentIPs(ctx context.Context, since time.Time, limit int) ([]model.RecentIPRow, error) {
items, err := s.store.ListRecentIPRows(ctx, since, limit)
if err != nil {
return nil, err
}
for index := range items {
state := model.IPState{
IP: items[index].IP,
State: items[index].State,
ManualOverride: items[index].ManualOverride,
}
backend := s.resolveOPNsenseStatus(ctx, state)
items[index].Actions = actionAvailability(state, backend)
}
return items, nil
}
func (s *Service) GetIPDetails(ctx context.Context, ip string) (model.IPDetails, error) {
normalized, err := normalizeIP(ip)
if err != nil {