@perses-dev/victorialogs-plugin 0.5.0-beta.7 → 0.5.0-rc.1

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.
Files changed (126) hide show
  1. package/__mf/js/{VictoriaLogs.ca556252.js → VictoriaLogs.e8a4ae5a.js} +7 -7
  2. package/__mf/js/async/1433.9776da61.js +7 -0
  3. package/__mf/js/async/1616.765688c0.js +1 -0
  4. package/__mf/js/async/198.da11d98f.js +2 -0
  5. package/__mf/js/async/2043.1b3742ce.js +2 -0
  6. package/__mf/js/async/2377.224e9d0a.js +1 -0
  7. package/__mf/js/async/2786.13b9aafd.js +2 -0
  8. package/__mf/js/async/2901.af3801a0.js +1 -0
  9. package/__mf/js/async/3286.39fb350a.js +2 -0
  10. package/__mf/js/async/392.9d1b82a6.js +2 -0
  11. package/__mf/js/async/4077.eea8c60f.js +1 -0
  12. package/__mf/js/async/4121.a72e6ba8.js +2 -0
  13. package/__mf/js/async/4248.335ca3ef.js +1 -0
  14. package/__mf/js/async/4496.765e7d80.js +1 -0
  15. package/__mf/js/async/4960.05ff9b04.js +2 -0
  16. package/__mf/js/async/5019.44bff90f.js +1 -0
  17. package/__mf/js/async/5071.6bebb890.js +1 -0
  18. package/__mf/js/async/5440.55d37493.js +2 -0
  19. package/__mf/js/async/5587.0813c3de.js +1 -0
  20. package/__mf/js/async/5706.af95ca73.js +1 -0
  21. package/__mf/js/async/6274.8370f225.js +2 -0
  22. package/__mf/js/async/6609.9b2a8642.js +88 -0
  23. package/__mf/js/async/6854.94912912.js +1 -0
  24. package/__mf/js/async/7192.7d456f44.js +1 -0
  25. package/__mf/js/async/{7740.071ecf65.js → 7740.bc3d5fb4.js} +1 -1
  26. package/__mf/js/async/7817.4c4318d6.js +2 -0
  27. package/__mf/js/async/7862.44ba6a5d.js +2 -0
  28. package/__mf/js/async/7958.a46cd9ed.js +52 -0
  29. package/__mf/js/async/7968.c64a1ce5.js +1 -0
  30. package/__mf/js/async/7978.0d2cb401.js +1 -0
  31. package/__mf/js/async/{8253.35b5a0dc.js → 8253.1c5d878f.js} +1 -1
  32. package/__mf/js/async/8356.8ab3c769.js +1 -0
  33. package/__mf/js/async/8470.c28c0f68.js +2 -0
  34. package/__mf/js/async/873.eb4d73bb.js +1 -0
  35. package/__mf/js/async/9207.00f46fa4.js +1 -0
  36. package/__mf/js/async/9235.3602339b.js +1 -0
  37. package/__mf/js/async/941.de57412f.js +2 -0
  38. package/__mf/js/async/{9440.0e7f2584.js → 9440.6b331a90.js} +2 -2
  39. package/__mf/js/async/9588.ac560835.js +1 -0
  40. package/__mf/js/async/__federation_expose_VictoriaLogsDatasource.ab627789.js +2 -0
  41. package/__mf/js/async/__federation_expose_VictoriaLogsFieldNamesVariable.6b3649b9.js +2 -0
  42. package/__mf/js/async/__federation_expose_VictoriaLogsFieldValuesVariable.183cb902.js +2 -0
  43. package/__mf/js/async/__federation_expose_VictoriaLogsLogQuery.2b5d129e.js +1 -0
  44. package/__mf/js/async/__federation_expose_VictoriaLogsTimeSeriesQuery.1ac117b0.js +1 -0
  45. package/__mf/js/{main.e604f250.js → main.9cb5966c.js} +7 -7
  46. package/lib/components/logsql-editor.js +2 -2
  47. package/lib/components/logsql-editor.js.map +1 -1
  48. package/lib/components/logsql-extension.d.ts +1 -1
  49. package/lib/components/logsql-extension.d.ts.map +1 -1
  50. package/lib/components/logsql-extension.js +1 -1
  51. package/lib/components/logsql-extension.js.map +1 -1
  52. package/lib/datasources/victorialogs-datasource/VictoriaLogsDatasource.d.ts.map +1 -1
  53. package/lib/datasources/victorialogs-datasource/VictoriaLogsDatasource.js +9 -5
  54. package/lib/datasources/victorialogs-datasource/VictoriaLogsDatasource.js.map +1 -1
  55. package/lib/model/client.d.ts +2 -0
  56. package/lib/model/client.d.ts.map +1 -1
  57. package/lib/model/client.js +8 -4
  58. package/lib/model/client.js.map +1 -1
  59. package/lib/queries/victorialogs-log-query/VictoriaLogsLogQueryEditor.d.ts.map +1 -1
  60. package/lib/queries/victorialogs-log-query/VictoriaLogsLogQueryEditor.js +5 -6
  61. package/lib/queries/victorialogs-log-query/VictoriaLogsLogQueryEditor.js.map +1 -1
  62. package/lib/queries/victorialogs-time-series-query/VictoriaLogsTimeSeriesQueryEditor.d.ts.map +1 -1
  63. package/lib/queries/victorialogs-time-series-query/VictoriaLogsTimeSeriesQueryEditor.js +5 -6
  64. package/lib/queries/victorialogs-time-series-query/VictoriaLogsTimeSeriesQueryEditor.js.map +1 -1
  65. package/mf-manifest.json +135 -135
  66. package/mf-stats.json +135 -135
  67. package/package.json +6 -6
  68. package/__mf/js/async/1616.a3cbd019.js +0 -1
  69. package/__mf/js/async/198.42cbc766.js +0 -2
  70. package/__mf/js/async/2043.09d2b336.js +0 -2
  71. package/__mf/js/async/2377.955d23a6.js +0 -1
  72. package/__mf/js/async/2786.4f8e4f80.js +0 -2
  73. package/__mf/js/async/2901.ead6a746.js +0 -1
  74. package/__mf/js/async/3068.121a74bc.js +0 -88
  75. package/__mf/js/async/3286.5f22185a.js +0 -2
  76. package/__mf/js/async/3873.fc2ead2a.js +0 -52
  77. package/__mf/js/async/392.241997df.js +0 -2
  78. package/__mf/js/async/4077.8bd92530.js +0 -1
  79. package/__mf/js/async/4121.f0c5c912.js +0 -2
  80. package/__mf/js/async/4248.99e208e8.js +0 -1
  81. package/__mf/js/async/4496.c8ce9931.js +0 -1
  82. package/__mf/js/async/4960.2753b110.js +0 -2
  83. package/__mf/js/async/5019.ad81a49d.js +0 -1
  84. package/__mf/js/async/5071.65fbbcc1.js +0 -1
  85. package/__mf/js/async/537.8e3a78c1.js +0 -7
  86. package/__mf/js/async/5440.badac8c0.js +0 -2
  87. package/__mf/js/async/5587.66c9d9a7.js +0 -1
  88. package/__mf/js/async/5706.bb73a688.js +0 -1
  89. package/__mf/js/async/6274.264e01dd.js +0 -2
  90. package/__mf/js/async/6854.5e11cf4a.js +0 -1
  91. package/__mf/js/async/7192.3c06168c.js +0 -1
  92. package/__mf/js/async/7817.50337aae.js +0 -2
  93. package/__mf/js/async/7862.09331015.js +0 -2
  94. package/__mf/js/async/7968.b157175c.js +0 -1
  95. package/__mf/js/async/7978.1033463f.js +0 -1
  96. package/__mf/js/async/8356.66de7816.js +0 -1
  97. package/__mf/js/async/8470.2c612fd2.js +0 -2
  98. package/__mf/js/async/873.edbf5c7e.js +0 -1
  99. package/__mf/js/async/9207.786bc303.js +0 -1
  100. package/__mf/js/async/9235.8a5eac53.js +0 -1
  101. package/__mf/js/async/941.f8103f8e.js +0 -2
  102. package/__mf/js/async/9588.bf6042f9.js +0 -1
  103. package/__mf/js/async/__federation_expose_VictoriaLogsDatasource.90a59ac1.js +0 -2
  104. package/__mf/js/async/__federation_expose_VictoriaLogsFieldNamesVariable.98706d8a.js +0 -2
  105. package/__mf/js/async/__federation_expose_VictoriaLogsFieldValuesVariable.320f2e3b.js +0 -2
  106. package/__mf/js/async/__federation_expose_VictoriaLogsLogQuery.49a0e8f6.js +0 -1
  107. package/__mf/js/async/__federation_expose_VictoriaLogsTimeSeriesQuery.3aad6f1d.js +0 -1
  108. /package/__mf/css/async/{537.85c2cbf6.css → 1433.85c2cbf6.css} +0 -0
  109. /package/__mf/js/async/{537.8e3a78c1.js.LICENSE.txt → 1433.9776da61.js.LICENSE.txt} +0 -0
  110. /package/__mf/js/async/{198.42cbc766.js.LICENSE.txt → 198.da11d98f.js.LICENSE.txt} +0 -0
  111. /package/__mf/js/async/{2043.09d2b336.js.LICENSE.txt → 2043.1b3742ce.js.LICENSE.txt} +0 -0
  112. /package/__mf/js/async/{2786.4f8e4f80.js.LICENSE.txt → 2786.13b9aafd.js.LICENSE.txt} +0 -0
  113. /package/__mf/js/async/{392.241997df.js.LICENSE.txt → 392.9d1b82a6.js.LICENSE.txt} +0 -0
  114. /package/__mf/js/async/{4121.f0c5c912.js.LICENSE.txt → 4121.a72e6ba8.js.LICENSE.txt} +0 -0
  115. /package/__mf/js/async/{4960.2753b110.js.LICENSE.txt → 4960.05ff9b04.js.LICENSE.txt} +0 -0
  116. /package/__mf/js/async/{5440.badac8c0.js.LICENSE.txt → 5440.55d37493.js.LICENSE.txt} +0 -0
  117. /package/__mf/js/async/{6274.264e01dd.js.LICENSE.txt → 6274.8370f225.js.LICENSE.txt} +0 -0
  118. /package/__mf/js/async/{3068.121a74bc.js.LICENSE.txt → 6609.9b2a8642.js.LICENSE.txt} +0 -0
  119. /package/__mf/js/async/{7817.50337aae.js.LICENSE.txt → 7817.4c4318d6.js.LICENSE.txt} +0 -0
  120. /package/__mf/js/async/{7862.09331015.js.LICENSE.txt → 7862.44ba6a5d.js.LICENSE.txt} +0 -0
  121. /package/__mf/js/async/{8470.2c612fd2.js.LICENSE.txt → 8470.c28c0f68.js.LICENSE.txt} +0 -0
  122. /package/__mf/js/async/{941.f8103f8e.js.LICENSE.txt → 941.de57412f.js.LICENSE.txt} +0 -0
  123. /package/__mf/js/async/{9440.0e7f2584.js.LICENSE.txt → 9440.6b331a90.js.LICENSE.txt} +0 -0
  124. /package/__mf/js/async/{__federation_expose_VictoriaLogsDatasource.90a59ac1.js.LICENSE.txt → __federation_expose_VictoriaLogsDatasource.ab627789.js.LICENSE.txt} +0 -0
  125. /package/__mf/js/async/{__federation_expose_VictoriaLogsFieldNamesVariable.98706d8a.js.LICENSE.txt → __federation_expose_VictoriaLogsFieldNamesVariable.6b3649b9.js.LICENSE.txt} +0 -0
  126. /package/__mf/js/async/{__federation_expose_VictoriaLogsFieldValuesVariable.320f2e3b.js.LICENSE.txt → __federation_expose_VictoriaLogsFieldValuesVariable.183cb902.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 { LogsQLExtension } from "./logsql-extension.js";
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 LogsQLExtension();
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 { LogsQLExtension } 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 LogsQLExtension();\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","LogsQLExtension","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,eAAe,QAAQ,wBAAqB;AAIrD,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
+ {"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 LogsQLExtension(): Array<LRLanguage | Extension>;
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,eAAe,IAAI,KAAK,CAAC,UAAU,GAAG,SAAS,CAAC,CAG/D"}
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"}
@@ -37,7 +37,7 @@ function logsqlLanguage() {
37
37
  }
38
38
  });
