summaryrefslogtreecommitdiffstats
path: root/web/react/stores
diff options
context:
space:
mode:
authorChristopher Speller <crspeller@gmail.com>2016-02-03 08:52:18 -0500
committerChristopher Speller <crspeller@gmail.com>2016-02-03 08:52:18 -0500
commit75f412c4be81abfd99e2aed8c24dd15db9ae1068 (patch)
tree7e1aeb0ced8e02b8d6bed5bdce841d3f5b99f45e /web/react/stores
parentd479b08c997d3216938a3e92c3634a8b5afdb841 (diff)
parentd153d661db7d4349d69824d318aa9ad571970606 (diff)
downloadchat-75f412c4be81abfd99e2aed8c24dd15db9ae1068.tar.gz
chat-75f412c4be81abfd99e2aed8c24dd15db9ae1068.tar.bz2
chat-75f412c4be81abfd99e2aed8c24dd15db9ae1068.zip
Merge pull request #2049 from mattermost/plt-1856
PLT-1856 Add basic server audit tab to system console for EE
Diffstat (limited to 'web/react/stores')
-rw-r--r--web/react/stores/admin_store.jsx32
1 files changed, 31 insertions, 1 deletions
diff --git a/web/react/stores/admin_store.jsx b/web/react/stores/admin_store.jsx
index 704e2ced4..8f43091a7 100644
--- a/web/react/stores/admin_store.jsx
+++ b/web/react/stores/admin_store.jsx
@@ -1,4 +1,4 @@
-// Copyright (c) 2015 Mattermost, Inc. All Rights Reserved.
+// Copyright (c) 2016 Mattermost, Inc. All Rights Reserved.
// See License.txt for license information.
import AppDispatcher from '../dispatcher/app_dispatcher.jsx';
@@ -10,6 +10,7 @@ import Constants from '../utils/constants.jsx';
const ActionTypes = Constants.ActionTypes;
const LOG_CHANGE_EVENT = 'log_change';
+const SERVER_AUDIT_CHANGE_EVENT = 'server_audit_change';
const CONFIG_CHANGE_EVENT = 'config_change';
const ALL_TEAMS_EVENT = 'all_team_change';
@@ -18,6 +19,7 @@ class AdminStoreClass extends EventEmitter {
super();
this.logs = null;
+ this.audits = null;
this.config = null;
this.teams = null;
@@ -25,6 +27,10 @@ class AdminStoreClass extends EventEmitter {
this.addLogChangeListener = this.addLogChangeListener.bind(this);
this.removeLogChangeListener = this.removeLogChangeListener.bind(this);
+ this.emitAuditChange = this.emitAuditChange.bind(this);
+ this.addAuditChangeListener = this.addAuditChangeListener.bind(this);
+ this.removeAuditChangeListener = this.removeAuditChangeListener.bind(this);
+
this.emitConfigChange = this.emitConfigChange.bind(this);
this.addConfigChangeListener = this.addConfigChangeListener.bind(this);
this.removeConfigChangeListener = this.removeConfigChangeListener.bind(this);
@@ -46,6 +52,18 @@ class AdminStoreClass extends EventEmitter {
this.removeListener(LOG_CHANGE_EVENT, callback);
}
+ emitAuditChange() {
+ this.emit(SERVER_AUDIT_CHANGE_EVENT);
+ }
+
+ addAuditChangeListener(callback) {
+ this.on(SERVER_AUDIT_CHANGE_EVENT, callback);
+ }
+
+ removeAuditChangeListener(callback) {
+ this.removeListener(SERVER_AUDIT_CHANGE_EVENT, callback);
+ }
+
emitConfigChange() {
this.emit(CONFIG_CHANGE_EVENT);
}
@@ -78,6 +96,14 @@ class AdminStoreClass extends EventEmitter {
this.logs = logs;
}
+ getAudits() {
+ return this.audits;
+ }
+
+ saveAudits(audits) {
+ this.audits = audits;
+ }
+
getConfig() {
return this.config;
}
@@ -113,6 +139,10 @@ AdminStoreClass.dispatchToken = AppDispatcher.register((payload) => {
AdminStore.saveLogs(action.logs);
AdminStore.emitLogChange();
break;
+ case ActionTypes.RECIEVED_SERVER_AUDITS:
+ AdminStore.saveAudits(action.audits);
+ AdminStore.emitAuditChange();
+ break;
case ActionTypes.RECIEVED_CONFIG:
AdminStore.saveConfig(action.config);
AdminStore.emitConfigChange();