Merge pull request #2049 from mattermost/plt-1856

PLT-1856 Add basic server audit tab to system console for EE
Этот коммит содержится в:
Christopher Speller
2016-02-03 08:52:18 -05:00
родитель d479b08c99 d153d661db
Коммит 75f412c4be
15 изменённых файлов: 909 добавлений и 588 удалений

Просмотреть файл

@@ -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();