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
26ba7ab5
Unverified
Commit
26ba7ab5
authored
Oct 01, 2020
by
Andrej Ocenas
Committed by
GitHub
Oct 01, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Chore: Remove loki version hack in explore (#27966)
parent
43c389d1
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
4 additions
and
56 deletions
+4
-56
packages/grafana-data/src/types/datasource.ts
+1
-0
public/app/core/utils/explore.ts
+1
-1
public/app/features/explore/state/actionTypes.ts
+0
-1
public/app/features/explore/state/actions.ts
+0
-2
public/app/features/explore/state/reducers.test.ts
+0
-2
public/app/features/explore/state/reducers.ts
+2
-47
public/app/types/explore.ts
+0
-3
No files found.
packages/grafana-data/src/types/datasource.ts
View file @
26ba7ab5
...
...
@@ -331,6 +331,7 @@ export enum DataSourceStatus {
Disconnected
,
}
// TODO: not really needed but used as type in some data sources and in DataQueryRequest
export
enum
ExploreMode
{
Logs
=
'Logs'
,
Metrics
=
'Metrics'
,
...
...
public/app/core/utils/explore.ts
View file @
26ba7ab5
...
...
@@ -155,7 +155,7 @@ export function buildQueryTransaction(
__interval_ms
:
{
text
:
intervalMs
,
value
:
intervalMs
},
},
maxDataPoints
:
queryOptions
.
maxDataPoints
,
exploreMode
:
queryOptions
.
mode
,
exploreMode
:
undefined
,
liveStreaming
:
queryOptions
.
liveStreaming
,
/**
* @deprecated (external API) showingGraph and showingTable are always set to true and set to true
...
...
public/app/features/explore/state/actionTypes.ts
View file @
26ba7ab5
...
...
@@ -128,7 +128,6 @@ export interface SyncTimesPayload {
export
interface
UpdateDatasourceInstancePayload
{
exploreId
:
ExploreId
;
datasourceInstance
:
DataSourceApi
;
version
?:
string
;
}
export
interface
ToggleLogLevelPayload
{
...
...
public/app/features/explore/state/actions.ts
View file @
26ba7ab5
...
...
@@ -123,13 +123,11 @@ export function changeDatasource(
const
currentDataSourceInstance
=
getState
().
explore
[
exploreId
].
datasourceInstance
;
const
queries
=
getState
().
explore
[
exploreId
].
queries
;
const
orgId
=
getState
().
user
.
orgId
;
const
datasourceVersion
=
newDataSourceInstance
.
getVersion
&&
(
await
newDataSourceInstance
.
getVersion
());
dispatch
(
updateDatasourceInstanceAction
({
exploreId
,
datasourceInstance
:
newDataSourceInstance
,
version
:
datasourceVersion
,
})
);
...
...
public/app/features/explore/state/reducers.test.ts
View file @
26ba7ab5
...
...
@@ -2,7 +2,6 @@ import {
DataQuery
,
DataSourceApi
,
dateTime
,
ExploreMode
,
LoadingState
,
RawTimeRange
,
UrlQueryMap
,
...
...
@@ -99,7 +98,6 @@ describe('Explore item reducer', () => {
graphResult
:
null
,
logsResult
:
null
,
tableResult
:
null
,
supportedModes
:
[
ExploreMode
.
Metrics
,
ExploreMode
.
Logs
],
latency
:
0
,
loading
:
false
,
queryResponse
:
createEmptyQueryResponse
(),
...
...
public/app/features/explore/state/reducers.ts
View file @
26ba7ab5
...
...
@@ -3,14 +3,12 @@ import { AnyAction } from 'redux';
import
{
PayloadAction
}
from
'@reduxjs/toolkit'
;
import
{
DataQuery
,
DataSourceApi
,
DefaultTimeRange
,
LoadingState
,
PanelData
,
PanelEvents
,
TimeZone
,
toLegacyResponseData
,
ExploreMode
,
LogsDedupStrategy
,
sortLogsResult
,
DataQueryErrorType
,
...
...
@@ -107,7 +105,6 @@ export const makeExploreItemState = (): ExploreItemState => ({
urlState
:
null
,
update
:
makeInitialUpdateState
(),
latency
:
0
,
supportedModes
:
[],
isLive
:
false
,
isPaused
:
false
,
urlReplaced
:
false
,
...
...
@@ -259,33 +256,14 @@ export const itemReducer = (state: ExploreItemState = makeExploreItemState(), ac
}
if
(
updateDatasourceInstanceAction
.
match
(
action
))
{
const
{
datasourceInstance
,
version
}
=
action
.
payload
;
const
{
datasourceInstance
}
=
action
.
payload
;
// Custom components
stopQueryState
(
state
.
querySubscription
);
let
newMetadata
=
datasourceInstance
.
meta
;
// HACK: Temporary hack for Loki datasource. Can remove when plugin.json structure is changed.
if
(
version
&&
version
.
length
&&
datasourceInstance
.
meta
.
name
===
'Loki'
)
{
const
lokiVersionMetadata
:
Record
<
string
,
{
metrics
:
boolean
}
>
=
{
v0
:
{
metrics
:
false
,
},
v1
:
{
metrics
:
true
,
},
};
newMetadata
=
{
...
newMetadata
,
...
lokiVersionMetadata
[
version
]
};
}
const
updatedDatasourceInstance
=
Object
.
assign
(
datasourceInstance
,
{
meta
:
newMetadata
});
const
supportedModes
=
getModesForDatasource
(
updatedDatasourceInstance
);
return
{
...
state
,
datasourceInstance
:
updatedDatasourceInstance
,
datasourceInstance
,
graphResult
:
null
,
tableResult
:
null
,
logsResult
:
null
,
...
...
@@ -293,7 +271,6 @@ export const itemReducer = (state: ExploreItemState = makeExploreItemState(), ac
queryResponse
:
createEmptyQueryResponse
(),
loading
:
false
,
queryKeys
:
[],
supportedModes
,
originPanelId
:
state
.
urlState
&&
state
.
urlState
.
originPanelId
,
};
}
...
...
@@ -588,28 +565,6 @@ export const updateChildRefreshState = (
};
};
const
getModesForDatasource
=
(
dataSource
:
DataSourceApi
):
ExploreMode
[]
=>
{
const
supportsGraph
=
dataSource
.
meta
.
metrics
;
const
supportsLogs
=
dataSource
.
meta
.
logs
;
const
supportsTracing
=
dataSource
.
meta
.
tracing
;
const
supportedModes
:
ExploreMode
[]
=
[];
if
(
supportsGraph
)
{
supportedModes
.
push
(
ExploreMode
.
Metrics
);
}
if
(
supportsLogs
)
{
supportedModes
.
push
(
ExploreMode
.
Logs
);
}
if
(
supportsTracing
)
{
supportedModes
.
push
(
ExploreMode
.
Tracing
);
}
return
supportedModes
;
};
/**
* Global Explore reducer that handles multiple Explore areas (left and right).
* Actions that have an `exploreId` get routed to the ExploreItemReducer.
...
...
public/app/types/explore.ts
View file @
26ba7ab5
...
...
@@ -14,7 +14,6 @@ import {
AbsoluteTimeRange
,
GraphSeriesXY
,
DataFrame
,
ExploreMode
,
ExploreUrlState
,
}
from
'@grafana/data'
;
...
...
@@ -157,7 +156,6 @@ export interface ExploreItemState {
update
:
ExploreUpdateState
;
latency
:
number
;
supportedModes
:
ExploreMode
[];
/**
* If true, the view is in live tailing mode.
...
...
@@ -197,7 +195,6 @@ export interface QueryOptions {
minInterval
?:
string
;
maxDataPoints
?:
number
;
liveStreaming
?:
boolean
;
mode
?:
ExploreMode
;
}
export
interface
QueryTransaction
{
...
...
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