diff options
author | =Corey Hulen <corey@hulen.com> | 2015-09-10 18:32:22 -0700 |
---|---|---|
committer | =Corey Hulen <corey@hulen.com> | 2015-09-10 18:32:22 -0700 |
commit | e06e292be71ca699d90bafbd635118aa47c2d7a5 (patch) | |
tree | 3f8f7ce86a1618f625e71084041746745139ba0c /web/react/utils/async_client.jsx | |
parent | 41439eb801c6c8c0a55bcada3eeba3b4a561c663 (diff) | |
download | chat-e06e292be71ca699d90bafbd635118aa47c2d7a5.tar.gz chat-e06e292be71ca699d90bafbd635118aa47c2d7a5.tar.bz2 chat-e06e292be71ca699d90bafbd635118aa47c2d7a5.zip |
PLT-12 adding log viewer
Diffstat (limited to 'web/react/utils/async_client.jsx')
-rw-r--r-- | web/react/utils/async_client.jsx | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/web/react/utils/async_client.jsx b/web/react/utils/async_client.jsx index 6ccef0506..6b8e73c5a 100644 --- a/web/react/utils/async_client.jsx +++ b/web/react/utils/async_client.jsx @@ -319,6 +319,32 @@ export function getAudits() { ); } +export function getLogs() { + if (isCallInProgress('getLogs')) { + return; + } + + callTracker.getLogs = utils.getTimestamp(); + client.getLogs( + (data, textStatus, xhr) => { + callTracker.getLogs = 0; + + if (xhr.status === 304 || !data) { + return; + } + + AppDispatcher.handleServerAction({ + type: ActionTypes.RECIEVED_LOGS, + logs: data + }); + }, + (err) => { + callTracker.getLogs = 0; + dispatchError(err, 'getLogs'); + } + ); +} + export function findTeams(email) { if (isCallInProgress('findTeams_' + email)) { return; |