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plugins/parca/external amd \"@grafana/data\"","webpack://@grafana-plugins/parca/external amd \"@grafana/runtime\"","webpack://@grafana-plugins/parca/external amd \"@grafana/ui\"","webpack://@grafana-plugins/parca/external amd \"lodash\"","webpack://@grafana-plugins/parca/external amd \"react\"","webpack://@grafana-plugins/parca/external amd \"rxjs\"","webpack://@grafana-plugins/parca/webpack/bootstrap","webpack://@grafana-plugins/parca/webpack/runtime/compat get default export","webpack://@grafana-plugins/parca/webpack/runtime/define property getters","webpack://@grafana-plugins/parca/webpack/runtime/hasOwnProperty shorthand","webpack://@grafana-plugins/parca/webpack/runtime/make namespace object","webpack://@grafana-plugins/parca/../../../../../node_modules/react-use/esm/useEffectOnce.js","webpack://@grafana-plugins/parca/../../../../../node_modules/react-use/esm/useMount.js","webpack://@grafana-plugins/parca/./QueryEditor/Stack.tsx","webpack://@grafana-plugins/parca/./QueryEditor/EditorRow.tsx","webpack://@grafana-plugins/parca/./QueryEditor/EditorRows.tsx","webpack://@grafana-plugins/parca/./lang/index.ts","webpack://@grafana-plugins/parca/./lang/lang.ts","webpack://@grafana-plugins/parca/./QueryEditor/autocomplete.ts","webpack://@grafana-plugins/parca/./QueryEditor/LabelsEditor.tsx","webpack://@grafana-plugins/parca/../../../../../node_modules/react-use/esm/useLatest.js","webpack://@grafana-plugins/parca/../../../../../node_modules/react-use/esm/useToggle.js","webpack://@grafana-plugins/parca/./QueryEditor/QueryOptions.tsx","webpack://@grafana-plugins/parca/./QueryEditor/QueryEditor.tsx","webpack://@grafana-plugins/parca/./dataquery.gen.ts","webpack://@grafana-plugins/parca/./datasource.ts","webpack://@grafana-plugins/parca/./module.ts","webpack://@grafana-plugins/parca/./ConfigEditor.tsx"],"sourcesContent":["module.exports = __WEBPACK_EXTERNAL_MODULE__89__;","module.exports = __WEBPACK_EXTERNAL_MODULE__781__;","module.exports = __WEBPACK_EXTERNAL_MODULE__531__;","module.exports = __WEBPACK_EXTERNAL_MODULE__7__;","module.exports = __WEBPACK_EXTERNAL_MODULE__241__;","module.exports = __WEBPACK_EXTERNAL_MODULE__959__;","module.exports = __WEBPACK_EXTERNAL_MODULE__269__;","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","import { useEffect } from 'react';\nvar useEffectOnce = function (effect) {\n useEffect(effect, []);\n};\nexport default useEffectOnce;\n","import useEffectOnce from './useEffectOnce';\nvar useMount = function (fn) {\n useEffectOnce(function () {\n fn();\n });\n};\nexport default useMount;\n","import { css } from '@emotion/css';\nimport React, { CSSProperties } from 'react';\n\nimport { GrafanaTheme2 } from '@grafana/data';\nimport { useStyles2 } from '@grafana/ui';\n\ninterface StackProps {\n direction?: CSSProperties['flexDirection'];\n alignItems?: CSSProperties['alignItems'];\n wrap?: boolean;\n gap?: number;\n flexGrow?: CSSProperties['flexGrow'];\n children: React.ReactNode;\n}\n\nexport function Stack(props: StackProps) {\n const styles = useStyles2(getStyles, props);\n return <div className={styles.root}>{props.children}</div>;\n}\n\nconst getStyles = (theme: GrafanaTheme2, props: StackProps) => ({\n root: css({\n display: 'flex',\n flexDirection: props.direction ?? 'row',\n flexWrap: props.wrap ?? true ? 'wrap' : undefined,\n alignItems: props.alignItems,\n gap: theme.spacing(props.gap ?? 2),\n flexGrow: props.flexGrow,\n }),\n});\n","import { css } from '@emotion/css';\nimport React from 'react';\n\nimport { GrafanaTheme2 } from '@grafana/data';\nimport { useStyles2 } from '@grafana/ui';\n\nimport { Stack } from './Stack';\n\ninterface EditorRowProps {\n children: React.ReactNode;\n stackProps?: Partial<React.ComponentProps<typeof Stack>>;\n}\n\nexport const EditorRow = ({ children, stackProps }: EditorRowProps) => {\n const styles = useStyles2(getStyles);\n\n return (\n <div className={styles.root}>\n <Stack gap={2} {...stackProps}>\n {children}\n </Stack>\n </div>\n );\n};\n\nconst getStyles = (theme: GrafanaTheme2) => {\n return {\n root: css({\n padding: theme.spacing(1),\n backgroundColor: theme.colors.background.secondary,\n borderRadius: theme.shape.radius.default,\n }),\n };\n};\n","import React from 'react';\n\nimport { Stack } from './Stack';\n\ninterface EditorRowsProps {\n children: React.ReactNode;\n}\n\nexport const EditorRows = ({ children }: EditorRowsProps) => {\n return (\n <Stack gap={0.5} direction=\"column\">\n {children}\n </Stack>\n );\n};\n","import { language, languageConfiguration } from './lang';\n\nexport const languageDefinition = {\n id: 'parca',\n extensions: ['.parca'],\n aliases: ['parca'],\n mimetypes: [],\n def: {\n language,\n languageConfiguration,\n },\n};\n","import type { languages } from 'monaco-editor';\n\nexport const languageConfiguration: languages.LanguageConfiguration = {\n // the default separators except `@$`\n wordPattern: /(-?\\d*\\.\\d\\w*)|([^`~!#%^&*()\\-=+\\[{\\]}\\\\|;:'\",.<>\\/?\\s]+)/g,\n brackets: [['{', '}']],\n autoClosingPairs: [\n { open: '{', close: '}' },\n { open: '\"', close: '\"' },\n { open: \"'\", close: \"'\" },\n ],\n surroundingPairs: [\n { open: '{', close: '}' },\n { open: '\"', close: '\"' },\n { open: \"'\", close: \"'\" },\n ],\n folding: {},\n};\n\nexport const language: languages.IMonarchLanguage = {\n ignoreCase: false,\n defaultToken: '',\n tokenPostfix: '.fireql',\n\n keywords: [],\n operators: [],\n\n // we include these common regular expressions\n symbols: /[=><!~?:&|+\\-*\\/^%]+/,\n escapes: /\\\\(?:[abfnrtv\\\\\"']|x[0-9A-Fa-f]{1,4}|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8})/,\n digits: /\\d+(_+\\d+)*/,\n octaldigits: /[0-7]+(_+[0-7]+)*/,\n binarydigits: /[0-1]+(_+[0-1]+)*/,\n hexdigits: /[[0-9a-fA-F]+(_+[0-9a-fA-F]+)*/,\n integersuffix: /(ll|LL|u|U|l|L)?(ll|LL|u|U|l|L)?/,\n floatsuffix: /[fFlL]?/,\n\n tokenizer: {\n root: [\n // labels\n [/[a-z_]\\w*(?=\\s*(=|!=|=~|!~))/, 'tag'],\n\n // strings\n [/\"([^\"\\\\]|\\\\.)*$/, 'string.invalid'], // non-teminated string\n [/'([^'\\\\]|\\\\.)*$/, 'string.invalid'], // non-teminated string\n [/\"/, 'string', '@string_double'],\n [/'/, 'string', '@string_single'],\n\n // whitespace\n { include: '@whitespace' },\n\n // delimiters and operators\n [/[{}()\\[\\]]/, '@brackets'],\n [/[<>](?!@symbols)/, '@brackets'],\n [\n /@symbols/,\n {\n cases: {\n '@operators': 'delimiter',\n '@default': '',\n },\n },\n ],\n\n // numbers\n [/\\d+/, 'number'],\n [/\\d*\\d+[eE]([\\-+]?\\d+)?(@floatsuffix)/, 'number.float'],\n [/\\d*\\.\\d+([eE][\\-+]?\\d+)?(@floatsuffix)/, 'number.float'],\n [/0[xX][0-9a-fA-F']*[0-9a-fA-F](@integersuffix)/, 'number.hex'],\n [/0[0-7']*[0-7](@integersuffix)/, 'number.octal'],\n [/0[bB][0-1']*[0-1](@integersuffix)/, 'number.binary'],\n [/\\d[\\d']*\\d(@integersuffix)/, 'number'],\n [/\\d(@integersuffix)/, 'number'],\n ],\n\n string_double: [\n [/[^\\\\\"]+/, 'string'],\n [/@escapes/, 'string.escape'],\n [/\\\\./, 'string.escape.invalid'],\n [/\"/, 'string', '@pop'],\n ],\n\n string_single: [\n [/[^\\\\']+/, 'string'],\n [/@escapes/, 'string.escape'],\n [/\\\\./, 'string.escape.invalid'],\n [/'/, 'string', '@pop'],\n ],\n\n clauses: [\n [/[^(,)]/, 'tag'],\n [/\\)/, 'identifier', '@pop'],\n ],\n\n whitespace: [[/[ \\t\\r\\n]+/, 'white']],\n },\n};\n","import { monacoTypes, Monaco } from '@grafana/ui';\n\n/**\n * Class that implements CompletionItemProvider interface and allows us to provide suggestion for the Monaco\n * autocomplete system.\n *\n * At this moment we just pass it all the labels/values we get from Fire backend later on we may do something a bit\n * smarter if there will be lots of labels.\n */\nexport class CompletionProvider implements monacoTypes.languages.CompletionItemProvider {\n triggerCharacters = ['{', ',', '[', '(', '=', '~', ' ', '\"'];\n\n private labels: { [label: string]: string[] } = {};\n\n constructor(\n private datasource: {\n getLabelNames: () => Promise<string[]>;\n getLabelValues: (label: string) => Promise<string[]>;\n },\n private monaco: Monaco,\n private editor: monacoTypes.editor.IStandaloneCodeEditor\n ) {}\n\n async init() {\n const names = await this.datasource.getLabelNames();\n this.labels = names.reduce<{ [label: string]: string[] }>((acc, name) => {\n acc[name] = [];\n return acc;\n }, {});\n }\n\n provideCompletionItems(\n model: monacoTypes.editor.ITextModel,\n position: monacoTypes.Position\n ): monacoTypes.languages.ProviderResult<monacoTypes.languages.CompletionList> {\n // if the model-id does not match, then this call is from a different editor-instance,\n // not \"our instance\", so return nothing\n if (this.editor.getModel()?.id !== model.id) {\n return { suggestions: [] };\n }\n\n const { range, offset } = getRangeAndOffset(this.monaco, model, position);\n const situation = getSituation(model.getValue(), offset);\n // Cannot be async/await cause of the ProviderResult return type\n return this.getCompletions(situation).then((completionItems) => {\n // monaco by-default alphabetically orders the items.\n // to stop it, we use a number-as-string sortkey,\n // so that monaco keeps the order we use\n const maxIndexDigits = completionItems.length.toString().length;\n const suggestions: monacoTypes.languages.CompletionItem[] = completionItems.map((item, index) => ({\n kind: getMonacoCompletionItemKind(item.type, this.monaco!),\n label: item.label,\n insertText: item.insertText,\n sortText: index.toString().padStart(maxIndexDigits, '0'), // to force the order we have\n range,\n }));\n return { suggestions };\n });\n }\n\n /**\n * Get suggestion based on the situation we are in like whether we should suggest label names or values.\n * @param situation\n * @private\n */\n private async getCompletions(situation: Situation): Promise<Completion[]> {\n if (!Object.keys(this.labels).length) {\n return [];\n }\n switch (situation.type) {\n // Not really sure what would make sense to suggest in this case so just leave it\n case 'UNKNOWN': {\n return [];\n }\n case 'EMPTY': {\n return Object.keys(this.labels).map((key) => {\n return {\n label: key,\n insertText: `{${key}=\"`,\n type: 'LABEL_NAME',\n };\n });\n }\n case 'IN_LABEL_NAME':\n return Object.keys(this.labels).map((key) => {\n return {\n label: key,\n insertText: key,\n type: 'LABEL_NAME',\n };\n });\n case 'IN_LABEL_VALUE':\n let values = [];\n if (this.labels[situation.labelName].length) {\n values = this.labels[situation.labelName];\n } else {\n values = await this.datasource.getLabelValues(situation.labelName);\n this.labels[situation.labelName] = values;\n }\n\n return values.map((val) => {\n return {\n label: val,\n insertText: situation.betweenQuotes ? val : `\"${val}\"`,\n type: 'LABEL_VALUE',\n };\n });\n default:\n throw new Error(`Unexpected situation ${situation}`);\n }\n }\n}\n\n/**\n * Get item kind which is used for icon next to the suggestion.\n * @param type\n * @param monaco\n */\nfunction getMonacoCompletionItemKind(type: CompletionType, monaco: Monaco): monacoTypes.languages.CompletionItemKind {\n switch (type) {\n case 'LABEL_NAME':\n return monaco.languages.CompletionItemKind.Enum;\n case 'LABEL_VALUE':\n return monaco.languages.CompletionItemKind.EnumMember;\n default:\n throw new Error(`Unexpected CompletionType: ${type}`);\n }\n}\n\nexport type CompletionType = 'LABEL_NAME' | 'LABEL_VALUE';\ntype Completion = {\n type: CompletionType;\n label: string;\n insertText: string;\n};\n\nexport type Label = {\n name: string;\n value: string;\n};\n\nexport type Situation =\n | {\n type: 'UNKNOWN';\n }\n | {\n type: 'EMPTY';\n }\n | {\n type: 'IN_LABEL_NAME';\n otherLabels: Label[];\n }\n | {\n type: 'IN_LABEL_VALUE';\n labelName: string;\n betweenQuotes: boolean;\n otherLabels: Label[];\n };\n\nconst labelNameRegex = /[a-zA-Z_][a-zA-Z0-9_]*/;\nconst labelValueRegex = /[^\"]*/; // anything except a double quote\nconst labelPairsRegex = new RegExp(`(${labelNameRegex.source})=\"(${labelValueRegex.source})\"`, 'g');\nconst inLabelValueRegex = new RegExp(`(${labelNameRegex.source})=(\"?)${labelValueRegex.source}$`);\nconst inLabelNameRegex = new RegExp(/[{,]\\s*[a-zA-Z0-9_]*$/);\n\n/**\n * Figure out where is the cursor and what kind of suggestions are appropriate.\n * As currently Fire handles just a simple {foo=\"bar\", baz=\"zyx\"} kind of values we can do with simple regex to figure\n * out where we are with the cursor.\n * @param text\n * @param offset\n */\nfunction getSituation(text: string, offset: number): Situation {\n if (text === '') {\n return {\n type: 'EMPTY',\n };\n }\n\n // Get all the labels so far in the query, so we can do some more filtering.\n const matches = text.matchAll(labelPairsRegex);\n const existingLabels = Array.from(matches).reduce<Label[]>((acc, match) => {\n const [_, name, value] = match[1];\n acc.push({ name, value });\n return acc;\n }, []);\n\n // Check if we are editing a label value right now. If so also get name of the label\n const matchLabelValue = text.substring(0, offset).match(inLabelValueRegex);\n if (matchLabelValue) {\n return {\n type: 'IN_LABEL_VALUE',\n labelName: matchLabelValue[1],\n betweenQuotes: !!matchLabelValue[2],\n otherLabels: existingLabels,\n };\n }\n\n // Check if we are editing a label name\n const matchLabelName = text.substring(0, offset).match(inLabelNameRegex);\n if (matchLabelName) {\n return {\n type: 'IN_LABEL_NAME',\n otherLabels: existingLabels,\n };\n }\n\n // Will happen only if user writes something that isn't really a label selector\n return {\n type: 'UNKNOWN',\n };\n}\n\nfunction getRangeAndOffset(monaco: Monaco, model: monacoTypes.editor.ITextModel, position: monacoTypes.Position) {\n const word = model.getWordAtPosition(position);\n const range =\n word != null\n ? monaco.Range.lift({\n startLineNumber: position.lineNumber,\n endLineNumber: position.lineNumber,\n startColumn: word.startColumn,\n endColumn: word.endColumn,\n })\n : monaco.Range.fromPositions(position);\n\n // documentation says `position` will be \"adjusted\" in `getOffsetAt` so we clone it here just for sure.\n const positionClone = {\n column: position.column,\n lineNumber: position.lineNumber,\n };\n\n const offset = model.getOffsetAt(positionClone);\n return { offset, range };\n}\n","import { css } from '@emotion/css';\nimport React, { useEffect, useRef } from 'react';\nimport { useLatest } from 'react-use';\n\nimport { CodeEditor, Monaco, useStyles2, monacoTypes } from '@grafana/ui';\n\nimport { ParcaDataSource } from '../datasource';\nimport { languageDefinition } from '../lang';\n\nimport { CompletionProvider } from './autocomplete';\n\ninterface Props {\n value: string;\n datasource: ParcaDataSource;\n onChange: (val: string) => void;\n onRunQuery: (value: string) => void;\n}\n\nexport function LabelsEditor(props: Props) {\n const setupAutocompleteFn = useAutocomplete(props.datasource);\n const styles = useStyles2(getStyles);\n\n const onRunQueryRef = useLatest(props.onRunQuery);\n const containerRef = useRef<HTMLDivElement>(null);\n\n return (\n <div\n className={styles.wrapper}\n // NOTE: we will be setting inline-style-width/height on this element\n ref={containerRef}\n >\n <CodeEditor\n value={props.value}\n language={langId}\n onBlur={props.onChange}\n containerStyles={styles.queryField}\n monacoOptions={{\n folding: false,\n fontSize: 14,\n lineNumbers: 'off',\n overviewRulerLanes: 0,\n renderLineHighlight: 'none',\n scrollbar: {\n vertical: 'hidden',\n verticalScrollbarSize: 8, // used as \"padding-right\"\n horizontal: 'hidden',\n horizontalScrollbarSize: 0,\n },\n scrollBeyondLastLine: false,\n wordWrap: 'on',\n padding: {\n top: 5,\n bottom: 6,\n },\n }}\n onBeforeEditorMount={ensureParcaQL}\n onEditorDidMount={(editor, monaco) => {\n setupAutocompleteFn(editor, monaco);\n\n const updateElementHeight = () => {\n const containerDiv = containerRef.current;\n if (containerDiv !== null) {\n const pixelHeight = editor.getContentHeight();\n containerDiv.style.height = `${pixelHeight + EDITOR_HEIGHT_OFFSET}px`;\n containerDiv.style.width = '100%';\n const pixelWidth = containerDiv.clientWidth;\n editor.layout({ width: pixelWidth, height: pixelHeight });\n }\n };\n\n editor.onDidContentSizeChange(updateElementHeight);\n updateElementHeight();\n\n editor.addCommand(monaco.KeyMod.Shift | monaco.KeyCode.Enter, () => {\n onRunQueryRef.current(editor.getValue());\n });\n }}\n />\n </div>\n );\n}\n\n// this number was chosen by testing various values. it might be necessary\n// because of the width of the border, not sure.\n//it needs to do 2 things:\n// 1. when the editor is single-line, it should make the editor height be visually correct\n// 2. when the editor is multi-line, the editor should not be \"scrollable\" (meaning,\n// you do a scroll-movement in the editor, and it will scroll the content by a couple pixels\n// up & down. this we want to avoid)\nconst EDITOR_HEIGHT_OFFSET = 2;\n\n/**\n * Hook that returns function that will set up monaco autocomplete for the label selector\n * @param datasource\n */\nfunction useAutocomplete(datasource: ParcaDataSource) {\n const autocompleteDisposeFun = useRef<(() => void) | null>(null);\n useEffect(() => {\n // when we unmount, we unregister the autocomplete-function, if it was registered\n return () => {\n autocompleteDisposeFun.current?.();\n };\n }, []);\n\n // This should be run in monaco onEditorDidMount\n return async (editor: monacoTypes.editor.IStandaloneCodeEditor, monaco: Monaco) => {\n const provider = new CompletionProvider(datasource, monaco, editor);\n await provider.init();\n const { dispose } = monaco.languages.registerCompletionItemProvider(langId, provider);\n autocompleteDisposeFun.current = dispose;\n };\n}\n\n// we must only run the setup code once\nlet parcaqlSetupDone = false;\nconst langId = 'parca';\n\nfunction ensureParcaQL(monaco: Monaco) {\n if (parcaqlSetupDone === false) {\n parcaqlSetupDone = true;\n const { aliases, extensions, mimetypes, def } = languageDefinition;\n monaco.languages.register({ id: langId, aliases, extensions, mimetypes });\n monaco.languages.setMonarchTokensProvider(langId, def.language);\n monaco.languages.setLanguageConfiguration(langId, def.languageConfiguration);\n }\n}\n\nconst getStyles = () => {\n return {\n queryField: css`\n flex: 1;\n // Not exactly sure but without this the editor doe not shrink after resizing (so you can make it bigger but not\n // smaller). At the same time this does not actually make the editor 100px because it has flex 1 so I assume\n // this should sort of act as a flex-basis (but flex-basis does not work for this). So yeah CSS magic.\n width: 100px;\n `,\n wrapper: css`\n display: flex;\n flex: 1;\n border: 1px solid rgba(36, 41, 46, 0.3);\n border-radius: 2px;\n `,\n };\n};\n","import { useRef } from 'react';\nvar useLatest = function (value) {\n var ref = useRef(value);\n ref.current = value;\n return ref;\n};\nexport default useLatest;\n","import { useReducer } from 'react';\nvar toggleReducer = function (state, nextValue) {\n return typeof nextValue === 'boolean' ? nextValue : !state;\n};\nvar useToggle = function (initialValue) {\n return useReducer(toggleReducer, initialValue);\n};\nexport default useToggle;\n","import { css, cx } from '@emotion/css';\nimport React from 'react';\nimport { useToggle } from 'react-use';\n\nimport { CoreApp, GrafanaTheme2 } from '@grafana/data';\nimport { Icon, useStyles2, RadioButtonGroup, Field, clearButtonStyles, Button } from '@grafana/ui';\n\nimport { Query } from '../types';\n\nimport { Stack } from './Stack';\n\nexport interface Props {\n query: Query;\n onQueryTypeChange: (val: Query['queryType']) => void;\n app?: CoreApp;\n}\n\nconst rangeOptions: Array<{ value: Query['queryType']; label: string; description: string }> = [\n { value: 'metrics', label: 'Metric', description: 'Return aggregated metrics' },\n { value: 'profile', label: 'Profile', description: 'Return profile' },\n { value: 'both', label: 'Both', description: 'Return both metric and profile data' },\n];\n\nfunction getOptions(app?: CoreApp) {\n if (app === CoreApp.Explore) {\n return rangeOptions;\n }\n return rangeOptions.filter((option) => option.value !== 'both');\n}\n\n/**\n * Base on QueryOptionGroup component from grafana/ui but that is not available yet.\n */\nexport function QueryOptions({ query, onQueryTypeChange, app }: Props) {\n const [isOpen, toggleOpen] = useToggle(false);\n const styles = useStyles2(getStyles);\n const options = getOptions(app);\n const buttonStyles = useStyles2(clearButtonStyles);\n\n return (\n <Stack gap={0} direction=\"column\">\n <Button className={cx(styles.header, buttonStyles)} onClick={toggleOpen} title=\"Click to edit options\">\n <div className={styles.toggle}>\n <Icon name={isOpen ? 'angle-down' : 'angle-right'} />\n </div>\n <h6 className={styles.title}>Options</h6>\n {!isOpen && (\n <div className={styles.description}>\n <span>Type: {query.queryType}</span>\n </div>\n )}\n </Button>\n {isOpen && (\n <div className={styles.body}>\n <Field label={'Query Type'}>\n <RadioButtonGroup options={options} value={query.queryType} onChange={onQueryTypeChange} />\n </Field>\n </div>\n )}\n </Stack>\n );\n}\n\nconst getStyles = (theme: GrafanaTheme2) => {\n return {\n switchLabel: css({\n color: theme.colors.text.secondary,\n cursor: 'pointer',\n fontSize: theme.typography.bodySmall.fontSize,\n '&:hover': {\n color: theme.colors.text.primary,\n },\n }),\n header: css({\n display: 'flex',\n cursor: 'pointer',\n alignItems: 'baseline',\n color: theme.colors.text.primary,\n '&:hover': {\n background: theme.colors.emphasize(theme.colors.background.primary, 0.03),\n },\n }),\n title: css({\n flexGrow: 1,\n overflow: 'hidden',\n fontSize: theme.typography.bodySmall.fontSize,\n fontWeight: theme.typography.fontWeightMedium,\n margin: 0,\n }),\n description: css({\n color: theme.colors.text.secondary,\n fontSize: theme.typography.bodySmall.fontSize,\n paddingLeft: theme.spacing(2),\n gap: theme.spacing(2),\n display: 'flex',\n }),\n body: css({\n display: 'flex',\n paddingTop: theme.spacing(2),\n gap: theme.spacing(2),\n flexWrap: 'wrap',\n }),\n toggle: css({\n color: theme.colors.text.secondary,\n marginRight: `${theme.spacing(1)}`,\n }),\n };\n};\n","import { defaults } from 'lodash';\nimport React, { useMemo, useState } from 'react';\nimport { useMount } from 'react-use';\n\nimport { CoreApp, QueryEditorProps } from '@grafana/data';\nimport { ButtonCascader, CascaderOption } from '@grafana/ui';\n\nimport { defaultParca, defaultParcaQueryType, Parca } from '../dataquery.gen';\nimport { ParcaDataSource } from '../datasource';\nimport { ParcaDataSourceOptions, ProfileTypeMessage, Query } from '../types';\n\nimport { EditorRow } from './EditorRow';\nimport { EditorRows } from './EditorRows';\nimport { LabelsEditor } from './LabelsEditor';\nimport { QueryOptions } from './QueryOptions';\n\nexport type Props = QueryEditorProps<ParcaDataSource, Query, ParcaDataSourceOptions>;\n\nexport const defaultQuery: Partial<Parca> = {\n ...defaultParca,\n queryType: defaultParcaQueryType,\n};\n\nexport function QueryEditor(props: Props) {\n const [profileTypes, setProfileTypes] = useState<ProfileTypeMessage[]>([]);\n\n function onProfileTypeChange(value: string[], selectedOptions: CascaderOption[]) {\n if (selectedOptions.length === 0) {\n return;\n }\n const id = selectedOptions[selectedOptions.length - 1].value;\n if (typeof id !== 'string') {\n throw new Error('id is not string');\n }\n props.onChange({ ...props.query, profileTypeId: id });\n }\n\n function onLabelSelectorChange(value: string) {\n props.onChange({ ...props.query, labelSelector: value });\n }\n\n function handleRunQuery(value: string) {\n props.onChange({ ...props.query, labelSelector: value });\n props.onRunQuery();\n }\n\n useMount(async () => {\n const profileTypes = await props.datasource.getProfileTypes();\n setProfileTypes(profileTypes);\n });\n\n // Turn profileTypes into cascader options\n const cascaderOptions = useMemo(() => {\n let mainTypes = new Map<string, CascaderOption>();\n // Classify profile types by name then sample type.\n for (let profileType of profileTypes) {\n if (!mainTypes.has(profileType.name)) {\n mainTypes.set(profileType.name, {\n label: profileType.name,\n value: profileType.ID,\n children: [],\n });\n }\n mainTypes.get(profileType.name)?.children?.push({\n label: profileType.sample_type,\n value: profileType.ID,\n });\n }\n return Array.from(mainTypes.values());\n }, [profileTypes]);\n\n const selectedProfileName = useMemo(() => {\n if (!profileTypes) {\n return 'Loading';\n }\n const profile = profileTypes.find((type) => type.ID === props.query.profileTypeId);\n if (!profile) {\n return 'Select a profile type';\n }\n\n return profile.name + ' - ' + profile.sample_type;\n }, [props.query.profileTypeId, profileTypes]);\n\n let query = normalizeQuery(props.query, props.app);\n\n return (\n <EditorRows>\n <EditorRow stackProps={{ wrap: false, gap: 1 }}>\n <ButtonCascader onChange={onProfileTypeChange} options={cascaderOptions} buttonProps={{ variant: 'secondary' }}>\n {selectedProfileName}\n </ButtonCascader>\n <LabelsEditor\n value={query.labelSelector}\n onChange={onLabelSelectorChange}\n datasource={props.datasource}\n onRunQuery={handleRunQuery}\n />\n </EditorRow>\n <EditorRow>\n <QueryOptions\n query={query}\n onQueryTypeChange={(val) => {\n props.onChange({ ...query, queryType: val });\n }}\n app={props.app}\n />\n </EditorRow>\n </EditorRows>\n );\n}\n\nfunction normalizeQuery(query: Query, app?: CoreApp) {\n let normalized = defaults(query, defaultQuery);\n if (app !== CoreApp.Explore && normalized.queryType === 'both') {\n // In dashboards and other places, we can't show both types of graphs at the same time.\n // This will also be a default when having 'both' query and adding it from explore to dashboard\n normalized.queryType = 'profile';\n }\n return normalized;\n}\n","// Code generated - EDITING IS FUTILE. DO NOT EDIT.\n//\n// Generated by:\n// public/app/plugins/gen.go\n// Using jennies:\n// TSTypesJenny\n// PluginTSTypesJenny\n//\n// Run 'make gen-cue' from repository root to regenerate.\n\nimport * as common from '@grafana/schema';\n\nexport type ParcaQueryType = ('metrics' | 'profile' | 'both');\n\nexport const defaultParcaQueryType: ParcaQueryType = 'both';\n\nexport interface Parca extends common.DataQuery {\n /**\n * Specifies the query label selectors.\n */\n labelSelector: string;\n /**\n * Specifies the type of profile to query.\n */\n profileTypeId: string;\n}\n\nexport const defaultParca: Partial<Parca> = {\n labelSelector: '{}',\n};\n","import { Observable, of } from 'rxjs';\n\nimport { DataQueryRequest, DataQueryResponse, DataSourceInstanceSettings } from '@grafana/data';\nimport { DataSourceWithBackend } from '@grafana/runtime';\n\nimport { ParcaDataSourceOptions, Query, ProfileTypeMessage } from './types';\n\nexport class ParcaDataSource extends DataSourceWithBackend<Query, ParcaDataSourceOptions> {\n constructor(instanceSettings: DataSourceInstanceSettings<ParcaDataSourceOptions>) {\n super(instanceSettings);\n }\n\n query(request: DataQueryRequest<Query>): Observable<DataQueryResponse> {\n if (!request.targets.every((q) => q.profileTypeId)) {\n // When changing data source in explore, firs query can be sent without filled in profileTypeId\n return of({ data: [] });\n }\n\n return super.query(request);\n }\n\n async getProfileTypes(): Promise<ProfileTypeMessage[]> {\n return await super.getResource('profileTypes');\n }\n\n async getLabelNames(): Promise<string[]> {\n return await super.getResource('labelNames');\n }\n\n async getLabelValues(labelName: string): Promise<string[]> {\n return await super.getResource('labelValues', { label: labelName });\n }\n}\n","import { DataSourcePlugin } from '@grafana/data';\n\nimport { ConfigEditor } from './ConfigEditor';\nimport { QueryEditor } from './QueryEditor/QueryEditor';\nimport { ParcaDataSource } from './datasource';\nimport { Query, ParcaDataSourceOptions } from './types';\n\nexport const plugin = new DataSourcePlugin<ParcaDataSource, Query, ParcaDataSourceOptions>(ParcaDataSource)\n .setConfigEditor(ConfigEditor)\n .setQueryEditor(QueryEditor);\n","import React from 'react';\n\nimport { DataSourcePluginOptionsEditorProps } from '@grafana/data';\nimport { config } from '@grafana/runtime';\nimport { DataSourceHttpSettings } from '@grafana/ui';\n\nimport { ParcaDataSourceOptions } from './types';\n\ninterface Props extends DataSourcePluginOptionsEditorProps<ParcaDataSourceOptions> {}\n\nexport const ConfigEditor = (props: Props) => {\n const { options, onOptionsChange } = props;\n\n return (\n <>\n <DataSourceHttpSettings\n defaultUrl={'http://localhost:7070'}\n dataSourceConfig={options}\n showAccessOptions={false}\n onChange={onOptionsChange}\n secureSocksDSProxyEnabled={config.secureSocksDSProxyEnabled}\n />\n </>\n );\n};\n"],"names":["module","exports","__WEBPACK_EXTERNAL_MODULE__89__","__WEBPACK_EXTERNAL_MODULE__781__","__WEBPACK_EXTERNAL_MODULE__531__","__WEBPACK_EXTERNAL_MODULE__7__","__WEBPACK_EXTERNAL_MODULE__241__","__WEBPACK_EXTERNAL_MODULE__959__","__WEBPACK_EXTERNAL_MODULE__269__","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","undefined","__webpack_modules__","n","getter","__esModule","d","a","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","r","Symbol","toStringTag","value","fn","effect","useEffect","Stack","props","styles","useStyles2","getStyles","div","className","root","children","theme","css","display","flexDirection","direction","flexWrap","wrap","alignItems","gap","spacing","flexGrow","EditorRow","stackProps","padding","backgroundColor","colors","background","secondary","borderRadius","shape","radius","default","EditorRows","languageDefinition","id","extensions","aliases","mimetypes","def","language","ignoreCase","defaultToken","tokenPostfix","keywords","operators","symbols","escapes","digits","octaldigits","binarydigits","hexdigits","integersuffix","floatsuffix","tokenizer","include","cases","string_double","string_single","clauses","whitespace","languageConfiguration","wordPattern","brackets","autoClosingPairs","open","close","surroundingPairs","folding","CompletionProvider","init","names","datasource","getLabelNames","labels","reduce","acc","name","provideCompletionItems","model","position","this","editor","getModel","suggestions","range","offset","monaco","word","getWordAtPosition","Range","lift","startLineNumber","lineNumber","endLineNumber","startColumn","endColumn","fromPositions","positionClone","column","getOffsetAt","getRangeAndOffset","situation","text","type","matches","matchAll","labelPairsRegex","existingLabels","Array","from","match","_","push","matchLabelValue","substring","inLabelValueRegex","labelName","betweenQuotes","otherLabels","inLabelNameRegex","getSituation","getValue","getCompletions","then","completionItems","maxIndexDigits","length","toString","map","item","index","kind","getMonacoCompletionItemKind","label","insertText","sortText","padStart","keys","values","getLabelValues","val","Error","constructor","triggerCharacters","languages","CompletionItemKind","Enum","EnumMember","labelNameRegex","labelValueRegex","RegExp","source","LabelsEditor","setupAutocompleteFn","autocompleteDisposeFun","useRef","current","provider","dispose","registerCompletionItemProvider","langId","useAutocomplete","onRunQueryRef","onRunQuery","ref","containerRef","wrapper","CodeEditor","onBlur","onChange","containerStyles","queryField","monacoOptions","fontSize","lineNumbers","overviewRulerLanes","renderLineHighlight","scrollbar","vertical","verticalScrollbarSize","horizontal","horizontalScrollbarSize","scrollBeyondLastLine","wordWrap","top","bottom","onBeforeEditorMount","ensureParcaQL","onEditorDidMount","updateElementHeight","containerDiv","pixelHeight","getContentHeight","style","height","EDITOR_HEIGHT_OFFSET","width","pixelWidth","clientWidth","layout","onDidContentSizeChange","addCommand","KeyMod","Shift","KeyCode","Enter","parcaqlSetupDone","register","setMonarchTokensProvider","setLanguageConfiguration","toggleReducer","state","nextValue","rangeOptions","description","QueryOptions","query","onQueryTypeChange","app","isOpen","toggleOpen","initialValue","useReducer","options","CoreApp","Explore","filter","option","getOptions","buttonStyles","clearButtonStyles","Button","cx","header","onClick","title","toggle","Icon","h6","span","queryType","body","Field","RadioButtonGroup","switchLabel","color","cursor","typography","bodySmall","primary","emphasize","overflow","fontWeight","fontWeightMedium","margin","paddingLeft","paddingTop","marginRight","defaultQuery","labelSelector","defaultParca","ParcaDataSource","DataSourceWithBackend","request","targets","every","q","profileTypeId","super","of","data","getProfileTypes","instanceSettings","plugin","DataSourcePlugin","setConfigEditor","onOptionsChange","DataSourceHttpSettings","defaultUrl","dataSourceConfig","showAccessOptions","secureSocksDSProxyEnabled","config","setQueryEditor","profileTypes","setProfileTypes","useState","useMount","cascaderOptions","useMemo","mainTypes","Map","profileType","has","set","ID","sample_type","selectedProfileName","profile","find","normalized","defaults","normalizeQuery","ButtonCascader","selectedOptions","buttonProps","variant"],"sourceRoot":""}
Submit
FILE
FOLDER
INFO
Name
Size
Permission
Action
img
---
0755
CHANGELOG.md
12 bytes
0644
LICENSE
34523 bytes
0644
README.md
71 bytes
0644
module.js
15046 bytes
0644
module.js.map
49080 bytes
0644
plugin.json
843 bytes
0644
N4ST4R_ID | Naxtarrr