@perses-dev/victorialogs-plugin 0.5.0-beta.7 → 0.5.0-rc.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/__mf/js/{VictoriaLogs.ca556252.js → VictoriaLogs.635392ce.js} +2 -2
- package/__mf/js/async/1433.3d2ebb70.js +7 -0
- package/__mf/js/async/1616.0258fe9a.js +1 -0
- package/__mf/js/async/198.cc78ac12.js +2 -0
- package/__mf/js/async/2043.2c73ebfe.js +2 -0
- package/__mf/js/async/2377.2348cb20.js +1 -0
- package/__mf/js/async/2786.5f881482.js +2 -0
- package/__mf/js/async/2901.9c427b40.js +1 -0
- package/__mf/js/async/3286.38c055b9.js +2 -0
- package/__mf/js/async/392.49d52d98.js +2 -0
- package/__mf/js/async/4077.39e0efff.js +1 -0
- package/__mf/js/async/4121.356a5dcc.js +2 -0
- package/__mf/js/async/4248.847c390d.js +1 -0
- package/__mf/js/async/4496.af265a24.js +1 -0
- package/__mf/js/async/4960.f43ba55c.js +2 -0
- package/__mf/js/async/5019.644f7b0c.js +1 -0
- package/__mf/js/async/5071.6670fa87.js +1 -0
- package/__mf/js/async/5440.1ca84a65.js +2 -0
- package/__mf/js/async/5587.3f86da0e.js +1 -0
- package/__mf/js/async/5706.87cad874.js +1 -0
- package/__mf/js/async/6274.a464d64f.js +2 -0
- package/__mf/js/async/6609.6f2adcdd.js +88 -0
- package/__mf/js/async/6854.207d90c8.js +1 -0
- package/__mf/js/async/7192.92d05ad2.js +1 -0
- package/__mf/js/async/{7740.071ecf65.js → 7740.57961d20.js} +1 -1
- package/__mf/js/async/7817.4a21d143.js +2 -0
- package/__mf/js/async/7862.f33fc6ee.js +2 -0
- package/__mf/js/async/7958.426f9f71.js +52 -0
- package/__mf/js/async/7968.62aeba5d.js +1 -0
- package/__mf/js/async/7978.f0523bd3.js +1 -0
- package/__mf/js/async/{8253.35b5a0dc.js → 8253.66844887.js} +1 -1
- package/__mf/js/async/8356.b320d176.js +1 -0
- package/__mf/js/async/8470.ccd01079.js +2 -0
- package/__mf/js/async/873.d1c527eb.js +1 -0
- package/__mf/js/async/9207.3c630cde.js +1 -0
- package/__mf/js/async/9235.ce1cdbe4.js +1 -0
- package/__mf/js/async/941.fd358e10.js +2 -0
- package/__mf/js/async/{9440.0e7f2584.js → 9440.c066de88.js} +2 -2
- package/__mf/js/async/9588.453d5d98.js +1 -0
- package/__mf/js/async/__federation_expose_VictoriaLogsDatasource.049ba3c8.js +2 -0
- package/__mf/js/async/__federation_expose_VictoriaLogsFieldNamesVariable.ae8c52fb.js +2 -0
- package/__mf/js/async/__federation_expose_VictoriaLogsFieldValuesVariable.975e3794.js +2 -0
- package/__mf/js/async/__federation_expose_VictoriaLogsLogQuery.08f75beb.js +1 -0
- package/__mf/js/async/__federation_expose_VictoriaLogsTimeSeriesQuery.d266fd53.js +1 -0
- package/__mf/js/{main.e604f250.js → main.4f60490d.js} +3 -3
- package/lib/components/logsql-editor.js +2 -2
- package/lib/components/logsql-editor.js.map +1 -1
- package/lib/components/logsql-extension.d.ts +1 -1
- package/lib/components/logsql-extension.d.ts.map +1 -1
- package/lib/components/logsql-extension.js +1 -1
- package/lib/components/logsql-extension.js.map +1 -1
- package/lib/datasources/victorialogs-datasource/VictoriaLogsDatasource.d.ts.map +1 -1
- package/lib/datasources/victorialogs-datasource/VictoriaLogsDatasource.js +9 -5
- package/lib/datasources/victorialogs-datasource/VictoriaLogsDatasource.js.map +1 -1
- package/lib/model/client.d.ts +2 -0
- package/lib/model/client.d.ts.map +1 -1
- package/lib/model/client.js +8 -4
- package/lib/model/client.js.map +1 -1
- package/lib/queries/victorialogs-log-query/VictoriaLogsLogQueryEditor.d.ts.map +1 -1
- package/lib/queries/victorialogs-log-query/VictoriaLogsLogQueryEditor.js +5 -6
- package/lib/queries/victorialogs-log-query/VictoriaLogsLogQueryEditor.js.map +1 -1
- package/lib/queries/victorialogs-time-series-query/VictoriaLogsTimeSeriesQueryEditor.d.ts.map +1 -1
- package/lib/queries/victorialogs-time-series-query/VictoriaLogsTimeSeriesQueryEditor.js +5 -6
- package/lib/queries/victorialogs-time-series-query/VictoriaLogsTimeSeriesQueryEditor.js.map +1 -1
- package/mf-manifest.json +135 -135
- package/mf-stats.json +135 -135
- package/package.json +6 -6
- package/__mf/js/async/1616.a3cbd019.js +0 -1
- package/__mf/js/async/198.42cbc766.js +0 -2
- package/__mf/js/async/2043.09d2b336.js +0 -2
- package/__mf/js/async/2377.955d23a6.js +0 -1
- package/__mf/js/async/2786.4f8e4f80.js +0 -2
- package/__mf/js/async/2901.ead6a746.js +0 -1
- package/__mf/js/async/3068.121a74bc.js +0 -88
- package/__mf/js/async/3286.5f22185a.js +0 -2
- package/__mf/js/async/3873.fc2ead2a.js +0 -52
- package/__mf/js/async/392.241997df.js +0 -2
- package/__mf/js/async/4077.8bd92530.js +0 -1
- package/__mf/js/async/4121.f0c5c912.js +0 -2
- package/__mf/js/async/4248.99e208e8.js +0 -1
- package/__mf/js/async/4496.c8ce9931.js +0 -1
- package/__mf/js/async/4960.2753b110.js +0 -2
- package/__mf/js/async/5019.ad81a49d.js +0 -1
- package/__mf/js/async/5071.65fbbcc1.js +0 -1
- package/__mf/js/async/537.8e3a78c1.js +0 -7
- package/__mf/js/async/5440.badac8c0.js +0 -2
- package/__mf/js/async/5587.66c9d9a7.js +0 -1
- package/__mf/js/async/5706.bb73a688.js +0 -1
- package/__mf/js/async/6274.264e01dd.js +0 -2
- package/__mf/js/async/6854.5e11cf4a.js +0 -1
- package/__mf/js/async/7192.3c06168c.js +0 -1
- package/__mf/js/async/7817.50337aae.js +0 -2
- package/__mf/js/async/7862.09331015.js +0 -2
- package/__mf/js/async/7968.b157175c.js +0 -1
- package/__mf/js/async/7978.1033463f.js +0 -1
- package/__mf/js/async/8356.66de7816.js +0 -1
- package/__mf/js/async/8470.2c612fd2.js +0 -2
- package/__mf/js/async/873.edbf5c7e.js +0 -1
- package/__mf/js/async/9207.786bc303.js +0 -1
- package/__mf/js/async/9235.8a5eac53.js +0 -1
- package/__mf/js/async/941.f8103f8e.js +0 -2
- package/__mf/js/async/9588.bf6042f9.js +0 -1
- package/__mf/js/async/__federation_expose_VictoriaLogsDatasource.90a59ac1.js +0 -2
- package/__mf/js/async/__federation_expose_VictoriaLogsFieldNamesVariable.98706d8a.js +0 -2
- package/__mf/js/async/__federation_expose_VictoriaLogsFieldValuesVariable.320f2e3b.js +0 -2
- package/__mf/js/async/__federation_expose_VictoriaLogsLogQuery.49a0e8f6.js +0 -1
- package/__mf/js/async/__federation_expose_VictoriaLogsTimeSeriesQuery.3aad6f1d.js +0 -1
- /package/__mf/css/async/{537.85c2cbf6.css → 1433.85c2cbf6.css} +0 -0
- /package/__mf/js/async/{537.8e3a78c1.js.LICENSE.txt → 1433.3d2ebb70.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{198.42cbc766.js.LICENSE.txt → 198.cc78ac12.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{2043.09d2b336.js.LICENSE.txt → 2043.2c73ebfe.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{2786.4f8e4f80.js.LICENSE.txt → 2786.5f881482.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{392.241997df.js.LICENSE.txt → 392.49d52d98.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{4121.f0c5c912.js.LICENSE.txt → 4121.356a5dcc.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{4960.2753b110.js.LICENSE.txt → 4960.f43ba55c.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{5440.badac8c0.js.LICENSE.txt → 5440.1ca84a65.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{6274.264e01dd.js.LICENSE.txt → 6274.a464d64f.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{3068.121a74bc.js.LICENSE.txt → 6609.6f2adcdd.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{7817.50337aae.js.LICENSE.txt → 7817.4a21d143.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{7862.09331015.js.LICENSE.txt → 7862.f33fc6ee.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{8470.2c612fd2.js.LICENSE.txt → 8470.ccd01079.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{941.f8103f8e.js.LICENSE.txt → 941.fd358e10.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{9440.0e7f2584.js.LICENSE.txt → 9440.c066de88.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{__federation_expose_VictoriaLogsDatasource.90a59ac1.js.LICENSE.txt → __federation_expose_VictoriaLogsDatasource.049ba3c8.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{__federation_expose_VictoriaLogsFieldNamesVariable.98706d8a.js.LICENSE.txt → __federation_expose_VictoriaLogsFieldNamesVariable.ae8c52fb.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{__federation_expose_VictoriaLogsFieldValuesVariable.320f2e3b.js.LICENSE.txt → __federation_expose_VictoriaLogsFieldValuesVariable.975e3794.js.LICENSE.txt} +0 -0
|
@@ -14,12 +14,12 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
14
14
|
import { useTheme } from "@mui/material";
|
|
15
15
|
import CodeMirror, { EditorView } from "@uiw/react-codemirror";
|
|
16
16
|
import { useMemo } from "react";
|
|
17
|
-
import {
|
|
17
|
+
import { createLogsQLExtension } from "./logsql-extension.js";
|
|
18
18
|
export function LogsQLEditor(props) {
|
|
19
19
|
const theme = useTheme();
|
|
20
20
|
const isDarkMode = theme.palette.mode === 'dark';
|
|
21
21
|
const logsqlExtension = useMemo(()=>{
|
|
22
|
-
return
|
|
22
|
+
return createLogsQLExtension();
|
|
23
23
|
}, []);
|
|
24
24
|
const codemirrorTheme = useMemo(()=>{
|
|
25
25
|
const borderColor = theme.palette.mode === 'light' ? 'rgba(0, 0, 0, 0.23)' : 'rgba(255, 255, 255, 0.23)';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/logsql-editor.tsx"],"sourcesContent":["// Copyright The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { useTheme } from '@mui/material';\nimport type { ReactCodeMirrorProps } from '@uiw/react-codemirror';\nimport CodeMirror, { EditorView } from '@uiw/react-codemirror';\nimport type { ReactElement } from 'react';\nimport { useMemo } from 'react';\n\nimport {
|
|
1
|
+
{"version":3,"sources":["../../../src/components/logsql-editor.tsx"],"sourcesContent":["// Copyright The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { useTheme } from '@mui/material';\nimport type { ReactCodeMirrorProps } from '@uiw/react-codemirror';\nimport CodeMirror, { EditorView } from '@uiw/react-codemirror';\nimport type { ReactElement } from 'react';\nimport { useMemo } from 'react';\n\nimport { createLogsQLExtension } from './logsql-extension';\n\nexport type LogsQLEditorProps = Omit<ReactCodeMirrorProps, 'theme' | 'extensions'>;\n\nexport function LogsQLEditor(props: LogsQLEditorProps): ReactElement {\n const theme = useTheme();\n const isDarkMode = theme.palette.mode === 'dark';\n\n const logsqlExtension = useMemo(() => {\n return createLogsQLExtension();\n }, []);\n\n const codemirrorTheme = useMemo(() => {\n const borderColor = theme.palette.mode === 'light' ? 'rgba(0, 0, 0, 0.23)' : 'rgba(255, 255, 255, 0.23)';\n\n return EditorView.theme({\n '&': {\n backgroundColor: 'transparent !important', // required for dark mode\n border: `1px solid ${borderColor}`,\n borderRadius: `${theme.shape.borderRadius}px`,\n },\n '&.cm-focused.cm-editor': {\n outline: 'none',\n },\n '.cm-content': {\n padding: '8px',\n },\n });\n }, [theme]);\n\n return (\n <CodeMirror\n {...props}\n theme={isDarkMode ? 'dark' : 'light'}\n basicSetup={{\n lineNumbers: false,\n highlightActiveLine: false,\n highlightActiveLineGutter: false,\n foldGutter: false,\n syntaxHighlighting: true,\n }}\n extensions={[EditorView.lineWrapping, logsqlExtension, codemirrorTheme]}\n placeholder='Example: {job=\"my-service\"} |= \"error\"'\n />\n );\n}\n"],"names":["useTheme","CodeMirror","EditorView","useMemo","createLogsQLExtension","LogsQLEditor","props","theme","isDarkMode","palette","mode","logsqlExtension","codemirrorTheme","borderColor","backgroundColor","border","borderRadius","shape","outline","padding","basicSetup","lineNumbers","highlightActiveLine","highlightActiveLineGutter","foldGutter","syntaxHighlighting","extensions","lineWrapping","placeholder"],"mappings":";AAAA,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,SAASA,QAAQ,QAAQ,gBAAgB;AAEzC,OAAOC,cAAcC,UAAU,QAAQ,wBAAwB;AAE/D,SAASC,OAAO,QAAQ,QAAQ;AAEhC,SAASC,qBAAqB,QAAQ,wBAAqB;AAI3D,OAAO,SAASC,aAAaC,KAAwB;IACnD,MAAMC,QAAQP;IACd,MAAMQ,aAAaD,MAAME,OAAO,CAACC,IAAI,KAAK;IAE1C,MAAMC,kBAAkBR,QAAQ;QAC9B,OAAOC;IACT,GAAG,EAAE;IAEL,MAAMQ,kBAAkBT,QAAQ;QAC9B,MAAMU,cAAcN,MAAME,OAAO,CAACC,IAAI,KAAK,UAAU,wBAAwB;QAE7E,OAAOR,WAAWK,KAAK,CAAC;YACtB,KAAK;gBACHO,iBAAiB;gBACjBC,QAAQ,CAAC,UAAU,EAAEF,aAAa;gBAClCG,cAAc,GAAGT,MAAMU,KAAK,CAACD,YAAY,CAAC,EAAE,CAAC;YAC/C;YACA,0BAA0B;gBACxBE,SAAS;YACX;YACA,eAAe;gBACbC,SAAS;YACX;QACF;IACF,GAAG;QAACZ;KAAM;IAEV,qBACE,KAACN;QACE,GAAGK,KAAK;QACTC,OAAOC,aAAa,SAAS;QAC7BY,YAAY;YACVC,aAAa;YACbC,qBAAqB;YACrBC,2BAA2B;YAC3BC,YAAY;YACZC,oBAAoB;QACtB;QACAC,YAAY;YAACxB,WAAWyB,YAAY;YAAEhB;YAAiBC;SAAgB;QACvEgB,aAAY;;AAGlB"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { LRLanguage } from '@codemirror/language';
|
|
2
2
|
import type { Extension } from '@uiw/react-codemirror';
|
|
3
|
-
export declare function
|
|
3
|
+
export declare function createLogsQLExtension(): Array<LRLanguage | Extension>;
|
|
4
4
|
//# sourceMappingURL=logsql-extension.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logsql-extension.d.ts","sourceRoot":"","sources":["../../../src/components/logsql-extension.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAElD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAgBvD,wBAAgB,
|
|
1
|
+
{"version":3,"file":"logsql-extension.d.ts","sourceRoot":"","sources":["../../../src/components/logsql-extension.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAElD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAgBvD,wBAAgB,qBAAqB,IAAI,KAAK,CAAC,UAAU,GAAG,SAAS,CAAC,CAGrE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/logsql-extension.ts"],"sourcesContent":["// Copyright The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { LRLanguage } from '@codemirror/language';\nimport { parser } from '@grafana/lezer-logql';\nimport type { Extension } from '@uiw/react-codemirror';\n\nimport { logsqlHighlight } from './logsql-highlight';\n\nfunction logsqlLanguage(): LRLanguage {\n return LRLanguage.define({\n parser: parser.configure({\n props: [logsqlHighlight],\n }),\n languageData: {\n closeBrackets: { brackets: ['(', '[', '{', \"'\", '\"', '`'] },\n commentTokens: { line: '#' },\n },\n });\n}\n\nexport function
|
|
1
|
+
{"version":3,"sources":["../../../src/components/logsql-extension.ts"],"sourcesContent":["// Copyright The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { LRLanguage } from '@codemirror/language';\nimport { parser } from '@grafana/lezer-logql';\nimport type { Extension } from '@uiw/react-codemirror';\n\nimport { logsqlHighlight } from './logsql-highlight';\n\nfunction logsqlLanguage(): LRLanguage {\n return LRLanguage.define({\n parser: parser.configure({\n props: [logsqlHighlight],\n }),\n languageData: {\n closeBrackets: { brackets: ['(', '[', '{', \"'\", '\"', '`'] },\n commentTokens: { line: '#' },\n },\n });\n}\n\nexport function createLogsQLExtension(): Array<LRLanguage | Extension> {\n const language = logsqlLanguage();\n return [language];\n}\n"],"names":["LRLanguage","parser","logsqlHighlight","logsqlLanguage","define","configure","props","languageData","closeBrackets","brackets","commentTokens","line","createLogsQLExtension","language"],"mappings":"AAAA,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,SAASA,UAAU,QAAQ,uBAAuB;AAClD,SAASC,MAAM,QAAQ,uBAAuB;AAG9C,SAASC,eAAe,QAAQ,wBAAqB;AAErD,SAASC;IACP,OAAOH,WAAWI,MAAM,CAAC;QACvBH,QAAQA,OAAOI,SAAS,CAAC;YACvBC,OAAO;gBAACJ;aAAgB;QAC1B;QACAK,cAAc;YACZC,eAAe;gBAAEC,UAAU;oBAAC;oBAAK;oBAAK;oBAAK;oBAAK;oBAAK;iBAAI;YAAC;YAC1DC,eAAe;gBAAEC,MAAM;YAAI;QAC7B;IACF;AACF;AAEA,OAAO,SAASC;IACd,MAAMC,WAAWV;IACjB,OAAO;QAACU;KAAS;AACnB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VictoriaLogsDatasource.d.ts","sourceRoot":"","sources":["../../../../src/datasources/victorialogs-datasource/VictoriaLogsDatasource.tsx"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAElE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAE7D,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"VictoriaLogsDatasource.d.ts","sourceRoot":"","sources":["../../../../src/datasources/victorialogs-datasource/VictoriaLogsDatasource.tsx"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAElE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAE7D,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,SAAS,CAAC;AAgC1D,eAAO,MAAM,sBAAsB,EAAE,gBAAgB,CAAC,0BAA0B,EAAE,kBAAkB,CAInG,CAAC"}
|
|
@@ -14,7 +14,7 @@ import { streamQueryRange, statsQueryRange, fieldNames, fieldValues } from "../.
|
|
|
14
14
|
import { VictoriaLogsDatasourceEditor } from "./VictoriaLogsDatasourceEditor.js";
|
|
15
15
|
const createClient = (spec, options)=>{
|
|
16
16
|
const { directUrl, proxy } = spec;
|
|
17
|
-
const { proxyUrl } = options;
|
|
17
|
+
const { proxyUrl, fetch: customFetch } = options;
|
|
18
18
|
const datasourceUrl = directUrl ?? proxyUrl;
|
|
19
19
|
if (datasourceUrl === undefined) {
|
|
20
20
|
throw new Error('No URL specified for VictoriaLogs client. You can use directUrl in the spec to configure it.');
|
|
@@ -26,19 +26,23 @@ const createClient = (spec, options)=>{
|
|
|
26
26
|
},
|
|
27
27
|
streamQueryRange: (params, headers)=>streamQueryRange(params, {
|
|
28
28
|
datasourceUrl,
|
|
29
|
-
headers: headers ?? specHeaders
|
|
29
|
+
headers: headers ?? specHeaders,
|
|
30
|
+
fetch: customFetch
|
|
30
31
|
}),
|
|
31
32
|
statsQueryRange: (params, headers)=>statsQueryRange(params, {
|
|
32
33
|
datasourceUrl,
|
|
33
|
-
headers: headers ?? specHeaders
|
|
34
|
+
headers: headers ?? specHeaders,
|
|
35
|
+
fetch: customFetch
|
|
34
36
|
}),
|
|
35
37
|
fieldNames: (params, headers)=>fieldNames(params, {
|
|
36
38
|
datasourceUrl,
|
|
37
|
-
headers: headers ?? specHeaders
|
|
39
|
+
headers: headers ?? specHeaders,
|
|
40
|
+
fetch: customFetch
|
|
38
41
|
}),
|
|
39
42
|
fieldValues: (params, headers)=>fieldValues(params, {
|
|
40
43
|
datasourceUrl,
|
|
41
|
-
headers: headers ?? specHeaders
|
|
44
|
+
headers: headers ?? specHeaders,
|
|
45
|
+
fetch: customFetch
|
|
42
46
|
})
|
|
43
47
|
};
|
|
44
48
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/datasources/victorialogs-datasource/VictoriaLogsDatasource.tsx"],"sourcesContent":["// Copyright The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport type { DatasourcePlugin } from '@perses-dev/plugin-system';\n\nimport type { VictoriaLogsClient } from '../../model/client';\nimport { streamQueryRange, statsQueryRange, fieldNames, fieldValues } from '../../model/client';\nimport type { VictoriaLogsDatasourceSpec } from './types';\nimport { VictoriaLogsDatasourceEditor } from './VictoriaLogsDatasourceEditor';\n\nconst createClient: DatasourcePlugin<VictoriaLogsDatasourceSpec, VictoriaLogsClient>['createClient'] = (\n spec,\n options,\n) => {\n const { directUrl, proxy } = spec;\n const { proxyUrl } = options;\n\n const datasourceUrl = directUrl ?? proxyUrl;\n if (datasourceUrl === undefined) {\n throw new Error('No URL specified for VictoriaLogs client. You can use directUrl in the spec to configure it.');\n }\n\n const specHeaders = proxy?.spec.headers;\n\n return {\n options: {\n datasourceUrl,\n },\n streamQueryRange: (params, headers)
|
|
1
|
+
{"version":3,"sources":["../../../../src/datasources/victorialogs-datasource/VictoriaLogsDatasource.tsx"],"sourcesContent":["// Copyright The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport type { DatasourcePlugin } from '@perses-dev/plugin-system';\n\nimport type { VictoriaLogsClient } from '../../model/client';\nimport { streamQueryRange, statsQueryRange, fieldNames, fieldValues } from '../../model/client';\nimport type { VictoriaLogsDatasourceSpec } from './types';\nimport { VictoriaLogsDatasourceEditor } from './VictoriaLogsDatasourceEditor';\n\nconst createClient: DatasourcePlugin<VictoriaLogsDatasourceSpec, VictoriaLogsClient>['createClient'] = (\n spec,\n options,\n) => {\n const { directUrl, proxy } = spec;\n const { proxyUrl, fetch: customFetch } = options;\n\n const datasourceUrl = directUrl ?? proxyUrl;\n if (datasourceUrl === undefined) {\n throw new Error('No URL specified for VictoriaLogs client. You can use directUrl in the spec to configure it.');\n }\n\n const specHeaders = proxy?.spec.headers;\n\n return {\n options: {\n datasourceUrl,\n },\n streamQueryRange: (params, headers) =>\n streamQueryRange(params, { datasourceUrl, headers: headers ?? specHeaders, fetch: customFetch }),\n statsQueryRange: (params, headers) =>\n statsQueryRange(params, { datasourceUrl, headers: headers ?? specHeaders, fetch: customFetch }),\n fieldNames: (params, headers) =>\n fieldNames(params, { datasourceUrl, headers: headers ?? specHeaders, fetch: customFetch }),\n fieldValues: (params, headers) =>\n fieldValues(params, { datasourceUrl, headers: headers ?? specHeaders, fetch: customFetch }),\n };\n};\n\nexport const VictoriaLogsDatasource: DatasourcePlugin<VictoriaLogsDatasourceSpec, VictoriaLogsClient> = {\n createClient,\n OptionsEditorComponent: VictoriaLogsDatasourceEditor,\n createInitialOptions: () => ({ directUrl: '' }),\n};\n"],"names":["streamQueryRange","statsQueryRange","fieldNames","fieldValues","VictoriaLogsDatasourceEditor","createClient","spec","options","directUrl","proxy","proxyUrl","fetch","customFetch","datasourceUrl","undefined","Error","specHeaders","headers","params","VictoriaLogsDatasource","O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
|
1
|
+
import type { FetchFn } from '@perses-dev/client';
|
|
1
2
|
import type { VictoriaLogsStreamQueryRangeResponse, VictoriaLogsStatsQueryRangeResponse, VictoriaLogsFieldNamesResponse, VictoriaLogsFieldValuesResponse, VictoriaLogsRequestHeaders } from './types';
|
|
2
3
|
export interface VictoriaLogsBaseParams {
|
|
3
4
|
start: string;
|
|
@@ -22,6 +23,7 @@ export interface VictoriaLogsFieldValuesParams extends VictoriaLogsBaseParams {
|
|
|
22
23
|
export interface VictoriaLogsApiOptions {
|
|
23
24
|
datasourceUrl: string;
|
|
24
25
|
headers?: VictoriaLogsRequestHeaders;
|
|
26
|
+
fetch?: FetchFn;
|
|
25
27
|
}
|
|
26
28
|
export interface VictoriaLogsClient {
|
|
27
29
|
options: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../../src/model/client.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EACV,oCAAoC,EACpC,mCAAmC,EACnC,8BAA8B,EAC9B,+BAA+B,EAC/B,0BAA0B,EAC3B,MAAM,SAAS,CAAC;AAEjB,MAAM,WAAW,sBAAsB;IACrC,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;CACb;AAED,MAAM,WAAW,kCAAmC,SAAQ,sBAAsB;IAChF,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,iCAAkC,SAAQ,sBAAsB;IAC/E,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,4BAA6B,SAAQ,sBAAsB;IAC1E,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,6BAA8B,SAAQ,sBAAsB;IAC3E,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MA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MAAM,EAAE,iCAAiC,EACzC,OAAO,CAAC,EAAE,0BAA0B,KACjC,OAAO,CAAC,mCAAmC,CAAC,CAAC;IAClD,UAAU,EAAE,CACV,MAAM,EAAE,4BAA4B,EACpC,OAAO,CAAC,EAAE,0BAA0B,KACjC,OAAO,CAAC,8BAA8B,CAAC,CAAC;IAC7C,WAAW,EAAE,CACX,MAAM,EAAE,6BAA6B,EACrC,OAAO,CAAC,EAAE,0BAA0B,KACjC,OAAO,CAAC,+BAA+B,CAAC,CAAC;CAC/C;AAoBD,wBAAsB,gBAAgB,CACpC,MAAM,EAAE,kCAAkC,EAC1C,OAAO,EAAE,sBAAsB,GAC9B,OAAO,CAAC,oCAAoC,CAAC,CA+C/C;AAED,wBAAsB,eAAe,CACnC,MAAM,EAAE,iCAAiC,EACzC,OAAO,EAAE,sBAAsB,GAC9B,OAAO,CAAC,mCAAmC,CAAC,CAqB9C;AAED,wBAAsB,UAAU,CAC9B,MAAM,EAAE,4BAA4B,EACpC,OAAO,EAAE,sBAAsB,GAC9B,OAAO,CAAC,8BAA8B,CAAC,CAoBzC;AAED,wBAAsB,WAAW,CAC/B,MAAM,EAAE,6BAA6B,EACrC,OAAO,EAAE,sBAAsB,GAC9B,OAAO,CAAC,+BAA+B,CAAC,CAqB1C"}
|
package/lib/model/client.js
CHANGED
|
@@ -35,7 +35,8 @@ export async function streamQueryRange(params, options) {
|
|
|
35
35
|
if (params?.limit) postData['limit'] = params.limit.toString();
|
|
36
36
|
if (params?.offset) postData['offset'] = params.offset.toString();
|
|
37
37
|
const data = new URLSearchParams(postData).toString();
|
|
38
|
-
const
|
|
38
|
+
const doFetch = options.fetch ?? fetch;
|
|
39
|
+
const response = await doFetch(url.toString(), {
|
|
39
40
|
method: 'POST',
|
|
40
41
|
headers: {
|
|
41
42
|
'Content-Type': 'application/x-www-form-urlencoded',
|
|
@@ -80,7 +81,8 @@ export async function statsQueryRange(params, options) {
|
|
|
80
81
|
};
|
|
81
82
|
if (params?.step) postData['step'] = params.step.toString();
|
|
82
83
|
const data = new URLSearchParams(postData).toString();
|
|
83
|
-
const
|
|
84
|
+
const doFetch = options.fetch ?? fetch;
|
|
85
|
+
const response = await doFetch(url.toString(), {
|
|
84
86
|
method: 'POST',
|
|
85
87
|
headers: {
|
|
86
88
|
'Content-Type': 'application/x-www-form-urlencoded',
|
|
@@ -99,7 +101,8 @@ export async function fieldNames(params, options) {
|
|
|
99
101
|
if (params.start) postData['start'] = params.start;
|
|
100
102
|
if (params.end) postData['end'] = params.end;
|
|
101
103
|
const data = new URLSearchParams(postData).toString();
|
|
102
|
-
const
|
|
104
|
+
const doFetch = options.fetch ?? fetch;
|
|
105
|
+
const response = await doFetch(url.toString(), {
|
|
103
106
|
method: 'POST',
|
|
104
107
|
headers: {
|
|
105
108
|
'Content-Type': 'application/x-www-form-urlencoded',
|
|
@@ -119,7 +122,8 @@ export async function fieldValues(params, options) {
|
|
|
119
122
|
if (params.start) postData['start'] = params.start;
|
|
120
123
|
if (params.end) postData['end'] = params.end;
|
|
121
124
|
const data = new URLSearchParams(postData).toString();
|
|
122
|
-
const
|
|
125
|
+
const doFetch = options.fetch ?? fetch;
|
|
126
|
+
const response = await doFetch(url.toString(), {
|
|
123
127
|
method: 'POST',
|
|
124
128
|
headers: {
|
|
125
129
|
'Content-Type': 'application/x-www-form-urlencoded',
|
package/lib/model/client.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/model/client.ts"],"sourcesContent":["// Copyright The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport type {\n VictoriaLogsStreamQueryRangeResponse,\n VictoriaLogsStatsQueryRangeResponse,\n VictoriaLogsFieldNamesResponse,\n VictoriaLogsFieldValuesResponse,\n VictoriaLogsRequestHeaders,\n} from './types';\n\nexport interface VictoriaLogsBaseParams {\n start: string;\n end: string;\n}\n\nexport interface VictoriaLogsStreamQueryRangeParams extends VictoriaLogsBaseParams {\n query: string;\n limit?: number;\n offset?: number;\n}\n\nexport interface VictoriaLogsStatsQueryRangeParams extends VictoriaLogsBaseParams {\n query: string;\n step?: string;\n}\n\nexport interface VictoriaLogsFieldNamesParams extends VictoriaLogsBaseParams {\n query: string;\n}\n\nexport interface VictoriaLogsFieldValuesParams extends VictoriaLogsBaseParams {\n query: string;\n field: string;\n}\n\nexport interface VictoriaLogsApiOptions {\n datasourceUrl: string;\n headers?: VictoriaLogsRequestHeaders;\n}\n\nexport interface VictoriaLogsClient {\n options: {\n datasourceUrl: string;\n };\n streamQueryRange: (\n params: VictoriaLogsStreamQueryRangeParams,\n headers?: VictoriaLogsRequestHeaders,\n ) => Promise<VictoriaLogsStreamQueryRangeResponse>;\n statsQueryRange: (\n params: VictoriaLogsStatsQueryRangeParams,\n headers?: VictoriaLogsRequestHeaders,\n ) => Promise<VictoriaLogsStatsQueryRangeResponse>;\n fieldNames: (\n params: VictoriaLogsFieldNamesParams,\n headers?: VictoriaLogsRequestHeaders,\n ) => Promise<VictoriaLogsFieldNamesResponse>;\n fieldValues: (\n params: VictoriaLogsFieldValuesParams,\n headers?: VictoriaLogsRequestHeaders,\n ) => Promise<VictoriaLogsFieldValuesResponse>;\n}\n\nfunction buildUrl(path: string, datasourceUrl: string): URL {\n if (datasourceUrl.startsWith('http://') || datasourceUrl.startsWith('https://')) {\n return new URL(path, datasourceUrl);\n }\n\n let fullPath = datasourceUrl;\n // Assume relative path, ensure no double slashes\n if (datasourceUrl.endsWith('/') && path.startsWith('/')) {\n fullPath = datasourceUrl + path.slice(1);\n } else if (!datasourceUrl.endsWith('/') && !path.startsWith('/')) {\n fullPath = datasourceUrl + '/' + path;\n } else {\n fullPath = datasourceUrl + path;\n }\n\n return new URL(fullPath, window.location.origin);\n}\n\nexport async function streamQueryRange(\n params: VictoriaLogsStreamQueryRangeParams,\n options: VictoriaLogsApiOptions,\n): Promise<VictoriaLogsStreamQueryRangeResponse> {\n const url = buildUrl('/select/logsql/query', options.datasourceUrl);\n const postData: Record<string, string> = {\n query: params.query,\n start: params.start,\n end: params.end,\n };\n if (params?.limit) postData['limit'] = params.limit.toString();\n if (params?.offset) postData['offset'] = params.offset.toString();\n\n const data = new URLSearchParams(postData).toString();\n const response = await fetch(url.toString(), {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/x-www-form-urlencoded',\n Accept: 'application/stream+json',\n ...options.headers,\n },\n body: data,\n });\n if (response.status !== 200) {\n throw new Error(await response.text());\n }\n const output: VictoriaLogsStreamQueryRangeResponse = [];\n\n if (!response?.body) return output;\n const reader = response.body.getReader();\n const decoder = new TextDecoder('utf-8');\n let buffer = '';\n\n let result = await reader.read();\n while (!result.done) {\n buffer += decoder.decode(result.value, { stream: true });\n let boundary = buffer.indexOf('\\n');\n while (boundary !== -1) {\n const line = buffer.slice(0, boundary);\n buffer = buffer.slice(boundary + 1);\n output.push(JSON.parse(line));\n boundary = buffer.indexOf('\\n');\n }\n result = await reader.read();\n }\n if (buffer.trim().length > 0) {\n output.push(JSON.parse(buffer));\n }\n return output;\n}\n\nexport async function statsQueryRange(\n params: VictoriaLogsStatsQueryRangeParams,\n options: VictoriaLogsApiOptions,\n): Promise<VictoriaLogsStatsQueryRangeResponse> {\n const url = buildUrl('/select/logsql/stats_query_range', options.datasourceUrl);\n const postData: Record<string, string> = {\n query: params.query,\n start: params.start,\n end: params.end,\n };\n if (params?.step) postData['step'] = params.step.toString();\n\n const data = new URLSearchParams(postData).toString();\n const response = await fetch(url.toString(), {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/x-www-form-urlencoded',\n Accept: 'application/json',\n ...options.headers,\n },\n body: data,\n });\n return await response.json();\n}\n\nexport async function fieldNames(\n params: VictoriaLogsFieldNamesParams,\n options: VictoriaLogsApiOptions,\n): Promise<VictoriaLogsFieldNamesResponse> {\n const url = buildUrl('/select/logsql/field_names', options.datasourceUrl);\n const postData: Record<string, string> = {\n query: params.query,\n };\n if (params.start) postData['start'] = params.start;\n if (params.end) postData['end'] = params.end;\n\n const data = new URLSearchParams(postData).toString();\n const response = await fetch(url.toString(), {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/x-www-form-urlencoded',\n Accept: 'application/json',\n ...options.headers,\n },\n body: data,\n });\n return await response.json();\n}\n\nexport async function fieldValues(\n params: VictoriaLogsFieldValuesParams,\n options: VictoriaLogsApiOptions,\n): Promise<VictoriaLogsFieldValuesResponse> {\n const url = buildUrl(`/select/logsql/field_values`, options.datasourceUrl);\n const postData: Record<string, string> = {\n query: params.query,\n field: params.field,\n };\n if (params.start) postData['start'] = params.start;\n if (params.end) postData['end'] = params.end;\n\n const data = new URLSearchParams(postData).toString();\n const response = await fetch(url.toString(), {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/x-www-form-urlencoded',\n Accept: 'application/json',\n ...options.headers,\n },\n body: data,\n });\n return await response.json();\n}\n"],"names":["buildUrl","path","datasourceUrl","startsWith","URL","fullPath","endsWith","slice","window","location","origin","streamQueryRange","params","options","url","postData","query","start","end","limit","toString","offset","data","URLSearchParams","response","fetch","method","headers","Accept","body","status","Error","text","output","reader","getReader","decoder","TextDecoder","buffer","result","read","done","decode","value","stream","boundary","indexOf","line","push","JSON","parse","trim","length","statsQueryRange","step","json","fieldNames","fieldValues","field"],"mappings":"AAAA,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AA8DjC,SAASA,SAASC,IAAY,EAAEC,aAAqB;IACnD,IAAIA,cAAcC,UAAU,CAAC,cAAcD,cAA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AQX,aAAa;IACxE,MAAMa,WAAmC;QACvCC,OAAOJ,OAAOI,KAAK;IACrB;IACA,IAAIJ,OAAOK,KAAK,EAAEF,QAAQ,CAAC,QAAQ,GAAGH,OAAOK,KAAK;IAClD,IAAIL,OAAOM,GAAG,EAAEH,QAAQ,CAAC,MAAM,GAAGH,OAAOM,GAAG;IAE5C,MAAMI,OAAO,IAAIC,gBAAgBR,UAAUK,QAAQ;IACnD,MAAMI,WAAW,MAAMC,MAAMX,IAAIM,QAAQ,IAAI;QAC3CM,QAAQ;QACRC,SAAS;YACP,gBAAgB;YAChBC,QAAQ;YACR,GAAGf,QAAQc,OAAO;QACpB;QACAE,MAAMP;IACR;IACA,OAAO,MAAME,SAAS+B,IAAI;AAC5B;AAEA,OAAO,eAAeE,YACpB7C,MAAqC,EACrCC,OAA+B;IAE/B,MAAMC,MAAMd,SAAS,CAAC,2BAA2B,CAAC,EAAEa,QAAQX,aAAa;IACzE,MAAMa,WAAmC;QACvCC,OAAOJ,OAAOI,KAAK;QACnB0C,OAAO9C,OAAO8C,KAAK;IACrB;IACA,IAAI9C,OAAOK,KAAK,EAAEF,QAAQ,CAAC,QAAQ,GAAGH,OAAOK,KAAK;IAClD,IAAIL,OAAOM,GAAG,EAAEH,QAAQ,CAAC,MAAM,GAAGH,OAAOM,GAAG;IAE5C,MAAMI,OAAO,IAAIC,gBAAgBR,UAAUK,QAAQ;IACnD,MAAMI,WAAW,MAAMC,MAAMX,IAAIM,QAAQ,IAAI;QAC3CM,QAAQ;QACRC,SAAS;YACP,gBAAgB;YAChBC,QAAQ;YACR,GAAGf,QAAQc,OAAO;QACpB;QACAE,MAAMP;IACR;IACA,OAAO,MAAME,SAAS+B,IAAI;AAC5B"}
|
|
1
|
+
{"version":3,"sources":["../../../src/model/client.ts"],"sourcesContent":["// Copyright The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport type { FetchFn } from '@perses-dev/client';\n\nimport type {\n VictoriaLogsStreamQueryRangeResponse,\n VictoriaLogsStatsQueryRangeResponse,\n VictoriaLogsFieldNamesResponse,\n VictoriaLogsFieldValuesResponse,\n VictoriaLogsRequestHeaders,\n} from './types';\n\nexport interface VictoriaLogsBaseParams {\n start: string;\n end: string;\n}\n\nexport interface VictoriaLogsStreamQueryRangeParams extends VictoriaLogsBaseParams {\n query: string;\n limit?: number;\n offset?: number;\n}\n\nexport interface VictoriaLogsStatsQueryRangeParams extends VictoriaLogsBaseParams {\n query: string;\n step?: string;\n}\n\nexport interface VictoriaLogsFieldNamesParams extends VictoriaLogsBaseParams {\n query: string;\n}\n\nexport interface VictoriaLogsFieldValuesParams extends VictoriaLogsBaseParams {\n query: string;\n field: string;\n}\n\nexport interface VictoriaLogsApiOptions {\n datasourceUrl: string;\n headers?: VictoriaLogsRequestHeaders;\n fetch?: FetchFn;\n}\n\nexport interface VictoriaLogsClient {\n options: {\n datasourceUrl: string;\n };\n streamQueryRange: (\n params: VictoriaLogsStreamQueryRangeParams,\n headers?: VictoriaLogsRequestHeaders,\n ) => Promise<VictoriaLogsStreamQueryRangeResponse>;\n statsQueryRange: (\n params: VictoriaLogsStatsQueryRangeParams,\n headers?: VictoriaLogsRequestHeaders,\n ) => Promise<VictoriaLogsStatsQueryRangeResponse>;\n fieldNames: (\n params: VictoriaLogsFieldNamesParams,\n headers?: VictoriaLogsRequestHeaders,\n ) => Promise<VictoriaLogsFieldNamesResponse>;\n fieldValues: (\n params: VictoriaLogsFieldValuesParams,\n headers?: VictoriaLogsRequestHeaders,\n ) => Promise<VictoriaLogsFieldValuesResponse>;\n}\n\nfunction buildUrl(path: string, datasourceUrl: string): URL {\n if (datasourceUrl.startsWith('http://') || datasourceUrl.startsWith('https://')) {\n return new URL(path, datasourceUrl);\n }\n\n let fullPath = datasourceUrl;\n // Assume relative path, ensure no double slashes\n if (datasourceUrl.endsWith('/') && path.startsWith('/')) {\n fullPath = datasourceUrl + path.slice(1);\n } else if (!datasourceUrl.endsWith('/') && !path.startsWith('/')) {\n fullPath = datasourceUrl + '/' + path;\n } else {\n fullPath = datasourceUrl + path;\n }\n\n return new URL(fullPath, window.location.origin);\n}\n\nexport async function streamQueryRange(\n params: VictoriaLogsStreamQueryRangeParams,\n options: VictoriaLogsApiOptions,\n): Promise<VictoriaLogsStreamQueryRangeResponse> {\n const url = buildUrl('/select/logsql/query', options.datasourceUrl);\n const postData: Record<string, string> = {\n query: params.query,\n start: params.start,\n end: params.end,\n };\n if (params?.limit) postData['limit'] = params.limit.toString();\n if (params?.offset) postData['offset'] = params.offset.toString();\n\n const data = new URLSearchParams(postData).toString();\n const doFetch = options.fetch ?? fetch;\n const response = await doFetch(url.toString(), {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/x-www-form-urlencoded',\n Accept: 'application/stream+json',\n ...options.headers,\n },\n body: data,\n });\n if (response.status !== 200) {\n throw new Error(await response.text());\n }\n const output: VictoriaLogsStreamQueryRangeResponse = [];\n\n if (!response?.body) return output;\n const reader = response.body.getReader();\n const decoder = new TextDecoder('utf-8');\n let buffer = '';\n\n let result = await reader.read();\n while (!result.done) {\n buffer += decoder.decode(result.value, { stream: true });\n let boundary = buffer.indexOf('\\n');\n while (boundary !== -1) {\n const line = buffer.slice(0, boundary);\n buffer = buffer.slice(boundary + 1);\n output.push(JSON.parse(line));\n boundary = buffer.indexOf('\\n');\n }\n result = await reader.read();\n }\n if (buffer.trim().length > 0) {\n output.push(JSON.parse(buffer));\n }\n return output;\n}\n\nexport async function statsQueryRange(\n params: VictoriaLogsStatsQueryRangeParams,\n options: VictoriaLogsApiOptions,\n): Promise<VictoriaLogsStatsQueryRangeResponse> {\n const url = buildUrl('/select/logsql/stats_query_range', options.datasourceUrl);\n const postData: Record<string, string> = {\n query: params.query,\n start: params.start,\n end: params.end,\n };\n if (params?.step) postData['step'] = params.step.toString();\n\n const data = new URLSearchParams(postData).toString();\n const doFetch = options.fetch ?? fetch;\n const response = await doFetch(url.toString(), {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/x-www-form-urlencoded',\n Accept: 'application/json',\n ...options.headers,\n },\n body: data,\n });\n return await response.json();\n}\n\nexport async function fieldNames(\n params: VictoriaLogsFieldNamesParams,\n options: VictoriaLogsApiOptions,\n): Promise<VictoriaLogsFieldNamesResponse> {\n const url = buildUrl('/select/logsql/field_names', options.datasourceUrl);\n const postData: Record<string, string> = {\n query: params.query,\n };\n if (params.start) postData['start'] = params.start;\n if (params.end) postData['end'] = params.end;\n\n const data = new URLSearchParams(postData).toString();\n const doFetch = options.fetch ?? fetch;\n const response = await doFetch(url.toString(), {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/x-www-form-urlencoded',\n Accept: 'application/json',\n ...options.headers,\n },\n body: data,\n });\n return await response.json();\n}\n\nexport async function fieldValues(\n params: VictoriaLogsFieldValuesParams,\n options: VictoriaLogsApiOptions,\n): Promise<VictoriaLogsFieldValuesResponse> {\n const url = buildUrl(`/select/logsql/field_values`, options.datasourceUrl);\n const postData: Record<string, string> = {\n query: params.query,\n field: params.field,\n };\n if (params.start) postData['start'] = params.start;\n if (params.end) postData['end'] = params.end;\n\n const data = new URLSearchParams(postData).toString();\n const doFetch = options.fetch ?? fetch;\n const response = await doFetch(url.toString(), {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/x-www-form-urlencoded',\n Accept: 'application/json',\n ...options.headers,\n },\n body: data,\n });\n return await response.json();\n}\n"],"names":["buildUrl","path","datasourceUrl","startsWith","URL","fullPath","endsWith","slice","window","location","origin","streamQueryRange","params","options","url","postData","query","start","end","limit","toString","offset","data","URLSearchParams","doFetch","fetch","response","method","headers","Accept","body","status","Error","text","output","reader","getReader","decoder","TextDecoder","buffer","result","read","done","decode","value","stream","boundary","indexOf","line","push","JSON","parse","trim","length","statsQueryRange","step","json","fieldNames","fieldValues","field"],"mappings":"AAAA,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAiEjC,SAASA,SAASC,IAAY,EAAEC,aAAqB;IACnD,IAAIA,cAAcC,UAAU,CAAC,cAAcD,cAAcC,UAAU,CAAC,aAAa;QAC/E,OAAO,IAAIC,IAAIH,MAAMC;IACvB;IAEA,IAAIG,WAAWH;IACf,iDAAiD;IACjD,IAAIA,cAAcI,QAAQ,CAAC,QAAQL,KAAKE,UAAU,CAAC,MAAM;QACvDE,WAAWH,gBAAgBD,KAAKM,KAAK,CAAC;IACxC,OAAO,IAAI,CAACL,cAAcI,QAAQ,CAAC,QAAQ,CAACL,KAAKE,UAAU,CAAC,MAAM;QAChEE,WAAWH,gBAAgB,MAAMD;IACnC,OAAO;QACLI,WAAWH,gBAAgBD;IAC7B;IAEA,OAAO,IAAIG,IAAIC,UAAUG,OAAOC,QAAQ,CAACC,MAAM;AACjD;AAEA,OAAO,eAAeC,iBACpBC,MAA0C,EAC1CC,OAA+B;IAE/B,MAAMC,MAAMd,SAAS,wBAAwBa,QAAQX,aAAa;IAClE,MAAMa,WAAmC;QACvCC,OAAOJ,OAAOI,KAAK;QACnBC,OAAOL,OAAOK,KAAK;QACnBC,KAAKN,OAAOM,GAAG;IACjB;IACA,IAAIN,QAAQO,OAAOJ,QAAQ,CAAC,QAAQ,GAAGH,OAAOO,KAAK,CAACC,QAAQ;IAC5D,IAAIR,QAAQS,QAAQN,QAAQ,CAAC,SAAS,GAAGH,OAAOS,MAAM,CAACD,QAAQ;IAE/D,MAAME,OAAO,IAAIC,gBAAgBR,UAAUK,QAAQ;IACnD,MAAMI,UAAUX,QAAQY,KAAK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OM,GAAG,EAAEH,QAAQ,CAAC,MAAM,GAAGH,OAAOM,GAAG;IAE5C,MAAMI,OAAO,IAAIC,gBAAgBR,UAAUK,QAAQ;IACnD,MAAMI,UAAUX,QAAQY,KAAK,IAAIA;IACjC,MAAMC,WAAW,MAAMF,QAAQV,IAAIM,QAAQ,IAAI;QAC7CO,QAAQ;QACRC,SAAS;YACP,gBAAgB;YAChBC,QAAQ;YACR,GAAGhB,QAAQe,OAAO;QACpB;QACAE,MAAMR;IACR;IACA,OAAO,MAAMI,SAAS8B,IAAI;AAC5B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VictoriaLogsLogQueryEditor.d.ts","sourceRoot":"","sources":["../../../../src/queries/victorialogs-log-query/VictoriaLogsLogQueryEditor.tsx"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAyB,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAE3F,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAO1C,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,SAAS,CAAC;AAExD,KAAK,4BAA4B,GAAG,kBAAkB,CAAC,wBAAwB,CAAC,CAAC;AAEjF,wBAAgB,0BAA0B,CAAC,KAAK,EAAE,4BAA4B,GAAG,YAAY,
|
|
1
|
+
{"version":3,"file":"VictoriaLogsLogQueryEditor.d.ts","sourceRoot":"","sources":["../../../../src/queries/victorialogs-log-query/VictoriaLogsLogQueryEditor.tsx"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAyB,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAE3F,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAO1C,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,SAAS,CAAC;AAExD,KAAK,4BAA4B,GAAG,kBAAkB,CAAC,wBAAwB,CAAC,CAAC;AAEjF,wBAAgB,0BAA0B,CAAC,KAAK,EAAE,4BAA4B,GAAG,YAAY,CAqF5F"}
|
|
@@ -14,7 +14,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
14
14
|
import { InputLabel, Stack } from "@mui/material";
|
|
15
15
|
import { createModEnterHandler } from "@perses-dev/dashboards";
|
|
16
16
|
import { DatasourceSelect, isVariableDatasource, useDatasourceSelectValueToSelector } from "@perses-dev/plugin-system";
|
|
17
|
-
import { useCallback, useState
|
|
17
|
+
import { useCallback, useState } from "react";
|
|
18
18
|
import { LogsQLEditor } from "../../components/logsql-editor.js";
|
|
19
19
|
import { VICTORIALOGS_DATASOURCE_KIND } from "../../model/index.js";
|
|
20
20
|
import { DATASOURCE_KIND, DEFAULT_DATASOURCE } from "../constants.js";
|
|
@@ -27,12 +27,11 @@ export function VictoriaLogsLogQueryEditor(props) {
|
|
|
27
27
|
// const victorialogsURL = client?.options.datasourceUrl;
|
|
28
28
|
// Local state for editor value to prevent query_range calls on every keystroke
|
|
29
29
|
const [localQuery, setLocalQuery] = useState(value.query);
|
|
30
|
-
|
|
31
|
-
|
|
30
|
+
const [previousQuery, setPreviousQuery] = useState(value.query);
|
|
31
|
+
if (value.query !== previousQuery) {
|
|
32
|
+
setPreviousQuery(value.query);
|
|
32
33
|
setLocalQuery(value.query);
|
|
33
|
-
}
|
|
34
|
-
value.query
|
|
35
|
-
]);
|
|
34
|
+
}
|
|
36
35
|
const handleDatasourceChange = (newDatasourceSelection)=>{
|
|
37
36
|
if (!isVariableDatasource(newDatasourceSelection) && newDatasourceSelection.kind === DATASOURCE_KIND) {
|
|
38
37
|
onChange({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/queries/victorialogs-log-query/VictoriaLogsLogQueryEditor.tsx"],"sourcesContent":["// Copyright The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { InputLabel, Stack } from '@mui/material';\nimport { createModEnterHandler } from '@perses-dev/dashboards';\nimport type { DatasourceSelectProps, OptionsEditorProps } from '@perses-dev/plugin-system';\nimport { DatasourceSelect, isVariableDatasource, useDatasourceSelectValueToSelector } from '@perses-dev/plugin-system';\nimport type { ReactElement } from 'react';\nimport { useCallback, useState
|
|
1
|
+
{"version":3,"sources":["../../../../src/queries/victorialogs-log-query/VictoriaLogsLogQueryEditor.tsx"],"sourcesContent":["// Copyright The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { InputLabel, Stack } from '@mui/material';\nimport { createModEnterHandler } from '@perses-dev/dashboards';\nimport type { DatasourceSelectProps, OptionsEditorProps } from '@perses-dev/plugin-system';\nimport { DatasourceSelect, isVariableDatasource, useDatasourceSelectValueToSelector } from '@perses-dev/plugin-system';\nimport type { ReactElement } from 'react';\nimport { useCallback, useState } from 'react';\n\nimport { LogsQLEditor } from '../../components/logsql-editor';\nimport type { VictoriaLogsDatasourceSelector } from '../../model';\nimport { VICTORIALOGS_DATASOURCE_KIND } from '../../model';\nimport { DATASOURCE_KIND, DEFAULT_DATASOURCE } from '../constants';\nimport type { VictoriaLogsLogQuerySpec } from './types';\n\ntype VictoriaLogsQueryEditorProps = OptionsEditorProps<VictoriaLogsLogQuerySpec>;\n\nexport function VictoriaLogsLogQueryEditor(props: VictoriaLogsQueryEditorProps): ReactElement {\n const { onChange, value } = props;\n const { datasource } = value;\n const datasourceSelectValue = datasource ?? DEFAULT_DATASOURCE;\n const selectedDatasource = useDatasourceSelectValueToSelector(\n datasourceSelectValue,\n VICTORIALOGS_DATASOURCE_KIND,\n ) as VictoriaLogsDatasourceSelector;\n\n // const { data: client } = useDatasourceClient<VictoriaLogsClient>(selectedDatasource);\n // const victorialogsURL = client?.options.datasourceUrl;\n\n // Local state for editor value to prevent query_range calls on every keystroke\n const [localQuery, setLocalQuery] = useState(value.query);\n\n const [previousQuery, setPreviousQuery] = useState(value.query);\n if (value.query !== previousQuery) {\n setPreviousQuery(value.query);\n setLocalQuery(value.query);\n }\n\n const handleDatasourceChange: DatasourceSelectProps['onChange'] = (newDatasourceSelection) => {\n if (!isVariableDatasource(newDatasourceSelection) && newDatasourceSelection.kind === DATASOURCE_KIND) {\n onChange({ ...value, datasource: newDatasourceSelection });\n return;\n }\n\n throw new Error('Got unexpected non VictoriaLogsQuery datasource selection');\n };\n\n // Debounced query change handler to prevent excessive query_range calls\n const handleQueryChange = useCallback((newQuery: string) => {\n setLocalQuery(newQuery);\n }, []);\n\n // Immediate query execution on Enter or blur\n const handleQueryExecute = useCallback(\n (query: string) => {\n onChange({ ...value, query });\n },\n [onChange, value],\n );\n\n return (\n <Stack spacing={1.5} paddingBottom={1}>\n <div>\n <InputLabel\n sx={{\n display: 'block',\n marginBottom: '4px',\n fontWeight: 500,\n }}\n >\n Datasource\n </InputLabel>\n <DatasourceSelect\n datasourcePluginKind={DATASOURCE_KIND}\n value={selectedDatasource}\n onChange={handleDatasourceChange}\n label=\"VictoriaLogs Datasource\"\n notched\n />\n </div>\n\n <div>\n <InputLabel\n sx={{\n display: 'block',\n marginBottom: '4px',\n fontWeight: 500,\n }}\n >\n LogsQL Query\n </InputLabel>\n <LogsQLEditor\n value={localQuery}\n onChange={handleQueryChange}\n onBlur={() => handleQueryExecute(localQuery)}\n onKeyDown={createModEnterHandler(() => handleQueryExecute(localQuery))}\n placeholder='Enter LogsQL query (e.g. {job=\"mysql\"} |= \"error\")'\n // height=\"120px\"\n />\n </div>\n </Stack>\n );\n}\n"],"names":["InputLabel","Stack","createModEnterHandler","DatasourceSelect","isVariableDatasource","useDatasourceSelectValueToSelector","useCallback","useState","LogsQLEditor","VICTORIALOGS_DATASOURCE_KIND","DATASOURCE_KIND","DEFAULT_DATASOURCE","VictoriaLogsLogQueryEditor","props","onChange","value","datasource","datasourceSelectValue","selectedDatasource","localQuery","setLocalQuery","query","previousQuery","setPreviousQuery","handleDatasourceChange","newDatasourceSelection","kind","Error","handleQueryChange","newQuery","handleQueryExecute","spacing","paddingBottom","div","sx","display","marginBottom","fontWeight","datasourcePluginKind","label","notched","onBlur","onKeyDown","placeholder"],"mappings":";AAAA,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,SAASA,UAAU,EAAEC,KAAK,QAAQ,gBAAgB;AAClD,SAASC,qBAAqB,QAAQ,yBAAyB;AAE/D,SAASC,gBAAgB,EAAEC,oBAAoB,EAAEC,kCAAkC,QAAQ,4BAA4B;AAEvH,SAASC,WAAW,EAAEC,QAAQ,QAAQ,QAAQ;AAE9C,SAASC,YAAY,QAAQ,oCAAiC;AAE9D,SAASC,4BAA4B,QAAQ,uBAAc;AAC3D,SAASC,eAAe,EAAEC,kBAAkB,QAAQ,kBAAe;AAKnE,OAAO,SAASC,2BAA2BC,KAAmC;IAC5E,MAAM,EAAEC,QAAQ,EAAEC,KAAK,EAAE,GAAGF;IAC5B,MAAM,EAAEG,UAAU,EAAE,GAAGD;IACvB,MAAME,wBAAwBD,cAAcL;IAC5C,MAAMO,qBAAqBb,mCACzBY,uBACAR;IAGF,wFAAwF;IACxF,yDAAyD;IAEzD,+EAA+E;IAC/E,MAAM,CAACU,YAAYC,cAAc,GAAGb,SAASQ,MAAMM,KAAK;IAExD,MAAM,CAACC,eAAeC,iBAAiB,GAAGhB,SAASQ,MAAMM,KAAK;IAC9D,IAAIN,MAAMM,KAAK,KAAKC,eAAe;QACjCC,iBAAiBR,MAAMM,KAAK;QAC5BD,cAAcL,MAAMM,KAAK;IAC3B;IAEA,MAAMG,yBAA4D,CAACC;QACjE,IAAI,CAACrB,qBAAqBqB,2BAA2BA,uBAAuBC,IAAI,KAAKhB,iBAAiB;YACpGI,SAAS;gBAAE,GAAGC,KAAK;gBAAEC,YAAYS;YAAuB;YACxD;QACF;QAEA,MAAM,IAAIE,MAAM;IAClB;IAEA,wEAAwE;IACxE,MAAMC,oBAAoBtB,YAAY,CAACuB;QACrCT,cAAcS;IAChB,GAAG,EAAE;IAEL,6CAA6C;IAC7C,MAAMC,qBAAqBxB,YACzB,CAACe;QACCP,SAAS;YAAE,GAAGC,KAAK;YAAEM;QAAM;IAC7B,GACA;QAACP;QAAUC;KAAM;IAGnB,qBACE,MAACd;QAAM8B,SAAS;QAAKC,eAAe;;0BAClC,MAACC;;kCACC,KAACjC;wBACCkC,IAAI;4BACFC,SAAS;4BACTC,cAAc;4BACdC,YAAY;wBACd;kCACD;;kCAGD,KAAClC;wBACCmC,sBAAsB5B;wBACtBK,OAAOG;wBACPJ,UAAUU;wBACVe,OAAM;wBACNC,OAAO;;;;0BAIX,MAACP;;kCACC,KAACjC;wBACCkC,IAAI;4BACFC,SAAS;4BACTC,cAAc;4BACdC,YAAY;wBACd;kCACD;;kCAGD,KAAC7B;wBACCO,OAAOI;wBACPL,UAAUc;wBACVa,QAAQ,IAAMX,mBAAmBX;wBACjCuB,WAAWxC,sBAAsB,IAAM4B,mBAAmBX;wBAC1DwB,aAAY;;;;;;AAMtB"}
|
package/lib/queries/victorialogs-time-series-query/VictoriaLogsTimeSeriesQueryEditor.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VictoriaLogsTimeSeriesQueryEditor.d.ts","sourceRoot":"","sources":["../../../../src/queries/victorialogs-time-series-query/VictoriaLogsTimeSeriesQueryEditor.tsx"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAyB,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAE3F,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAO1C,OAAO,KAAK,EAAE,+BAA+B,EAAE,MAAM,SAAS,CAAC;AAE/D,KAAK,4BAA4B,GAAG,kBAAkB,CAAC,+BAA+B,CAAC,CAAC;AAExF,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,4BAA4B,GAAG,YAAY,
|
|
1
|
+
{"version":3,"file":"VictoriaLogsTimeSeriesQueryEditor.d.ts","sourceRoot":"","sources":["../../../../src/queries/victorialogs-time-series-query/VictoriaLogsTimeSeriesQueryEditor.tsx"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAyB,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAE3F,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAO1C,OAAO,KAAK,EAAE,+BAA+B,EAAE,MAAM,SAAS,CAAC;AAE/D,KAAK,4BAA4B,GAAG,kBAAkB,CAAC,+BAA+B,CAAC,CAAC;AAExF,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,4BAA4B,GAAG,YAAY,CAkFzF"}
|
|
@@ -14,7 +14,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
14
14
|
import { InputLabel, Stack } from "@mui/material";
|
|
15
15
|
import { createModEnterHandler } from "@perses-dev/dashboards";
|
|
16
16
|
import { DatasourceSelect, isVariableDatasource, useDatasourceSelectValueToSelector } from "@perses-dev/plugin-system";
|
|
17
|
-
import { useCallback, useState
|
|
17
|
+
import { useCallback, useState } from "react";
|
|
18
18
|
import { LogsQLEditor } from "../../components/logsql-editor.js";
|
|
19
19
|
import { VICTORIALOGS_DATASOURCE_KIND } from "../../model/index.js";
|
|
20
20
|
import { DATASOURCE_KIND, DEFAULT_DATASOURCE } from "../constants.js";
|
|
@@ -25,12 +25,11 @@ export function VictoriaLogsQueryEditor(props) {
|
|
|
25
25
|
const selectedDatasource = useDatasourceSelectValueToSelector(datasourceSelectValue, VICTORIALOGS_DATASOURCE_KIND);
|
|
26
26
|
// Local state for editor value to prevent query_range calls on every keystroke
|
|
27
27
|
const [localQuery, setLocalQuery] = useState(value.query);
|
|
28
|
-
|
|
29
|
-
|
|
28
|
+
const [previousQuery, setPreviousQuery] = useState(value.query);
|
|
29
|
+
if (value.query !== previousQuery) {
|
|
30
|
+
setPreviousQuery(value.query);
|
|
30
31
|
setLocalQuery(value.query);
|
|
31
|
-
}
|
|
32
|
-
value.query
|
|
33
|
-
]);
|
|
32
|
+
}
|
|
34
33
|
const handleDatasourceChange = (newDatasourceSelection)=>{
|
|
35
34
|
if (!isVariableDatasource(newDatasourceSelection) && newDatasourceSelection.kind === DATASOURCE_KIND) {
|
|
36
35
|
onChange({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/queries/victorialogs-time-series-query/VictoriaLogsTimeSeriesQueryEditor.tsx"],"sourcesContent":["// Copyright The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { InputLabel, Stack } from '@mui/material';\nimport { createModEnterHandler } from '@perses-dev/dashboards';\nimport type { DatasourceSelectProps, OptionsEditorProps } from '@perses-dev/plugin-system';\nimport { DatasourceSelect, isVariableDatasource, useDatasourceSelectValueToSelector } from '@perses-dev/plugin-system';\nimport type { ReactElement } from 'react';\nimport { useCallback, useState
|
|
1
|
+
{"version":3,"sources":["../../../../src/queries/victorialogs-time-series-query/VictoriaLogsTimeSeriesQueryEditor.tsx"],"sourcesContent":["// Copyright The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { InputLabel, Stack } from '@mui/material';\nimport { createModEnterHandler } from '@perses-dev/dashboards';\nimport type { DatasourceSelectProps, OptionsEditorProps } from '@perses-dev/plugin-system';\nimport { DatasourceSelect, isVariableDatasource, useDatasourceSelectValueToSelector } from '@perses-dev/plugin-system';\nimport type { ReactElement } from 'react';\nimport { useCallback, useState } from 'react';\n\nimport { LogsQLEditor } from '../../components/logsql-editor';\nimport type { VictoriaLogsDatasourceSelector } from '../../model';\nimport { VICTORIALOGS_DATASOURCE_KIND } from '../../model';\nimport { DATASOURCE_KIND, DEFAULT_DATASOURCE } from '../constants';\nimport type { VictoriaLogsTimeSeriesQuerySpec } from './types';\n\ntype VictoriaLogsQueryEditorProps = OptionsEditorProps<VictoriaLogsTimeSeriesQuerySpec>;\n\nexport function VictoriaLogsQueryEditor(props: VictoriaLogsQueryEditorProps): ReactElement {\n const { onChange, value } = props;\n const { datasource } = value;\n const datasourceSelectValue = datasource ?? DEFAULT_DATASOURCE;\n const selectedDatasource = useDatasourceSelectValueToSelector(\n datasourceSelectValue,\n VICTORIALOGS_DATASOURCE_KIND,\n ) as VictoriaLogsDatasourceSelector;\n\n // Local state for editor value to prevent query_range calls on every keystroke\n const [localQuery, setLocalQuery] = useState(value.query);\n\n const [previousQuery, setPreviousQuery] = useState(value.query);\n if (value.query !== previousQuery) {\n setPreviousQuery(value.query);\n setLocalQuery(value.query);\n }\n\n const handleDatasourceChange: DatasourceSelectProps['onChange'] = (newDatasourceSelection) => {\n if (!isVariableDatasource(newDatasourceSelection) && newDatasourceSelection.kind === DATASOURCE_KIND) {\n onChange({ ...value, datasource: newDatasourceSelection });\n return;\n }\n\n throw new Error('Got unexpected non VictoriaLogsQuery datasource selection');\n };\n\n // Debounced query change handler to prevent excessive query_range calls\n const handleQueryChange = useCallback((newQuery: string) => {\n setLocalQuery(newQuery);\n }, []);\n\n // Immediate query execution on Enter or blur\n const handleQueryExecute = useCallback(\n (query: string) => {\n onChange({ ...value, query });\n },\n [onChange, value],\n );\n\n return (\n <Stack spacing={1.5} paddingBottom={1}>\n <div>\n <InputLabel\n sx={{\n display: 'block',\n marginBottom: '4px',\n fontWeight: 500,\n }}\n >\n Datasource\n </InputLabel>\n <DatasourceSelect\n datasourcePluginKind={DATASOURCE_KIND}\n value={selectedDatasource}\n onChange={handleDatasourceChange}\n label=\"VictoriaLogs Datasource\"\n notched\n />\n </div>\n\n <div>\n <InputLabel\n sx={{\n display: 'block',\n marginBottom: '4px',\n fontWeight: 500,\n }}\n >\n LogsQL Query\n </InputLabel>\n <LogsQLEditor\n value={localQuery}\n onChange={handleQueryChange}\n onBlur={() => handleQueryExecute(localQuery)}\n onKeyDown={createModEnterHandler(() => handleQueryExecute(localQuery))}\n placeholder='Enter LogsQL query (e.g. {job=\"mysql\"} |= \"error\")'\n // height=\"120px\"\n />\n </div>\n </Stack>\n );\n}\n"],"names":["InputLabel","Stack","createModEnterHandler","DatasourceSelect","isVariableDatasource","useDatasourceSelectValueToSelector","useCallback","useState","LogsQLEditor","VICTORIALOGS_DATASOURCE_KIND","DATASOURCE_KIND","DEFAULT_DATASOURCE","VictoriaLogsQueryEditor","props","onChange","value","datasource","datasourceSelectValue","selectedDatasource","localQuery","setLocalQuery","query","previousQuery","setPreviousQuery","handleDatasourceChange","newDatasourceSelection","kind","Error","handleQueryChange","newQuery","handleQueryExecute","spacing","paddingBottom","div","sx","display","marginBottom","fontWeight","datasourcePluginKind","label","notched","onBlur","onKeyDown","placeholder"],"mappings":";AAAA,+BAA+B;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