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
f43735ac
Unverified
Commit
f43735ac
authored
Aug 07, 2018
by
David
Committed by
GitHub
Aug 07, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #12813 from grafana/davkal/explore-empty-results
Explore: show message if queries did not return data
parents
0f94d2f5
f1c1633d
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
33 additions
and
7 deletions
+33
-7
public/app/containers/Explore/Explore.tsx
+5
-4
public/app/containers/Explore/Graph.tsx
+8
-1
public/app/containers/Explore/Logs.tsx
+1
-0
public/app/containers/Explore/Table.tsx
+19
-2
No files found.
public/app/containers/Explore/Explore.tsx
View file @
f43735ac
...
@@ -513,21 +513,22 @@ export class Explore extends React.Component<any, IExploreState> {
...
@@ -513,21 +513,22 @@ export class Explore extends React.Component<any, IExploreState> {
onExecuteQuery=
{
this
.
handleSubmit
}
onExecuteQuery=
{
this
.
handleSubmit
}
onRemoveQueryRow=
{
this
.
handleRemoveQueryRow
}
onRemoveQueryRow=
{
this
.
handleRemoveQueryRow
}
/>
/>
{
queryError
?
<
div
className=
"text-warning m-a-2"
>
{
queryError
}
</
div
>
:
null
}
{
queryError
&&
!
loading
?
<
div
className=
"text-warning m-a-2"
>
{
queryError
}
</
div
>
:
null
}
<
main
className=
"m-t-2"
>
<
main
className=
"m-t-2"
>
{
supportsGraph
&&
showingGraph
?
(
{
supportsGraph
&&
showingGraph
?
(
<
Graph
<
Graph
data=
{
graphResult
}
data=
{
graphResult
}
height=
{
graphHeight
}
loading=
{
loading
}
id=
{
`explore-graph-${position}`
}
id=
{
`explore-graph-${position}`
}
options=
{
requestOptions
}
options=
{
requestOptions
}
height=
{
graphHeight
}
split=
{
split
}
split=
{
split
}
/>
/>
)
:
null
}
)
:
null
}
{
supportsTable
&&
showingTable
?
(
{
supportsTable
&&
showingTable
?
(
<
Table
data=
{
tableResult
}
onClickCell=
{
this
.
onClickTableCell
}
className=
"m-t-3"
/>
<
Table
className=
"m-t-3"
data=
{
tableResult
}
loading=
{
loading
}
onClickCell=
{
this
.
onClickTableCell
}
/>
)
:
null
}
)
:
null
}
{
supportsLogs
&&
showingLogs
?
<
Logs
data=
{
logsResult
}
/>
:
null
}
{
supportsLogs
&&
showingLogs
?
<
Logs
data=
{
logsResult
}
loading=
{
loading
}
/>
:
null
}
</
main
>
</
main
>
</
div
>
</
div
>
)
:
null
}
)
:
null
}
...
...
public/app/containers/Explore/Graph.tsx
View file @
f43735ac
...
@@ -123,7 +123,14 @@ class Graph extends Component<any, any> {
...
@@ -123,7 +123,14 @@ class Graph extends Component<any, any> {
}
}
render
()
{
render
()
{
const
{
data
,
height
}
=
this
.
props
;
const
{
data
,
height
,
loading
}
=
this
.
props
;
if
(
!
loading
&&
data
&&
data
.
length
===
0
)
{
return
(
<
div
className=
"panel-container"
>
<
div
className=
"muted m-a-1"
>
The queries returned no time series to graph.
</
div
>
</
div
>
);
}
return
(
return
(
<
div
className=
"panel-container"
>
<
div
className=
"panel-container"
>
<
div
id=
{
this
.
props
.
id
}
className=
"explore-graph"
style=
{
{
height
}
}
/>
<
div
id=
{
this
.
props
.
id
}
className=
"explore-graph"
style=
{
{
height
}
}
/>
...
...
public/app/containers/Explore/Logs.tsx
View file @
f43735ac
...
@@ -5,6 +5,7 @@ import { LogsModel, LogRow } from 'app/core/logs_model';
...
@@ -5,6 +5,7 @@ import { LogsModel, LogRow } from 'app/core/logs_model';
interface
LogsProps
{
interface
LogsProps
{
className
?:
string
;
className
?:
string
;
data
:
LogsModel
;
data
:
LogsModel
;
loading
:
boolean
;
}
}
const
EXAMPLE_QUERY
=
'{job="default/prometheus"}'
;
const
EXAMPLE_QUERY
=
'{job="default/prometheus"}'
;
...
...
public/app/containers/Explore/Table.tsx
View file @
f43735ac
...
@@ -6,6 +6,7 @@ const EMPTY_TABLE = new TableModel();
...
@@ -6,6 +6,7 @@ const EMPTY_TABLE = new TableModel();
interface
TableProps
{
interface
TableProps
{
className
?:
string
;
className
?:
string
;
data
:
TableModel
;
data
:
TableModel
;
loading
:
boolean
;
onClickCell
?:
(
columnKey
:
string
,
rowValue
:
string
)
=>
void
;
onClickCell
?:
(
columnKey
:
string
,
rowValue
:
string
)
=>
void
;
}
}
...
@@ -38,8 +39,24 @@ function Cell(props: SFCCellProps) {
...
@@ -38,8 +39,24 @@ function Cell(props: SFCCellProps) {
export
default
class
Table
extends
PureComponent
<
TableProps
,
{}
>
{
export
default
class
Table
extends
PureComponent
<
TableProps
,
{}
>
{
render
()
{
render
()
{
const
{
className
=
''
,
data
,
onClickCell
}
=
this
.
props
;
const
{
className
=
''
,
data
,
loading
,
onClickCell
}
=
this
.
props
;
const
tableModel
=
data
||
EMPTY_TABLE
;
let
tableModel
=
data
||
EMPTY_TABLE
;
if
(
!
loading
&&
data
&&
data
.
rows
.
length
===
0
)
{
return
(
<
table
className=
{
`${className} filter-table`
}
>
<
thead
>
<
tr
>
<
th
>
Table
</
th
>
</
tr
>
</
thead
>
<
tbody
>
<
tr
>
<
td
className=
"muted"
>
The queries returned no data for a table.
</
td
>
</
tr
>
</
tbody
>
</
table
>
);
}
return
(
return
(
<
table
className=
{
`${className} filter-table`
}
>
<
table
className=
{
`${className} filter-table`
}
>
<
thead
>
<
thead
>
...
...
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