summaryrefslogtreecommitdiffstats
path: root/webapp/components/admin_console/webserver_mode_dropdown_setting.jsx
diff options
context:
space:
mode:
authorChristopher Speller <crspeller@gmail.com>2016-07-06 12:04:22 -0400
committerJoram Wilander <jwawilander@gmail.com>2016-07-06 12:04:22 -0400
commitda0747ac7a3c8d3ef8eb2620f52fe5d1fd355a12 (patch)
treed6520ee16291ed3c805ad8014d518e9dd03ec694 /webapp/components/admin_console/webserver_mode_dropdown_setting.jsx
parentce8cb14eb598c4e9820bbb335190f4bcaa359610 (diff)
downloadchat-da0747ac7a3c8d3ef8eb2620f52fe5d1fd355a12.tar.gz
chat-da0747ac7a3c8d3ef8eb2620f52fe5d1fd355a12.tar.bz2
chat-da0747ac7a3c8d3ef8eb2620f52fe5d1fd355a12.zip
Adding webserver mode to the system console. Automatic enabling of gzip on existing servers (#3458)
Diffstat (limited to 'webapp/components/admin_console/webserver_mode_dropdown_setting.jsx')
-rw-r--r--webapp/components/admin_console/webserver_mode_dropdown_setting.jsx101
1 files changed, 101 insertions, 0 deletions
diff --git a/webapp/components/admin_console/webserver_mode_dropdown_setting.jsx b/webapp/components/admin_console/webserver_mode_dropdown_setting.jsx
new file mode 100644
index 000000000..9581816f1
--- /dev/null
+++ b/webapp/components/admin_console/webserver_mode_dropdown_setting.jsx
@@ -0,0 +1,101 @@
+// Copyright (c) 2016 Mattermost, Inc. All Rights Reserved.
+// See License.txt for license information.
+
+import React from 'react';
+import * as Utils from 'utils/utils.jsx';
+
+import DropdownSetting from './dropdown_setting.jsx';
+import {FormattedMessage} from 'react-intl';
+
+const WEBSERVER_MODE_HELP_TEXT = (
+ <div>
+ <table
+ className='table table-bordered table-margin--none'
+ cellPadding='5'
+ >
+ <tbody>
+ <tr>
+ <td className='help-text'>
+ <FormattedMessage
+ id='admin.webserverModeGzip'
+ defaultMessage='gzip'
+ />
+ </td>
+ <td className='help-text'>
+ <FormattedMessage
+ id='admin.webserverModeGzipDescription'
+ defaultMessage='The Mattermost server will serve static files compressed with gzip.'
+ />
+ </td>
+ </tr>
+ <tr>
+ <td className='help-text'>
+ <FormattedMessage
+ id='admin.webserverModeUncompressed'
+ defaultMessage='Uncompressed'
+ />
+ </td>
+ <td className='help-text'>
+ <FormattedMessage
+ id='admin.webserverModeUncompressedDescription'
+ defaultMessage='The Mattermost server will serve static files uncompressed.'
+ />
+ </td>
+ </tr>
+ <tr>
+ <td className='help-text'>
+ <FormattedMessage
+ id='admin.webserverModeDisabled'
+ defaultMessage='Disabled'
+ />
+ </td>
+ <td className='help-text'>
+ <FormattedMessage
+ id='admin.webserverModeDisabledDescription'
+ defaultMessage='The Mattermost server will not serve static files.'
+ />
+ </td>
+ </tr>
+ </tbody>
+ </table>
+ <p className='help-text'>
+ <FormattedMessage
+ id='admin.webserverModeHelpText'
+ defaultMessage='gzip compression applies to static content files. It is recommended to enable gzip to improve performance unless your environment has specific restrictions, such as a web proxy that distributes gzip files poorly. This setting requires a server restart to take effect.'
+ />
+ </p>
+ </div>
+);
+
+export default class WebserverModeDropdownSetting extends React.Component {
+ render() {
+ return (
+ <DropdownSetting
+ id='webserverMode'
+ values={[
+ {value: 'gzip', text: Utils.localizeMessage('admin.webserverModeGzip', 'gzip')},
+ {value: 'uncompressed', text: Utils.localizeMessage('admin.webserverModeUncompressed', 'Uncompressed')},
+ {value: 'disabled', text: Utils.localizeMessage('admin.webserverModeDiabled', 'Disabled')}
+ ]}
+ label={
+ <FormattedMessage
+ id='admin.webserverModeTitle'
+ defaultMessage='Webserver Mode:'
+ />
+ }
+ value={this.props.value}
+ onChange={this.props.onChange}
+ disabled={this.props.disabled}
+ helpText={WEBSERVER_MODE_HELP_TEXT}
+ />
+ );
+ }
+}
+WebserverModeDropdownSetting.defaultProps = {
+};
+
+WebserverModeDropdownSetting.propTypes = {
+ value: React.PropTypes.string.isRequired,
+ onChange: React.PropTypes.func.isRequired,
+ disabled: React.PropTypes.bool.isRequired
+};