Apisix-dashboard: bug: when created route by adminAPI, "method" can be null value which dashboard can not identify

Created on 11 Nov 2020  路  14Comments  路  Source: apache/apisix-dashboard

  • Why do you submit this issue?
  • [ ] Question or discussion
  • [x] Bug
  • [ ] Requirements
  • [ ] Feature or performance improvement
  • [ ] Other

when created route by adminAPI, method can be null value which mean all method good to use, bug dashboard can not identify.
adminAPI,no method, means all method can be used:

curl http://127.0.0.1:9080/apisix/admin/routes/1 -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PUT -d '
 {
     "name":"test_route_%s",
     "uri": "/name/1/*",
     "upstream": {
         "type": "roundrobin",
         "nodes": {
             "127.0.0.1:9797": 1
         }
     }
}

dashboard, can not identify
image

enhancement frontend good first issue

All 14 comments

cc @membphis to determine this issue.

adminAPI,no method, means all method can be used

confirm, that is the default way for admin API. we'd better keep same for this process

This will make confusion in the frontend, two solutions here,

  1. If the response doesn't have that field, the manager-api will modify it and apply all HTTP methods.
  2. Update APISIX's logic, though it's a default action, it's not clear and will lead to complexity if using the dashboard, right?

for method, I think the Admin API's logic is fine.

  1. no method: means any method.
  2. has method: limit with listed method.

It is the same as other fields, eg: host, remote_addr etc.

image

It may be reasonable in the APIs, but it's not in GUI (UX). Let's hear others' opinions.

cc @liuxiran @LiteSun @moonming @ShiningRush

I think there is good with the dashboard interaction now

The dashboard does not need to be completely consistent with the admin API

  1. no method: means any method.

I don't think the user should remember these default rules, otherwise it will be very difficult to use Dashboard later as the number of default rules increases.

I don't think the user should remember these default rules, otherwise it will be very difficult to use Dashboard later as the number of default rules increases.

agree +1
What you see is what you get is easier for users to accept馃槉, at the same time, the page supports multiple choices, which can cover all scenarios of method field, that is enough

I think we can use multiple-select instead of check box,
then we can select/unselect all methods through a shortcut button(such as select all) instead of clicking them one by one.

BTW: when I first saw the UI interaction of the method, I found it very inconvenient to use. The checkbox occupies too much page space and must be clicked one by one : (
it is a chance to optimize interaction.

Nice catch for me! And the antd should support this.

for method, I think the Admin API's logic is fine.

  1. no method: means any method.

That is not for Admin API, that is the default action for Route.

image

Please read the doc of Route: https://github.com/apache/apisix/blob/master/doc/admin-api.md#route

Same issue: hosts, methods and remote_addrs.

And I believe that many users' route data does not have the methods field.

current solution: use multiple select[1] to resolve this issue

[1] https://ant.design/components/select-cn/

Was this page helpful?
0 / 5 - 0 ratings

Related issues

juzhiyuan picture juzhiyuan  路  3Comments

chenyicai picture chenyicai  路  4Comments

membphis picture membphis  路  6Comments

Applenice picture Applenice  路  4Comments

juzhiyuan picture juzhiyuan  路  4Comments