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
f02f41c9
Commit
f02f41c9
authored
Jan 12, 2019
by
David Kaltschmidt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move types to types/explore
parent
be172d3e
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
64 additions
and
84 deletions
+64
-84
public/app/features/explore/Explore.tsx
+8
-2
public/app/features/explore/state/actions.ts
+2
-2
public/app/features/explore/state/reducers.ts
+1
-49
public/app/types/explore.ts
+52
-30
public/app/types/index.ts
+1
-1
No files found.
public/app/features/explore/Explore.tsx
View file @
f02f41c9
...
@@ -6,7 +6,14 @@ import { AutoSizer } from 'react-virtualized';
...
@@ -6,7 +6,14 @@ import { AutoSizer } from 'react-virtualized';
import
{
RawTimeRange
,
TimeRange
}
from
'@grafana/ui'
;
import
{
RawTimeRange
,
TimeRange
}
from
'@grafana/ui'
;
import
{
DataSourceSelectItem
}
from
'app/types/datasources'
;
import
{
DataSourceSelectItem
}
from
'app/types/datasources'
;
import
{
ExploreUrlState
,
HistoryItem
,
QueryTransaction
,
RangeScanner
,
ExploreId
}
from
'app/types/explore'
;
import
{
ExploreItemState
,
ExploreUrlState
,
HistoryItem
,
QueryTransaction
,
RangeScanner
,
ExploreId
,
}
from
'app/types/explore'
;
import
{
DataQuery
}
from
'app/types/series'
;
import
{
DataQuery
}
from
'app/types/series'
;
import
{
StoreState
}
from
'app/types'
;
import
{
StoreState
}
from
'app/types'
;
import
store
from
'app/core/store'
;
import
store
from
'app/core/store'
;
...
@@ -37,7 +44,6 @@ import {
...
@@ -37,7 +44,6 @@ import {
scanStart
,
scanStart
,
scanStop
,
scanStop
,
}
from
'./state/actions'
;
}
from
'./state/actions'
;
import
{
ExploreItemState
}
from
'./state/reducers'
;
import
Panel
from
'./Panel'
;
import
Panel
from
'./Panel'
;
import
QueryRows
from
'./QueryRows'
;
import
QueryRows
from
'./QueryRows'
;
...
...
public/app/features/explore/state/actions.ts
View file @
f02f41c9
...
@@ -21,6 +21,8 @@ import { DataQuery, StoreState } from 'app/types';
...
@@ -21,6 +21,8 @@ import { DataQuery, StoreState } from 'app/types';
import
{
getDatasourceSrv
}
from
'app/features/plugins/datasource_srv'
;
import
{
getDatasourceSrv
}
from
'app/features/plugins/datasource_srv'
;
import
{
import
{
ExploreId
,
ExploreId
,
ExploreItemState
,
ExploreUrlState
,
HistoryItem
,
HistoryItem
,
RangeScanner
,
RangeScanner
,
ResultType
,
ResultType
,
...
@@ -28,10 +30,8 @@ import {
...
@@ -28,10 +30,8 @@ import {
QueryTransaction
,
QueryTransaction
,
QueryHint
,
QueryHint
,
QueryHintGetter
,
QueryHintGetter
,
ExploreUrlState
,
}
from
'app/types/explore'
;
}
from
'app/types/explore'
;
import
{
Emitter
}
from
'app/core/core'
;
import
{
Emitter
}
from
'app/core/core'
;
import
{
ExploreItemState
}
from
'./reducers'
;
export
enum
ActionTypes
{
export
enum
ActionTypes
{
AddQueryRow
=
'ADD_QUERY_ROW'
,
AddQueryRow
=
'ADD_QUERY_ROW'
,
...
...
public/app/features/explore/state/reducers.ts
View file @
f02f41c9
import
{
RawTimeRange
,
TimeRange
}
from
'@grafana/ui'
;
import
{
import
{
calculateResultsFromQueryTransactions
,
calculateResultsFromQueryTransactions
,
generateEmptyQuery
,
generateEmptyQuery
,
getIntervals
,
getIntervals
,
ensureQueries
,
ensureQueries
,
}
from
'app/core/utils/explore'
;
}
from
'app/core/utils/explore'
;
import
{
DataSourceSelectItem
}
from
'app/types/datasources'
;
import
{
ExploreItemState
,
ExploreState
,
QueryTransaction
}
from
'app/types/explore'
;
import
{
HistoryItem
,
QueryTransaction
,
QueryIntervals
,
RangeScanner
}
from
'app/types/explore'
;
import
{
DataQuery
}
from
'app/types/series'
;
import
{
DataQuery
}
from
'app/types/series'
;
import
{
Action
,
ActionTypes
}
from
'./actions'
;
import
{
Action
,
ActionTypes
}
from
'./actions'
;
import
{
Emitter
}
from
'app/core/core'
;
import
{
LogsModel
}
from
'app/core/logs_model'
;
import
TableModel
from
'app/core/table_model'
;
// TODO move to types
export
interface
ExploreState
{
split
:
boolean
;
left
:
ExploreItemState
;
right
:
ExploreItemState
;
}
export
interface
ExploreItemState
{
StartPage
?:
any
;
containerWidth
:
number
;
datasourceInstance
:
any
;
datasourceError
:
string
;
datasourceLoading
:
boolean
|
null
;
datasourceMissing
:
boolean
;
eventBridge
?:
Emitter
;
exploreDatasources
:
DataSourceSelectItem
[];
graphResult
?:
any
[];
history
:
HistoryItem
[];
initialDatasource
?:
string
;
initialQueries
:
DataQuery
[];
initialized
:
boolean
;
logsHighlighterExpressions
?:
string
[];
logsResult
?:
LogsModel
;
modifiedQueries
:
DataQuery
[];
queryIntervals
:
QueryIntervals
;
queryTransactions
:
QueryTransaction
[];
requestedDatasourceId
?:
number
;
range
:
TimeRange
|
RawTimeRange
;
scanner
?:
RangeScanner
;
scanning
?:
boolean
;
scanRange
?:
RawTimeRange
;
showingGraph
:
boolean
;
showingLogs
:
boolean
;
showingStartPage
?:
boolean
;
showingTable
:
boolean
;
supportsGraph
:
boolean
|
null
;
supportsLogs
:
boolean
|
null
;
supportsTable
:
boolean
|
null
;
tableResult
?:
TableModel
;
}
export
const
DEFAULT_RANGE
=
{
export
const
DEFAULT_RANGE
=
{
from
:
'now-6h'
,
from
:
'now-6h'
,
...
...
public/app/types/explore.ts
View file @
f02f41c9
import
{
Value
}
from
'slate'
;
import
{
Value
}
from
'slate'
;
import
{
RawTimeRange
,
TimeRange
}
from
'@grafana/ui'
;
import
{
DataQuery
}
from
'./series'
;
import
{
Emitter
}
from
'app/core/core'
;
import
{
RawTimeRange
}
from
'@grafana/ui'
;
import
TableModel
from
'app/core/table_model'
;
import
{
LogsModel
}
from
'app/core/logs_model'
;
import
{
LogsModel
}
from
'app/core/logs_model'
;
import
TableModel
from
'app/core/table_model'
;
import
{
DataSourceSelectItem
}
from
'app/types/datasources'
;
import
{
DataQuery
}
from
'./series'
;
export
interface
CompletionItem
{
export
interface
CompletionItem
{
/**
/**
...
@@ -80,6 +83,52 @@ export enum ExploreId {
...
@@ -80,6 +83,52 @@ export enum ExploreId {
right
=
'right'
,
right
=
'right'
,
}
}
export
interface
ExploreState
{
split
:
boolean
;
left
:
ExploreItemState
;
right
:
ExploreItemState
;
}
export
interface
ExploreItemState
{
StartPage
?:
any
;
containerWidth
:
number
;
datasourceInstance
:
any
;
datasourceError
:
string
;
datasourceLoading
:
boolean
|
null
;
datasourceMissing
:
boolean
;
eventBridge
?:
Emitter
;
exploreDatasources
:
DataSourceSelectItem
[];
graphResult
?:
any
[];
history
:
HistoryItem
[];
initialDatasource
?:
string
;
initialQueries
:
DataQuery
[];
initialized
:
boolean
;
logsHighlighterExpressions
?:
string
[];
logsResult
?:
LogsModel
;
modifiedQueries
:
DataQuery
[];
queryIntervals
:
QueryIntervals
;
queryTransactions
:
QueryTransaction
[];
requestedDatasourceId
?:
number
;
range
:
TimeRange
|
RawTimeRange
;
scanner
?:
RangeScanner
;
scanning
?:
boolean
;
scanRange
?:
RawTimeRange
;
showingGraph
:
boolean
;
showingLogs
:
boolean
;
showingStartPage
?:
boolean
;
showingTable
:
boolean
;
supportsGraph
:
boolean
|
null
;
supportsLogs
:
boolean
|
null
;
supportsTable
:
boolean
|
null
;
tableResult
?:
TableModel
;
}
export
interface
ExploreUrlState
{
datasource
:
string
;
queries
:
any
[];
// Should be a DataQuery, but we're going to strip refIds, so typing makes less sense
range
:
RawTimeRange
;
}
export
interface
HistoryItem
{
export
interface
HistoryItem
{
ts
:
number
;
ts
:
number
;
query
:
DataQuery
;
query
:
DataQuery
;
...
@@ -168,31 +217,4 @@ export interface TextMatch {
...
@@ -168,31 +217,4 @@ export interface TextMatch {
end
:
number
;
end
:
number
;
}
}
export
interface
ExploreState
{
StartPage
?:
any
;
datasource
:
any
;
datasourceError
:
any
;
graphResult
?:
any
[];
history
:
HistoryItem
[];
logsHighlighterExpressions
?:
string
[];
logsResult
?:
LogsModel
;
queryTransactions
:
QueryTransaction
[];
scanning
?:
boolean
;
scanRange
?:
RawTimeRange
;
showingGraph
:
boolean
;
showingLogs
:
boolean
;
showingStartPage
?:
boolean
;
showingTable
:
boolean
;
supportsGraph
:
boolean
|
null
;
supportsLogs
:
boolean
|
null
;
supportsTable
:
boolean
|
null
;
tableResult
?:
TableModel
;
}
export
interface
ExploreUrlState
{
datasource
:
string
;
queries
:
any
[];
// Should be a DataQuery, but we're going to strip refIds, so typing makes less sense
range
:
RawTimeRange
;
}
export
type
ResultType
=
'Graph'
|
'Logs'
|
'Table'
;
export
type
ResultType
=
'Graph'
|
'Logs'
|
'Table'
;
public/app/types/index.ts
View file @
f02f41c9
...
@@ -19,7 +19,7 @@ import {
...
@@ -19,7 +19,7 @@ import {
}
from
'./appNotifications'
;
}
from
'./appNotifications'
;
import
{
DashboardSearchHit
}
from
'./search'
;
import
{
DashboardSearchHit
}
from
'./search'
;
import
{
ValidationEvents
,
ValidationRule
}
from
'./form'
;
import
{
ValidationEvents
,
ValidationRule
}
from
'./form'
;
import
{
ExploreState
}
from
'
app/features/explore/state/reducers
'
;
import
{
ExploreState
}
from
'
./explore
'
;
export
{
export
{
Team
,
Team
,
TeamsState
,
TeamsState
,
...
...
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