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
7f4a4794
Commit
7f4a4794
authored
Jan 08, 2019
by
Torkel Ödegaard
Committed by
Johannes Schill
Jan 16, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
POC of page layout component
parent
8fef2138
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
68 additions
and
13 deletions
+68
-13
public/app/core/components/Page/Page.tsx
+26
-0
public/app/core/components/Page/PageContents.tsx
+29
-0
public/app/core/components/PageLoader/PageLoader.tsx
+1
-1
public/app/features/datasources/DataSourcesListPage.tsx
+12
-12
No files found.
public/app/core/components/Page/Page.tsx
0 → 100644
View file @
7f4a4794
// Libraries
import
React
,
{
Component
}
from
'react'
;
// Components
import
PageHeader
from
'../PageHeader/PageHeader'
;
import
PageContents
from
'./PageContents'
;
interface
Props
{
title
:
string
;
children
:
JSX
.
Element
[]
|
JSX
.
Element
;
}
class
Page
extends
Component
<
Props
>
{
static
Header
=
PageHeader
;
static
Contents
=
PageContents
;
render
()
{
return
(
<
div
>
{
this
.
props
.
children
}
</
div
>
);
}
}
export
default
Page
;
public/app/core/components/Page/PageContents.tsx
0 → 100644
View file @
7f4a4794
// Libraries
import
React
,
{
Component
}
from
'react'
;
// Components
import
CustomScrollbar
from
'../CustomScrollbar/CustomScrollbar'
;
import
PageLoader
from
'../PageLoader/PageLoader'
;
interface
Props
{
isLoading
?:
boolean
;
children
:
JSX
.
Element
[]
|
JSX
.
Element
;
}
class
PageContents
extends
Component
<
Props
>
{
render
()
{
const
{
isLoading
}
=
this
.
props
;
return
(
<
div
className=
"page-container page-body"
>
<
CustomScrollbar
>
{
isLoading
&&
<
PageLoader
/>
}
{
this
.
props
.
children
}
</
CustomScrollbar
>
</
div
>
);
}
}
export
default
PageContents
;
public/app/core/components/PageLoader/PageLoader.tsx
View file @
7f4a4794
import
React
,
{
SFC
}
from
'react'
;
interface
Props
{
pageName
:
string
;
pageName
?
:
string
;
}
const
PageLoader
:
SFC
<
Props
>
=
({
pageName
})
=>
{
...
...
public/app/features/datasources/DataSourcesListPage.tsx
View file @
7f4a4794
import
React
,
{
PureComponent
}
from
'react'
;
import
{
connect
}
from
'react-redux'
;
import
{
hot
}
from
'react-hot-loader'
;
import
PageHeader
from
'../../core/components/PageHeader/PageHeader'
;
import
PageLoader
from
'app/core/components/PageLoader/PageLoader'
;
import
OrgActionBar
from
'../../core/components/OrgActionBar/OrgActionBar'
;
import
EmptyListCTA
from
'../../core/components/EmptyListCTA/EmptyListCTA'
;
import
Page
from
'app/core/components/Page/Page'
;
import
OrgActionBar
from
'app/core/components/OrgActionBar/OrgActionBar'
;
import
EmptyListCTA
from
'app/core/components/EmptyListCTA/EmptyListCTA'
;
import
DataSourcesList
from
'./DataSourcesList'
;
import
{
DataSource
,
NavModel
}
from
'app/types'
;
import
{
LayoutMode
}
from
'
../..
/core/components/LayoutSelector/LayoutSelector'
;
import
{
LayoutMode
}
from
'
app
/core/components/LayoutSelector/LayoutSelector'
;
import
{
loadDataSources
,
setDataSourcesLayoutMode
,
setDataSourcesSearchQuery
}
from
'./state/actions'
;
import
{
getNavModel
}
from
'
../..
/core/selectors/navModel'
;
import
{
getNavModel
}
from
'
app
/core/selectors/navModel'
;
import
{
getDataSources
,
getDataSourcesCount
,
...
...
@@ -67,10 +66,10 @@ export class DataSourcesListPage extends PureComponent<Props> {
};
return
(
<
div
>
<
PageHeader
model=
{
navModel
}
/>
<
div
className=
"page-container page-body"
>
{
!
hasFetched
&&
<
PageLoader
pageName=
"Data sources"
/>
}
<
Page
title=
"Data Sources"
>
<
Page
.
Header
model=
{
navModel
}
/>
<
Page
.
Contents
isLoading=
{
!
hasFetched
}
>
<>
{
hasFetched
&&
dataSourcesCount
===
0
&&
<
EmptyListCTA
model=
{
emptyListModel
}
/>
}
{
hasFetched
&&
dataSourcesCount
>
0
&&
[
...
...
@@ -84,8 +83,9 @@ export class DataSourcesListPage extends PureComponent<Props> {
/>,
<
DataSourcesList
dataSources=
{
dataSources
}
layoutMode=
{
layoutMode
}
key=
"list"
/>,
]
}
</
div
>
</
div
>
</>
</
Page
.
Contents
>
</
Page
>
);
}
}
...
...
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