Remove data source replica from system console UI (#3267)
Этот коммит содержится в:
коммит произвёл
Harrison Healey
родитель
384d0eb245
Коммит
629b49a119
@@ -24,7 +24,6 @@ export default class DatabaseSettings extends AdminSettings {
|
|||||||
this.state = Object.assign(this.state, {
|
this.state = Object.assign(this.state, {
|
||||||
driverName: this.props.config.SqlSettings.DriverName,
|
driverName: this.props.config.SqlSettings.DriverName,
|
||||||
dataSource: this.props.config.SqlSettings.DataSource,
|
dataSource: this.props.config.SqlSettings.DataSource,
|
||||||
dataSourceReplicas: this.props.config.SqlSettings.DataSourceReplicas,
|
|
||||||
maxIdleConns: props.config.SqlSettings.MaxIdleConns,
|
maxIdleConns: props.config.SqlSettings.MaxIdleConns,
|
||||||
maxOpenConns: props.config.SqlSettings.MaxOpenConns,
|
maxOpenConns: props.config.SqlSettings.MaxOpenConns,
|
||||||
atRestEncryptKey: props.config.SqlSettings.AtRestEncryptKey,
|
atRestEncryptKey: props.config.SqlSettings.AtRestEncryptKey,
|
||||||
@@ -33,7 +32,7 @@ export default class DatabaseSettings extends AdminSettings {
|
|||||||
}
|
}
|
||||||
|
|
||||||
getConfigFromState(config) {
|
getConfigFromState(config) {
|
||||||
// driverName, dataSource, and dataSourceReplicas are read-only from the UI
|
// driverName and dataSource are read-only from the UI
|
||||||
|
|
||||||
config.SqlSettings.MaxIdleConns = this.parseIntNonZero(this.state.maxIdleConns);
|
config.SqlSettings.MaxIdleConns = this.parseIntNonZero(this.state.maxIdleConns);
|
||||||
config.SqlSettings.MaxOpenConns = this.parseIntNonZero(this.state.maxOpenConns);
|
config.SqlSettings.MaxOpenConns = this.parseIntNonZero(this.state.maxOpenConns);
|
||||||
@@ -57,15 +56,6 @@ export default class DatabaseSettings extends AdminSettings {
|
|||||||
renderSettings() {
|
renderSettings() {
|
||||||
const dataSource = '**********' + this.state.dataSource.substring(this.state.dataSource.indexOf('@'));
|
const dataSource = '**********' + this.state.dataSource.substring(this.state.dataSource.indexOf('@'));
|
||||||
|
|
||||||
let dataSourceReplicas = '';
|
|
||||||
this.state.dataSourceReplicas.forEach((replica) => {
|
|
||||||
dataSourceReplicas += '[**********' + replica.substring(replica.indexOf('@')) + '] ';
|
|
||||||
});
|
|
||||||
|
|
||||||
if (this.state.dataSourceReplicas.length === 0) {
|
|
||||||
dataSourceReplicas = 'none';
|
|
||||||
}
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<SettingsGroup>
|
<SettingsGroup>
|
||||||
<p>
|
<p>
|
||||||
@@ -102,20 +92,6 @@ export default class DatabaseSettings extends AdminSettings {
|
|||||||
<p className='help-text'>{dataSource}</p>
|
<p className='help-text'>{dataSource}</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className='form-group'>
|
|
||||||
<label
|
|
||||||
className='control-label col-sm-4'
|
|
||||||
htmlFor='DataSourceReplicas'
|
|
||||||
>
|
|
||||||
<FormattedMessage
|
|
||||||
id='admin.sql.replicas'
|
|
||||||
defaultMessage='Data Source Replicas:'
|
|
||||||
/>
|
|
||||||
</label>
|
|
||||||
<div className='col-sm-8'>
|
|
||||||
<p className='help-text'>{dataSourceReplicas}</p>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<TextSetting
|
<TextSetting
|
||||||
id='maxIdleConns'
|
id='maxIdleConns'
|
||||||
label={
|
label={
|
||||||
@@ -191,4 +167,4 @@ export default class DatabaseSettings extends AdminSettings {
|
|||||||
</SettingsGroup>
|
</SettingsGroup>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user