tju-yxq opened a new pull request, #2436:
URL: https://github.com/apache/rocketmq-dashboard/pull/2436
## Why
The settings data-source inventory is still unbounded and unpaged. `GET
/api/settings/datasources` returns every row, the repository orders only by
insertion id, and the Settings page renders `pagination={false}`. As the number
of configured sources grows, the page loads the entire inventory, provides no
server-side name/type filtering, and cannot reach a bounded page or total count.
Closes #2426 and implements the tracked inventory requirement from #2298.
## Backend
A compatibility-preserving endpoint was added rather than changing the
existing list response:
```text
GET /api/settings/datasources/page?search=&type=&page=&pageSize=
```
- returns `PageResult<DataSourceVO>`;
- `page` defaults to `1`;
- `pageSize` defaults to `20` and is bounded at `100`;
- invalid pagination returns HTTP 400 before repository access;
- repository filtering and paging occur in the SQL layer;
- ordering is `gmt_modified DESC, id DESC` for stable page boundaries;
- `search` and `type` are optional filters;
- the legacy `GET /api/settings/datasources` remains unchanged for existing
callers.
## Frontend
The Settings data-source tab now consumes the bounded inventory:
- debounced name search;
- type filter;
- server-side pagination with 20/50/100 page-size options;
- server-provided total count;
- filter changes reset to page 1;
- request sequencing prevents stale responses from overwriting newer filter
results;
- an emptied current page moves back to the latest valid page;
- create/update/delete refresh the canonical server page instead of only
patching an unbounded local array;
- existing connection-test and credential handling remain unchanged.
## Size
Production code, excluding tests:
- 177 additions
- 25 deletions
Complete PR, including tests:
- 261 additions
- 36 deletions
The size comes from the complete backend repository/service/controller
contract plus frontend filter, pagination, sequencing, and mutation-refresh
flow.
## Verification
Backend focused:
```text
mvn
"-Dtest=SettingsServiceTest,SettingsControllerTest,MybatisPlusSettingsRepositoryTest"
test
72 tests
0 failures
0 errors
BUILD SUCCESS
Checkstyle: 0 violations
```
Backend full:
```text
mvn -DskipTests=false test
1,484 tests
0 failures
0 errors
BUILD SUCCESS
```
Frontend focused:
```text
npm test -- src/pages/settings/__tests__/DataSourceTab.test.tsx
src/api/settings.test.ts
2 files
11 tests
all passed
```
Frontend full:
```text
npm test
94 test files
636 tests
all passed
```
Build:
```text
npm run build
success
```
Lint:
```text
npm run lint
0 errors
1 pre-existing react-hooks warning in src/pages/instance/topic.tsx
```
Targeted ESLint and Prettier checks pass. `git diff --check` passes.
--
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]