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() {
|
||||
const { location } = store.getState();
|
||||
const activeTab = location.query.tab || 'queries';
|
||||
@ -81,17 +90,23 @@ export class PanelEditor extends React.Component<PanelEditorProps, any> {
|
||||
<i className="fa fa-cog" />
|
||||
Edit Panel
|
||||
</h2>
|
||||
|
||||
{this.tabs.map(tab => {
|
||||
return <TabItem tab={tab} activeTab={activeTab} onClick={this.onChangeTab} key={tab.id} />;
|
||||
})}
|
||||
|
||||
<div className="dashboard-settings__aside-actions">
|
||||
<button className="btn btn-inverse" ng-click="ctrl.exitFullscreen();">
|
||||
<i className="fa fa-remove" /> Close
|
||||
</button>
|
||||
<div className="panel-editor__aside-actions">
|
||||
<a className="btn btn-link" onClick={this.onClose}>
|
||||
<i className="fa fa-check" /> Close
|
||||
</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 className="panel-editor__content">
|
||||
<CustomScrollbar>
|
||||
{activeTab === 'queries' && this.renderQueriesTab()}
|
||||
@ -111,7 +126,7 @@ interface TabItemParams {
|
||||
|
||||
function TabItem({ tab, activeTab, onClick }: TabItemParams) {
|
||||
const tabClasses = classNames({
|
||||
'dashboard-settings__nav-item': true,
|
||||
'panel-editor__aside-item': true,
|
||||
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>
|
||||
<div className="gf-form--grow" />
|
||||
<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" />
|
||||
</label>
|
||||
<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>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -108,8 +108,11 @@ export class Graph extends PureComponent<GraphProps> {
|
||||
...dynamicOptions,
|
||||
};
|
||||
|
||||
console.log('plot', timeSeries, options);
|
||||
$.plot(this.element, timeSeries, options);
|
||||
try {
|
||||
$.plot(this.element, timeSeries, options);
|
||||
} catch (err) {
|
||||
console.log('plot error', err);
|
||||
}
|
||||
}
|
||||
|
||||
render() {
|
||||
|
@ -3,7 +3,7 @@
|
||||
|
||||
.panel-in-fullscreen {
|
||||
.react-grid-layout {
|
||||
height: 100% !important;
|
||||
height: calc(100% - 20px) !important;
|
||||
}
|
||||
|
||||
.react-grid-item {
|
||||
|
@ -4,7 +4,7 @@
|
||||
flex-wrap: wrap;
|
||||
align-content: flex-start;
|
||||
align-items: flex-start;
|
||||
margin: 0 0 $panel-margin 0;
|
||||
padding: 0 0 $panel-margin 0;
|
||||
}
|
||||
|
||||
.annotation-disabled,
|
||||
|
@ -1,5 +1,27 @@
|
||||
.viz-editor {
|
||||
height: 100%;
|
||||
.panel-in-fullscreen {
|
||||
.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 {
|
||||
@ -66,35 +88,71 @@
|
||||
}
|
||||
|
||||
.panel-editor-container__panel {
|
||||
height: 35%;
|
||||
flex: 1 1 0;
|
||||
}
|
||||
|
||||
.panel-editor-container__editor {
|
||||
height: 65%;
|
||||
margin-top: $panel-margin*2;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
height: 65%;
|
||||
}
|
||||
|
||||
.panel-editor__content {
|
||||
flex-grow: 1;
|
||||
min-width: 0;
|
||||
height: 100%;
|
||||
padding: 0px 0 20px 20px;
|
||||
padding: 0 20px;
|
||||
max-width: 1100px;
|
||||
}
|
||||
|
||||
.panel-editor__aside {
|
||||
padding: 18px 0 0 20px;
|
||||
background: $panel-bg;
|
||||
display: flex;
|
||||
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 {
|
||||
color: $text-muted;
|
||||
font-size: $font-size-h3;
|
||||
padding-right: 50px;
|
||||
padding: 20px 20px 10px 20px;
|
||||
white-space: nowrap;
|
||||
margin-bottom: $spacer;
|
||||
|
||||
|
@ -9,18 +9,6 @@
|
||||
}
|
||||
}
|
||||
|
||||
.panel-in-fullscreen {
|
||||
.scroll-canvas--dashboard {
|
||||
height: 100%;
|
||||
}
|
||||
.sidemenu {
|
||||
display: none;
|
||||
}
|
||||
.main-view {
|
||||
background: unset;
|
||||
}
|
||||
}
|
||||
|
||||
.template-variable {
|
||||
color: $variable;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user