mirror of
https://github.com/grafana/grafana.git
synced 2025-09-29 03:04:12 +08:00

* initial implementation of csv support for test data source * CSV file & content scenarios working * Removing categorical data * fixing handler names * Update pkg/tsdb/testdatasource/csv_data.go Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com> * Update pkg/tsdb/testdatasource/csv_data.go Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com> * Update pkg/tsdb/testdatasource/csv_data.go Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com> * Update pkg/tsdb/testdatasource/csv_data.go Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com> * Update pkg/tsdb/testdatasource/csv_data.go Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com> * Update pkg/tsdb/testdatasource/csv_data.go Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com> * Update pkg/tsdb/testdatasource/csv_data.go Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com> * Fixed lint issues * updated so it uses the same parsing * more CSV tests * lint fixes * more lint * lint * support time field * migrate manual entry to csv * more test output * more test output * missing file Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com> Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
22 lines
603 B
TypeScript
22 lines
603 B
TypeScript
import React, { ChangeEvent } from 'react';
|
|
import { InlineField, TextArea } from '@grafana/ui';
|
|
import { EditorProps } from '../QueryEditor';
|
|
|
|
export const CSVContentEditor = ({ onChange, query }: EditorProps) => {
|
|
const onContent = (e: ChangeEvent<HTMLTextAreaElement>) => {
|
|
onChange({ ...query, csvContent: e.currentTarget.value });
|
|
};
|
|
|
|
return (
|
|
<InlineField label="CSV" labelWidth={14}>
|
|
<TextArea
|
|
width="100%"
|
|
rows={10}
|
|
onBlur={onContent}
|
|
placeholder="CSV content"
|
|
defaultValue={query.csvContent ?? ''}
|
|
/>
|
|
</InlineField>
|
|
);
|
|
};
|