diff options
author | Harrison Healey <harrisonmhealey@gmail.com> | 2015-09-18 18:11:01 -0400 |
---|---|---|
committer | Harrison Healey <harrisonmhealey@gmail.com> | 2015-09-18 18:11:01 -0400 |
commit | 679e20aa4b74b468c7e372c77219142599f2385d (patch) | |
tree | 544b2a5f932dc2a2cbd27a800fddcb4ce07b057e /web/react/stores/admin_store.jsx | |
parent | 676f2a63999e51a03f2f57209ce4c9f106683da4 (diff) | |
parent | cdf813f07b207c14bb9fa03f38d734b45e40823e (diff) | |
download | chat-679e20aa4b74b468c7e372c77219142599f2385d.tar.gz chat-679e20aa4b74b468c7e372c77219142599f2385d.tar.bz2 chat-679e20aa4b74b468c7e372c77219142599f2385d.zip |
Merge pull request #709 from mattermost/PLT-11
PLT-11 adding config for logs to UI
Diffstat (limited to 'web/react/stores/admin_store.jsx')
-rw-r--r-- | web/react/stores/admin_store.jsx | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/web/react/stores/admin_store.jsx b/web/react/stores/admin_store.jsx index 591b52d05..dd5b60a24 100644 --- a/web/react/stores/admin_store.jsx +++ b/web/react/stores/admin_store.jsx @@ -8,16 +8,22 @@ var Constants = require('../utils/constants.jsx'); var ActionTypes = Constants.ActionTypes; var LOG_CHANGE_EVENT = 'log_change'; +var CONFIG_CHANGE_EVENT = 'config_change'; class AdminStoreClass extends EventEmitter { constructor() { super(); this.logs = null; + this.config = null; this.emitLogChange = this.emitLogChange.bind(this); this.addLogChangeListener = this.addLogChangeListener.bind(this); this.removeLogChangeListener = this.removeLogChangeListener.bind(this); + + this.emitConfigChange = this.emitConfigChange.bind(this); + this.addConfigChangeListener = this.addConfigChangeListener.bind(this); + this.removeConfigChangeListener = this.removeConfigChangeListener.bind(this); } emitLogChange() { @@ -32,6 +38,18 @@ class AdminStoreClass extends EventEmitter { this.removeListener(LOG_CHANGE_EVENT, callback); } + emitConfigChange() { + this.emit(CONFIG_CHANGE_EVENT); + } + + addConfigChangeListener(callback) { + this.on(CONFIG_CHANGE_EVENT, callback); + } + + removeConfigChangeListener(callback) { + this.removeListener(CONFIG_CHANGE_EVENT, callback); + } + getLogs() { return this.logs; } @@ -39,6 +57,14 @@ class AdminStoreClass extends EventEmitter { saveLogs(logs) { this.logs = logs; } + + getConfig() { + return this.config; + } + + saveConfig(config) { + this.config = config; + } } var AdminStore = new AdminStoreClass(); @@ -51,6 +77,10 @@ AdminStoreClass.dispatchToken = AppDispatcher.register((payload) => { AdminStore.saveLogs(action.logs); AdminStore.emitLogChange(); break; + case ActionTypes.RECIEVED_CONFIG: + AdminStore.saveConfig(action.config); + AdminStore.emitConfigChange(); + break; default: } }); |