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afana/./public/app/plugins/datasource/grafana/components/SearchEditor.tsx","webpack://grafana/./public/app/plugins/datasource/grafana/components/QueryEditor.tsx","webpack://grafana/./public/app/plugins/datasource/grafana/module.ts"],"sourcesContent":["import React, { useEffect, useState } from 'react';\n\nimport { InlineField, Input, InlineFieldRow, CodeEditor } from '@grafana/ui';\nimport { SearchQuery } from 'app/features/search/service';\n\ninterface Props {\n value: SearchQuery;\n onChange: (value: SearchQuery) => void;\n}\n\nexport default function SearchEditor({ value, onChange }: Props) {\n const [json, setJSON] = useState('');\n const [query, setQuery] = useState(value.query ?? '');\n\n useEffect(() => {\n const emptySearchQuery: SearchQuery = {\n query: '*',\n location: '', // general, etc\n ds_uid: '',\n sort: '',\n tags: [],\n kind: [],\n explain: false,\n facet: [{ field: 'kind' }, { field: 'tags' }],\n from: 0,\n limit: 20,\n };\n\n setJSON(JSON.stringify({ ...emptySearchQuery, ...value }, null, 2));\n }, [value]);\n\n const handleSearchBlur = (e: React.FocusEvent) => {\n if (query !== value.query) {\n onChange({ ...value, query });\n }\n };\n\n const handleSearchEnterKey = (e: React.KeyboardEvent) => {\n if (e.key !== 'Enter') {\n return;\n }\n handleSearchBlur(e as any);\n };\n\n const onSaveSearchJSON = (rawSearchJSON: string) => {\n try {\n const searchQuery = JSON.parse(rawSearchJSON) as SearchQuery;\n onChange(searchQuery);\n setQuery(searchQuery.query ?? '');\n } catch (ex) {\n console.log('UNABLE TO parse search', rawSearchJSON, ex);\n }\n };\n\n return (\n <>\n \n \n setQuery(e.currentTarget.value)}\n onKeyDown={handleSearchEnterKey}\n onBlur={handleSearchBlur}\n spellCheck={false}\n />\n \n \n \n \n );\n}\n","import React, { PureComponent } from 'react';\n\nimport {\n QueryEditorProps,\n SelectableValue,\n dataFrameFromJSON,\n rangeUtil,\n DataQueryRequest,\n DataFrame,\n} from '@grafana/data';\nimport { config, getBackendSrv, getDataSourceSrv } from '@grafana/runtime';\nimport { InlineField, Select, Alert, Input, InlineFieldRow } from '@grafana/ui';\nimport { hasAlphaPanels } from 'app/core/config';\nimport { SearchQuery } from 'app/features/search/service';\n\nimport { GrafanaDatasource } from '../datasource';\nimport { defaultQuery, GrafanaQuery, GrafanaQueryType } from '../types';\n\nimport SearchEditor from './SearchEditor';\n\ntype Props = QueryEditorProps;\n\nconst labelWidth = 12;\n\ninterface State {\n channels: Array>;\n channelFields: Record>>;\n folders?: Array>;\n}\n\nexport class QueryEditor extends PureComponent {\n state: State = { channels: [], channelFields: {} };\n\n queryTypes: Array> = [\n {\n label: 'Random Walk',\n value: GrafanaQueryType.RandomWalk,\n description: 'Random signal within the selected time range',\n },\n {\n label: 'Live Measurements',\n value: GrafanaQueryType.LiveMeasurements,\n description: 'Stream real-time measurements from Grafana',\n },\n {\n label: 'List public files',\n value: GrafanaQueryType.List,\n description: 'Show directory listings for public resources',\n },\n ];\n\n constructor(props: Props) {\n super(props);\n\n if (config.featureToggles.panelTitleSearch && hasAlphaPanels) {\n this.queryTypes.push({\n label: 'Search',\n value: GrafanaQueryType.Search,\n description: 'Search for grafana resources',\n });\n }\n }\n\n loadChannelInfo() {\n getBackendSrv()\n .fetch({ url: 'api/live/list' })\n .subscribe({\n next: (v: any) => {\n const channelInfo = v.data?.channels as any[];\n if (channelInfo?.length) {\n const channelFields: Record>> = {};\n const channels: Array> = channelInfo.map((c) => {\n if (c.data) {\n const distinctFields = new Set();\n const frame = dataFrameFromJSON(c.data);\n for (const f of frame.fields) {\n distinctFields.add(f.name);\n }\n channelFields[c.channel] = Array.from(distinctFields).map((n) => ({\n value: n,\n label: n,\n }));\n }\n return {\n value: c.channel,\n label: c.channel + ' [' + c.minute_rate + ' msg/min]',\n };\n });\n\n this.setState({ channelFields, channels });\n }\n },\n });\n }\n\n loadFolderInfo() {\n const query: DataQueryRequest = {\n targets: [{ queryType: GrafanaQueryType.List, refId: 'A' }],\n } as any;\n\n getDataSourceSrv()\n .get('-- Grafana --')\n .then((ds) => {\n const gds = ds as GrafanaDatasource;\n gds.query(query).subscribe({\n next: (rsp) => {\n if (rsp.data.length) {\n const names = (rsp.data[0] as DataFrame).fields[0];\n const folders = names.values.toArray().map((v) => ({\n value: v,\n label: v,\n }));\n this.setState({ folders });\n }\n },\n });\n });\n }\n\n componentDidMount() {\n this.loadChannelInfo();\n }\n\n onQueryTypeChange = (sel: SelectableValue) => {\n const { onChange, query, onRunQuery } = this.props;\n onChange({ ...query, queryType: sel.value! });\n onRunQuery();\n\n // Reload the channel list\n this.loadChannelInfo();\n };\n\n onChannelChange = (sel: SelectableValue) => {\n const { onChange, query, onRunQuery } = this.props;\n onChange({ ...query, channel: sel?.value });\n onRunQuery();\n };\n\n onFieldNamesChange = (item: SelectableValue) => {\n const { onChange, query, onRunQuery } = this.props;\n let fields: string[] = [];\n if (Array.isArray(item)) {\n fields = item.map((v) => v.value);\n } else if (item.value) {\n fields = [item.value];\n }\n\n // When adding the first field, also add time (if it exists)\n if (fields.length === 1 && !query.filter?.fields?.length && query.channel) {\n const names = this.state.channelFields[query.channel] ?? [];\n const tf = names.find((f) => f.value === 'time' || f.value === 'Time');\n if (tf && tf.value && tf.value !== fields[0]) {\n fields = [tf.value, ...fields];\n }\n }\n\n onChange({\n ...query,\n filter: {\n ...query.filter,\n fields,\n },\n });\n onRunQuery();\n };\n\n checkAndUpdateValue = (key: keyof GrafanaQuery, txt: string) => {\n const { onChange, query, onRunQuery } = this.props;\n if (key === 'buffer') {\n let buffer: number | undefined;\n if (txt) {\n try {\n buffer = rangeUtil.intervalToSeconds(txt) * 1000;\n } catch (err) {\n console.warn('ERROR', err);\n }\n }\n onChange({\n ...query,\n buffer,\n });\n } else {\n onChange({\n ...query,\n [key]: txt,\n });\n }\n onRunQuery();\n };\n\n handleEnterKey = (e: React.KeyboardEvent) => {\n if (e.key !== 'Enter') {\n return;\n }\n this.checkAndUpdateValue('buffer', (e.target as any).value);\n };\n\n handleBlur = (e: React.FocusEvent) => {\n this.checkAndUpdateValue('buffer', e.target.value);\n };\n\n renderMeasurementsQuery() {\n let { channel, filter, buffer } = this.props.query;\n let { channels, channelFields } = this.state;\n let currentChannel = channels.find((c) => c.value === channel);\n if (channel && !currentChannel) {\n currentChannel = {\n value: channel,\n label: channel,\n description: `Connected to ${channel}`,\n };\n channels = [currentChannel, ...channels];\n }\n\n const distinctFields = new Set();\n const fields: Array> = channel ? channelFields[channel] ?? [] : [];\n // if (data && data.series?.length) {\n // for (const frame of data.series) {\n // for (const field of frame.fields) {\n // if (distinctFields.has(field.name) || !field.name) {\n // continue;\n // }\n // fields.push({\n // value: field.name,\n // label: field.name,\n // description: `(${getFrameDisplayName(frame)} / ${field.type})`,\n // });\n // distinctFields.add(field.name);\n // }\n // }\n // }\n if (filter?.fields) {\n for (const f of filter.fields) {\n if (!distinctFields.has(f)) {\n fields.push({\n value: f,\n label: `${f} (not loaded)`,\n description: `Configured, but not found in the query results`,\n });\n distinctFields.add(f);\n }\n }\n }\n\n let formattedTime = '';\n if (buffer) {\n formattedTime = rangeUtil.secondsToHms(buffer / 1000);\n }\n\n return (\n <>\n
\n \n `Connect to: ${input}`}\n />\n \n
\n {channel && (\n
\n \n `Field: ${input}`}\n isSearchable={true}\n isMulti={true}\n />\n \n \n \n \n
\n )}\n\n \n This supports real-time event streams in Grafana core. This feature is under heavy development. Expect the\n interfaces and structures to change as this becomes more production ready.\n \n \n );\n }\n\n onFolderChanged = (sel: SelectableValue) => {\n const { onChange, query, onRunQuery } = this.props;\n onChange({ ...query, path: sel?.value });\n onRunQuery();\n };\n\n renderListPublicFiles() {\n let { path } = this.props.query;\n let { folders } = this.state;\n if (!folders) {\n folders = [];\n this.loadFolderInfo();\n }\n const currentFolder = folders.find((f) => f.value === path);\n if (path && !currentFolder) {\n folders = [\n ...folders,\n {\n value: path,\n label: path,\n },\n ];\n }\n\n return (\n \n \n `Folder: ${input}`}\n />\n \n \n );\n }\n\n onSearchChange = (search: SearchQuery) => {\n const { query, onChange, onRunQuery } = this.props;\n\n onChange({\n ...query,\n search,\n });\n onRunQuery();\n };\n\n render() {\n const query = {\n ...defaultQuery,\n ...this.props.query,\n };\n\n const { queryType } = query;\n\n return (\n <>\n {queryType === GrafanaQueryType.Search && (\n \n Using this datasource to call the new search system is experimental, and subject to change at any time\n without notice.\n \n )}\n \n \n v.value === queryType) || this.queryTypes[0]}\n onChange={this.onQueryTypeChange}\n />\n \n \n {queryType === GrafanaQueryType.LiveMeasurements && this.renderMeasurementsQuery()}\n {queryType === GrafanaQueryType.List && this.renderListPublicFiles()}\n {queryType === GrafanaQueryType.Search && (\n \n )}\n \n );\n }\n}\n","import { DataSourcePlugin } from '@grafana/data';\n\nimport { QueryEditor } from './components/QueryEditor';\nimport { GrafanaDatasource } from './datasource';\nimport { GrafanaQuery } from './types';\n\nexport const plugin = new DataSourcePlugin(GrafanaDatasource).setQueryEditor(\n QueryEditor\n);\n"],"names":["SearchEditor","value","onChange","json","setJSON","useState","query","setQuery","useEffect","JSON","stringify","location","ds_uid","sort","tags","kind","explain","facet","field","from","limit","handleSearchBlur","e","onSaveSearchJSON","rawSearchJSON","searchQuery","parse","ex","console","log","InlineFieldRow","InlineField","label","grow","labelWidth","Input","placeholder","currentTarget","onKeyDown","key","onBlur","spellCheck","CodeEditor","height","language","onSave","showMiniMap","showLineNumbers","QueryEditor","PureComponent","constructor","props","super","channels","channelFields","GrafanaQueryType","description","sel","onRunQuery","this","queryType","loadChannelInfo","channel","item","fields","Array","isArray","map","v","length","filter","tf","state","find","f","txt","buffer","rangeUtil","err","warn","checkAndUpdateValue","target","path","search","config","hasAlphaPanels","queryTypes","push","getBackendSrv","fetch","url","subscribe","next","channelInfo","data","c","distinctFields","Set","frame","dataFrameFromJSON","add","name","n","minute_rate","setState","loadFolderInfo","targets","refId","getDataSourceSrv","get","then","ds","rsp","folders","values","toArray","componentDidMount","renderMeasurementsQuery","currentChannel","has","formattedTime","className","Select","options","onChannelChange","allowCustomValue","backspaceRemovesValue","isClearable","noOptionsMessage","formatCreateLabel","input","onFieldNamesChange","isSearchable","isMulti","width","defaultValue","handleEnterKey","handleBlur","Alert","title","severity","renderListPublicFiles","currentFolder","onFolderChanged","render","defaultQuery","onQueryTypeChange","onSearchChange","plugin","DataSourcePlugin","GrafanaDatasource","setQueryEditor"],"sourceRoot":""}