fix: clients api node params

This commit is contained in:
DDDHuang 2021-08-23 16:39:14 +08:00 committed by turtleDeng
parent e88823fd36
commit 32a84b3aba
1 changed files with 9 additions and 2 deletions

View File

@ -514,8 +514,15 @@ subscriptions(get, Request) ->
%% api apply
list(Params) ->
Response = emqx_mgmt_api:cluster_query(Params, ?CLIENT_QS_SCHEMA, ?query_fun),
{200, Response}.
case proplists:get_value(<<"node">>, Params, undefined) of
undefined ->
Response = emqx_mgmt_api:cluster_query(Params, ?CLIENT_QS_SCHEMA, ?query_fun),
{200, Response};
Node1 ->
Node = binary_to_atom(Node1, utf8),
Response = emqx_mgmt_api:node_query(Node, proplists:delete(<<"node">>, Params), ?CLIENT_QS_SCHEMA, ?query_fun),
{200, Response}
end.
lookup(#{clientid := ClientID}) ->
case emqx_mgmt:lookup_client({clientid, ClientID}, ?format_fun) of