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
37eb7ca6
Commit
37eb7ca6
authored
Nov 07, 2018
by
Torkel Ödegaard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
further refactoring of #13984
parent
a24f6998
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
19 additions
and
12 deletions
+19
-12
public/app/features/dashboard/dashgrid/PanelChrome.tsx
+1
-4
public/app/features/dashboard/dashgrid/PanelHeader/PanelHeader.tsx
+12
-5
public/app/features/dashboard/dashgrid/PanelHeader/PanelHeaderMenu.tsx
+1
-1
public/app/features/dashboard/dashgrid/PanelHeader/PanelHeaderMenuItem.tsx
+5
-1
public/app/features/dashboard/utils/getPanelMenu.ts
+0
-0
public/app/types/panel.ts
+0
-1
No files found.
public/app/features/dashboard/dashgrid/PanelChrome.tsx
View file @
37eb7ca6
...
...
@@ -7,7 +7,6 @@ import { getTimeSrv } from '../time_srv';
// Components
import
{
PanelHeader
}
from
'./PanelHeader/PanelHeader'
;
import
{
DataPanel
}
from
'./DataPanel'
;
import
{
PanelHeaderMenu
}
from
'./PanelHeader/PanelHeaderMenu'
;
// Types
import
{
PanelModel
}
from
'../panel_model'
;
...
...
@@ -79,9 +78,7 @@ export class PanelChrome extends PureComponent<Props, State> {
console
.
log
(
'panelChrome render'
);
return
(
<
div
className=
"panel-container"
>
<
PanelHeader
title=
{
panel
.
title
}
>
<
PanelHeaderMenu
panel=
{
panel
}
dashboard=
{
dashboard
}
/>
</
PanelHeader
>
<
PanelHeader
panel=
{
panel
}
dashboard=
{
dashboard
}
/>
<
div
className=
"panel-content"
>
<
DataPanel
datasource=
{
datasource
}
...
...
public/app/features/dashboard/dashgrid/PanelHeader/PanelHeader.tsx
View file @
37eb7ca6
import
React
,
{
PureComponent
}
from
'react'
;
import
classNames
from
'classnames'
;
interface
Props
{
title
:
string
;
import
{
PanelHeaderMenu
}
from
'./PanelHeaderMenu'
;
import
{
DashboardModel
}
from
'app/features/dashboard/dashboard_model'
;
import
{
PanelModel
}
from
'app/features/dashboard/panel_model'
;
export
interface
Props
{
panel
:
PanelModel
;
dashboard
:
DashboardModel
;
}
export
class
PanelHeader
extends
PureComponent
<
Props
>
{
...
...
@@ -10,7 +16,7 @@ export class PanelHeader extends PureComponent<Props> {
const
isFullscreen
=
false
;
const
isLoading
=
false
;
const
panelHeaderClass
=
classNames
({
'panel-header'
:
true
,
'grid-drag-handle'
:
!
isFullscreen
});
const
{
title
}
=
this
.
props
;
const
{
panel
,
dashboard
}
=
this
.
props
;
return
(
<
div
className=
{
panelHeaderClass
}
>
...
...
@@ -29,10 +35,11 @@ export class PanelHeader extends PureComponent<Props> {
<
div
className=
"panel-title"
>
<
span
className=
"icon-gf panel-alert-icon"
/>
<
span
className=
"panel-title-text"
data
-
toggle=
"dropdown"
>
{
title
}
<
span
className=
"fa fa-caret-down panel-menu-toggle"
/>
{
panel
.
title
}
<
span
className=
"fa fa-caret-down panel-menu-toggle"
/>
</
span
>
{
this
.
props
.
children
}
<
PanelHeaderMenu
panel=
{
panel
}
dashboard=
{
dashboard
}
/>
<
span
className=
"panel-time-info"
>
<
i
className=
"fa fa-clock-o"
/>
4m
</
span
>
...
...
public/app/features/dashboard/dashgrid/PanelHeader/PanelHeaderMenu.tsx
View file @
37eb7ca6
...
...
@@ -2,7 +2,7 @@ import React, { PureComponent } from 'react';
import
{
DashboardModel
}
from
'app/features/dashboard/dashboard_model'
;
import
{
PanelModel
}
from
'app/features/dashboard/panel_model'
;
import
{
PanelHeaderMenuItem
}
from
'./PanelHeaderMenuItem'
;
import
{
getPanelMenu
}
from
'app/features/dashboard/utils/
panel_m
enu'
;
import
{
getPanelMenu
}
from
'app/features/dashboard/utils/
getPanelM
enu'
;
import
{
PanelMenuItem
}
from
'app/types/panel'
;
export
interface
Props
{
...
...
public/app/features/dashboard/dashgrid/PanelHeader/PanelHeaderMenuItem.tsx
View file @
37eb7ca6
import
React
,
{
SFC
}
from
'react'
;
import
{
PanelMenuItem
}
from
'app/types/panel'
;
export
const
PanelHeaderMenuItem
:
SFC
<
PanelMenuItem
>
=
props
=>
{
interface
Props
{
children
:
any
;
}
export
const
PanelHeaderMenuItem
:
SFC
<
Props
&
PanelMenuItem
>
=
props
=>
{
const
isSubMenu
=
props
.
type
===
'submenu'
;
const
isDivider
=
props
.
type
===
'divider'
;
return
isDivider
?
(
...
...
public/app/features/dashboard/utils/
panel_m
enu.ts
→
public/app/features/dashboard/utils/
getPanelM
enu.ts
View file @
37eb7ca6
File moved
public/app/types/panel.ts
View file @
37eb7ca6
...
...
@@ -19,6 +19,5 @@ export interface PanelMenuItem {
iconClassName
?:
string
;
onClick
?:
()
=>
void
;
shortcut
?:
string
;
children
?:
any
;
subMenu
?:
PanelMenuItem
[];
}
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