mirror of
https://github.com/mattermost/mattermost.git
synced 2025-02-25 18:55:24 -06:00
* Updating client dependancies. Switching to using yarn. * Updating React * Moving pure components to using function syntax (performance gains with newer react version) * Updating client dependancies. * Ignore .yarninstall * Enabling pre-lockfile because it's the entire point of using yarn. * Removing old webpack config * Moving to new prop-types * Fixing ESLint Errors * Updating jest snapshots. * Cleaning up package.json
102 lines
3.7 KiB
JavaScript
102 lines
3.7 KiB
JavaScript
import PropTypes from 'prop-types';
|
|
|
|
// Copyright (c) 2016-present 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>
|
|
<FormattedMessage
|
|
id='admin.webserverModeGzip'
|
|
defaultMessage='gzip'
|
|
/>
|
|
</td>
|
|
<td>
|
|
<FormattedMessage
|
|
id='admin.webserverModeGzipDescription'
|
|
defaultMessage='The Mattermost server will serve static files compressed with gzip.'
|
|
/>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td>
|
|
<FormattedMessage
|
|
id='admin.webserverModeUncompressed'
|
|
defaultMessage='Uncompressed'
|
|
/>
|
|
</td>
|
|
<td>
|
|
<FormattedMessage
|
|
id='admin.webserverModeUncompressedDescription'
|
|
defaultMessage='The Mattermost server will serve static files uncompressed.'
|
|
/>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td>
|
|
<FormattedMessage
|
|
id='admin.webserverModeDisabled'
|
|
defaultMessage='Disabled'
|
|
/>
|
|
</td>
|
|
<td>
|
|
<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.'
|
|
/>
|
|
</p>
|
|
</div>
|
|
);
|
|
|
|
export default function WebserverModeDropdownSetting(props) {
|
|
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.webserverModeDisabled', 'Disabled')}
|
|
]}
|
|
label={
|
|
<FormattedMessage
|
|
id='admin.webserverModeTitle'
|
|
defaultMessage='Webserver Mode:'
|
|
/>
|
|
}
|
|
value={props.value}
|
|
onChange={props.onChange}
|
|
disabled={props.disabled}
|
|
helpText={WEBSERVER_MODE_HELP_TEXT}
|
|
/>
|
|
);
|
|
}
|
|
WebserverModeDropdownSetting.defaultProps = {
|
|
};
|
|
|
|
WebserverModeDropdownSetting.propTypes = {
|
|
value: PropTypes.string.isRequired,
|
|
onChange: PropTypes.func.isRequired,
|
|
disabled: PropTypes.bool.isRequired
|
|
};
|