lxbme opened a new issue, #3460:
URL: https://github.com/apache/apisix-dashboard/issues/3460

   # Feature request
   
   ## Please describe your feature
   
   **A disabled route is visually identical to an enabled one in the Routes 
list.**
   
   The Routes list renders ID, Name, Description, URI and Actions 
(`src/routes/routes/index.tsx`). `status` is not among them, so a route that is 
switched off looks exactly like one that is serving traffic. The only way to 
find out is to open each route and scroll to the Status field on its detail 
page — which does show it.
   
   The same list also cannot answer, without opening every row:
   
   - which methods a route matches (`methods`)
   - where it forwards to (`upstream_id` / `service_id`)
   - whether it has any plugins at all, let alone auth or rate limiting 
(`plugins`)
   
   Meanwhile `Description` gets the widest column, and it is empty (`-`) for 
most rows in practice.
   
   **None of this needs an extra request.** The list endpoint already returns 
these fields. Raw `GET /apisix/admin/routes` on APISIX 3.17.0, keys per item:
   
   ```
   demo-cors        create_time, desc, id, methods, name, plugins, update_time, 
uri
   demo-dangling    create_time, id, name, update_time, upstream_id, uri
   demo-route       create_time, id, methods, name, update_time, upstream_id, 
uri
   demo-via-service create_time, id, name, plugin_config_id, service_id, 
update_time, uri
   ```
   
   Everything proposed below is already in that payload and is currently 
discarded at render time.
   
   ## Describe the solution you'd like
   
   Add to the Routes list:
   
   1. **Status** — enabled / disabled. This is the one that is arguably a 
correctness problem rather than an ergonomics one: the list currently makes a 
false implication of uniformity.
   2. **Methods** — the second half of "what does this route match", next to 
URI which is already there.
   3. **Target** — the `upstream_id` / `service_id` the route forwards to. With 
#3459 merged these ids already resolve and link on the detail page, so the list 
can show the same reference.
   
   And demote `Description` from the widest column, since it is optional and 
usually unset.
   
   **One implementation note that is easy to get wrong.** APISIX omits `status` 
from the response when it is the default. Verified on 3.17.0:
   
   ```
   PATCH /apisix/admin/routes/demo-route {"status": 0}
   → list shows  demo-route status=0,  every other route  status=<absent>
   PATCH /apisix/admin/routes/demo-route {"status": 1}
   → list shows  demo-route status=<absent>
   ```
   
   So a plain `valueEnum: { 1: enabled, 0: disabled }` renders `-` for every 
enabled route. **Absent must be read as enabled.**
   
   ## Describe alternatives you've considered
   
   **Leaving it to the detail page.** That is the state today, and it makes "is 
anything switched off in this cluster?" an O(n) question answered by opening n 
pages.
   
   **Adding every remaining schema field as a column.** `hosts`, `vars`, 
`priority`, `labels` and the rest are real, but a list that shows everything 
shows nothing. The three above are what distinguishes one route from another at 
a glance.
   
   **Making the columns user-configurable.** A larger feature, and it does not 
help the default view, which is what a first-time visitor sees.
   
   ## Additional context
   
   - **There is already a precedent in this repo**: the SSLs list renders a 
Status column with exactly this enabled/disabled `valueEnum` 
(`src/routes/ssls/index.tsx`). Routes and SSLs both carry `status`; only one of 
them shows it. Services and consumers model it too.
   - Stream routes deliberately omit `status` in the dashboard's schema, so 
they are out of scope for the status part.
   - Related but distinct: #3205 asks for *search/filter* over the list. This 
issue is about what a row shows once you are looking at it; the two compose but 
neither depends on the other.
   
   Happy to put up a PR if this direction is agreed.
   


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