文件操作 - LokiQueryField.tsx
返回文件管理
返回主菜单
删除本文件
文件: /usr/share/grafana/public/app/plugins/datasource/loki/components/LokiQueryField.tsx
编辑文件内容
import React, { FunctionComponent } from 'react'; import { LokiQueryFieldForm, LokiQueryFieldFormProps } from './LokiQueryFieldForm'; import { useLokiSyntaxAndLabels } from './useLokiSyntaxAndLabels'; import LokiLanguageProvider from '../language_provider'; type LokiQueryFieldProps = Omit< LokiQueryFieldFormProps, 'syntax' | 'syntaxLoaded' | 'onLoadOptions' | 'onLabelsRefresh' | 'logLabelOptions' >; export const LokiQueryField: FunctionComponent<LokiQueryFieldProps> = props => { const { datasource, absoluteRange, ...otherProps } = props; const { isSyntaxReady, setActiveOption, refreshLabels, syntax, logLabelOptions } = useLokiSyntaxAndLabels( datasource.languageProvider as LokiLanguageProvider, absoluteRange ); return ( <LokiQueryFieldForm datasource={datasource} /** * setActiveOption name is intentional. Because of the way rc-cascader requests additional data * https://github.com/react-component/cascader/blob/master/src/Cascader.jsx#L165 * we are notyfing useLokiSyntax hook, what the active option is, and then it's up to the hook logic * to fetch data of options that aren't fetched yet */ onLoadOptions={setActiveOption} onLabelsRefresh={refreshLabels} absoluteRange={absoluteRange} syntax={syntax} syntaxLoaded={isSyntaxReady} logLabelOptions={logLabelOptions} {...otherProps} /> ); }; export default LokiQueryField;
修改文件时间
将文件时间修改为当前时间的前一年
删除文件