Commit 1656f03a by Peter Holmberg

cleaned up render

parent 5140325a
...@@ -76,13 +76,22 @@ export class DataSourceSettings extends PureComponent<Props, State> { ...@@ -76,13 +76,22 @@ export class DataSourceSettings extends PureComponent<Props, State> {
return null; return null;
} }
renderIsReadOnlyMessage() {
return (
<div className="grafana-info-box span8">
This datasource was added by config and cannot be modified using the UI. Please contact your server admin to
update this datasource.
</div>
);
}
render() { render() {
const { dataSource, dataSourceMeta, navModel } = this.props; const { dataSource, dataSourceMeta, navModel } = this.props;
return ( return (
<div> <div>
<PageHeader model={navModel} /> <PageHeader model={navModel} />
{Object.keys(dataSource).length === 0 && Object.keys(dataSourceMeta).length === 0 ? ( {Object.keys(dataSource).length === 0 ? (
<PageLoader pageName="Data source settings" /> <PageLoader pageName="Data source settings" />
) : ( ) : (
<div className="page-container page-body"> <div className="page-container page-body">
...@@ -95,14 +104,9 @@ export class DataSourceSettings extends PureComponent<Props, State> { ...@@ -95,14 +104,9 @@ export class DataSourceSettings extends PureComponent<Props, State> {
{this.shouldRenderInfoBox() && <div className="grafana-info-box">{this.getInfoText()}</div>} {this.shouldRenderInfoBox() && <div className="grafana-info-box">{this.getInfoText()}</div>}
{this.isReadOnly() ? ( {this.isReadOnly()
<div className="grafana-info-box span8"> ? this.renderIsReadOnlyMessage()
This datasource was added by config and cannot be modified using the UI. Please contact your server : dataSourceMeta.module && <PluginSettings dataSource={dataSource} dataSourceMeta={dataSourceMeta} />}
admin to update this datasource.
</div>
) : (
dataSourceMeta.module && <PluginSettings dataSource={dataSource} dataSourceMeta={dataSourceMeta} />
)}
<ButtonRow <ButtonRow
onSubmit={event => this.onSubmit(event)} onSubmit={event => this.onSubmit(event)}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment