Fix dashboard not showing data bug
This commit is contained in:
parent
16eef90707
commit
d9f14dacaf
|
@ -26,7 +26,7 @@
|
|||
|
||||
-import(proplists, [get_value/2, get_value/3]).
|
||||
|
||||
-export([http_handler/0, handle_request/2, http_api/0]).
|
||||
-export([http_handler/0, handle_request/2, http_api/0, inner_handle_request/2]).
|
||||
|
||||
-include("emqttd_internal.hrl").
|
||||
|
||||
|
@ -54,14 +54,14 @@ handle_request(Req, State) ->
|
|||
"/api/v2/auth" ->
|
||||
handle_request(Path, Req, State);
|
||||
_ ->
|
||||
Host = Req:get_header_value("Host"),
|
||||
[_, Port] = string:tokens(Host, ":"),
|
||||
case Port of
|
||||
"18083" -> handle_request(Path, Req, State);
|
||||
_ -> if_authorized(Req, fun() -> handle_request(Path, Req, State) end)
|
||||
end
|
||||
if_authorized(Req, fun() -> handle_request(Path, Req, State) end)
|
||||
end.
|
||||
|
||||
inner_handle_request(Req, State) ->
|
||||
Path = Req:get(path),
|
||||
handle_request(Path, Req, State).
|
||||
|
||||
|
||||
handle_request("/api/v2/" ++ Url, Req, #state{dispatch = Dispatch}) ->
|
||||
Dispatch(Req, Url);
|
||||
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
-http_api({"^nodes/(.+?)/clients/(.+?)/?$", 'GET',client_list, []}).
|
||||
-http_api({"^clients/(.+?)/?$", 'GET', client, []}).
|
||||
-http_api({"^clients/(.+?)/?$", 'DELETE', kick_client, []}).
|
||||
-http_api({"^clients/(.+?)/clean_acl_cache?$", 'DELETE', clean_acl_cache, [{<<"topic">>, binary}]}).
|
||||
-http_api({"^clients/(.+?)/clean_acl_cache?$", 'PUT', clean_acl_cache, [{<<"topic">>, binary}]}).
|
||||
|
||||
-http_api({"^routes?$", 'GET', route_list, []}).
|
||||
-http_api({"^routes/(.+?)/?$", 'GET', route, []}).
|
||||
|
|
Loading…
Reference in New Issue