summaryrefslogtreecommitdiffstats
path: root/webapp/components/admin_console/database_settings.jsx
diff options
context:
space:
mode:
Diffstat (limited to 'webapp/components/admin_console/database_settings.jsx')
-rw-r--r--webapp/components/admin_console/database_settings.jsx52
1 files changed, 50 insertions, 2 deletions
diff --git a/webapp/components/admin_console/database_settings.jsx b/webapp/components/admin_console/database_settings.jsx
index e182db70e..303865d91 100644
--- a/webapp/components/admin_console/database_settings.jsx
+++ b/webapp/components/admin_console/database_settings.jsx
@@ -3,6 +3,7 @@
import React from 'react';
+import {recycleDatabaseConnection} from 'actions/admin_actions.jsx';
import * as Utils from 'utils/utils.jsx';
import AdminSettings from './admin_settings.jsx';
@@ -11,7 +12,7 @@ import {FormattedMessage} from 'react-intl';
import GeneratedSetting from './generated_setting.jsx';
import SettingsGroup from './settings_group.jsx';
import TextSetting from './text_setting.jsx';
-import RecycleDbButton from './recycle_db.jsx';
+import RequestButton from './request_button/request_button.jsx';
export default class DatabaseSettings extends AdminSettings {
constructor(props) {
@@ -58,6 +59,53 @@ export default class DatabaseSettings extends AdminSettings {
renderSettings() {
const dataSource = '**********' + this.state.dataSource.substring(this.state.dataSource.indexOf('@'));
+ let recycleDbButton = <div/>;
+ if (global.window.mm_license.IsLicensed === 'true') {
+ recycleDbButton = (
+ <RequestButton
+ requestAction={recycleDatabaseConnection}
+ helpText={
+ <FormattedMessage
+ id='admin.recycle.recycleDescription'
+ defaultMessage='Deployments using multiple databases can switch from one master database to another without restarting the Mattermost server by updating "config.json" to the new desired configuration and using the {reloadConfiguration} feature to load the new settings while the server is running. The administrator should then use {featureName} feature to recycle the database connections based on the new settings.'
+ values={{
+ featureName: (
+ <b>
+ <FormattedMessage
+ id='admin.recycle.recycleDescription.featureName'
+ defaultMessage='Recycle Database Connections'
+ />
+ </b>
+ ),
+ reloadConfiguration: (
+ <a href='../general/configuration'>
+ <b>
+ <FormattedMessage
+ id='admin.recycle.recycleDescription.reloadConfiguration'
+ defaultMessage='Configuration > Reload Configuration from Disk'
+ />
+ </b>
+ </a>
+ )
+ }}
+ />
+ }
+ buttonText={
+ <FormattedMessage
+ id='admin.recycle.button'
+ defaultMessage='Recycle Database Connections'
+ />
+ }
+ showSuccessMessage={false}
+ errorMessage={{
+ id: 'admin.recycle.reloadFail',
+ defaultMessage: 'Recycling unsuccessful: {error}'
+ }}
+ includeDetailedError={true}
+ />
+ );
+ }
+
return (
<SettingsGroup>
<p>
@@ -183,7 +231,7 @@ export default class DatabaseSettings extends AdminSettings {
value={this.state.trace}
onChange={this.handleChange}
/>
- <RecycleDbButton/>
+ {recycleDbButton}
</SettingsGroup>
);
}