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
a69f79ca
Commit
a69f79ca
authored
Jan 18, 2019
by
Torkel Ödegaard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wip: more typings
parent
98fabfae
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
7 deletions
+16
-7
public/app/features/dashboard/panel_model.ts
+0
-2
public/app/plugins/datasource/loki/datasource.ts
+10
-5
public/app/plugins/datasource/loki/types.ts
+6
-0
No files found.
public/app/features/dashboard/panel_model.ts
View file @
a69f79ca
...
...
@@ -243,8 +243,6 @@ export class PanelModel {
addQuery
(
query
?:
Partial
<
DataQuery
>
)
{
query
=
query
||
{
refId
:
'A'
};
query
.
refId
=
this
.
getNextQueryLetter
();
query
.
isNew
=
true
;
this
.
targets
.
push
(
query
);
}
...
...
public/app/plugins/datasource/loki/datasource.ts
View file @
a69f79ca
// Libraries
import
_
from
'lodash'
;
// Services & Utils
import
*
as
dateMath
from
'app/core/utils/datemath'
;
import
{
LogsStream
,
LogsModel
,
makeSeriesForLogs
}
from
'app/core/logs_model'
;
import
{
PluginMeta
,
DataQuery
}
from
'@grafana/ui/src/types'
;
import
{
addLabelToSelector
}
from
'app/plugins/datasource/prometheus/add_label_to_query'
;
import
LanguageProvider
from
'./language_provider'
;
import
{
mergeStreamsToLogs
}
from
'./result_transformer'
;
import
{
formatQuery
,
parseQuery
}
from
'./query_utils'
;
import
{
makeSeriesForLogs
}
from
'app/core/logs_model'
;
// Types
import
{
LogsStream
,
LogsModel
}
from
'app/core/logs_model'
;
import
{
PluginMeta
,
DataQueryOptions
,
DataSourceApi
}
from
'@grafana/ui/src/types'
;
import
{
LokiQuery
}
from
'./types'
;
export
const
DEFAULT_MAX_LINES
=
1000
;
...
...
@@ -27,7 +32,7 @@ function serializeParams(data: any) {
.
join
(
'&'
);
}
export
default
class
LokiDatasource
{
export
default
class
LokiDatasource
implements
DataSourceApi
<
LokiQuery
>
{
languageProvider
:
LanguageProvider
;
maxLines
:
number
;
...
...
@@ -68,7 +73,7 @@ export default class LokiDatasource {
};
}
query
(
options
):
Promise
<
{
data
:
LogsStream
[]
}
>
{
query
(
options
:
DataQueryOptions
<
LokiQuery
>
):
Promise
<
{
data
:
LogsStream
[]
}
>
{
const
queryTargets
=
options
.
targets
.
filter
(
target
=>
target
.
expr
)
.
map
(
target
=>
this
.
prepareQueryTarget
(
target
,
options
));
...
...
public/app/plugins/datasource/loki/types.ts
0 → 100644
View file @
a69f79ca
import
{
DataQuery
}
from
'@grafana/ui/src/types'
;
export
interface
LokiQuery
extends
DataQuery
{
expr
:
string
;
}
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