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
dd388ed5
Commit
dd388ed5
authored
Mar 25, 2019
by
Steven Sheehy
Committed by
David
Mar 25, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(loki): Hide empty labels column
Signed-off-by: Steven Sheehy <ssheehy@firescope.com>
parent
8dfa1f4c
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
8 additions
and
3 deletions
+8
-3
public/app/core/logs_model.ts
+1
-0
public/app/features/explore/LogRow.tsx
+1
-1
public/app/features/explore/Logs.tsx
+3
-2
public/app/plugins/datasource/loki/result_transformer.ts
+3
-0
No files found.
public/app/core/logs_model.ts
View file @
dd388ed5
...
...
@@ -77,6 +77,7 @@ export interface LogsMetaItem {
}
export
interface
LogsModel
{
hasUniqueLabels
:
boolean
;
id
:
string
;
// Identify one logs result from another
meta
?:
LogsMetaItem
[];
rows
:
LogRowModel
[];
...
...
public/app/features/explore/LogRow.tsx
View file @
dd388ed5
...
...
@@ -13,7 +13,7 @@ interface Props {
highlighterExpressions
?:
string
[];
row
:
LogRowModel
;
showDuplicates
:
boolean
;
showLabels
:
boolean
|
null
;
// Tristate: null means auto
showLabels
:
boolean
;
showLocalTime
:
boolean
;
showUtc
:
boolean
;
getRows
:
()
=>
LogRowModel
[];
...
...
public/app/features/explore/Logs.tsx
View file @
dd388ed5
...
...
@@ -169,6 +169,7 @@ export default class Logs extends PureComponent<Props, State> {
const
{
deferLogs
,
renderAll
,
showLabels
,
showLocalTime
,
showUtc
}
=
this
.
state
;
const
{
dedupStrategy
}
=
this
.
props
;
const
hasData
=
data
&&
data
.
rows
&&
data
.
rows
.
length
>
0
;
const
hasLabel
=
hasData
&&
dedupedData
.
hasUniqueLabels
;
const
dedupCount
=
dedupedData
.
rows
.
reduce
((
sum
,
row
)
=>
sum
+
row
.
duplicates
,
0
);
const
showDuplicates
=
dedupStrategy
!==
LogsDedupStrategy
.
none
&&
dedupCount
>
0
;
const
meta
=
[...
data
.
meta
];
...
...
@@ -247,7 +248,7 @@ export default class Logs extends PureComponent<Props, State> {
highlighterExpressions=
{
highlighterExpressions
}
row=
{
row
}
showDuplicates=
{
showDuplicates
}
showLabels=
{
showLabels
}
showLabels=
{
showLabels
&&
hasLabel
}
showLocalTime=
{
showLocalTime
}
showUtc=
{
showUtc
}
onClickLabel=
{
onClickLabel
}
...
...
@@ -262,7 +263,7 @@ export default class Logs extends PureComponent<Props, State> {
getRows=
{
getRows
}
row=
{
row
}
showDuplicates=
{
showDuplicates
}
showLabels=
{
showLabels
}
showLabels=
{
showLabels
&&
hasLabel
}
showLocalTime=
{
showLocalTime
}
showUtc=
{
showUtc
}
onClickLabel=
{
onClickLabel
}
...
...
public/app/plugins/datasource/loki/result_transformer.ts
View file @
dd388ed5
...
...
@@ -175,6 +175,8 @@ export function mergeStreamsToLogs(streams: LogsStream[], limit = DEFAULT_MAX_LI
.
reverse
()
.
value
();
const
hasUniqueLabels
=
sortedRows
&&
sortedRows
.
some
(
row
=>
Object
.
keys
(
row
.
uniqueLabels
).
length
>
0
);
// Meta data to display in status
const
meta
:
LogsMetaItem
[]
=
[];
if
(
_
.
size
(
commonLabels
)
>
0
)
{
...
...
@@ -194,6 +196,7 @@ export function mergeStreamsToLogs(streams: LogsStream[], limit = DEFAULT_MAX_LI
return
{
id
,
hasUniqueLabels
,
meta
,
rows
:
sortedRows
,
};
...
...
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