Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@Errorist79
Copy link

Why submit this pull request?

  • 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 clsxcx 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

Checklist

  • 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.
  • Is this PR backward compatible? If it is not backward compatible, please discuss on the mailing list first

@Errorist79 Errorist79 changed the title dev: use 9180 for admin proxy; guard secrets list parsing; fix lint fix: use 9180 for admin proxy; guard secrets list parsing; fix lint Oct 13, 2025
Copy link
Contributor

@Baoyuantop Baoyuantop left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. Test cases are required for code logic modifications
  2. Code conflicts need to be resolved

@SkyeYoung
Copy link
Member

SkyeYoung commented Oct 16, 2025

Hi, please ensure that a PR focuses on only one goal as much as possible. Thx 😸

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants