|
@@ -1,5 +1,5 @@
|
|
|
import React, { PureComponent } from 'react';
|
|
import React, { PureComponent } from 'react';
|
|
|
-import SimpleDropdown, { KeyValueDropdown } from './SimpleDropdown';
|
|
|
|
|
|
|
+import SimpleDropdown from './SimpleDropdown';
|
|
|
import { TemplateQueryProps } from 'app/types/plugins';
|
|
import { TemplateQueryProps } from 'app/types/plugins';
|
|
|
import { getMetricTypesByService, extractServicesFromMetricDescriptors } from '../functions';
|
|
import { getMetricTypesByService, extractServicesFromMetricDescriptors } from '../functions';
|
|
|
import defaultsDeep from 'lodash/defaultsDeep';
|
|
import defaultsDeep from 'lodash/defaultsDeep';
|
|
@@ -113,7 +113,7 @@ export class StackdriverTemplateQueryComponent extends PureComponent<TemplateQue
|
|
|
return (
|
|
return (
|
|
|
<SimpleDropdown
|
|
<SimpleDropdown
|
|
|
value={this.state.labelKey}
|
|
value={this.state.labelKey}
|
|
|
- options={this.state.labels}
|
|
|
|
|
|
|
+ options={this.state.labels.map(l => ({ value: l, name: l }))}
|
|
|
onValueChange={this.onLabelKeyChange}
|
|
onValueChange={this.onLabelKeyChange}
|
|
|
label="Resource Labels"
|
|
label="Resource Labels"
|
|
|
/>
|
|
/>
|
|
@@ -122,7 +122,7 @@ export class StackdriverTemplateQueryComponent extends PureComponent<TemplateQue
|
|
|
return (
|
|
return (
|
|
|
<SimpleDropdown
|
|
<SimpleDropdown
|
|
|
value={this.state.labelKey}
|
|
value={this.state.labelKey}
|
|
|
- options={this.state.labels}
|
|
|
|
|
|
|
+ options={this.state.labels.map(l => ({ value: l, name: l }))}
|
|
|
onValueChange={this.onLabelKeyChange}
|
|
onValueChange={this.onLabelKeyChange}
|
|
|
label="Metric Labels"
|
|
label="Metric Labels"
|
|
|
/>
|
|
/>
|
|
@@ -136,7 +136,7 @@ export class StackdriverTemplateQueryComponent extends PureComponent<TemplateQue
|
|
|
switch (queryType) {
|
|
switch (queryType) {
|
|
|
case MetricFindQueryTypes.MetricTypes:
|
|
case MetricFindQueryTypes.MetricTypes:
|
|
|
return (
|
|
return (
|
|
|
- <KeyValueDropdown
|
|
|
|
|
|
|
+ <SimpleDropdown
|
|
|
value={this.state.service}
|
|
value={this.state.service}
|
|
|
options={this.state.services}
|
|
options={this.state.services}
|
|
|
onValueChange={this.onServiceChange}
|
|
onValueChange={this.onServiceChange}
|
|
@@ -150,13 +150,13 @@ export class StackdriverTemplateQueryComponent extends PureComponent<TemplateQue
|
|
|
return (
|
|
return (
|
|
|
<React.Fragment>
|
|
<React.Fragment>
|
|
|
{this.state.labels.join(',')}
|
|
{this.state.labels.join(',')}
|
|
|
- <KeyValueDropdown
|
|
|
|
|
|
|
+ <SimpleDropdown
|
|
|
value={this.state.service}
|
|
value={this.state.service}
|
|
|
options={this.state.services}
|
|
options={this.state.services}
|
|
|
onValueChange={this.onServiceChange}
|
|
onValueChange={this.onServiceChange}
|
|
|
label="Services"
|
|
label="Services"
|
|
|
/>
|
|
/>
|
|
|
- <KeyValueDropdown
|
|
|
|
|
|
|
+ <SimpleDropdown
|
|
|
value={this.state.metricType}
|
|
value={this.state.metricType}
|
|
|
options={this.state.metricTypes}
|
|
options={this.state.metricTypes}
|
|
|
onValueChange={this.onMetricTypeChange}
|
|
onValueChange={this.onMetricTypeChange}
|
|
@@ -169,13 +169,13 @@ export class StackdriverTemplateQueryComponent extends PureComponent<TemplateQue
|
|
|
case MetricFindQueryTypes.Aggregations:
|
|
case MetricFindQueryTypes.Aggregations:
|
|
|
return (
|
|
return (
|
|
|
<React.Fragment>
|
|
<React.Fragment>
|
|
|
- <KeyValueDropdown
|
|
|
|
|
|
|
+ <SimpleDropdown
|
|
|
value={this.state.service}
|
|
value={this.state.service}
|
|
|
options={this.state.services}
|
|
options={this.state.services}
|
|
|
onValueChange={this.onServiceChange}
|
|
onValueChange={this.onServiceChange}
|
|
|
label="Services"
|
|
label="Services"
|
|
|
/>
|
|
/>
|
|
|
- <KeyValueDropdown
|
|
|
|
|
|
|
+ <SimpleDropdown
|
|
|
value={this.state.metricType}
|
|
value={this.state.metricType}
|
|
|
options={this.state.metricTypes}
|
|
options={this.state.metricTypes}
|
|
|
onValueChange={this.onMetricTypeChange}
|
|
onValueChange={this.onMetricTypeChange}
|
|
@@ -191,7 +191,7 @@ export class StackdriverTemplateQueryComponent extends PureComponent<TemplateQue
|
|
|
render() {
|
|
render() {
|
|
|
return (
|
|
return (
|
|
|
<React.Fragment>
|
|
<React.Fragment>
|
|
|
- <KeyValueDropdown
|
|
|
|
|
|
|
+ <SimpleDropdown
|
|
|
value={this.state.type}
|
|
value={this.state.type}
|
|
|
options={this.queryTypes}
|
|
options={this.queryTypes}
|
|
|
onValueChange={this.handleQueryTypeChange}
|
|
onValueChange={this.handleQueryTypeChange}
|