tju-yxq opened a new pull request, #5189:
URL: https://github.com/apache/rocketmq-dashboard/pull/5189

   ### Which Issue(s) This PR Fixes
   
   - Fixes #3565
   
   ### Brief Description
   
   Adds a `GET /api/instances/export` endpoint that streams the filtered 
instance inventory as CSV (UTF-8 BOM, `text/csv;charset=UTF-8`, attachment 
disposition), honouring the same `type` and `search` filters as the list 
endpoint and reusing `listInstances` so the rows, counts and region names match 
what the page shows. The columns mirror the inventory table (name, type, 
vendor, endpoint, region, remark, topic/group counts, resource-count 
availability, created/modified); internal credential references are 
deliberately not part of the export. Requests beyond 10,000 records fail with 
400 naming the cap. The instance page gains an **Export instances** button that 
downloads the file with the currently applied filters.
   
   This re-submits the capability from #3970/#3982, which were closed unmerged 
when the base branch moved from `rocketmq-studio` to `master` in September; the 
implementation is rebuilt against current `master` as a server-side export.
   
   ### How Did You Test This Change?
   
   Run on the branch (`76be36df`, based on `master` @ `0228dad5`):
   
   ```
   cd server && mvn -B -ntp '-Dtest=InstanceServiceTest,InstanceControllerTest' 
test
   InstanceControllerTest: 13, InstanceServiceTest: 93
   Tests run: 106, Failures: 0, Errors: 0, Skipped: 0 — BUILD SUCCESS
   
   cd web && npm test -- InstancePage --run
   Test Files  1 passed (1)
        Tests  28 passed (28)
   
   cd web && npm run lint
   0 errors (11 pre-existing warnings in unrelated files)
   ```
   
   New coverage: the service test asserts the BOM, the header, both an Apache 
and a cloud row (region display name included), that no credential reference 
appears anywhere in the CSV, and the 400 on a 10,001-record result set; the 
controller test asserts the `text/csv` content type, the `Content-Disposition` 
filename, the BOM-prefixed body and the filter pass-through; the page test 
clicks **导出实例** and asserts the service call with the active query plus 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]

Reply via email to