diff options
author | Christopher Speller <crspeller@gmail.com> | 2015-09-15 15:59:29 -0400 |
---|---|---|
committer | Christopher Speller <crspeller@gmail.com> | 2015-09-15 15:59:29 -0400 |
commit | 1bbb5265be24476faa2d44f8538918708391bde8 (patch) | |
tree | 5f1b30ec8a4cf1dfa1366b7945accb502add43ba /web/react/utils/async_client.jsx | |
parent | bbb0607e1ddf3e3d530095ba2aa28abd9c49a3e4 (diff) | |
parent | 23a1311ef5f9ecac0a250419a49e74b290e63516 (diff) | |
download | chat-1bbb5265be24476faa2d44f8538918708391bde8.tar.gz chat-1bbb5265be24476faa2d44f8538918708391bde8.tar.bz2 chat-1bbb5265be24476faa2d44f8538918708391bde8.zip |
Merge pull request #681 from mattermost/PLT-12-log
PLT-12 Adding server logs viewer to admin console
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; |