39
39
  }
40
- export function LogsQLExtension() {
40
+ export function createLogsQLExtension() {
41
41
  const language = logsqlLanguage();
42
42
  return [
43
43
  language
@@ -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 LogsQLExtension(): 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","LogsQLExtension","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
+ {"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;AA4B1D,eAAO,MAAM,sBAAsB,EAAE,gBAAgB,CAAC,0BAA0B,EAAE,kBAAkB,CAInG,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) => streamQueryRange(params, { datasourceUrl, headers: headers ?? specHeaders }),\n statsQueryRange: (params, headers) => statsQueryRange(params, { datasourceUrl, headers: headers ?? specHeaders }),\n fieldNames: (params, headers) => fieldNames(params, { datasourceUrl, headers: headers ?? specHeaders }),\n fieldValues: (params, headers) => fieldValues(params, { datasourceUrl, headers: headers ?? specHeaders }),\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","datasourceUrl","undefined","Error","specHeaders","headers","params","VictoriaLogsDatasource","OptionsEditorComponent","createInitialOptions"],"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;AAKjC,SAASA,gBAAgB,EAAEC,eAAe,EAAEC,UAAU,EAAEC,WAAW,QAAQ,wBAAqB;AAEhG,SAASC,4BAA4B,QAAQ,oCAAiC;AAE9E,MAAMC,eAAiG,CACrGC,MACAC;IAEA,MAAM,EAAEC,SAAS,EAAEC,KAAK,EAAE,GAAGH;IAC7B,MAAM,EAAEI,QAAQ,EAAE,GAAGH;IAErB,MAAMI,gBAAgBH,aAAaE;IACnC,IAAIC,kBAAkBC,WAAW;QAC/B,MAAM,IAAIC,MAAM;IAClB;IAEA,MAAMC,cAAcL,OAAOH,KAAKS;IAEhC,OAAO;QACLR,SAAS;YACPI;QACF;QACAX,kBAAkB,CAACgB,QAAQD,UAAYf,iBAAiBgB,QAAQ;gBAAEL;gBAAeI,SAASA,WAAWD;YAAY;QACjHb,iBAAiB,CAACe,QAAQD,UAAYd,gBAAgBe,QAAQ;gBAAEL;gBAAeI,SAASA,WAAWD;YAAY;QAC/GZ,YAAY,CAACc,QAAQD,UAAYb,WAAWc,QAAQ;gBAAEL;gBAAeI,SAASA,WAAWD;YAAY;QACrGX,aAAa,CAACa,QAAQD,UAAYZ,YAAYa,QAAQ;gBAAEL;gBAAeI,SAASA,WAAWD;YAAY;IACzG;AACF;AAEA,OAAO,MAAMG,yBAA2F;IACtGZ;IACAa,wBAAwBd;IACxBe,sBAAsB,IAAO,CAAA;YAAEX,WAAW;QAAG,CAAA;AAC/C,EAAE"}
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","OptionsEditorComponent","createInitialOptions"],"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;AAKjC,SAASA,gBAAgB,EAAEC,eAAe,EAAEC,UAAU,EAAEC,WAAW,QAAQ,wBAAqB;AAEhG,SAASC,4BAA4B,QAAQ,oCAAiC;AAE9E,MAAMC,eAAiG,CACrGC,MACAC;IAEA,MAAM,EAAEC,SAAS,EAAEC,KAAK,EAAE,GAAGH;IAC7B,MAAM,EAAEI,QAAQ,EAAEC,OAAOC,WAAW,EAAE,GAAGL;IAEzC,MAAMM,gBAAgBL,aAAaE;IACnC,IAAIG,kBAAkBC,WAAW;QAC/B,MAAM,IAAIC,MAAM;IAClB;IAEA,MAAMC,cAAcP,OAAOH,KAAKW;IAEhC,OAAO;QACLV,SAAS;YACPM;QACF;QACAb,kBAAkB,CAACkB,QAAQD,UACzBjB,iBAAiBkB,QAAQ;gBAAEL;gBAAeI,SAASA,WAAWD;gBAAaL,OAAOC;YAAY;QAChGX,iBAAiB,CAACiB,QAAQD,UACxBhB,gBAAgBiB,QAAQ;gBAAEL;gBAAeI,SAASA,WAAWD;gBAAaL,OAAOC;YAAY;QAC/FV,YAAY,CAACgB,QAAQD,UACnBf,WAAWgB,QAAQ;gBAAEL;gBAAeI,SAASA,WAAWD;gBAAaL,OAAOC;YAAY;QAC1FT,aAAa,CAACe,QAAQD,UACpBd,YAAYe,QAAQ;gBAAEL;gBAAeI,SAASA,WAAWD;gBAAaL,OAAOC;YAAY;IAC7F;AACF;AAEA,OAAO,MAAMO,yBAA2F;IACtGd;IACAe,wBAAwBhB;IACxBiB,sBAAsB,IAAO,CAAA;YAAEb,WAAW;QAAG,CAAA;AAC/C,EAAE"}
@@ -1,3 +1,4 @@
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,MAAM,WAAW,sBAAsB;IACrC,aAAa,EAAE,MAAM,CAAC;IACtB,OAAO,CAAC,EAAE,0BAA0B,CAAC;CACtC;AAED,MAAM,WAAW,kBAAkB;IACjC,OAAO,EAAE;QACP,aAAa,EAAE,MAAM,CAAC;KACvB,CAAC;IACF,gBAAgB,EAAE,CAChB,MAAM,EAAE,kCAAkC,EAC1C,OAAO,CAAC,EAAE,0BAA0B,KACjC,OAAO,CAAC,oCAAoC,CAAC,CAAC;IACnD,eAAe,EAAE,CACf,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,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B,WAAW,CAC/B,MAAM,EAAE,6BAA6B,EACrC,OAAO,EAAE,sBAAsB,GAC9B,OAAO,CAAC,+BAA+B,CAAC,CAqB1C"}
@@ -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 response = await fetch(url.toString(), {
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 response = await fetch(url.toString(), {
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 response = await fetch(url.toString(), {
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 response = await fetch(url.toString(), {
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',
@@ -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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AS;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;Q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E,YACpB9C,MAAqC,EACrCC,OAA+B;IAE/B,MAAMC,MAAMd,SAAS,CAAC,2BAA2B,CAAC,EAAEa,QAAQX,aAAa;IACzE,MAAMa,WAAmC;QACvCC,OAAOJ,OAAOI,KAAK;QACnB2C,OAAO/C,OAAO+C,KAAK;IACrB;IACA,IAAI/C,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,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,CAoF5F"}
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, useEffect } from "react";
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
- // Update local state when prop changes
31
- useEffect(()=>{
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, useEffect } 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 // Update local state when prop changes\n useEffect(() => {\n setLocalQuery(value.query);\n }, [value.query]);\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","useEffect","LogsQLEditor","VICTORIALOGS_DATASOURCE_KIND","DATASOURCE_KIND","DEFAULT_DATASOURCE","VictoriaLogsLogQueryEditor","props","onChange","value","datasource","datasourceSelectValue","selectedDatasource","localQuery","setLocalQuery","query","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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;QAAUC;KAAM;IAGnB,qBACE,MAACf;QAAM6B,SAAS;QAAKC,eAAe;;0BAClC,MAACC;;kCACC,KAAChC;wBACCiC,IAAI;4BACFC,SAAS;4BACTC,cAAc;4BACdC,YAAY;wBACd;kCACD;;kCAGD,KAACjC;wBACCkC,sBAAsB1B;wBACtBK,OAAOG;wBACPJ,UAAUQ;wBACVe,OAAM;wBACNC,OAAO;;;;0BAIX,MAACP;;kCACC,KAAChC;wBACCiC,IAAI;4BACFC,SAAS;4BACTC,cAAc;4BACdC,YAAY;wBACd;kCACD;;kCAGD,KAAC3B;wBACCO,OAAOI;wBACPL,UAAUY;wBACVa,QAAQ,IAAMX,mBAAmBT;wBACjCqB,WAAWvC,sBAAsB,IAAM2B,mBAAmBT;wBAC1DsB,aAAY;;;;;;AAMtB"}
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,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
@@ -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,CAiFzF"}
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, useEffect } from "react";
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
- // Update local state when prop changes
29
- useEffect(()=>{
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, useEffect } 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 // Update local state when prop changes\n useEffect(() => {\n setLocalQuery(value.query);\n }, [value.query]);\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","useEffect","LogsQLEditor","VICTORIALOGS_DATASOURCE_KIND","DATASOURCE_KIND","DEFAULT_DATASOURCE","VictoriaLogsQueryEditor","props","onChange","value","datasource","datasourceSelectValue","selectedDatasource","localQuery","setLocalQuery","query","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,EAAEC,SAAS,QAAQ,QAAQ;AAEzD,SAASC,YAAY,QAAQ,oCAAiC;AAE9D,SAASC,4BAA4B,QAAQ,uBAAc;AAC3D,SAASC,eAAe,EAAEC,kBAAkB,QAAQ,kBAAe;AAKnE,OAAO,SAASC,wBAAwBC,KAAmC;IACzE,MAAM,EAAEC,QAAQ,EAAEC,KAAK,EAAE,GAAGF;IAC5B,MAAM,EAAEG,UAAU,EAAE,GAAGD;IACvB,MAAME,wBAAwBD,cAAcL;IAC5C,MAAMO,qBAAqBd,mCACzBa,uBACAR;IAGF,+EAA+E;IAC/E,MAAM,CAACU,YAAYC,cAAc,GAAGd,SAASS,MAAMM,KAAK;IAExD,uCAAuC;IACvCd,UAAU;QACRa,cAAcL,MAAMM,KAAK;IAC3B,GAAG;QAACN,MAAMM,KAAK;KAAC;IAEhB,MAAMC,yBAA4D,CAACC;QACjE,IAAI,CAACpB,qBAAqBoB,2BAA2BA,uBAAuBC,IAAI,KAAKd,iBAAiB;YACpGI,SAAS;gBAAE,GAAGC,KAAK;gBAAEC,YAAYO;YAAuB;YACxD;QACF;QAEA,MAAM,IAAIE,MAAM;IAClB;IAEA,wEAAwE;IACxE,MAAMC,oBAAoBrB,YAAY,CAACsB;QACrCP,cAAcO;IAChB,GAAG,EAAE;IAEL,6CAA6C;IAC7C,MAAMC,qBAAqBvB,YACzB,CAACgB;QACCP,SAAS;YAAE,GAAGC,KAAK;YAAEM;QAAM;IAC7B,GACA;QAACP;QAAUC;KAAM;IAGnB,qBACE,MAACf;QAAM6B,SAAS;QAAKC,eAAe;;0BAClC,MAACC;;kCACC,KAAChC;wBACCiC,IAAI;4BACFC,SAAS;4BACTC,cAAc;4BACdC,YAAY;wBACd;kCACD;;kCAGD,KAACjC;wBACCkC,sBAAsB1B;wBACtBK,OAAOG;wBACPJ,UAAUQ;wBACVe,OAAM;wBACNC,OAAO;;;;0BAIX,MAACP;;kCACC,KAAChC;wBACCiC,IAAI;4BACFC,SAAS;4BACTC,cAAc;4BACdC,YAAY;wBACd;kCACD;;kCAGD,KAAC3B;wBACCO,OAAOI;wBACPL,UAAUY;wBACVa,QAAQ,IAAMX,mBAAmBT;wBACjCqB,WAAWvC,sBAAsB,IAAM2B,mBAAmBT;wBAC1DsB,aAAY;;;;;;AAMtB"}
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;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE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