summaryrefslogtreecommitdiffstats
path: root/web/react/components/admin_console/admin_controller.jsx
diff options
context:
space:
mode:
authorJack <jackdeng@gmail.com>2015-09-22 08:16:51 -0700
committerJack <jackdeng@gmail.com>2015-09-22 08:16:51 -0700
commit602bed85f2b32733f73e2edddb542fa36baac462 (patch)
tree06a6ee9b609a9122bc2f0e6f6e6300f9ba79a3aa /web/react/components/admin_console/admin_controller.jsx
parenta31868336f97a91bfd5a7e91e99a9b294d131f90 (diff)
parentf439c82d7c885b4c530ba9da0a41b17910743b55 (diff)
downloadchat-602bed85f2b32733f73e2edddb542fa36baac462.tar.gz
chat-602bed85f2b32733f73e2edddb542fa36baac462.tar.bz2
chat-602bed85f2b32733f73e2edddb542fa36baac462.zip
fix conflict
Diffstat (limited to 'web/react/components/admin_console/admin_controller.jsx')
-rw-r--r--web/react/components/admin_console/admin_controller.jsx46
1 files changed, 34 insertions, 12 deletions
diff --git a/web/react/components/admin_console/admin_controller.jsx b/web/react/components/admin_console/admin_controller.jsx
index 68984c9e0..e82fe1b76 100644
--- a/web/react/components/admin_console/admin_controller.jsx
+++ b/web/react/components/admin_console/admin_controller.jsx
@@ -2,35 +2,58 @@
// See License.txt for license information.
var AdminSidebar = require('./admin_sidebar.jsx');
-var EmailTab = require('./email_settings.jsx');
-var JobsTab = require('./jobs_settings.jsx');
+var AdminStore = require('../../stores/admin_store.jsx');
+var AsyncClient = require('../../utils/async_client.jsx');
+var LoadingScreen = require('../loading_screen.jsx');
+
+var EmailSettingsTab = require('./email_settings.jsx');
+var LogSettingsTab = require('./log_settings.jsx');
var LogsTab = require('./logs.jsx');
-var Navbar = require('../../components/navbar.jsx');
export default class AdminController extends React.Component {
constructor(props) {
super(props);
this.selectTab = this.selectTab.bind(this);
+ this.onConfigListenerChange = this.onConfigListenerChange.bind(this);
this.state = {
+ config: null,
selected: 'email_settings'
};
}
+ componentDidMount() {
+ AdminStore.addConfigChangeListener(this.onConfigListenerChange);
+ AsyncClient.getConfig();
+ }
+
+ componentWillUnmount() {
+ AdminStore.removeConfigChangeListener(this.onConfigListenerChange);
+ }
+
+ onConfigListenerChange() {
+ this.setState({
+ config: AdminStore.getConfig(),
+ selected: this.state.selected
+ });
+ }
+
selectTab(tab) {
this.setState({selected: tab});
}
render() {
- var tab = '';
-
- if (this.state.selected === 'email_settings') {
- tab = <EmailTab />;
- } else if (this.state.selected === 'job_settings') {
- tab = <JobsTab />;
- } else if (this.state.selected === 'logs') {
- tab = <LogsTab />;
+ var tab = <LoadingScreen />;
+
+ if (this.state.config != null) {
+ if (this.state.selected === 'email_settings') {
+ tab = <EmailSettingsTab config={this.state.config} />;
+ } else if (this.state.selected === 'log_settings') {
+ tab = <LogSettingsTab config={this.state.config} />;
+ } else if (this.state.selected === 'logs') {
+ tab = <LogsTab />;
+ }
}
return (
@@ -45,7 +68,6 @@ export default class AdminController extends React.Component {
/>
<div className='inner__wrap channel__wrap'>
<div className='row header'>
- <Navbar teamDisplayName='Admin Console' />
</div>
<div className='row main'>
<div