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
d2a54776
Commit
d2a54776
authored
Jan 24, 2019
by
Hugo Häggmark
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed small issue with TimePicker dropdown position
parent
032a82fe
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
12 deletions
+13
-12
public/app/features/explore/Explore.tsx
+3
-0
public/app/features/explore/ExploreToolbar.tsx
+4
-12
public/sass/pages/_explore.scss
+6
-0
No files found.
public/app/features/explore/Explore.tsx
View file @
d2a54776
...
@@ -231,6 +231,8 @@ export class Explore extends React.PureComponent<ExploreProps> {
...
@@ -231,6 +231,8 @@ export class Explore extends React.PureComponent<ExploreProps> {
?
exploreDatasources
.
find
(
d
=>
d
.
name
===
datasourceInstance
.
name
)
?
exploreDatasources
.
find
(
d
=>
d
.
name
===
datasourceInstance
.
name
)
:
undefined
;
:
undefined
;
const
timepicker
=
<
TimePicker
ref=
{
this
.
timepickerRef
}
range=
{
range
}
onChangeTime=
{
this
.
onChangeTime
}
/>;
return
(
return
(
<
div
className=
{
exploreClass
}
ref=
{
this
.
getRef
}
>
<
div
className=
{
exploreClass
}
ref=
{
this
.
getRef
}
>
<
ExploreToolbar
<
ExploreToolbar
...
@@ -241,6 +243,7 @@ export class Explore extends React.PureComponent<ExploreProps> {
...
@@ -241,6 +243,7 @@ export class Explore extends React.PureComponent<ExploreProps> {
range=
{
range
}
range=
{
range
}
selectedDatasource=
{
selectedDatasource
}
selectedDatasource=
{
selectedDatasource
}
splitted=
{
split
}
splitted=
{
split
}
timepicker=
{
timepicker
}
onChangeDatasource=
{
this
.
onChangeDatasource
}
onChangeDatasource=
{
this
.
onChangeDatasource
}
onClearAll=
{
this
.
onClickClear
}
onClearAll=
{
this
.
onClickClear
}
onCloseSplit=
{
this
.
onClickCloseSplit
}
onCloseSplit=
{
this
.
onClickCloseSplit
}
...
...
public/app/features/explore/ExploreToolbar.tsx
View file @
d2a54776
import
React
,
{
PureComponent
}
from
'react'
;
import
React
,
{
PureComponent
}
from
'react'
;
import
{
ExploreId
}
from
'app/types/explore'
;
import
{
ExploreId
}
from
'app/types/explore'
;
import
{
DataSourceSelectItem
,
RawTimeRange
,
TimeRange
}
from
'@grafana/ui'
;
import
{
DataSourceSelectItem
,
RawTimeRange
,
TimeRange
}
from
'@grafana/ui'
;
import
TimePicker
from
'./TimePicker'
;
import
{
DataSourcePicker
}
from
'app/core/components/Select/DataSourcePicker'
;
import
{
DataSourcePicker
}
from
'app/core/components/Select/DataSourcePicker'
;
interface
Props
{
interface
Props
{
...
@@ -12,6 +11,7 @@ interface Props {
...
@@ -12,6 +11,7 @@ interface Props {
range
:
RawTimeRange
;
range
:
RawTimeRange
;
selectedDatasource
:
DataSourceSelectItem
;
selectedDatasource
:
DataSourceSelectItem
;
splitted
:
boolean
;
splitted
:
boolean
;
timepicker
:
JSX
.
Element
;
onChangeDatasource
:
(
option
)
=>
void
;
onChangeDatasource
:
(
option
)
=>
void
;
onClearAll
:
()
=>
void
;
onClearAll
:
()
=>
void
;
onCloseSplit
:
()
=>
void
;
onCloseSplit
:
()
=>
void
;
...
@@ -56,22 +56,16 @@ const createSplittedClassName = (options: { splitted: boolean; className: string
...
@@ -56,22 +56,16 @@ const createSplittedClassName = (options: { splitted: boolean; className: string
};
};
export
class
ExploreToolbar
extends
PureComponent
<
Props
,
{}
>
{
export
class
ExploreToolbar
extends
PureComponent
<
Props
,
{}
>
{
/**
* Timepicker to control scanning
*/
timepickerRef
:
React
.
RefObject
<
TimePicker
>
;
constructor
(
props
)
{
constructor
(
props
)
{
super
(
props
);
super
(
props
);
this
.
timepickerRef
=
React
.
createRef
();
}
}
render
()
{
render
()
{
const
{
datasourceMissing
,
exploreId
,
loading
,
range
,
splitted
}
=
this
.
props
;
const
{
datasourceMissing
,
exploreId
,
loading
,
splitted
,
timepicker
}
=
this
.
props
;
const
toolbar
=
createSplittedClassName
({
splitted
,
className
:
'toolbar'
});
const
toolbar
=
createSplittedClassName
({
splitted
,
className
:
'toolbar'
});
const
toolbarItem
=
createSplittedClassName
({
splitted
,
className
:
'toolbar-item'
});
const
toolbarItem
=
createSplittedClassName
({
splitted
,
className
:
'toolbar-item'
});
const
toolbarHeader
=
createSplittedClassName
({
splitted
,
className
:
'toolbar-header'
});
const
toolbarHeader
=
createSplittedClassName
({
splitted
,
className
:
'toolbar-header'
});
const
timepicker
=
createSplittedClassName
({
splitted
,
className
:
'toolbar-content-item timepicker'
});
const
timepicker
Classes
=
createSplittedClassName
({
splitted
,
className
:
'toolbar-content-item timepicker'
});
return
(
return
(
<
div
className=
{
toolbar
}
>
<
div
className=
{
toolbar
}
>
...
@@ -121,9 +115,7 @@ export class ExploreToolbar extends PureComponent<Props, {}> {
...
@@ -121,9 +115,7 @@ export class ExploreToolbar extends PureComponent<Props, {}> {
})
}
})
}
</
div
>
</
div
>
)
:
null
}
)
:
null
}
<
div
className=
{
timepicker
}
>
<
div
className=
{
timepickerClasses
}
>
{
timepicker
}
</
div
>
<
TimePicker
ref=
{
this
.
timepickerRef
}
range=
{
range
}
onChangeTime=
{
this
.
props
.
onChangeTime
}
/>
</
div
>
<
div
className=
"toolbar-content-item"
>
<
div
className=
"toolbar-content-item"
>
<
button
className=
"btn navbar-button navbar-button--no-icon"
onClick=
{
this
.
props
.
onClearAll
}
>
<
button
className=
"btn navbar-button navbar-button--no-icon"
onClick=
{
this
.
props
.
onClearAll
}
>
Clear All
Clear All
...
...
public/sass/pages/_explore.scss
View file @
d2a54776
...
@@ -2,6 +2,7 @@
...
@@ -2,6 +2,7 @@
display
:
none
;
display
:
none
;
}
}
.timepicker-splitted
,
.timepicker
{
.timepicker
{
display
:
flex
;
display
:
flex
;
}
}
...
@@ -32,6 +33,10 @@
...
@@ -32,6 +33,10 @@
justify-content
:
space-between
;
justify-content
:
space-between
;
height
:
auto
;
height
:
auto
;
padding
:
0px
$dashboard-padding
;
padding
:
0px
$dashboard-padding
;
border-bottom
:
1px
solid
#0000
;
transition-duration
:
0
.35s
;
transition-timing-function
:
ease-in-out
;
transition-property
:
box-shadow
,
border-bottom
;
}
}
.toolbar
{
.toolbar
{
...
@@ -44,6 +49,7 @@
...
@@ -44,6 +49,7 @@
.toolbar-item-splitted
,
.toolbar-item-splitted
,
.toolbar-item
{
.toolbar-item
{
position
:
relative
;
align-self
:
center
;
align-self
:
center
;
}
}
...
...
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