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
0cd89e80
Commit
0cd89e80
authored
Oct 23, 2018
by
David Kaltschmidt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Submit query when enabling result viewer
parent
fbed57ab
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
61 additions
and
6 deletions
+61
-6
public/app/features/explore/Explore.tsx
+57
-4
public/app/types/explore.ts
+4
-2
No files found.
public/app/features/explore/Explore.tsx
View file @
0cd89e80
...
...
@@ -3,7 +3,15 @@ import { hot } from 'react-hot-loader';
import
Select
from
'react-select'
;
import
_
from
'lodash'
;
import
{
ExploreState
,
ExploreUrlState
,
HistoryItem
,
Query
,
QueryTransaction
,
Range
}
from
'app/types/explore'
;
import
{
ExploreState
,
ExploreUrlState
,
HistoryItem
,
Query
,
QueryTransaction
,
Range
,
ResultType
,
}
from
'app/types/explore'
;
import
kbn
from
'app/core/utils/kbn'
;
import
colors
from
'app/core/utils/colors'
;
import
store
from
'app/core/store'
;
...
...
@@ -306,11 +314,41 @@ export class Explore extends React.PureComponent<ExploreProps, ExploreState> {
};
onClickGraphButton
=
()
=>
{
this
.
setState
(
state
=>
({
showingGraph
:
!
state
.
showingGraph
}));
this
.
setState
(
state
=>
{
const
showingGraph
=
!
state
.
showingGraph
;
let
nextQueryTransactions
=
state
.
queryTransactions
;
if
(
!
showingGraph
)
{
// Discard transactions related to Graph query
nextQueryTransactions
=
state
.
queryTransactions
.
filter
(
qt
=>
qt
.
resultType
!==
'Graph'
);
}
return
{
queryTransactions
:
nextQueryTransactions
,
showingGraph
};
},
()
=>
{
if
(
this
.
state
.
showingGraph
)
{
this
.
onSubmit
();
}
}
);
};
onClickLogsButton
=
()
=>
{
this
.
setState
(
state
=>
({
showingLogs
:
!
state
.
showingLogs
}));
this
.
setState
(
state
=>
{
const
showingLogs
=
!
state
.
showingLogs
;
let
nextQueryTransactions
=
state
.
queryTransactions
;
if
(
!
showingLogs
)
{
// Discard transactions related to Logs query
nextQueryTransactions
=
state
.
queryTransactions
.
filter
(
qt
=>
qt
.
resultType
!==
'Logs'
);
}
return
{
queryTransactions
:
nextQueryTransactions
,
showingLogs
};
},
()
=>
{
if
(
this
.
state
.
showingLogs
)
{
this
.
onSubmit
();
}
}
);
};
onClickSplit
=
()
=>
{
...
...
@@ -322,7 +360,22 @@ export class Explore extends React.PureComponent<ExploreProps, ExploreState> {
};
onClickTableButton
=
()
=>
{
this
.
setState
(
state
=>
({
showingTable
:
!
state
.
showingTable
}));
this
.
setState
(
state
=>
{
const
showingTable
=
!
state
.
showingTable
;
let
nextQueryTransactions
=
state
.
queryTransactions
;
if
(
!
showingTable
)
{
// Discard transactions related to Table query
nextQueryTransactions
=
state
.
queryTransactions
.
filter
(
qt
=>
qt
.
resultType
!==
'Table'
);
}
return
{
queryTransactions
:
nextQueryTransactions
,
showingTable
};
},
()
=>
{
if
(
this
.
state
.
showingTable
)
{
this
.
onSubmit
();
}
}
);
};
onClickTableCell
=
(
columnKey
:
string
,
rowValue
:
string
)
=>
{
...
...
public/app/types/explore.ts
View file @
0cd89e80
...
...
@@ -26,8 +26,8 @@ export interface QueryTransaction {
latency
:
number
;
options
:
any
;
query
:
string
;
result
?:
any
;
// Table
/ Timeseries
/ Logs
resultType
:
string
;
result
?:
any
;
// Table
model / Timeseries[]
/ Logs
resultType
:
ResultType
;
rowIndex
:
number
;
}
...
...
@@ -71,3 +71,5 @@ export interface ExploreUrlState {
queries
:
Query
[];
range
:
Range
;
}
export
type
ResultType
=
'Graph'
|
'Logs'
|
'Table'
;
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