Fix Dashboard not showing data
This commit is contained in:
parent
88c77cf4c2
commit
54534967bd
|
@ -59,8 +59,10 @@ handle_request(Req, State) ->
|
||||||
|
|
||||||
inner_handle_request(Req, State) ->
|
inner_handle_request(Req, State) ->
|
||||||
Path = Req:get(path),
|
Path = Req:get(path),
|
||||||
handle_request(Path, Req, State).
|
case Path of
|
||||||
|
"/api/v2/auth" -> handle_request(Path, Req, State);
|
||||||
|
_ -> if_authorized(Req, fun() -> handle_request(Path, Req, State) end)
|
||||||
|
end.
|
||||||
|
|
||||||
handle_request("/api/v2/" ++ Url, Req, #state{dispatch = Dispatch}) ->
|
handle_request("/api/v2/" ++ Url, Req, #state{dispatch = Dispatch}) ->
|
||||||
Dispatch(Req, Url);
|
Dispatch(Req, Url);
|
||||||
|
|
|
@ -212,9 +212,10 @@ session_list('GET', Params, Node, ClientId) ->
|
||||||
{ok, [{objects, [session_row(Row) || Row <- Data]}]}.
|
{ok, [{objects, [session_row(Row) || Row <- Data]}]}.
|
||||||
|
|
||||||
session_row({ClientId, _Pid, _Persistent, Session}) ->
|
session_row({ClientId, _Pid, _Persistent, Session}) ->
|
||||||
InfoKeys = [clean_sess, max_inflight, inflight_queue, message_queue,
|
Data = lists:append(Session, emqttd_stats:get_session_stats(ClientId)),
|
||||||
message_dropped, awaiting_rel, awaiting_ack, awaiting_comp, created_at],
|
InfoKeys = [clean_sess, subscriptions, max_inflight, inflight_len, mqueue_len,
|
||||||
[{client_id, ClientId} | [{Key, format(Key, get_value(Key, Session))} || Key <- InfoKeys]].
|
mqueue_dropped, awaiting_rel_len, deliver_msg,enqueue_msg, created_at],
|
||||||
|
[{client_id, ClientId} | [{Key, format(Key, get_value(Key, Data))} || Key <- InfoKeys]].
|
||||||
|
|
||||||
%%--------------------------------------------------------------------------
|
%%--------------------------------------------------------------------------
|
||||||
%% subscription
|
%% subscription
|
||||||
|
|
Loading…
Reference in New Issue