文件操作 - QueryType.tsx
返回文件管理
返回主菜单
删除本文件
文件: /usr/share/grafana/public/app/plugins/datasource/cloud-monitoring/components/QueryType.tsx
编辑文件内容
import React, { FunctionComponent } from 'react'; import _ from 'lodash'; import { SelectableValue } from '@grafana/data'; import { Segment } from '@grafana/ui'; import { QueryType, queryTypes } from '../types'; export interface Props { value: QueryType; onChange: (slo: QueryType) => void; templateVariableOptions: Array<SelectableValue<string>>; } export const QueryTypeSelector: FunctionComponent<Props> = ({ onChange, value, templateVariableOptions }) => { return ( <div className="gf-form-inline"> <label className="gf-form-label query-keyword width-9">Query Type</label> <Segment value={[...queryTypes, ...templateVariableOptions].find(qt => qt.value === value)} options={[ ...queryTypes, { label: 'Template Variables', options: templateVariableOptions, }, ]} onChange={({ value }: SelectableValue<QueryType>) => onChange(value!)} /> <div className="gf-form gf-form--grow"> <label className="gf-form-label gf-form-label--grow"></label> </div> </div> ); };
修改文件时间
将文件时间修改为当前时间的前一年
删除文件