Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
nexpie-grafana-theme
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Registry
Registry
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kornkitt Poolsup
nexpie-grafana-theme
Commits
b6a5375a
Commit
b6a5375a
authored
Dec 12, 2018
by
Torkel Ödegaard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wip
parent
21e1d7b0
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
11 additions
and
11 deletions
+11
-11
public/app/features/dashboard/dashgrid/VisualizationTab.tsx
+6
-2
public/app/features/dashboard/dashgrid/VizTypePicker.tsx
+0
-1
public/app/features/dashboard/dashgrid/VizTypePickerPlugin.tsx
+4
-7
public/sass/components/_panel_editor.scss
+1
-1
No files found.
public/app/features/dashboard/dashgrid/VisualizationTab.tsx
View file @
b6a5375a
...
@@ -159,7 +159,7 @@ export class VisualizationTab extends PureComponent<Props, State> {
...
@@ -159,7 +159,7 @@ export class VisualizationTab extends PureComponent<Props, State> {
placeholder=
""
placeholder=
""
onChange=
{
this
.
onSearchQueryChange
}
onChange=
{
this
.
onSearchQueryChange
}
value=
{
searchQuery
}
value=
{
searchQuery
}
ref=
{
elem
=>
(
this
.
searchInput
=
elem
)
}
ref=
{
elem
=>
elem
&&
elem
.
focus
(
)
}
/>
/>
<
i
className=
"gf-form-input-icon fa fa-search"
/>
<
i
className=
"gf-form-input-icon fa fa-search"
/>
</
label
>
</
label
>
...
@@ -192,8 +192,12 @@ export class VisualizationTab extends PureComponent<Props, State> {
...
@@ -192,8 +192,12 @@ export class VisualizationTab extends PureComponent<Props, State> {
return
(
return
(
<
EditorTabBody
heading=
"Visualization"
renderToolbar=
{
this
.
renderToolbar
}
toolbarItems=
{
[
panelHelp
]
}
>
<
EditorTabBody
heading=
"Visualization"
renderToolbar=
{
this
.
renderToolbar
}
toolbarItems=
{
[
panelHelp
]
}
>
{
isVizPickerOpen
&&
<
VizTypePicker
current=
{
plugin
}
onTypeChanged=
{
this
.
onTypeChanged
}
searchQuery=
{
searchQuery
}
/>
}
<>
{
isVizPickerOpen
&&
(
<
VizTypePicker
current=
{
plugin
}
onTypeChanged=
{
this
.
onTypeChanged
}
searchQuery=
{
searchQuery
}
/>
)
}
{
this
.
renderPanelOptions
()
}
{
this
.
renderPanelOptions
()
}
</>
</
EditorTabBody
>
</
EditorTabBody
>
);
);
}
}
...
...
public/app/features/dashboard/dashgrid/VizTypePicker.tsx
View file @
b6a5375a
...
@@ -43,7 +43,6 @@ export class VizTypePicker extends PureComponent<Props> {
...
@@ -43,7 +43,6 @@ export class VizTypePicker extends PureComponent<Props> {
key=
{
plugin
.
id
}
key=
{
plugin
.
id
}
isCurrent=
{
isCurrent
}
isCurrent=
{
isCurrent
}
plugin=
{
plugin
}
plugin=
{
plugin
}
isSelected=
{
false
}
onClick=
{
()
=>
onTypeChanged
(
plugin
)
}
onClick=
{
()
=>
onTypeChanged
(
plugin
)
}
/>
/>
);
);
...
...
public/app/features/dashboard/dashgrid/VizTypePickerPlugin.tsx
View file @
b6a5375a
import
React
from
'react'
;
import
React
from
'react'
;
import
classNames
from
'classnames'
;
import
classNames
from
'classnames'
;
import
{
PanelPlugin
}
from
'app/types/plugins'
;
import
{
PanelPlugin
}
from
'app/types/plugins'
;
interface
Props
{
interface
Props
{
isSelected
:
boolean
;
isCurrent
:
boolean
;
isCurrent
:
boolean
;
plugin
:
PanelPlugin
;
plugin
:
PanelPlugin
;
onClick
:
()
=>
void
;
onClick
:
()
=>
void
;
onMouseEnter
:
()
=>
void
;
}
}
const
VizTypePickerPlugin
=
React
.
memo
(
const
VizTypePickerPlugin
=
React
.
memo
(
({
is
Selected
,
isCurrent
,
plugin
,
onClick
,
onMouseEnter
}:
Props
)
=>
{
({
is
Current
,
plugin
,
onClick
}:
Props
)
=>
{
const
cssClass
=
classNames
({
const
cssClass
=
classNames
({
'viz-picker__item'
:
true
,
'viz-picker__item'
:
true
,
'viz-picker__item--selected'
:
isSelected
,
'viz-picker__item--current'
:
isCurrent
,
'viz-picker__item--current'
:
isCurrent
,
});
});
return
(
return
(
<
div
className=
{
cssClass
}
onClick=
{
onClick
}
title=
{
plugin
.
name
}
onMouseEnter=
{
onMouseEnter
}
>
<
div
className=
{
cssClass
}
onClick=
{
onClick
}
title=
{
plugin
.
name
}
>
<
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
}
/>
<
img
className=
"viz-picker__item-img"
src=
{
plugin
.
info
.
logos
.
small
}
/>
</
div
>
</
div
>
);
);
},
},
(
prevProps
,
nextProps
)
=>
{
(
prevProps
,
nextProps
)
=>
{
if
(
prevProps
.
is
Selected
===
nextProps
.
isSelected
&&
prevProps
.
is
Current
===
nextProps
.
isCurrent
)
{
if
(
prevProps
.
isCurrent
===
nextProps
.
isCurrent
)
{
return
true
;
return
true
;
}
}
return
false
;
return
false
;
...
...
public/sass/components/_panel_editor.scss
View file @
b6a5375a
...
@@ -165,7 +165,7 @@
...
@@ -165,7 +165,7 @@
border
:
1px
solid
$orange
;
border
:
1px
solid
$orange
;
}
}
&
--selected
{
&
:hover
{
box-shadow
:
$panel-editor-viz-item-shadow-hover
;
box-shadow
:
$panel-editor-viz-item-shadow-hover
;
background
:
$panel-editor-viz-item-bg-hover
;
background
:
$panel-editor-viz-item-bg-hover
;
border
:
$panel-editor-viz-item-border-hover
;
border
:
$panel-editor-viz-item-border-hover
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment