mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
more ux progress
This commit is contained in:
parent
a4674ecaa1
commit
b1b534a005
@ -18,6 +18,7 @@ export const locationReducer = (state = initialState, action: Action): LocationS
|
|||||||
|
|
||||||
if (action.payload.partial) {
|
if (action.payload.partial) {
|
||||||
query = _.defaults(query, state.query);
|
query = _.defaults(query, state.query);
|
||||||
|
query = _.omitBy(query, _.isNull);
|
||||||
}
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import classNames from 'classnames';
|
import classNames from 'classnames';
|
||||||
|
|
||||||
import { PanelModel } from '../panel_model';
|
import { PanelModel } from '../panel_model';
|
||||||
import { DashboardModel } from '../dashboard_model';
|
import { DashboardModel } from '../dashboard_model';
|
||||||
import { store } from 'app/store/configureStore';
|
import { store } from 'app/store/configureStore';
|
||||||
@ -55,7 +56,6 @@ export class PanelEditor extends React.Component<PanelEditorProps, any> {
|
|||||||
return (
|
return (
|
||||||
<div className="viz-editor">
|
<div className="viz-editor">
|
||||||
<VizTypePicker currentType={this.props.panel.type} onTypeChanged={this.props.onTypeChanged} />
|
<VizTypePicker currentType={this.props.panel.type} onTypeChanged={this.props.onTypeChanged} />
|
||||||
<h5 className="page-heading p-t-2">Options</h5>
|
|
||||||
{this.renderPanelOptions()}
|
{this.renderPanelOptions()}
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
@ -73,7 +73,7 @@ export class PanelEditor extends React.Component<PanelEditorProps, any> {
|
|||||||
onClose = () => {
|
onClose = () => {
|
||||||
store.dispatch(
|
store.dispatch(
|
||||||
updateLocation({
|
updateLocation({
|
||||||
query: { tab: false, fullscreen: false, edit: false },
|
query: { tab: null, fullscreen: null, edit: null },
|
||||||
partial: true,
|
partial: true,
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
@ -85,6 +85,11 @@ export class PanelEditor extends React.Component<PanelEditorProps, any> {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="panel-editor-container__editor">
|
<div className="panel-editor-container__editor">
|
||||||
|
<div className="panel-editor-resizer">
|
||||||
|
<div className="panel-editor-resizer__handle">
|
||||||
|
<div className="panel-editor-resizer__handle-dots" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<div className="panel-editor__aside">
|
<div className="panel-editor__aside">
|
||||||
<h2 className="panel-editor__aside-header">
|
<h2 className="panel-editor__aside-header">
|
||||||
<i className="fa fa-cog" />
|
<i className="fa fa-cog" />
|
||||||
|
@ -1,7 +1,9 @@
|
|||||||
import React, { PureComponent } from 'react';
|
import React, { PureComponent } from 'react';
|
||||||
import classNames from 'classnames';
|
import classNames from 'classnames';
|
||||||
|
|
||||||
import config from 'app/core/config';
|
import config from 'app/core/config';
|
||||||
import { PanelPlugin } from 'app/types/plugins';
|
import { PanelPlugin } from 'app/types/plugins';
|
||||||
|
import CustomScrollbar from 'app/core/components/CustomScrollbar/CustomScrollbar';
|
||||||
import _ from 'lodash';
|
import _ from 'lodash';
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
@ -40,30 +42,45 @@ export class VizTypePicker extends PureComponent<Props, State> {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<div key={index} className={cssClass} onClick={() => this.props.onTypeChanged(plugin)} title={plugin.name}>
|
<div key={index} className={cssClass} onClick={() => this.props.onTypeChanged(plugin)} title={plugin.name}>
|
||||||
<img className="viz-picker__item-img" src={plugin.info.logos.small} />
|
|
||||||
<div className="viz-picker__item-name">{plugin.name}</div>
|
<div className="viz-picker__item-name">{plugin.name}</div>
|
||||||
|
<img className="viz-picker__item-img" src={plugin.info.logos.small} />
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
renderFilters() {
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<label className="gf-form--has-input-icon">
|
||||||
|
<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">Basic Types</button>
|
||||||
|
<button className="btn toggle-btn gf-form-btn">Master Types</button>
|
||||||
|
</div>
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
|
const { currentType } = this.props;
|
||||||
|
const { pluginList } = this.state;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="viz-picker">
|
<div className="viz-picker">
|
||||||
<div className="viz-picker__bar">
|
<div className="viz-picker__bar">
|
||||||
<label className="gf-form-label">Visualization</label>
|
<label className="gf-form-label">Visualization</label>
|
||||||
<label className="gf-form-input width-10">{this.props.currentType}</label>
|
<label className="gf-form-input width-10">
|
||||||
<div className="gf-form--grow" />
|
<span>{currentType}</span>
|
||||||
<label className="gf-form--has-input-icon">
|
|
||||||
<input type="text" className="gf-form-input width-13" placeholder="" />
|
|
||||||
<i className="gf-form-input-icon fa fa-search" />
|
|
||||||
</label>
|
</label>
|
||||||
<div>
|
<div className="gf-form--grow" />
|
||||||
<button className="btn toggle-btn gf-form-btn active">Basic Types</button>
|
{this.renderFilters()}
|
||||||
<button className="btn toggle-btn gf-form-btn">Master Types</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="viz-picker__items">{this.state.pluginList.map(this.renderVizPlugin)}</div>
|
<CustomScrollbar>
|
||||||
|
<div className="viz-picker__items">{pluginList.map(this.renderVizPlugin)}</div>
|
||||||
|
</CustomScrollbar>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -24,17 +24,14 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.viz-picker {
|
|
||||||
}
|
|
||||||
|
|
||||||
.viz-picker__search {
|
.viz-picker__search {
|
||||||
flex-grow: 0;
|
flex-grow: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.viz-picker__items {
|
.viz-picker__items {
|
||||||
flex-grow: 1;
|
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-wrap: wrap;
|
// for scrollbar
|
||||||
|
margin-bottom: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.viz-picker__item {
|
.viz-picker__item {
|
||||||
@ -42,16 +39,16 @@
|
|||||||
box-shadow: $card-shadow;
|
box-shadow: $card-shadow;
|
||||||
|
|
||||||
border-radius: 3px;
|
border-radius: 3px;
|
||||||
padding: $spacer;
|
height: 70px;
|
||||||
height: 60px;
|
width: 130px;
|
||||||
width: 157px;
|
flex-shrink: 0;
|
||||||
|
flex-direction: column;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
margin: 0 7px 7px 0;
|
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-shrink: 0;
|
margin-right: 6px;
|
||||||
border: 1px solid transparent;
|
border: 1px solid transparent;
|
||||||
@include left-brand-border;
|
align-items: center;
|
||||||
|
|
||||||
&:hover {
|
&:hover {
|
||||||
background: $card-background-hover;
|
background: $card-background-hover;
|
||||||
@ -68,17 +65,15 @@
|
|||||||
text-overflow: ellipsis;
|
text-overflow: ellipsis;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
font-size: $font-size-h5;
|
font-size: $font-size-sm;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
align-self: center;
|
align-self: center;
|
||||||
padding-left: $spacer;
|
height: 20px;
|
||||||
font-size: $font-size-md;
|
|
||||||
color: $text-muted;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.viz-picker__item-img {
|
.viz-picker__item-img {
|
||||||
height: 100%;
|
height: 40px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.panel-editor-container {
|
.panel-editor-container {
|
||||||
@ -96,6 +91,7 @@
|
|||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
height: 65%;
|
height: 65%;
|
||||||
|
position: relative;
|
||||||
}
|
}
|
||||||
|
|
||||||
.panel-editor__content {
|
.panel-editor__content {
|
||||||
@ -152,9 +148,8 @@
|
|||||||
.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: 20px 20px 10px 20px;
|
padding: 20px 30px 10px 20px;
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
margin-bottom: $spacer;
|
|
||||||
|
|
||||||
i {
|
i {
|
||||||
font-size: 25px;
|
font-size: 25px;
|
||||||
@ -168,3 +163,33 @@
|
|||||||
display: flex;
|
display: flex;
|
||||||
margin-bottom: $spacer;
|
margin-bottom: $spacer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.panel-editor-resizer {
|
||||||
|
position: absolute;
|
||||||
|
height: 2px;
|
||||||
|
width: 100%;
|
||||||
|
top: 1px;
|
||||||
|
padding-left: 32px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.panel-editor-resizer__handle {
|
||||||
|
display: inline-block;
|
||||||
|
width: 100px;
|
||||||
|
position: relative;
|
||||||
|
background: $input-label-bg;
|
||||||
|
top: -12px;
|
||||||
|
border-radius: 2px;
|
||||||
|
box-shadow: 0 0 8px $black;
|
||||||
|
height: 8px;
|
||||||
|
cursor: grabbing;
|
||||||
|
}
|
||||||
|
|
||||||
|
.panel-editor-resizer__handle-dots {
|
||||||
|
border-top: 2px dotted $text-color-faint;
|
||||||
|
position: relative;
|
||||||
|
top: 3px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.panel-editor {
|
||||||
|
height: calc(100% - 10px);
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user