From d153d661db7d4349d69824d318aa9ad571970606 Mon Sep 17 00:00:00 2001
From: JoramWilander <jwawilander@gmail.com>
Date: Tue, 2 Feb 2016 16:49:27 -0500
Subject: Add basic server audit tab to system console for EE

---
 web/react/utils/async_client.jsx | 26 ++++++++++++++++++++++++++
 1 file changed, 26 insertions(+)

(limited to 'web/react/utils/async_client.jsx')

diff --git a/web/react/utils/async_client.jsx b/web/react/utils/async_client.jsx
index 0ee89b9fa..d615e02c7 100644
--- a/web/react/utils/async_client.jsx
+++ b/web/react/utils/async_client.jsx
@@ -312,6 +312,32 @@ export function getLogs() {
     );
 }
 
+export function getServerAudits() {
+    if (isCallInProgress('getServerAudits')) {
+        return;
+    }
+
+    callTracker.getServerAudits = utils.getTimestamp();
+    client.getServerAudits(
+        (data, textStatus, xhr) => {
+            callTracker.getServerAudits = 0;
+
+            if (xhr.status === 304 || !data) {
+                return;
+            }
+
+            AppDispatcher.handleServerAction({
+                type: ActionTypes.RECIEVED_SERVER_AUDITS,
+                audits: data
+            });
+        },
+        (err) => {
+            callTracker.getServerAudits = 0;
+            dispatchError(err, 'getServerAudits');
+        }
+    );
+}
+
 export function getConfig() {
     if (isCallInProgress('getConfig')) {
         return;
-- 
cgit v1.2.3-1-g7c22

