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
786df792
Commit
786df792
authored
Jan 02, 2019
by
Erik Sundell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove group name from select component. let the parent set group name instead
parent
03856b4e
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
46 additions
and
20 deletions
+46
-20
public/app/core/angular_wrappers.ts
+0
-1
public/app/core/components/Select/MetricSelect.tsx
+7
-8
public/app/plugins/datasource/stackdriver/query_aggregation_ctrl.ts
+31
-10
public/app/plugins/datasource/stackdriver/query_filter_ctrl.ts
+8
-1
No files found.
public/app/core/angular_wrappers.ts
View file @
786df792
...
@@ -27,7 +27,6 @@ export function registerAngularDirectives() {
...
@@ -27,7 +27,6 @@ export function registerAngularDirectives() {
'isSearchable'
,
'isSearchable'
,
'className'
,
'className'
,
'placeholder'
,
'placeholder'
,
'groupName'
,
[
'variables'
,
{
watchDepth
:
'reference'
}],
[
'variables'
,
{
watchDepth
:
'reference'
}],
]);
]);
}
}
public/app/core/components/Select/MetricSelect.tsx
View file @
786df792
...
@@ -11,7 +11,6 @@ export interface Props {
...
@@ -11,7 +11,6 @@ export interface Props {
value
:
string
;
value
:
string
;
placeholder
?:
string
;
placeholder
?:
string
;
className
?:
string
;
className
?:
string
;
groupName
?:
string
;
variables
?:
Variable
[];
variables
?:
Variable
[];
}
}
...
@@ -23,7 +22,6 @@ export class MetricSelect extends React.Component<Props, State> {
...
@@ -23,7 +22,6 @@ export class MetricSelect extends React.Component<Props, State> {
static
defaultProps
=
{
static
defaultProps
=
{
variables
:
[],
variables
:
[],
options
:
[],
options
:
[],
groupName
:
'Options'
,
};
};
constructor
(
props
)
{
constructor
(
props
)
{
...
@@ -46,15 +44,16 @@ export class MetricSelect extends React.Component<Props, State> {
...
@@ -46,15 +44,16 @@ export class MetricSelect extends React.Component<Props, State> {
return
nextProps
.
value
!==
this
.
props
.
value
||
!
_
.
isEqual
(
nextOptions
,
this
.
state
.
options
);
return
nextProps
.
value
!==
this
.
props
.
value
||
!
_
.
isEqual
(
nextOptions
,
this
.
state
.
options
);
}
}
buildOptions
({
variables
=
[],
groupName
=
''
,
options
})
{
buildOptions
({
variables
=
[],
options
})
{
return
variables
.
length
>
0
return
variables
.
length
>
0
?
[
?
[
this
.
getVariablesGroup
(),
this
.
getVariablesGroup
(),
{
// {
label
:
groupName
,
// label: groupName,
expanded
:
true
,
// expanded: true,
options
,
// options,
},
// },
...
options
,
]
]
:
options
;
:
options
;
}
}
...
...
public/app/plugins/datasource/stackdriver/query_aggregation_ctrl.ts
View file @
786df792
...
@@ -29,10 +29,16 @@ export class StackdriverAggregationCtrl {
...
@@ -29,10 +29,16 @@ export class StackdriverAggregationCtrl {
constructor
(
private
$scope
,
private
templateSrv
)
{
constructor
(
private
$scope
,
private
templateSrv
)
{
this
.
$scope
.
ctrl
=
this
;
this
.
$scope
.
ctrl
=
this
;
this
.
target
=
$scope
.
target
;
this
.
target
=
$scope
.
target
;
this
.
alignmentPeriods
=
alignmentPeriods
.
map
(
ap
=>
({
this
.
alignmentPeriods
=
[
...
ap
,
{
label
:
ap
.
text
,
label
:
'Alignment Periods'
,
}));
expanded
:
true
,
options
:
alignmentPeriods
.
map
(
ap
=>
({
...
ap
,
label
:
ap
.
text
,
})),
},
];
this
.
setAggOptions
();
this
.
setAggOptions
();
this
.
setAlignOptions
();
this
.
setAlignOptions
();
const
self
=
this
;
const
self
=
this
;
...
@@ -46,28 +52,43 @@ export class StackdriverAggregationCtrl {
...
@@ -46,28 +52,43 @@ export class StackdriverAggregationCtrl {
}
}
setAlignOptions
()
{
setAlignOptions
()
{
this
.
alignOptions
=
getAlignmentOptionsByMetric
(
this
.
target
.
valueType
,
this
.
target
.
metricKind
).
map
(
a
=>
({
const
alignOptions
=
getAlignmentOptionsByMetric
(
this
.
target
.
valueType
,
this
.
target
.
metricKind
).
map
(
a
=>
({
...
a
,
...
a
,
label
:
a
.
text
,
label
:
a
.
text
,
}));
}));
if
(
!
this
.
alignOptions
.
find
(
o
=>
o
.
value
===
this
.
templateSrv
.
replace
(
this
.
target
.
aggregation
.
perSeriesAligner
)))
{
if
(
!
alignOptions
.
find
(
o
=>
o
.
value
===
this
.
templateSrv
.
replace
(
this
.
target
.
aggregation
.
perSeriesAligner
)))
{
this
.
target
.
aggregation
.
perSeriesAligner
=
this
.
alignOptions
.
length
>
0
?
this
.
alignOptions
[
0
].
value
:
''
;
this
.
target
.
aggregation
.
perSeriesAligner
=
alignOptions
.
length
>
0
?
alignOptions
[
0
].
value
:
''
;
}
}
this
.
alignOptions
=
[
{
label
:
'Alignment Options'
,
expanded
:
true
,
options
:
alignOptions
,
},
];
}
}
setAggOptions
()
{
setAggOptions
()
{
this
.
aggOptions
=
getAggregationOptionsByMetric
(
this
.
target
.
valueType
,
this
.
target
.
metricKind
).
map
(
a
=>
({
let
aggOptions
=
getAggregationOptionsByMetric
(
this
.
target
.
valueType
,
this
.
target
.
metricKind
).
map
(
a
=>
({
...
a
,
...
a
,
label
:
a
.
text
,
label
:
a
.
text
,
}));
}));
if
(
!
this
.
aggOptions
.
find
(
o
=>
o
.
value
===
this
.
templateSrv
.
replace
(
this
.
target
.
aggregation
.
crossSeriesReducer
)))
{
if
(
!
aggOptions
.
find
(
o
=>
o
.
value
===
this
.
templateSrv
.
replace
(
this
.
target
.
aggregation
.
crossSeriesReducer
)))
{
this
.
deselectAggregationOption
(
'REDUCE_NONE'
);
this
.
deselectAggregationOption
(
'REDUCE_NONE'
);
}
}
if
(
this
.
target
.
aggregation
.
groupBys
.
length
>
0
)
{
if
(
this
.
target
.
aggregation
.
groupBys
.
length
>
0
)
{
this
.
aggOptions
=
this
.
aggOptions
.
filter
(
o
=>
o
.
value
!==
'REDUCE_NONE'
);
aggOptions
=
aggOptions
.
filter
(
o
=>
o
.
value
!==
'REDUCE_NONE'
);
this
.
deselectAggregationOption
(
'REDUCE_NONE'
);
this
.
deselectAggregationOption
(
'REDUCE_NONE'
);
}
}
this
.
aggOptions
=
[
{
label
:
'Aggregation Options'
,
expanded
:
true
,
options
:
aggOptions
,
},
];
}
}
handleAlignmentChange
(
value
)
{
handleAlignmentChange
(
value
)
{
...
...
public/app/plugins/datasource/stackdriver/query_filter_ctrl.ts
View file @
786df792
...
@@ -130,7 +130,14 @@ export class StackdriverFilterCtrl {
...
@@ -130,7 +130,14 @@ export class StackdriverFilterCtrl {
)
{
)
{
this
.
target
.
metricType
=
metricsByService
[
0
].
value
;
this
.
target
.
metricType
=
metricsByService
[
0
].
value
;
}
}
return
metricsByService
;
return
[
{
label
:
'Metrics'
,
expanded
:
true
,
options
:
metricsByService
,
},
];
}
}
async
getLabels
()
{
async
getLabels
()
{
...
...
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