tju-yxq opened a new pull request, #5168:
URL: https://github.com/apache/rocketmq-dashboard/pull/5168
### Which Issue(s) This PR Fixes
- Fixes #5167
### Brief Description
Adds a `GET /api/alert-silences/export` endpoint that streams the full
maintenance-window inventory as CSV (UTF-8 BOM, `text/csv;charset=UTF-8`,
attachment disposition), with UTC-labelled timestamp columns, sorted label
matchers (`key=value;key2=value2`), sorted recurrence weekdays, and the
reason/creator for every window; requests beyond 10,000 records fail with 400
naming the cap, following the audit export's convention. The
maintenance-windows dialog gains an **Export windows** button that downloads
the file through the shared blob path. List, create and end behaviour are
unchanged.
### How Did You Test This Change?
Run on the branch (`1981f8ed`, based on `master` @ `0228dad5`):
```
cd server && mvn -B -ntp
'-Dtest=AlertSilenceServiceTest,AlertSilenceControllerTest' test
AlertSilenceControllerTest: 3, AlertSilenceServiceTest: 14
Tests run: 17, Failures: 0, Errors: 0, Skipped: 0 — BUILD SUCCESS
cd web && npm test -- SystemAlertsPage --run
Test Files 1 passed (1)
Tests 18 passed (18)
cd web && npm run lint
0 errors (11 pre-existing warnings in unrelated files)
```
New coverage: the service test asserts the BOM, the zone-labelled header,
and both row shapes (one-time window with labels; weekly window with time zone,
sorted weekdays `1,5`, and recurrence-until), plus the 400 on a 10,001-record
result set; the controller test asserts the `text/csv` content type, the
`Content-Disposition` filename, and the BOM-prefixed body; the page test opens
the dialog, clicks **导出维护窗口**, and asserts the service call and the blob
download.
### Checklist
- [x] One coherent change; unrelated modifications are not bundled in
- [x] Commit subject follows Conventional Commits
- [x] Tests added or updated for non-trivial changes, test methods named
`...Test`
- [x] New UI text has both Chinese and English entries under `web/src/i18n/`
- [x] Architecture constraints stay green (`mvn test` runs the ArchUnit
checks)
- [x] New source files carry the ASF license header
- [ ] Documentation touched where behaviour changed (README / `docs/` /
in-app help)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]