mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
panel edit mode changes
This commit is contained in:
parent
bcf669fab5
commit
a4674ecaa1
@ -70,6 +70,15 @@ export class PanelEditor extends React.Component<PanelEditorProps, any> {
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
onClose = () => {
|
||||||
|
store.dispatch(
|
||||||
|
updateLocation({
|
||||||
|
query: { tab: false, fullscreen: false, edit: false },
|
||||||
|
partial: true,
|
||||||
|
})
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const { location } = store.getState();
|
const { location } = store.getState();
|
||||||
const activeTab = location.query.tab || 'queries';
|
const activeTab = location.query.tab || 'queries';
|
||||||
@ -81,17 +90,23 @@ export class PanelEditor extends React.Component<PanelEditorProps, any> {
|
|||||||
<i className="fa fa-cog" />
|
<i className="fa fa-cog" />
|
||||||
Edit Panel
|
Edit Panel
|
||||||
</h2>
|
</h2>
|
||||||
|
|
||||||
{this.tabs.map(tab => {
|
{this.tabs.map(tab => {
|
||||||
return <TabItem tab={tab} activeTab={activeTab} onClick={this.onChangeTab} key={tab.id} />;
|
return <TabItem tab={tab} activeTab={activeTab} onClick={this.onChangeTab} key={tab.id} />;
|
||||||
})}
|
})}
|
||||||
|
|
||||||
<div className="dashboard-settings__aside-actions">
|
<div className="panel-editor__aside-actions">
|
||||||
<button className="btn btn-inverse" ng-click="ctrl.exitFullscreen();">
|
<a className="btn btn-link" onClick={this.onClose}>
|
||||||
<i className="fa fa-remove" /> Close
|
<i className="fa fa-check" /> Close
|
||||||
</button>
|
</a>
|
||||||
|
<a className="btn btn-link" onClick={this.onClose}>
|
||||||
|
<i className="fa fa-trash" /> Discard
|
||||||
|
</a>
|
||||||
|
<a className="btn btn-link" onClick={this.onClose}>
|
||||||
|
<i className="fa fa-copy" /> Save as master type
|
||||||
|
</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="panel-editor__content">
|
<div className="panel-editor__content">
|
||||||
<CustomScrollbar>
|
<CustomScrollbar>
|
||||||
{activeTab === 'queries' && this.renderQueriesTab()}
|
{activeTab === 'queries' && this.renderQueriesTab()}
|
||||||
@ -111,7 +126,7 @@ interface TabItemParams {
|
|||||||
|
|
||||||
function TabItem({ tab, activeTab, onClick }: TabItemParams) {
|
function TabItem({ tab, activeTab, onClick }: TabItemParams) {
|
||||||
const tabClasses = classNames({
|
const tabClasses = classNames({
|
||||||
'dashboard-settings__nav-item': true,
|
'panel-editor__aside-item': true,
|
||||||
active: activeTab === tab.id,
|
active: activeTab === tab.id,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -54,11 +54,11 @@ export class VizTypePicker extends PureComponent<Props, State> {
|
|||||||
<label className="gf-form-input width-10">{this.props.currentType}</label>
|
<label className="gf-form-input width-10">{this.props.currentType}</label>
|
||||||
<div className="gf-form--grow" />
|
<div className="gf-form--grow" />
|
||||||
<label className="gf-form--has-input-icon">
|
<label className="gf-form--has-input-icon">
|
||||||
<input type="text" className="gf-form-input width-13" value={''} placeholder="" />
|
<input type="text" className="gf-form-input width-13" placeholder="" />
|
||||||
<i className="gf-form-input-icon fa fa-search" />
|
<i className="gf-form-input-icon fa fa-search" />
|
||||||
</label>
|
</label>
|
||||||
<div>
|
<div>
|
||||||
<button className="btn toggle-btn gf-form-btn active">Panel Types</button>
|
<button className="btn toggle-btn gf-form-btn active">Basic Types</button>
|
||||||
<button className="btn toggle-btn gf-form-btn">Master Types</button>
|
<button className="btn toggle-btn gf-form-btn">Master Types</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -108,8 +108,11 @@ export class Graph extends PureComponent<GraphProps> {
|
|||||||
...dynamicOptions,
|
...dynamicOptions,
|
||||||
};
|
};
|
||||||
|
|
||||||
console.log('plot', timeSeries, options);
|
try {
|
||||||
$.plot(this.element, timeSeries, options);
|
$.plot(this.element, timeSeries, options);
|
||||||
|
} catch (err) {
|
||||||
|
console.log('plot error', err);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
.panel-in-fullscreen {
|
.panel-in-fullscreen {
|
||||||
.react-grid-layout {
|
.react-grid-layout {
|
||||||
height: 100% !important;
|
height: calc(100% - 20px) !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.react-grid-item {
|
.react-grid-item {
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
align-content: flex-start;
|
align-content: flex-start;
|
||||||
align-items: flex-start;
|
align-items: flex-start;
|
||||||
margin: 0 0 $panel-margin 0;
|
padding: 0 0 $panel-margin 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.annotation-disabled,
|
.annotation-disabled,
|
||||||
|
@ -1,5 +1,27 @@
|
|||||||
.viz-editor {
|
.panel-in-fullscreen {
|
||||||
height: 100%;
|
.scroll-canvas--dashboard {
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.sidemenu {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.main-view {
|
||||||
|
background: unset;
|
||||||
|
}
|
||||||
|
|
||||||
|
.dashboard-container {
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.submenu-controls {
|
||||||
|
padding: $dashboard-padding $dashboard-padding $panel-margin $dashboard-padding;
|
||||||
|
}
|
||||||
|
|
||||||
|
.panel-editor-container__panel {
|
||||||
|
margin: 0 $dashboard-padding;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.viz-picker {
|
.viz-picker {
|
||||||
@ -66,35 +88,71 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.panel-editor-container__panel {
|
.panel-editor-container__panel {
|
||||||
height: 35%;
|
flex: 1 1 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.panel-editor-container__editor {
|
.panel-editor-container__editor {
|
||||||
height: 65%;
|
|
||||||
margin-top: $panel-margin*2;
|
margin-top: $panel-margin*2;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
|
height: 65%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.panel-editor__content {
|
.panel-editor__content {
|
||||||
flex-grow: 1;
|
flex-grow: 1;
|
||||||
min-width: 0;
|
min-width: 0;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
padding: 0px 0 20px 20px;
|
padding: 0 20px;
|
||||||
max-width: 1100px;
|
max-width: 1100px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.panel-editor__aside {
|
.panel-editor__aside {
|
||||||
padding: 18px 0 0 20px;
|
|
||||||
background: $panel-bg;
|
background: $panel-bg;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.panel-editor__aside-item {
|
||||||
|
padding: 8px 20px;
|
||||||
|
color: $text-color;
|
||||||
|
font-size: $font-size-md;
|
||||||
|
@include left-brand-border;
|
||||||
|
|
||||||
|
&.active {
|
||||||
|
@include left-brand-border-gradient();
|
||||||
|
background: $page-bg;
|
||||||
|
}
|
||||||
|
|
||||||
|
i {
|
||||||
|
width: 23px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.gicon {
|
||||||
|
margin-bottom: 2px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.fa {
|
||||||
|
font-size: 17px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.panel-editor__aside-actions {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
height: 100%;
|
||||||
|
flex-grow: 1;
|
||||||
|
padding: 30px 0 0 0;
|
||||||
|
|
||||||
|
a {
|
||||||
|
text-align: left;
|
||||||
|
padding-left: 20px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.panel-editor__aside-header {
|
.panel-editor__aside-header {
|
||||||
color: $text-muted;
|
color: $text-muted;
|
||||||
font-size: $font-size-h3;
|
font-size: $font-size-h3;
|
||||||
padding-right: 50px;
|
padding: 20px 20px 10px 20px;
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
margin-bottom: $spacer;
|
margin-bottom: $spacer;
|
||||||
|
|
||||||
|
@ -9,18 +9,6 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.panel-in-fullscreen {
|
|
||||||
.scroll-canvas--dashboard {
|
|
||||||
height: 100%;
|
|
||||||
}
|
|
||||||
.sidemenu {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
.main-view {
|
|
||||||
background: unset;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.template-variable {
|
.template-variable {
|
||||||
color: $variable;
|
color: $variable;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user