Closed idbeta closed 3 years ago
@ShiningRush do you have any idea about this issue?
uri
, uris
host
, hosts
remote_addr
, remote_addrs
the Admin API user will create a route with any of those fields, the frontend needs to show them in the dashboard correctly.
For example, create the route with field uri
, and we need to show it at frontend:
$ curl http://127.0.0.1:9080/apisix/admin/routes/1 -X PUT -i -d '
{
"uri": "/index.html",
"upstream": {
"type": "roundrobin",
"nodes": {
"127.0.0.1:80": 1
}
}
}'
name
and updated_at
, I don’t think it’s a bug, I think it is a identifies that the data comes from admin-api. If the user subsequently performs an operation in manager-api, then these two fields will also automatically change by manager-api
- I think that in the future, we only need to support fields of arrays(uris, hosts, remote_addrs would be better). We can convert single-valued fields such as uri into arrays when manager-api list resources.
manager-api
can implement this feature after 2.0RC3
, need more time(manager-api and admin API will update to this process).
2.0
version, we should keep manager-api
and admin-api
same.
FYI: All fields without value would fallback to None
on the frontend.
And we will convert all host
to hosts
before sending requests because the variable in arrays should be more uniform when there have both host
and hosts
.
The table component supports columnEmptyText
, we could use it to set default content when that field doesn't have a value, but it will check if that field is returned from the data source.
According to the following snapshot, every record doesn't have the same structure, so I have to add a checker function for every field on the frontend, they are too many so it's not a good idea IMO.
Summary: Leave those fields' value as empty currently. cc @membphis @idbeta
manager-api can do convert in list
action, no need do that in web.
web just care array fields such as uris
, hosts
etc.
manager-api can do convert in
list
action, no need do that in web. web just care array fields such asuris
,hosts
etc.
There have 2 opinions:
I agree with @ShiningRush's opinion is because that would be better and the web will reduce many tricks.
I agree with @membphis's opinion is because the manager-api will have the same params with admin API in this way.
Because I don't think the manager-api will add those logics before publishing the RC3, so I just took some time and adding the convertor on the frontend.
web just care array fields such as
uris
,hosts
etc.
we can do this later, 2.1
or 2.2
.
The route created by admin API is missing fields in the dashboard display. This is an example provided by APISIX
after create the route, the dashboard display like this:
I think there should be default values of Name, Path, UpdateAt when the route was created like that.