Errorist79 opened a new pull request, #3225: URL: https://github.com/apache/apisix-dashboard/pull/3225
### Why submit this pull request? - [x] Bugfix - [ ] New feature provided - [ ] Improve performance - [ ] Backport patches ### What changes will this PR take into? - Fix a runtime crash on the Secrets list page when the APISIX Admin API returns a non-array `list` (e.g., empty object on 401/empty). The code now defensively treats non-array lists as empty arrays. - Improve developer experience: in dev, proxy `'/apisix/admin'` to `http://localhost:9180` by default, with optional override via `APISIX_ADMIN_URL`. This removes the need for a separate nginx proxy on port 6174 during host development. - Resolve a strict ESLint warning (`import/no-named-as-default`) in `Editor.tsx` by renaming the default import identifier. Files touched: - `vite.config.ts`: use `localhost:9180` for dev admin proxy; allow `APISIX_ADMIN_URL` override. - `src/apis/secrets.ts`: guard `.map` usage by handling non-array `list` safely. - `src/components/form/Editor.tsx`: rename default import `clsx` → `cx` and update usage. Behavioral impact: - Secrets list no longer crashes when unauthenticated or when the API responds with an empty object. - Local development works out of the box with APISIX on `:9180`. ### Related issues - Refs: [#3220](https://github.com/apache/apisix-dashboard/issues/3220) ### Checklist - [x] Did you explain what problem does this PR solve? Or what new features have been added? - [ ] Have you added corresponding test cases? - No new tests added; the change is a small guard and dev proxy tweak. Happy to add tests if maintainers prefer. - [ ] Have you modified the corresponding document? - No docs changes; behavior aligns with existing dev setup. Can add a note about `APISIX_ADMIN_URL` if requested. - [x] Is this PR backward compatible? If it is not backward compatible, please discuss on the mailing list first -- 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]
