Refactor data fetching hooks, add page size lint test

- Simplify useFetchData: remove unused URL building logic
- Add usePolledData initial implementation
- Add router page_size param validation test
- Update API reference docs
- Clean up tasks doc
This commit is contained in:
2026-05-04 06:48:24 +02:00
parent 0a3f9c6c16
commit 69e1726045
7 changed files with 134 additions and 93 deletions

View File

@@ -190,7 +190,7 @@ Paginated list of recent bans with geo enrichment.
| `range` | `TimeRange` | `24h` | Time window: `24h`, `7d`, `30d`, `365d` |
| `source` | string | `fail2ban` | Data source: `fail2ban` or `archive` |
| `page` | int | `1` | 1-based page number |
| `page_size` | int | `25` | Items per page (max 500) |
| `page_size` | int | `100` | Items per page (max 500) |
| `origin` | string | null | Filter: `blocklist` or `selfblock` |
**Response `200`**
@@ -209,7 +209,7 @@ Paginated list of recent bans with geo enrichment.
],
"total": 150,
"page": 1,
"page_size": 25
"page_size": 100
}
```
@@ -384,7 +384,7 @@ Paginated historical ban records.
| `origin` | string | null | Filter: `blocklist` or `selfblock` |
| `source` | string | `fail2ban` | `fail2ban` or `archive` |
| `page` | int | `1` | 1-based page number |
| `page_size` | int | `25` | Items per page (max 500) |
| `page_size` | int | `100` | Items per page (max 500) |
**Response `200`**
```json
@@ -401,7 +401,7 @@ Paginated historical ban records.
],
"total": 500,
"page": 1,
"page_size": 25
"page_size": 100
}
```
@@ -629,7 +629,7 @@ Paginated currently-banned IPs for a specific jail.
| Param | Type | Default | Description |
|---|---|---|---|
| `page` | int | `1` | 1-based page number |
| `page_size` | int | `25` | Items per page (max 100) |
| `page_size` | int | `100` | Items per page (max 100) |
| `search` | string | null | Case-insensitive substring filter on IP |
**Response `200`**
@@ -647,7 +647,7 @@ Paginated currently-banned IPs for a specific jail.
],
"total": 12,
"page": 1,
"page_size": 25
"page_size": 100
}
```
@@ -1208,7 +1208,7 @@ Paginated import log.
|---|---|---|---|
| `source_id` | int | null | Filter by source |
| `page` | int | `1` | 1-based page |
| `page_size` | int | `25` | Items per page (max 500) |
| `page_size` | int | `100` | Items per page (max 500) |
**Response `200`**
```json
@@ -1228,7 +1228,7 @@ Paginated import log.
],
"total": 50,
"page": 1,
"page_size": 25
"page_size": 100
}
```