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
18abd987
Commit
18abd987
authored
Nov 28, 2018
by
Erik Sundell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
prevent explore from crashing when table is not present in response
parent
4eebede9
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
11 deletions
+6
-11
public/app/core/table_model.ts
+2
-3
public/app/features/explore/Explore.tsx
+4
-8
No files found.
public/app/core/table_model.ts
View file @
18abd987
...
@@ -86,11 +86,10 @@ export function mergeTablesIntoModel(dst?: TableModel, ...tables: TableModel[]):
...
@@ -86,11 +86,10 @@ export function mergeTablesIntoModel(dst?: TableModel, ...tables: TableModel[]):
if
(
arguments
.
length
===
1
)
{
if
(
arguments
.
length
===
1
)
{
return
model
;
return
model
;
}
}
// Single query returns data columns and rows as is
// Single query returns data columns and rows as is
if
(
arguments
.
length
===
2
)
{
if
(
arguments
.
length
===
2
)
{
model
.
columns
=
[...
tables
[
0
].
columns
];
model
.
columns
=
tables
[
0
].
hasOwnProperty
(
'columns'
)
?
[...
tables
[
0
].
columns
]
:
[
];
model
.
rows
=
[...
tables
[
0
].
rows
];
model
.
rows
=
tables
[
0
].
hasOwnProperty
(
'rows'
)
?
[...
tables
[
0
].
rows
]
:
[
];
return
model
;
return
model
;
}
}
...
...
public/app/features/explore/Explore.tsx
View file @
18abd987
...
@@ -784,14 +784,10 @@ export class Explore extends React.PureComponent<ExploreProps, ExploreState> {
...
@@ -784,14 +784,10 @@ export class Explore extends React.PureComponent<ExploreProps, ExploreState> {
//Temp solution... How do detect if ds supports table format?
//Temp solution... How do detect if ds supports table format?
let
tableResult
;
let
tableResult
;
try
{
tableResult
=
mergeTablesIntoModel
(
tableResult
=
mergeTablesIntoModel
(
new
TableModel
(),
new
TableModel
(),
...
queryTransactions
.
filter
(
qt
=>
qt
.
resultType
===
'Table'
&&
qt
.
done
&&
qt
.
result
).
map
(
qt
=>
qt
.
result
)
...
queryTransactions
.
filter
(
qt
=>
qt
.
resultType
===
'Table'
&&
qt
.
done
&&
qt
.
result
).
map
(
qt
=>
qt
.
result
)
);
);
}
catch
(
error
)
{
console
.
log
(
error
);
}
const
logsResult
=
const
logsResult
=
datasource
&&
datasource
.
mergeStreams
datasource
&&
datasource
.
mergeStreams
?
datasource
.
mergeStreams
(
?
datasource
.
mergeStreams
(
...
...
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