Commit 521c8f34 by Torkel Ödegaard

Moved add query button to the right

parent 4c9046d6
...@@ -111,14 +111,11 @@ export class EditorTabBody extends PureComponent<Props, State> { ...@@ -111,14 +111,11 @@ export class EditorTabBody extends PureComponent<Props, State> {
return ( return (
<> <>
<div className="toolbar"> <div className="toolbar">
<div className="toolbar__heading">{heading}</div> <div className="toolbar__left">
{renderToolbar && renderToolbar()} <div className="toolbar__heading">{heading}</div>
{toolbarItems.length > 0 && ( {renderToolbar && renderToolbar()}
<> </div>
<div className="gf-form--grow" /> {toolbarItems.map(item => this.renderButton(item))}
{toolbarItems.map(item => this.renderButton(item))}
</>
)}
</div> </div>
<div className="panel-editor__scroll"> <div className="panel-editor__scroll">
<CustomScrollbar autoHide={false} scrollTop={scrollTop} setScrollTop={setScrollTop}> <CustomScrollbar autoHide={false} scrollTop={scrollTop} setScrollTop={setScrollTop}>
......
...@@ -18,7 +18,7 @@ import config from 'app/core/config'; ...@@ -18,7 +18,7 @@ import config from 'app/core/config';
// Types // Types
import { PanelModel } from '../panel_model'; import { PanelModel } from '../panel_model';
import { DashboardModel } from '../dashboard_model'; import { DashboardModel } from '../dashboard_model';
import { DataQuery, DataSourceSelectItem } from '@grafana/ui/src/types'; import { DataQuery, DataSourceSelectItem } from '@grafana/ui/src/types';
import { PluginHelp } from 'app/core/components/PluginHelp/PluginHelp'; import { PluginHelp } from 'app/core/components/PluginHelp/PluginHelp';
interface Props { interface Props {
...@@ -133,14 +133,13 @@ export class QueriesTab extends PureComponent<Props, State> { ...@@ -133,14 +133,13 @@ export class QueriesTab extends PureComponent<Props, State> {
return ( return (
<> <>
<DataSourcePicker datasources={this.datasources} onChange={this.onChangeDataSource} current={currentDS} /> <DataSourcePicker datasources={this.datasources} onChange={this.onChangeDataSource} current={currentDS} />
<div className="m-l-2"> <div className="flex-grow" />
{!isAddingMixed && ( {!isAddingMixed && (
<button className="btn navbar-button navbar-button--primary" onClick={this.onAddQueryClick}> <button className="btn navbar-button navbar-button--primary" onClick={this.onAddQueryClick}>
Add Query Add Query
</button> </button>
)} )}
{isAddingMixed && this.renderMixedPicker()} {isAddingMixed && this.renderMixedPicker()}
</div>
</> </>
); );
}; };
......
...@@ -16,6 +16,12 @@ ...@@ -16,6 +16,12 @@
padding-right: 20px; padding-right: 20px;
} }
.toolbar__left {
display: flex;
flex-grow: 1;
align-items: center;
}
.toolbar__main { .toolbar__main {
padding: 0 $input-padding-x; padding: 0 $input-padding-x;
font-size: $font-size-md; font-size: $font-size-md;
......
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