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
febb9e71
Commit
febb9e71
authored
Jan 17, 2019
by
Torkel Ödegaard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Moved data source and data query types
parent
4fc9d794
Show whitespace changes
Inline
Side-by-side
Showing
22 changed files
with
75 additions
and
53 deletions
+75
-53
packages/grafana-ui/src/types/datasource.ts
+3
-1
packages/grafana-ui/src/types/index.ts
+1
-0
public/app/core/utils/explore.ts
+6
-3
public/app/features/dashboard/dashgrid/DataPanel.tsx
+1
-2
public/app/features/dashboard/panel_editor/QueriesTab.tsx
+2
-1
public/app/features/dashboard/panel_editor/QueryEditorRow.tsx
+1
-1
public/app/features/dashboard/panel_model.ts
+5
-2
public/app/features/explore/Explore.tsx
+19
-14
public/app/features/explore/QueryEditor.tsx
+7
-3
public/app/features/explore/QueryRow.tsx
+11
-7
public/app/features/explore/QueryRows.tsx
+7
-3
public/app/features/explore/state/actionTypes.ts
+2
-3
public/app/features/explore/state/actions.ts
+2
-1
public/app/features/explore/state/reducers.ts
+1
-1
public/app/features/plugins/datasource_srv.ts
+1
-1
public/app/plugins/datasource/loki/components/LokiQueryField.tsx
+1
-1
public/app/plugins/datasource/loki/datasource.ts
+1
-2
public/app/plugins/datasource/loki/language_provider.ts
+1
-1
public/app/plugins/datasource/prometheus/components/PromQueryField.tsx
+1
-1
public/app/plugins/datasource/prometheus/datasource.ts
+1
-1
public/app/types/explore.ts
+1
-3
public/app/types/index.ts
+0
-1
No files found.
p
ublic/app/types/series
.ts
→
p
ackages/grafana-ui/src/types/datasource
.ts
View file @
febb9e71
import
{
TimeSeries
,
TimeRange
,
RawTimeRange
,
PluginExports
,
PluginMeta
}
from
'@grafana/ui/src/types'
;
import
{
TimeRange
,
RawTimeRange
}
from
'./time'
;
import
{
TimeSeries
}
from
'./series'
;
import
{
PluginExports
,
PluginMeta
}
from
'./plugin'
;
export
interface
DataQueryResponse
{
data
:
TimeSeries
[];
...
...
packages/grafana-ui/src/types/index.ts
View file @
febb9e71
...
...
@@ -2,3 +2,4 @@ export * from './series';
export
*
from
'./time'
;
export
*
from
'./panel'
;
export
*
from
'./plugin'
;
export
*
from
'./datasource'
;
public/app/core/utils/explore.ts
View file @
febb9e71
// Libraries
import
_
from
'lodash'
;
import
{
colors
,
RawTimeRange
,
IntervalValues
}
from
'@grafana/ui'
;
// Services & Utils
import
*
as
dateMath
from
'app/core/utils/datemath'
;
import
{
renderUrl
}
from
'app/core/utils/url'
;
import
kbn
from
'app/core/utils/kbn'
;
import
store
from
'app/core/store'
;
import
{
parse
as
parseDate
}
from
'app/core/utils/datemath'
;
import
{
colors
}
from
'@grafana/ui'
;
import
TableModel
,
{
mergeTablesIntoModel
}
from
'app/core/table_model'
;
// Types
import
{
RawTimeRange
,
IntervalValues
,
DataQuery
}
from
'@grafana/ui/src/types'
;
import
TimeSeries
from
'app/core/time_series2'
;
import
TableModel
,
{
mergeTablesIntoModel
}
from
'app/core/table_model'
;
import
{
ExploreUrlState
,
HistoryItem
,
...
...
@@ -17,7 +21,6 @@ import {
QueryIntervals
,
QueryOptions
,
}
from
'app/types/explore'
;
import
{
DataQuery
}
from
'app/types/series'
;
export
const
DEFAULT_RANGE
=
{
from
:
'now-6h'
,
...
...
public/app/features/dashboard/dashgrid/DataPanel.tsx
View file @
febb9e71
...
...
@@ -12,8 +12,7 @@ import { getDatasourceSrv, DatasourceSrv } from 'app/features/plugins/datasource
import
kbn
from
'app/core/utils/kbn'
;
// Types
import
{
DataQueryOptions
,
DataQueryResponse
}
from
'app/types'
;
import
{
TimeRange
,
TimeSeries
,
LoadingState
}
from
'@grafana/ui'
;
import
{
TimeRange
,
TimeSeries
,
LoadingState
,
DataQueryResponse
,
DataQueryOptions
}
from
'@grafana/ui/src/types'
;
const
DEFAULT_PLUGIN_ERROR
=
'Error in plugin'
;
...
...
public/app/features/dashboard/panel_editor/QueriesTab.tsx
View file @
febb9e71
...
...
@@ -18,7 +18,8 @@ import config from 'app/core/config';
// Types
import
{
PanelModel
}
from
'../panel_model'
;
import
{
DashboardModel
}
from
'../dashboard_model'
;
import
{
DataQuery
,
DataSourceSelectItem
}
from
'app/types'
;
import
{
DataQuery
}
from
'@grafana/ui'
;
import
{
DataSourceSelectItem
}
from
'app/types'
;
import
{
PluginHelp
}
from
'app/core/components/PluginHelp/PluginHelp'
;
interface
Props
{
...
...
public/app/features/dashboard/panel_editor/QueryEditorRow.tsx
View file @
febb9e71
...
...
@@ -10,7 +10,7 @@ import { Emitter } from 'app/core/utils/emitter';
// Types
import
{
PanelModel
}
from
'../panel_model'
;
import
{
DataQuery
,
DataSourceApi
}
from
'
app/types/series
'
;
import
{
DataQuery
,
DataSourceApi
}
from
'
@grafana/ui
'
;
interface
Props
{
panel
:
PanelModel
;
...
...
public/app/features/dashboard/panel_model.ts
View file @
febb9e71
import
{
Emitter
}
from
'app/core/utils/emitter'
;
// Libraries
import
_
from
'lodash'
;
// Types
import
{
Emitter
}
from
'app/core/utils/emitter'
;
import
{
PANEL_OPTIONS_KEY_PREFIX
}
from
'app/core/constants'
;
import
{
DataQuery
}
from
'
app
/types'
;
import
{
DataQuery
}
from
'
@grafana/ui/src
/types'
;
export
interface
GridPos
{
x
:
number
;
...
...
public/app/features/explore/Explore.tsx
View file @
febb9e71
// Libraries
import
React
from
'react'
;
import
{
hot
}
from
'react-hot-loader'
;
import
{
connect
}
from
'react-redux'
;
import
_
from
'lodash'
;
import
{
AutoSizer
}
from
'react-virtualized'
;
import
{
RawTimeRange
,
TimeRange
}
from
'@grafana/ui'
;
import
{
DataSourceSelectItem
}
from
'app/types/datasources'
;
import
{
ExploreItemState
,
ExploreUrlState
,
RangeScanner
,
ExploreId
}
from
'app/types/explore'
;
import
{
DataQuery
}
from
'app/types/series'
;
import
{
StoreState
}
from
'app/types'
;
// Services & Utils
import
store
from
'app/core/store'
;
import
{
LAST_USED_DATASOURCE_KEY
,
ensureQueries
,
DEFAULT_RANGE
}
from
'app/core/utils/explore'
;
// Components
import
{
DataSourceSelectItem
}
from
'app/types/datasources'
;
import
{
DataSourcePicker
}
from
'app/core/components/Select/DataSourcePicker'
;
import
{
Emitter
}
from
'app/core/utils/emitter'
;
import
{
Alert
}
from
'./Error'
;
import
ErrorBoundary
from
'./ErrorBoundary'
;
import
GraphContainer
from
'./GraphContainer'
;
import
LogsContainer
from
'./LogsContainer'
;
import
QueryRows
from
'./QueryRows'
;
import
TableContainer
from
'./TableContainer'
;
import
TimePicker
,
{
parseTime
}
from
'./TimePicker'
;
// Actions
import
{
changeDatasource
,
changeSize
,
...
...
@@ -29,13 +35,12 @@ import {
splitOpen
,
}
from
'./state/actions'
;
import
{
Alert
}
from
'./Error'
;
import
ErrorBoundary
from
'./ErrorBoundary'
;
import
GraphContainer
from
'./GraphContainer'
;
import
LogsContainer
from
'./LogsContainer'
;
import
QueryRows
from
'./QueryRows'
;
import
TableContainer
from
'./TableContainer'
;
import
TimePicker
,
{
parseTime
}
from
'./TimePicker'
;
// Types
import
{
RawTimeRange
,
TimeRange
,
DataQuery
}
from
'@grafana/ui'
;
import
{
ExploreItemState
,
ExploreUrlState
,
RangeScanner
,
ExploreId
}
from
'app/types/explore'
;
import
{
StoreState
}
from
'app/types'
;
import
{
LAST_USED_DATASOURCE_KEY
,
ensureQueries
,
DEFAULT_RANGE
}
from
'app/core/utils/explore'
;
import
{
Emitter
}
from
'app/core/utils/emitter'
;
interface
ExploreProps
{
StartPage
?:
any
;
...
...
public/app/features/explore/QueryEditor.tsx
View file @
febb9e71
// Libraries
import
React
,
{
PureComponent
}
from
'react'
;
// Services
import
{
getAngularLoader
,
AngularComponent
}
from
'app/core/services/AngularLoader'
;
import
{
Emitter
}
from
'app/core/utils/emitter'
;
import
{
getIntervals
}
from
'app/core/utils/explore'
;
import
{
DataQuery
}
from
'app/types'
;
import
{
RawTimeRange
}
from
'@grafana/ui'
;
import
{
getTimeSrv
}
from
'app/features/dashboard/time_srv'
;
// Types
import
{
Emitter
}
from
'app/core/utils/emitter'
;
import
{
RawTimeRange
,
DataQuery
}
from
'@grafana/ui'
;
import
'app/features/plugins/plugin_loader'
;
interface
QueryEditorProps
{
...
...
public/app/features/explore/QueryRow.tsx
View file @
febb9e71
// Libraries
import
React
,
{
PureComponent
}
from
'react'
;
import
_
from
'lodash'
;
import
{
hot
}
from
'react-hot-loader'
;
import
{
connect
}
from
'react-redux'
;
import
{
RawTimeRange
}
from
'@grafana/ui'
;
import
_
from
'lodash'
;
import
{
QueryTransaction
,
HistoryItem
,
QueryHint
,
ExploreItemState
,
ExploreId
}
from
'app/types/explore'
;
import
{
Emitter
}
from
'app/core/utils/emitter'
;
import
{
DataQuery
,
StoreState
}
from
'app/types'
;
//
import DefaultQueryField from './QueryField';
//
Components
import
QueryEditor
from
'./QueryEditor'
;
import
QueryTransactionStatus
from
'./QueryTransactionStatus'
;
// Actions
import
{
addQueryRow
,
changeQuery
,
...
...
@@ -20,6 +18,12 @@ import {
runQueries
,
}
from
'./state/actions'
;
// Types
import
{
RawTimeRange
,
DataQuery
}
from
'@grafana/ui'
;
import
{
StoreState
}
from
'app/types'
;
import
{
QueryTransaction
,
HistoryItem
,
QueryHint
,
ExploreItemState
,
ExploreId
}
from
'app/types/explore'
;
import
{
Emitter
}
from
'app/core/utils/emitter'
;
function
getFirstHintFromTransactions
(
transactions
:
QueryTransaction
[]):
QueryHint
{
const
transaction
=
transactions
.
find
(
qt
=>
qt
.
hints
&&
qt
.
hints
.
length
>
0
);
if
(
transaction
)
{
...
...
public/app/features/explore/QueryRows.tsx
View file @
febb9e71
// Libraries
import
React
,
{
PureComponent
}
from
'react'
;
// Components
import
QueryRow
from
'./QueryRow'
;
// Types
import
{
Emitter
}
from
'app/core/utils/emitter'
;
import
{
DataQuery
}
from
'
app
/types'
;
import
{
DataQuery
}
from
'
@grafana/ui/src
/types'
;
import
{
ExploreId
}
from
'app/types/explore'
;
import
QueryRow
from
'./QueryRow'
;
interface
QueryRowsProps
{
className
?:
string
;
exploreEvents
:
Emitter
;
exploreId
:
ExploreId
;
initialQueries
:
DataQuery
[];
}
export
default
class
QueryRows
extends
PureComponent
<
QueryRowsProps
>
{
render
()
{
const
{
className
=
''
,
exploreEvents
,
exploreId
,
initialQueries
}
=
this
.
props
;
...
...
public/app/features/explore/state/actionTypes.ts
View file @
febb9e71
import
{
RawTimeRange
,
TimeRange
}
from
'@grafana/ui'
;
// Types
import
{
Emitter
}
from
'app/core/core'
;
import
{
RawTimeRange
,
TimeRange
,
DataQuery
}
from
'@grafana/ui'
;
import
{
ExploreId
,
ExploreItemState
,
...
...
@@ -10,7 +10,6 @@ import {
QueryTransaction
,
}
from
'app/types/explore'
;
import
{
DataSourceSelectItem
}
from
'app/types/datasources'
;
import
{
DataQuery
}
from
'app/types'
;
export
enum
ActionTypes
{
AddQueryRow
=
'explore/ADD_QUERY_ROW'
,
...
...
public/app/features/explore/state/actions.ts
View file @
febb9e71
...
...
@@ -17,7 +17,8 @@ import {
import
{
updateLocation
}
from
'app/core/actions'
;
import
store
from
'app/core/store'
;
import
{
DataSourceSelectItem
}
from
'app/types/datasources'
;
import
{
DataQuery
,
StoreState
}
from
'app/types'
;
import
{
StoreState
}
from
'app/types'
;
import
{
DataQuery
}
from
'@grafana/ui/src/types'
;
import
{
getDatasourceSrv
}
from
'app/features/plugins/datasource_srv'
;
import
{
ExploreId
,
...
...
public/app/features/explore/state/reducers.ts
View file @
febb9e71
...
...
@@ -5,7 +5,7 @@ import {
ensureQueries
,
}
from
'app/core/utils/explore'
;
import
{
ExploreItemState
,
ExploreState
,
QueryTransaction
}
from
'app/types/explore'
;
import
{
DataQuery
}
from
'
app/types/seri
es'
;
import
{
DataQuery
}
from
'
@grafana/ui/src/typ
es'
;
import
{
Action
,
ActionTypes
}
from
'./actionTypes'
;
...
...
public/app/features/plugins/datasource_srv.ts
View file @
febb9e71
...
...
@@ -4,7 +4,7 @@ import coreModule from 'app/core/core_module';
import
config
from
'app/core/config'
;
import
{
importPluginModule
}
from
'./plugin_loader'
;
import
{
DataSourceApi
}
from
'
app/types/seri
es'
;
import
{
DataSourceApi
}
from
'
@grafana/ui/src/typ
es'
;
import
{
DataSource
,
DataSourceSelectItem
}
from
'app/types'
;
export
class
DatasourceSrv
{
...
...
public/app/plugins/datasource/loki/components/LokiQueryField.tsx
View file @
febb9e71
...
...
@@ -3,6 +3,7 @@ import Cascader from 'rc-cascader';
import
PluginPrism
from
'slate-prism'
;
import
Prism
from
'prismjs'
;
import
{
DataQuery
}
from
'@grafana/ui/src/types'
;
import
{
TypeaheadOutput
}
from
'app/types/explore'
;
// dom also includes Element polyfills
...
...
@@ -10,7 +11,6 @@ import { getNextCharacter, getPreviousCousin } from 'app/features/explore/utils/
import
BracesPlugin
from
'app/features/explore/slate-plugins/braces'
;
import
RunnerPlugin
from
'app/features/explore/slate-plugins/runner'
;
import
QueryField
,
{
TypeaheadInput
,
QueryFieldState
}
from
'app/features/explore/QueryField'
;
import
{
DataQuery
}
from
'app/types'
;
const
PRISM_SYNTAX
=
'promql'
;
...
...
public/app/plugins/datasource/loki/datasource.ts
View file @
febb9e71
...
...
@@ -2,8 +2,7 @@ import _ from 'lodash';
import
*
as
dateMath
from
'app/core/utils/datemath'
;
import
{
LogsStream
,
LogsModel
,
makeSeriesForLogs
}
from
'app/core/logs_model'
;
import
{
DataQuery
}
from
'app/types'
;
import
{
PluginMeta
}
from
'@grafana/ui/src/types'
;
import
{
PluginMeta
,
DataQuery
}
from
'@grafana/ui/src/types'
;
import
{
addLabelToSelector
}
from
'app/plugins/datasource/prometheus/add_label_to_query'
;
import
LanguageProvider
from
'./language_provider'
;
...
...
public/app/plugins/datasource/loki/language_provider.ts
View file @
febb9e71
...
...
@@ -11,7 +11,7 @@ import {
}
from
'app/types/explore'
;
import
{
parseSelector
,
labelRegexp
,
selectorRegexp
}
from
'app/plugins/datasource/prometheus/language_utils'
;
import
syntax
from
'./syntax'
;
import
{
DataQuery
}
from
'
app
/types'
;
import
{
DataQuery
}
from
'
@grafana/ui/src
/types'
;
const
DEFAULT_KEYS
=
[
'job'
,
'namespace'
];
const
EMPTY_SELECTOR
=
'{}'
;
...
...
public/app/plugins/datasource/prometheus/components/PromQueryField.tsx
View file @
febb9e71
...
...
@@ -11,7 +11,7 @@ import { getNextCharacter, getPreviousCousin } from 'app/features/explore/utils/
import
BracesPlugin
from
'app/features/explore/slate-plugins/braces'
;
import
RunnerPlugin
from
'app/features/explore/slate-plugins/runner'
;
import
QueryField
,
{
TypeaheadInput
,
QueryFieldState
}
from
'app/features/explore/QueryField'
;
import
{
DataQuery
}
from
'
app
/types'
;
import
{
DataQuery
}
from
'
@grafana/ui/src
/types'
;
const
HISTOGRAM_GROUP
=
'__histograms__'
;
const
METRIC_MARK
=
'metric'
;
...
...
public/app/plugins/datasource/prometheus/datasource.ts
View file @
febb9e71
...
...
@@ -11,7 +11,7 @@ import { BackendSrv } from 'app/core/services/backend_srv';
import
addLabelToQuery
from
'./add_label_to_query'
;
import
{
getQueryHints
}
from
'./query_hints'
;
import
{
expandRecordingRules
}
from
'./language_utils'
;
import
{
DataQuery
}
from
'
app
/types'
;
import
{
DataQuery
}
from
'
@grafana/ui/src
/types'
;
import
{
ExploreUrlState
}
from
'app/types/explore'
;
export
function
alignRange
(
start
,
end
,
step
)
{
...
...
public/app/types/explore.ts
View file @
febb9e71
import
{
Value
}
from
'slate'
;
import
{
RawTimeRange
,
TimeRange
}
from
'@grafana/ui'
;
import
{
RawTimeRange
,
TimeRange
,
DataQuery
}
from
'@grafana/ui'
;
import
{
Emitter
}
from
'app/core/core'
;
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
{
/**
* The label of this completion item. By default
...
...
public/app/types/index.ts
View file @
febb9e71
...
...
@@ -8,7 +8,6 @@ export * from './acl';
export
*
from
'./apiKeys'
;
export
*
from
'./user'
;
export
*
from
'./datasources'
;
export
*
from
'./series'
;
export
*
from
'./plugins'
;
export
*
from
'./organization'
;
export
*
from
'./appNotifications'
;
...
...
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