@perses-dev/loki-plugin 0.5.0 → 0.6.0-beta.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.
Files changed (309) hide show
  1. package/__mf/css/async/7354.85c2cbf6.css +1 -0
  2. package/__mf/font/inter-cyrillic-300-normal.432f2b21.woff +0 -0
  3. package/__mf/font/inter-cyrillic-300-normal.9da91009.woff2 +0 -0
  4. package/__mf/font/inter-cyrillic-400-normal.372704ff.woff2 +0 -0
  5. package/__mf/font/inter-cyrillic-400-normal.a6b6ef6f.woff +0 -0
  6. package/__mf/font/inter-cyrillic-500-normal.7c15bba8.woff2 +0 -0
  7. package/__mf/font/inter-cyrillic-500-normal.b9f8c929.woff +0 -0
  8. package/__mf/font/inter-cyrillic-600-normal.2f42892a.woff2 +0 -0
  9. package/__mf/font/inter-cyrillic-600-normal.c3987adc.woff +0 -0
  10. package/__mf/font/inter-cyrillic-700-normal.93eba3c3.woff +0 -0
  11. package/__mf/font/inter-cyrillic-700-normal.e9e5b2dc.woff2 +0 -0
  12. package/__mf/font/inter-cyrillic-900-normal.f285bd7a.woff2 +0 -0
  13. package/__mf/font/inter-cyrillic-900-normal.ffbd8a3a.woff +0 -0
  14. package/__mf/font/inter-cyrillic-ext-300-normal.95bb9038.woff2 +0 -0
  15. package/__mf/font/inter-cyrillic-ext-300-normal.cfc143a9.woff +0 -0
  16. package/__mf/font/inter-cyrillic-ext-400-normal.2a31c04b.woff +0 -0
  17. package/__mf/font/inter-cyrillic-ext-400-normal.f572b170.woff2 +0 -0
  18. package/__mf/font/inter-cyrillic-ext-500-normal.5a6bb1da.woff +0 -0
  19. package/__mf/font/inter-cyrillic-ext-500-normal.fe0d9b14.woff2 +0 -0
  20. package/__mf/font/inter-cyrillic-ext-600-normal.ecbdecad.woff +0 -0
  21. package/__mf/font/inter-cyrillic-ext-600-normal.f7b3c15b.woff2 +0 -0
  22. package/__mf/font/inter-cyrillic-ext-700-normal.4b4022a6.woff +0 -0
  23. package/__mf/font/inter-cyrillic-ext-700-normal.74b516d2.woff2 +0 -0
  24. package/__mf/font/inter-cyrillic-ext-900-normal.9970ddb5.woff +0 -0
  25. package/__mf/font/inter-cyrillic-ext-900-normal.a0d59adc.woff2 +0 -0
  26. package/__mf/font/inter-greek-300-normal.0d7be683.woff2 +0 -0
  27. package/__mf/font/inter-greek-300-normal.8f0b988e.woff +0 -0
  28. package/__mf/font/inter-greek-400-normal.cc58c11b.woff +0 -0
  29. package/__mf/font/inter-greek-400-normal.d7020e3c.woff2 +0 -0
  30. package/__mf/font/inter-greek-500-normal.d9a33207.woff +0 -0
  31. package/__mf/font/inter-greek-500-normal.f41f43db.woff2 +0 -0
  32. package/__mf/font/inter-greek-600-normal.4ec0c1c1.woff +0 -0
  33. package/__mf/font/inter-greek-600-normal.cc532937.woff2 +0 -0
  34. package/__mf/font/inter-greek-700-normal.5ec6c758.woff +0 -0
  35. package/__mf/font/inter-greek-700-normal.97f0eeeb.woff2 +0 -0
  36. package/__mf/font/inter-greek-900-normal.46b66369.woff2 +0 -0
  37. package/__mf/font/inter-greek-900-normal.9ae3a3c5.woff +0 -0
  38. package/__mf/font/inter-greek-ext-300-normal.10247a66.woff2 +0 -0
  39. package/__mf/font/inter-greek-ext-300-normal.4668e5cb.woff +0 -0
  40. package/__mf/font/inter-greek-ext-400-normal.4ce1df5d.woff2 +0 -0
  41. package/__mf/font/inter-greek-ext-400-normal.88ede1ea.woff +0 -0
  42. package/__mf/font/inter-greek-ext-500-normal.7a4aa726.woff +0 -0
  43. package/__mf/font/inter-greek-ext-500-normal.cbd51e2d.woff2 +0 -0
  44. package/__mf/font/inter-greek-ext-600-normal.089a95ee.woff +0 -0
  45. package/__mf/font/inter-greek-ext-600-normal.1f33d317.woff2 +0 -0
  46. package/__mf/font/inter-greek-ext-700-normal.31f1075d.woff +0 -0
  47. package/__mf/font/inter-greek-ext-700-normal.827cd618.woff2 +0 -0
  48. package/__mf/font/inter-greek-ext-900-normal.531bcee7.woff +0 -0
  49. package/__mf/font/inter-greek-ext-900-normal.8a9b36b9.woff2 +0 -0
  50. package/__mf/font/inter-latin-300-normal.15fb600d.woff2 +0 -0
  51. package/__mf/font/inter-latin-300-normal.6f95f590.woff +0 -0
  52. package/__mf/font/inter-latin-400-normal.2c7a775c.woff +0 -0
  53. package/__mf/font/inter-latin-400-normal.ef6d3f52.woff2 +0 -0
  54. package/__mf/font/inter-latin-500-normal.b7b43ace.woff2 +0 -0
  55. package/__mf/font/inter-latin-500-normal.cb4c8ceb.woff +0 -0
  56. package/__mf/font/inter-latin-600-normal.8fb1a964.woff2 +0 -0
  57. package/__mf/font/inter-latin-600-normal.ce0f5f43.woff +0 -0
  58. package/__mf/font/inter-latin-700-normal.953b7aa5.woff2 +0 -0
  59. package/__mf/font/inter-latin-700-normal.9c21d4dc.woff +0 -0
  60. package/__mf/font/inter-latin-900-normal.2a8028ec.woff2 +0 -0
  61. package/__mf/font/inter-latin-900-normal.fa252135.woff +0 -0
  62. package/__mf/font/inter-latin-ext-300-normal.167cc8c9.woff2 +0 -0
  63. package/__mf/font/inter-latin-ext-300-normal.f695be66.woff +0 -0
  64. package/__mf/font/inter-latin-ext-400-normal.32a25442.woff2 +0 -0
  65. package/__mf/font/inter-latin-ext-400-normal.4edcaace.woff +0 -0
  66. package/__mf/font/inter-latin-ext-500-normal.a19a84a6.woff +0 -0
  67. package/__mf/font/inter-latin-ext-500-normal.d9b491de.woff2 +0 -0
  68. package/__mf/font/inter-latin-ext-600-normal.38b075d8.woff2 +0 -0
  69. package/__mf/font/inter-latin-ext-600-normal.49faa47a.woff +0 -0
  70. package/__mf/font/inter-latin-ext-700-normal.93534b50.woff +0 -0
  71. package/__mf/font/inter-latin-ext-700-normal.b63daa1a.woff2 +0 -0
  72. package/__mf/font/inter-latin-ext-900-normal.0efdb307.woff +0 -0
  73. package/__mf/font/inter-latin-ext-900-normal.9c0fc2c7.woff2 +0 -0
  74. package/__mf/font/inter-vietnamese-300-normal.aad496d8.woff +0 -0
  75. package/__mf/font/inter-vietnamese-300-normal.ad9ef503.woff2 +0 -0
  76. package/__mf/font/inter-vietnamese-400-normal.a9dd2faf.woff +0 -0
  77. package/__mf/font/inter-vietnamese-400-normal.de4fc44f.woff2 +0 -0
  78. package/__mf/font/inter-vietnamese-500-normal.7c0a695f.woff2 +0 -0
  79. package/__mf/font/inter-vietnamese-500-normal.a3a73b95.woff +0 -0
  80. package/__mf/font/inter-vietnamese-600-normal.9d518599.woff2 +0 -0
  81. package/__mf/font/inter-vietnamese-600-normal.c5ce3fcb.woff +0 -0
  82. package/__mf/font/inter-vietnamese-700-normal.bc68b199.woff +0 -0
  83. package/__mf/font/inter-vietnamese-700-normal.faf12809.woff2 +0 -0
  84. package/__mf/font/inter-vietnamese-900-normal.2b782045.woff +0 -0
  85. package/__mf/font/inter-vietnamese-900-normal.e639b65a.woff2 +0 -0
  86. package/__mf/js/Loki.b7bb557c.js +7 -0
  87. package/__mf/js/async/1099.b49be119.js +1 -0
  88. package/__mf/js/async/155.fff99fe4.js +1 -0
  89. package/__mf/js/async/1616.9255be19.js +1 -0
  90. package/__mf/js/async/1728.c02a720c.js +1 -0
  91. package/__mf/js/async/1825.f02ff871.js +1 -0
  92. package/__mf/js/async/1969.f83e62d6.js +1 -0
  93. package/__mf/js/async/2043.79caea8b.js +2 -0
  94. package/__mf/js/async/2386.cebea91a.js +2 -0
  95. package/__mf/js/async/2502.943ec1cf.js +1 -0
  96. package/__mf/js/async/2657.5f9f9807.js +1 -0
  97. package/__mf/js/async/3181.b238b7b9.js +2 -0
  98. package/__mf/js/async/392.22b48ffa.js +2 -0
  99. package/__mf/js/async/4121.e547e3d4.js +2 -0
  100. package/__mf/js/async/4466.293eb237.js +74 -0
  101. package/__mf/js/async/5002.a483400c.js +1 -0
  102. package/__mf/js/async/5038.c6e1ac5e.js +2 -0
  103. package/__mf/js/async/5071.fd1136c7.js +1 -0
  104. package/__mf/js/async/5440.ff741d36.js +2 -0
  105. package/__mf/js/async/5587.e582af3f.js +1 -0
  106. package/__mf/js/async/6100.7d5962ad.js +1 -0
  107. package/__mf/js/async/6274.7255b4e9.js +2 -0
  108. package/__mf/js/async/6688.ad8a65bc.js +2 -0
  109. package/__mf/js/async/6823.7efa6882.js +2 -0
  110. package/__mf/js/async/{6710.a94fd362.js.LICENSE.txt → 6823.7efa6882.js.LICENSE.txt} +17 -1
  111. package/__mf/js/async/6898.11c8bae6.js +1 -0
  112. package/__mf/js/async/7095.0a8daf30.js +1 -0
  113. package/__mf/js/async/7177.7b6606d3.js +1 -0
  114. package/__mf/js/async/7192.b5444c91.js +1 -0
  115. package/__mf/js/async/7354.789ddba3.js +7 -0
  116. package/__mf/js/async/{7958.f25f7332.js.LICENSE.txt → 7354.789ddba3.js.LICENSE.txt} +19 -1
  117. package/__mf/js/async/7413.972aa60d.js +1 -0
  118. package/__mf/js/async/7862.679d0bd3.js +2 -0
  119. package/__mf/js/async/7968.952aec3b.js +1 -0
  120. package/__mf/js/async/7978.5f20023d.js +1 -0
  121. package/__mf/js/async/8199.98434cf3.js +28 -0
  122. package/__mf/js/async/8356.6bbe764b.js +1 -0
  123. package/__mf/js/async/8470.6f15ddf5.js +2 -0
  124. package/__mf/js/async/873.f59ec7c0.js +1 -0
  125. package/__mf/js/async/8750.fe623c5f.js +3 -0
  126. package/__mf/js/async/8988.cb10cfd3.js +1 -0
  127. package/__mf/js/async/9235.8532a487.js +1 -0
  128. package/__mf/js/async/9389.a063f523.js +2 -0
  129. package/__mf/js/async/941.49e5f628.js +2 -0
  130. package/__mf/js/async/9588.688593c0.js +1 -0
  131. package/__mf/js/async/9754.0c807c53.js +10 -0
  132. package/__mf/js/async/{9754.5d7b21c2.js.LICENSE.txt → 9754.0c807c53.js.LICENSE.txt} +1 -1
  133. package/__mf/js/async/9836.5401a9ec.js +1 -0
  134. package/__mf/js/async/9877.874a39f4.js +38 -0
  135. package/__mf/js/async/9916.d88af7d4.js +22 -0
  136. package/__mf/js/async/__federation_expose_LokiDatasource.6b14cd90.js +2 -0
  137. package/__mf/js/async/__federation_expose_LokiLabelNamesVariable.59592351.js +1 -0
  138. package/__mf/js/async/__federation_expose_LokiLabelValuesVariable.6bdc7a31.js +1 -0
  139. package/__mf/js/async/__federation_expose_LokiLogQLVariable.914390c4.js +1 -0
  140. package/__mf/js/async/__federation_expose_LokiLogQuery.18f1e6d4.js +1 -0
  141. package/__mf/js/async/__federation_expose_LokiTimeSeriesQuery.48d9f8d9.js +1 -0
  142. package/__mf/js/main.c96737bf.js +7 -0
  143. package/lib/cjs/components/complete.js +11 -4
  144. package/lib/cjs/datasources/loki-datasource/LokiDatasource.js +2 -2
  145. package/lib/cjs/index.js +1 -0
  146. package/lib/cjs/model/loki-client.js +51 -7
  147. package/lib/cjs/queries/loki-log-query/LokiLogQueryEditor.js +2 -6
  148. package/lib/cjs/queries/loki-time-series-query/LokiTimeSeriesQueryEditor.js +2 -6
  149. package/lib/cjs/queries/loki-time-series-query/get-loki-time-series-data.js +2 -2
  150. package/lib/cjs/variables/LokiLabelNamesVariable.js +53 -0
  151. package/lib/cjs/variables/LokiLabelValuesVariable.js +58 -0
  152. package/lib/cjs/variables/LokiLogQLVariable.js +64 -0
  153. package/lib/cjs/variables/MatcherEditor.js +84 -0
  154. package/lib/cjs/variables/index.js +35 -0
  155. package/lib/cjs/variables/loki-variables.js +239 -0
  156. package/lib/cjs/variables/types.js +16 -0
  157. package/lib/components/complete.js +11 -4
  158. package/lib/components/complete.js.map +1 -1
  159. package/lib/components/logql-extension.d.ts +1 -1
  160. package/lib/components/logql-extension.js.map +1 -1
  161. package/lib/datasources/loki-datasource/LokiDatasource.d.ts.map +1 -1
  162. package/lib/datasources/loki-datasource/LokiDatasource.js +2 -2
  163. package/lib/datasources/loki-datasource/LokiDatasource.js.map +1 -1
  164. package/lib/datasources/loki-datasource/loki-datasource-types.d.ts +1 -1
  165. package/lib/datasources/loki-datasource/loki-datasource-types.js.map +1 -1
  166. package/lib/index.d.ts +1 -0
  167. package/lib/index.d.ts.map +1 -1
  168. package/lib/index.js +1 -0
  169. package/lib/index.js.map +1 -1
  170. package/lib/model/loki-client-types.d.ts +1 -1
  171. package/lib/model/loki-client-types.js.map +1 -1
  172. package/lib/model/loki-client.d.ts +20 -4
  173. package/lib/model/loki-client.d.ts.map +1 -1
  174. package/lib/model/loki-client.js +48 -7
  175. package/lib/model/loki-client.js.map +1 -1
  176. package/lib/model/loki-data-types.d.ts +1 -1
  177. package/lib/model/loki-data-types.d.ts.map +1 -1
  178. package/lib/model/loki-data-types.js.map +1 -1
  179. package/lib/model/loki-selectors.d.ts +1 -1
  180. package/lib/model/loki-selectors.d.ts.map +1 -1
  181. package/lib/model/loki-selectors.js.map +1 -1
  182. package/lib/queries/loki-log-query/LokiLogQueryEditor.d.ts.map +1 -1
  183. package/lib/queries/loki-log-query/LokiLogQueryEditor.js +2 -6
  184. package/lib/queries/loki-log-query/LokiLogQueryEditor.js.map +1 -1
  185. package/lib/queries/loki-log-query/get-loki-log-data.d.ts.map +1 -1
  186. package/lib/queries/loki-log-query/get-loki-log-data.js.map +1 -1
  187. package/lib/queries/loki-log-query/log-query-plugin-interface.d.ts +1 -1
  188. package/lib/queries/loki-log-query/log-query-plugin-interface.d.ts.map +1 -1
  189. package/lib/queries/loki-log-query/log-query-plugin-interface.js.map +1 -1
  190. package/lib/queries/loki-log-query/loki-log-query-types.d.ts +1 -1
  191. package/lib/queries/loki-log-query/loki-log-query-types.js.map +1 -1
  192. package/lib/queries/loki-time-series-query/LokiTimeSeriesQueryEditor.d.ts.map +1 -1
  193. package/lib/queries/loki-time-series-query/LokiTimeSeriesQueryEditor.js +2 -6
  194. package/lib/queries/loki-time-series-query/LokiTimeSeriesQueryEditor.js.map +1 -1
  195. package/lib/queries/loki-time-series-query/get-loki-time-series-data.d.ts.map +1 -1
  196. package/lib/queries/loki-time-series-query/get-loki-time-series-data.js +1 -1
  197. package/lib/queries/loki-time-series-query/get-loki-time-series-data.js.map +1 -1
  198. package/lib/queries/loki-time-series-query/loki-time-series-query-types.d.ts +1 -1
  199. package/lib/queries/loki-time-series-query/loki-time-series-query-types.js.map +1 -1
  200. package/lib/variables/LokiLabelNamesVariable.d.ts +4 -0
  201. package/lib/variables/LokiLabelNamesVariable.d.ts.map +1 -0
  202. package/lib/variables/LokiLabelNamesVariable.js +45 -0
  203. package/lib/variables/LokiLabelNamesVariable.js.map +1 -0
  204. package/lib/variables/LokiLabelValuesVariable.d.ts +4 -0
  205. package/lib/variables/LokiLabelValuesVariable.d.ts.map +1 -0
  206. package/lib/variables/LokiLabelValuesVariable.js +50 -0
  207. package/lib/variables/LokiLabelValuesVariable.js.map +1 -0
  208. package/lib/variables/LokiLogQLVariable.d.ts +4 -0
  209. package/lib/variables/LokiLogQLVariable.d.ts.map +1 -0
  210. package/lib/variables/LokiLogQLVariable.js +56 -0
  211. package/lib/variables/LokiLogQLVariable.js.map +1 -0
  212. package/lib/variables/MatcherEditor.d.ts +9 -0
  213. package/lib/variables/MatcherEditor.d.ts.map +1 -0
  214. package/lib/variables/MatcherEditor.js +71 -0
  215. package/lib/variables/MatcherEditor.js.map +1 -0
  216. package/lib/variables/index.d.ts +7 -0
  217. package/lib/variables/index.d.ts.map +1 -0
  218. package/lib/variables/index.js +20 -0
  219. package/lib/variables/index.js.map +1 -0
  220. package/lib/variables/loki-variables.d.ts +13 -0
  221. package/lib/variables/loki-variables.d.ts.map +1 -0
  222. package/lib/variables/loki-variables.js +211 -0
  223. package/lib/variables/loki-variables.js.map +1 -0
  224. package/lib/variables/types.d.ts +17 -0
  225. package/lib/variables/types.d.ts.map +1 -0
  226. package/lib/variables/types.js +15 -0
  227. package/lib/variables/types.js.map +1 -0
  228. package/mf-manifest.json +313 -133
  229. package/mf-stats.json +345 -133
  230. package/package.json +33 -6
  231. package/__mf/css/async/3061.d3010b86.css +0 -1
  232. package/__mf/css/async/5442.d3010b86.css +0 -1
  233. package/__mf/css/async/7370.d3010b86.css +0 -1
  234. package/__mf/font/lato-all-300-normal.322bdf14.woff +0 -0
  235. package/__mf/font/lato-all-400-normal.63513b00.woff +0 -0
  236. package/__mf/font/lato-all-700-normal.bb27db94.woff +0 -0
  237. package/__mf/font/lato-all-900-normal.a27049a3.woff +0 -0
  238. package/__mf/font/lato-latin-300-normal.c5195215.woff2 +0 -0
  239. package/__mf/font/lato-latin-400-normal.b7ffde23.woff2 +0 -0
  240. package/__mf/font/lato-latin-700-normal.d5eb20bc.woff2 +0 -0
  241. package/__mf/font/lato-latin-900-normal.d884a71c.woff2 +0 -0
  242. package/__mf/font/lato-latin-ext-300-normal.abcc64a9.woff2 +0 -0
  243. package/__mf/font/lato-latin-ext-400-normal.6ebed106.woff2 +0 -0
  244. package/__mf/font/lato-latin-ext-700-normal.8697d1d5.woff2 +0 -0
  245. package/__mf/font/lato-latin-ext-900-normal.20a2b415.woff2 +0 -0
  246. package/__mf/js/Loki.2bd94c1e.js +0 -6
  247. package/__mf/js/async/1616.60c9a082.js +0 -1
  248. package/__mf/js/async/1728.326f0c08.js +0 -1
  249. package/__mf/js/async/1750.eba509e1.js +0 -1
  250. package/__mf/js/async/1811.a291a38b.js +0 -28
  251. package/__mf/js/async/1825.5005b3af.js +0 -1
  252. package/__mf/js/async/1969.53d223ca.js +0 -1
  253. package/__mf/js/async/2043.eb7e1c61.js +0 -2
  254. package/__mf/js/async/2386.a3cfef97.js +0 -2
  255. package/__mf/js/async/3059.cb101ca2.js +0 -1
  256. package/__mf/js/async/3181.d2b90b95.js +0 -2
  257. package/__mf/js/async/392.2c7c202d.js +0 -2
  258. package/__mf/js/async/4121.328a1e93.js +0 -2
  259. package/__mf/js/async/4466.21ddc88c.js +0 -74
  260. package/__mf/js/async/5002.29685f8e.js +0 -1
  261. package/__mf/js/async/5071.a03a64fd.js +0 -1
  262. package/__mf/js/async/54.b3492a7a.js +0 -22
  263. package/__mf/js/async/5440.995ad0c5.js +0 -2
  264. package/__mf/js/async/5587.55dbc663.js +0 -1
  265. package/__mf/js/async/6100.e2898f9c.js +0 -1
  266. package/__mf/js/async/6274.293b47c4.js +0 -2
  267. package/__mf/js/async/6283.78af4bc8.js +0 -2
  268. package/__mf/js/async/6710.a94fd362.js +0 -2
  269. package/__mf/js/async/7177.b50a1c64.js +0 -1
  270. package/__mf/js/async/7192.4dea1fd0.js +0 -1
  271. package/__mf/js/async/7370.0ddd349a.js +0 -2
  272. package/__mf/js/async/7958.f25f7332.js +0 -7
  273. package/__mf/js/async/7968.ec040694.js +0 -1
  274. package/__mf/js/async/7978.38078276.js +0 -1
  275. package/__mf/js/async/8356.5635696c.js +0 -1
  276. package/__mf/js/async/8470.c67049a2.js +0 -2
  277. package/__mf/js/async/8482.07caae1a.js +0 -1
  278. package/__mf/js/async/873.02aa55af.js +0 -1
  279. package/__mf/js/async/8988.1c565f12.js +0 -1
  280. package/__mf/js/async/9010.44bf2927.js +0 -2
  281. package/__mf/js/async/9010.44bf2927.js.LICENSE.txt +0 -15
  282. package/__mf/js/async/9071.ed72bdac.js +0 -2
  283. package/__mf/js/async/9235.f2e0e95c.js +0 -1
  284. package/__mf/js/async/9249.d90da2ad.js +0 -1
  285. package/__mf/js/async/9389.29616aa6.js +0 -2
  286. package/__mf/js/async/941.0bce16fe.js +0 -2
  287. package/__mf/js/async/9588.2d82f477.js +0 -1
  288. package/__mf/js/async/9754.5d7b21c2.js +0 -10
  289. package/__mf/js/async/9836.de786d07.js +0 -1
  290. package/__mf/js/async/9877.b76d1711.js +0 -38
  291. package/__mf/js/async/__federation_expose_LokiDatasource.3fe6141d.js +0 -2
  292. package/__mf/js/async/__federation_expose_LokiLogQuery.6591d0db.js +0 -1
  293. package/__mf/js/async/__federation_expose_LokiTimeSeriesQuery.2a9b451a.js +0 -1
  294. package/__mf/js/main.4d84b446.js +0 -6
  295. /package/__mf/js/async/{2043.eb7e1c61.js.LICENSE.txt → 2043.79caea8b.js.LICENSE.txt} +0 -0
  296. /package/__mf/js/async/{2386.a3cfef97.js.LICENSE.txt → 2386.cebea91a.js.LICENSE.txt} +0 -0
  297. /package/__mf/js/async/{3181.d2b90b95.js.LICENSE.txt → 3181.b238b7b9.js.LICENSE.txt} +0 -0
  298. /package/__mf/js/async/{392.2c7c202d.js.LICENSE.txt → 392.22b48ffa.js.LICENSE.txt} +0 -0
  299. /package/__mf/js/async/{4121.328a1e93.js.LICENSE.txt → 4121.e547e3d4.js.LICENSE.txt} +0 -0
  300. /package/__mf/js/async/{7370.0ddd349a.js.LICENSE.txt → 5038.c6e1ac5e.js.LICENSE.txt} +0 -0
  301. /package/__mf/js/async/{5440.995ad0c5.js.LICENSE.txt → 5440.ff741d36.js.LICENSE.txt} +0 -0
  302. /package/__mf/js/async/{6274.293b47c4.js.LICENSE.txt → 6274.7255b4e9.js.LICENSE.txt} +0 -0
  303. /package/__mf/js/async/{9071.ed72bdac.js.LICENSE.txt → 6688.ad8a65bc.js.LICENSE.txt} +0 -0
  304. /package/__mf/js/async/{6283.78af4bc8.js.LICENSE.txt → 7862.679d0bd3.js.LICENSE.txt} +0 -0
  305. /package/__mf/js/async/{8470.c67049a2.js.LICENSE.txt → 8470.6f15ddf5.js.LICENSE.txt} +0 -0
  306. /package/__mf/js/async/{9389.29616aa6.js.LICENSE.txt → 9389.a063f523.js.LICENSE.txt} +0 -0
  307. /package/__mf/js/async/{941.0bce16fe.js.LICENSE.txt → 941.49e5f628.js.LICENSE.txt} +0 -0
  308. /package/__mf/js/async/{54.b3492a7a.js.LICENSE.txt → 9916.d88af7d4.js.LICENSE.txt} +0 -0
  309. /package/__mf/js/async/{__federation_expose_LokiDatasource.3fe6141d.js.LICENSE.txt → __federation_expose_LokiDatasource.6b14cd90.js.LICENSE.txt} +0 -0
@@ -24,6 +24,7 @@ const _jsxruntime = require("react/jsx-runtime");
24
24
  const _pluginsystem = require("@perses-dev/plugin-system");
25
25
  const _material = require("@mui/material");
26
26
  const _react = require("react");
27
+ const _dashboards = require("@perses-dev/dashboards");
27
28
  const _immer = require("immer");
28
29
  const _components = require("../../components");
29
30
  const _model = require("../../model");
@@ -92,12 +93,7 @@ function LokiQueryEditor(props) {
92
93
  value: query,
93
94
  onChange: handleLogsQueryChange,
94
95
  onBlur: handleQueryBlur,
95
- onKeyDown: (event)=>{
96
- if (event.key === 'Enter' && (event.ctrlKey || event.metaKey)) {
97
- event.preventDefault();
98
- handleQueryExecute(query);
99
- }
100
- },
96
+ onKeyDown: (0, _dashboards.createModEnterHandler)(()=>handleQueryExecute(query)),
101
97
  placeholder: 'Enter LogQL query (e.g. {job="mysql"} |= "error")'
102
98
  })
103
99
  ]
@@ -20,9 +20,9 @@ Object.defineProperty(exports, "getLokiTimeSeriesData", {
20
20
  return getLokiTimeSeriesData;
21
21
  }
22
22
  });
23
- const _core = require("@perses-dev/core");
24
23
  const _pluginsystem = require("@perses-dev/plugin-system");
25
24
  const _datefns = require("date-fns");
25
+ const _spec = require("@perses-dev/spec");
26
26
  const _constants = require("../constants");
27
27
  // Constants for Loki step calculation
28
28
  const MAX_LOKI_DATA_POINTS = 10000; // Similar to Prometheus
@@ -31,7 +31,7 @@ const DEFAULT_MIN_STEP_SECONDS = 15; // 15 seconds default minimum
31
31
  * Converts a duration string (like "15s", "1m") to seconds
32
32
  */ function getDurationStringSeconds(durationString) {
33
33
  if (!durationString) return undefined;
34
- const duration = (0, _core.parseDurationString)(durationString);
34
+ const duration = (0, _spec.parseDurationString)(durationString);
35
35
  const ms = (0, _datefns.milliseconds)(duration);
36
36
  return Math.floor(ms / 1000);
37
37
  }
@@ -0,0 +1,53 @@
1
+ // Copyright The Perses Authors
2
+ // Licensed under the Apache License, Version 2.0 (the "License");
3
+ // you may not use this file except in compliance with the License.
4
+ // You may obtain a copy of the License at
5
+ //
6
+ // http://www.apache.org/licenses/LICENSE-2.0
7
+ //
8
+ // Unless required by applicable law or agreed to in writing, software
9
+ // distributed under the License is distributed on an "AS IS" BASIS,
10
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
+ // See the License for the specific language governing permissions and
12
+ // limitations under the License.
13
+ "use strict";
14
+ Object.defineProperty(exports, "__esModule", {
15
+ value: true
16
+ });
17
+ Object.defineProperty(exports, "LokiLabelNamesVariable", {
18
+ enumerable: true,
19
+ get: function() {
20
+ return LokiLabelNamesVariable;
21
+ }
22
+ });
23
+ const _pluginsystem = require("@perses-dev/plugin-system");
24
+ const _model = require("../model");
25
+ const _lokivariables = require("./loki-variables");
26
+ const LokiLabelNamesVariable = {
27
+ getVariableOptions: async (spec, ctx)=>{
28
+ const datasourceSelector = (0, _pluginsystem.datasourceSelectValueToSelector)(spec.datasource ?? _model.DEFAULT_LOKI, ctx.variables, await ctx.datasourceStore.listDatasourceSelectItems(_model.LOKI_DATASOURCE_KIND)) ?? _model.DEFAULT_LOKI;
29
+ const client = await ctx.datasourceStore.getDatasourceClient(datasourceSelector);
30
+ const query = spec.matchers ? (0, _pluginsystem.replaceVariables)(spec.matchers[0] ?? '', ctx.variables) || undefined : undefined;
31
+ const timeRange = (0, _model.getLokiTimeRange)(ctx.timeRange);
32
+ const { data: options } = await client.labels({
33
+ start: timeRange.start,
34
+ end: timeRange.end,
35
+ query
36
+ });
37
+ return {
38
+ data: (0, _lokivariables.stringArrayToVariableOptions)(options)
39
+ };
40
+ },
41
+ dependsOn: (spec)=>{
42
+ const matcherVariables = spec.matchers?.map((m)=>(0, _pluginsystem.parseVariables)(m)).flat() || [];
43
+ const datasourceVariables = spec.datasource && (0, _pluginsystem.isVariableDatasource)(spec.datasource) ? (0, _pluginsystem.parseVariables)(spec.datasource) : [];
44
+ return {
45
+ variables: [
46
+ ...matcherVariables,
47
+ ...datasourceVariables
48
+ ]
49
+ };
50
+ },
51
+ OptionsEditorComponent: _lokivariables.LokiLabelNamesVariableEditor,
52
+ createInitialOptions: ()=>({})
53
+ };
@@ -0,0 +1,58 @@
1
+ // Copyright The Perses Authors
2
+ // Licensed under the Apache License, Version 2.0 (the "License");
3
+ // you may not use this file except in compliance with the License.
4
+ // You may obtain a copy of the License at
5
+ //
6
+ // http://www.apache.org/licenses/LICENSE-2.0
7
+ //
8
+ // Unless required by applicable law or agreed to in writing, software
9
+ // distributed under the License is distributed on an "AS IS" BASIS,
10
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
+ // See the License for the specific language governing permissions and
12
+ // limitations under the License.
13
+ "use strict";
14
+ Object.defineProperty(exports, "__esModule", {
15
+ value: true
16
+ });
17
+ Object.defineProperty(exports, "LokiLabelValuesVariable", {
18
+ enumerable: true,
19
+ get: function() {
20
+ return LokiLabelValuesVariable;
21
+ }
22
+ });
23
+ const _pluginsystem = require("@perses-dev/plugin-system");
24
+ const _model = require("../model");
25
+ const _lokivariables = require("./loki-variables");
26
+ const LokiLabelValuesVariable = {
27
+ getVariableOptions: async (spec, ctx)=>{
28
+ const datasourceSelector = (0, _pluginsystem.datasourceSelectValueToSelector)(spec.datasource ?? _model.DEFAULT_LOKI, ctx.variables, await ctx.datasourceStore.listDatasourceSelectItems(_model.LOKI_DATASOURCE_KIND)) ?? _model.DEFAULT_LOKI;
29
+ const client = await ctx.datasourceStore.getDatasourceClient(datasourceSelector);
30
+ const query = spec.matchers ? (0, _pluginsystem.replaceVariables)(spec.matchers[0] ?? '', ctx.variables) || undefined : undefined;
31
+ const timeRange = (0, _model.getLokiTimeRange)(ctx.timeRange);
32
+ const { data: options } = await client.labelValues({
33
+ labelName: (0, _pluginsystem.replaceVariables)(spec.labelName, ctx.variables),
34
+ start: timeRange.start,
35
+ end: timeRange.end,
36
+ query
37
+ });
38
+ return {
39
+ data: (0, _lokivariables.stringArrayToVariableOptions)(options)
40
+ };
41
+ },
42
+ dependsOn: (spec)=>{
43
+ const matcherVariables = spec.matchers?.map((m)=>(0, _pluginsystem.parseVariables)(m)).flat() || [];
44
+ const labelVariables = (0, _pluginsystem.parseVariables)(spec.labelName);
45
+ const datasourceVariables = spec.datasource && (0, _pluginsystem.isVariableDatasource)(spec.datasource) ? (0, _pluginsystem.parseVariables)(spec.datasource) : [];
46
+ return {
47
+ variables: [
48
+ ...matcherVariables,
49
+ ...labelVariables,
50
+ ...datasourceVariables
51
+ ]
52
+ };
53
+ },
54
+ OptionsEditorComponent: _lokivariables.LokiLabelValuesVariableEditor,
55
+ createInitialOptions: ()=>({
56
+ labelName: ''
57
+ })
58
+ };
@@ -0,0 +1,64 @@
1
+ // Copyright The Perses Authors
2
+ // Licensed under the Apache License, Version 2.0 (the "License");
3
+ // you may not use this file except in compliance with the License.
4
+ // You may obtain a copy of the License at
5
+ //
6
+ // http://www.apache.org/licenses/LICENSE-2.0
7
+ //
8
+ // Unless required by applicable law or agreed to in writing, software
9
+ // distributed under the License is distributed on an "AS IS" BASIS,
10
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
+ // See the License for the specific language governing permissions and
12
+ // limitations under the License.
13
+ "use strict";
14
+ Object.defineProperty(exports, "__esModule", {
15
+ value: true
16
+ });
17
+ Object.defineProperty(exports, "LokiLogQLVariable", {
18
+ enumerable: true,
19
+ get: function() {
20
+ return LokiLogQLVariable;
21
+ }
22
+ });
23
+ const _pluginsystem = require("@perses-dev/plugin-system");
24
+ const _model = require("../model");
25
+ const _lokivariables = require("./loki-variables");
26
+ const LokiLogQLVariable = {
27
+ getVariableOptions: async (spec, ctx)=>{
28
+ const datasourceSelector = (0, _pluginsystem.datasourceSelectValueToSelector)(spec.datasource ?? _model.DEFAULT_LOKI, ctx.variables, await ctx.datasourceStore.listDatasourceSelectItems(_model.LOKI_DATASOURCE_KIND)) ?? _model.DEFAULT_LOKI;
29
+ const client = await ctx.datasourceStore.getDatasourceClient(datasourceSelector);
30
+ const timeRange = (0, _model.getLokiTimeRange)(ctx.timeRange);
31
+ const response = await client.queryRange({
32
+ query: (0, _pluginsystem.replaceVariables)(spec.expr, ctx.variables),
33
+ start: timeRange.start,
34
+ end: timeRange.end
35
+ });
36
+ const labelName = (0, _pluginsystem.replaceVariables)(spec.labelName, ctx.variables);
37
+ let values = [];
38
+ if (response.data?.resultType === 'streams') {
39
+ values = (0, _lokivariables.capturingStreams)(response.data.result, labelName);
40
+ } else if (response.data?.resultType === 'matrix') {
41
+ values = (0, _lokivariables.capturingMetric)(response.data.result, labelName);
42
+ }
43
+ return {
44
+ data: (0, _lokivariables.stringArrayToVariableOptions)(values)
45
+ };
46
+ },
47
+ dependsOn: (spec)=>{
48
+ const exprVariables = (0, _pluginsystem.parseVariables)(spec.expr);
49
+ const labelVariables = (0, _pluginsystem.parseVariables)(spec.labelName);
50
+ const datasourceVariables = spec.datasource && (0, _pluginsystem.isVariableDatasource)(spec.datasource) ? (0, _pluginsystem.parseVariables)(spec.datasource) : [];
51
+ return {
52
+ variables: [
53
+ ...exprVariables,
54
+ ...labelVariables,
55
+ ...datasourceVariables
56
+ ]
57
+ };
58
+ },
59
+ OptionsEditorComponent: _lokivariables.LokiLogQLVariableEditor,
60
+ createInitialOptions: ()=>({
61
+ expr: '',
62
+ labelName: ''
63
+ })
64
+ };
@@ -0,0 +1,84 @@
1
+ // Copyright The Perses Authors
2
+ // Licensed under the Apache License, Version 2.0 (the "License");
3
+ // you may not use this file except in compliance with the License.
4
+ // You may obtain a copy of the License at
5
+ //
6
+ // http://www.apache.org/licenses/LICENSE-2.0
7
+ //
8
+ // Unless required by applicable law or agreed to in writing, software
9
+ // distributed under the License is distributed on an "AS IS" BASIS,
10
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
+ // See the License for the specific language governing permissions and
12
+ // limitations under the License.
13
+ "use strict";
14
+ Object.defineProperty(exports, "__esModule", {
15
+ value: true
16
+ });
17
+ Object.defineProperty(exports, "MatcherEditor", {
18
+ enumerable: true,
19
+ get: function() {
20
+ return MatcherEditor;
21
+ }
22
+ });
23
+ const _jsxruntime = require("react/jsx-runtime");
24
+ const _material = require("@mui/material");
25
+ const _immer = require("immer");
26
+ const _TrashCan = /*#__PURE__*/ _interop_require_default(require("mdi-material-ui/TrashCan"));
27
+ function _interop_require_default(obj) {
28
+ return obj && obj.__esModule ? obj : {
29
+ default: obj
30
+ };
31
+ }
32
+ function MatcherEditor({ matchers, onChange, isReadonly }) {
33
+ return /*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Stack, {
34
+ spacing: 1,
35
+ mb: 2,
36
+ children: [
37
+ matchers.map((matcher, index)=>/*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Stack, {
38
+ direction: "row",
39
+ alignItems: "center",
40
+ children: [
41
+ /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.TextField, {
42
+ fullWidth: true,
43
+ label: "Stream Selector",
44
+ value: matcher,
45
+ slotProps: {
46
+ input: {
47
+ readOnly: isReadonly
48
+ }
49
+ },
50
+ onChange: (e)=>{
51
+ const newMatchers = (0, _immer.produce)(matchers, (draft)=>{
52
+ draft[index] = e.target.value;
53
+ });
54
+ onChange(newMatchers);
55
+ }
56
+ }),
57
+ /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.IconButton, {
58
+ onClick: ()=>{
59
+ const newMatchers = (0, _immer.produce)(matchers, (draft)=>{
60
+ draft.splice(index, 1);
61
+ });
62
+ onChange(newMatchers);
63
+ },
64
+ disabled: isReadonly,
65
+ children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_TrashCan.default, {})
66
+ })
67
+ ]
68
+ }, index)),
69
+ /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Button, {
70
+ fullWidth: false,
71
+ color: "secondary",
72
+ variant: "outlined",
73
+ onClick: ()=>{
74
+ const newMatchers = (0, _immer.produce)(matchers, (draft)=>{
75
+ draft.push('');
76
+ });
77
+ onChange(newMatchers);
78
+ },
79
+ disabled: isReadonly,
80
+ children: "Add Stream Selector"
81
+ })
82
+ ]
83
+ });
84
+ }
@@ -0,0 +1,35 @@
1
+ // Copyright The Perses Authors
2
+ // Licensed under the Apache License, Version 2.0 (the "License");
3
+ // you may not use this file except in compliance with the License.
4
+ // You may obtain a copy of the License at
5
+ //
6
+ // http://www.apache.org/licenses/LICENSE-2.0
7
+ //
8
+ // Unless required by applicable law or agreed to in writing, software
9
+ // distributed under the License is distributed on an "AS IS" BASIS,
10
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
+ // See the License for the specific language governing permissions and
12
+ // limitations under the License.
13
+ "use strict";
14
+ Object.defineProperty(exports, "__esModule", {
15
+ value: true
16
+ });
17
+ _export_star(require("./loki-variables"), exports);
18
+ _export_star(require("./LokiLabelNamesVariable"), exports);
19
+ _export_star(require("./LokiLabelValuesVariable"), exports);
20
+ _export_star(require("./LokiLogQLVariable"), exports);
21
+ _export_star(require("./MatcherEditor"), exports);
22
+ _export_star(require("./types"), exports);
23
+ function _export_star(from, to) {
24
+ Object.keys(from).forEach(function(k) {
25
+ if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) {
26
+ Object.defineProperty(to, k, {
27
+ enumerable: true,
28
+ get: function() {
29
+ return from[k];
30
+ }
31
+ });
32
+ }
33
+ });
34
+ return from;
35
+ }
@@ -0,0 +1,239 @@
1
+ // Copyright The Perses Authors
2
+ // Licensed under the Apache License, Version 2.0 (the "License");
3
+ // you may not use this file except in compliance with the License.
4
+ // You may obtain a copy of the License at
5
+ //
6
+ // http://www.apache.org/licenses/LICENSE-2.0
7
+ //
8
+ // Unless required by applicable law or agreed to in writing, software
9
+ // distributed under the License is distributed on an "AS IS" BASIS,
10
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
+ // See the License for the specific language governing permissions and
12
+ // limitations under the License.
13
+ "use strict";
14
+ Object.defineProperty(exports, "__esModule", {
15
+ value: true
16
+ });
17
+ function _export(target, all) {
18
+ for(var name in all)Object.defineProperty(target, name, {
19
+ enumerable: true,
20
+ get: Object.getOwnPropertyDescriptor(all, name).get
21
+ });
22
+ }
23
+ _export(exports, {
24
+ get LokiLabelNamesVariableEditor () {
25
+ return LokiLabelNamesVariableEditor;
26
+ },
27
+ get LokiLabelValuesVariableEditor () {
28
+ return LokiLabelValuesVariableEditor;
29
+ },
30
+ get LokiLogQLVariableEditor () {
31
+ return LokiLogQLVariableEditor;
32
+ },
33
+ get capturingMetric () {
34
+ return capturingMetric;
35
+ },
36
+ get capturingStreams () {
37
+ return capturingStreams;
38
+ },
39
+ get stringArrayToVariableOptions () {
40
+ return stringArrayToVariableOptions;
41
+ }
42
+ });
43
+ const _jsxruntime = require("react/jsx-runtime");
44
+ const _material = require("@mui/material");
45
+ const _pluginsystem = require("@perses-dev/plugin-system");
46
+ const _immer = require("immer");
47
+ const _react = require("react");
48
+ const _components = require("../components");
49
+ const _model = require("../model");
50
+ const _MatcherEditor = require("./MatcherEditor");
51
+ const EMPTY_MATCHERS = [];
52
+ function useLokiDatasourceChangeHandler(value, onChange) {
53
+ return (0, _react.useCallback)((next)=>{
54
+ if ((0, _pluginsystem.isVariableDatasource)(next) || (0, _model.isLokiDatasourceSelector)(next)) {
55
+ // If they're using the default, just omit the datasource prop
56
+ onChange((0, _immer.produce)(value, (draft)=>{
57
+ draft.datasource = !(0, _pluginsystem.isVariableDatasource)(next) && (0, _model.isDefaultLokiSelector)(next) ? undefined : next;
58
+ }));
59
+ return;
60
+ }
61
+ throw new Error('Got unexpected non-Loki datasource selector');
62
+ }, [
63
+ onChange,
64
+ value
65
+ ]);
66
+ }
67
+ function LokiLabelValuesVariableEditor(props) {
68
+ const { onChange, value, value: { datasource } } = props;
69
+ const selectedDatasource = datasource ?? _model.DEFAULT_LOKI;
70
+ const handleDatasourceChange = useLokiDatasourceChangeHandler(value, onChange);
71
+ const handleLabelChange = (0, _react.useCallback)((e)=>{
72
+ onChange((0, _immer.produce)(value, (draft)=>{
73
+ draft.labelName = e.target.value;
74
+ }));
75
+ }, [
76
+ onChange,
77
+ value
78
+ ]);
79
+ const handleMatchEditorsChange = (0, _react.useCallback)((matchers)=>{
80
+ onChange((0, _immer.produce)(value, (draft)=>{
81
+ draft.matchers = matchers;
82
+ }));
83
+ }, [
84
+ onChange,
85
+ value
86
+ ]);
87
+ return /*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Stack, {
88
+ spacing: 2,
89
+ children: [
90
+ /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.FormControl, {
91
+ margin: "dense",
92
+ children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_pluginsystem.DatasourceSelect, {
93
+ datasourcePluginKind: _model.LOKI_DATASOURCE_KIND,
94
+ value: selectedDatasource,
95
+ onChange: handleDatasourceChange,
96
+ disabled: props.isReadonly,
97
+ labelId: "loki-datasource-label",
98
+ label: "Loki Datasource"
99
+ })
100
+ }),
101
+ /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.TextField, {
102
+ label: "Label Name",
103
+ required: true,
104
+ value: props.value.labelName,
105
+ onChange: handleLabelChange,
106
+ slotProps: {
107
+ input: {
108
+ readOnly: props.isReadonly
109
+ }
110
+ }
111
+ }),
112
+ /*#__PURE__*/ (0, _jsxruntime.jsx)(_MatcherEditor.MatcherEditor, {
113
+ matchers: props.value.matchers ?? EMPTY_MATCHERS,
114
+ onChange: handleMatchEditorsChange,
115
+ isReadonly: props.isReadonly
116
+ })
117
+ ]
118
+ });
119
+ }
120
+ function LokiLabelNamesVariableEditor(props) {
121
+ const { onChange, value, value: { datasource } } = props;
122
+ const selectedDatasource = datasource ?? _model.DEFAULT_LOKI;
123
+ const handleDatasourceChange = useLokiDatasourceChangeHandler(value, onChange);
124
+ const handleMatchEditorChange = (0, _react.useCallback)((matchers)=>{
125
+ onChange((0, _immer.produce)(value, (draft)=>{
126
+ draft.matchers = matchers;
127
+ }));
128
+ }, [
129
+ onChange,
130
+ value
131
+ ]);
132
+ return /*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Stack, {
133
+ spacing: 2,
134
+ children: [
135
+ /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.FormControl, {
136
+ margin: "dense",
137
+ children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_pluginsystem.DatasourceSelect, {
138
+ datasourcePluginKind: _model.LOKI_DATASOURCE_KIND,
139
+ value: selectedDatasource,
140
+ onChange: handleDatasourceChange,
141
+ disabled: props.isReadonly,
142
+ labelId: "loki-datasource-label",
143
+ label: "Loki Datasource"
144
+ })
145
+ }),
146
+ /*#__PURE__*/ (0, _jsxruntime.jsx)(_MatcherEditor.MatcherEditor, {
147
+ matchers: props.value.matchers ?? EMPTY_MATCHERS,
148
+ isReadonly: props.isReadonly,
149
+ onChange: handleMatchEditorChange
150
+ })
151
+ ]
152
+ });
153
+ }
154
+ function LokiLogQLVariableEditor(props) {
155
+ const { onChange, value, value: { datasource } } = props;
156
+ const datasourceSelectValue = datasource ?? _model.DEFAULT_LOKI;
157
+ const selectedDatasource = (0, _pluginsystem.useDatasourceSelectValueToSelector)(datasourceSelectValue, _model.LOKI_DATASOURCE_KIND);
158
+ const { data: client } = (0, _pluginsystem.useDatasourceClient)(selectedDatasource);
159
+ const handleDatasourceChange = useLokiDatasourceChangeHandler(value, onChange);
160
+ const handleOnBlurLogQLChange = (0, _react.useCallback)((e)=>{
161
+ onChange((0, _immer.produce)(value, (draft)=>{
162
+ draft.expr = e.target.textContent ?? '';
163
+ }));
164
+ }, [
165
+ onChange,
166
+ value
167
+ ]);
168
+ const handleLabelNameChange = (0, _react.useCallback)((e)=>{
169
+ onChange((0, _immer.produce)(value, (draft)=>{
170
+ draft.labelName = e.target.value;
171
+ }));
172
+ }, [
173
+ onChange,
174
+ value
175
+ ]);
176
+ return /*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Stack, {
177
+ spacing: 2,
178
+ children: [
179
+ /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.FormControl, {
180
+ margin: "dense",
181
+ children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_pluginsystem.DatasourceSelect, {
182
+ datasourcePluginKind: _model.LOKI_DATASOURCE_KIND,
183
+ value: datasourceSelectValue,
184
+ onChange: handleDatasourceChange,
185
+ labelId: "loki-datasource-label",
186
+ label: "Loki Datasource",
187
+ disabled: props.isReadonly
188
+ })
189
+ }),
190
+ /*#__PURE__*/ (0, _jsxruntime.jsx)(_components.LogQLEditor, {
191
+ completionConfig: client ? {
192
+ client
193
+ } : undefined,
194
+ value: value.expr,
195
+ onBlur: handleOnBlurLogQLChange,
196
+ readOnly: props.isReadonly,
197
+ width: "100%"
198
+ }),
199
+ /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.TextField, {
200
+ label: "Label Name",
201
+ required: true,
202
+ value: props.value.labelName,
203
+ slotProps: {
204
+ input: {
205
+ readOnly: props.isReadonly
206
+ }
207
+ },
208
+ onChange: handleLabelNameChange
209
+ })
210
+ ]
211
+ });
212
+ }
213
+ function capturingMetric(results, labelName) {
214
+ const captured = new Set();
215
+ for (const sample of results){
216
+ const value = sample.metric[labelName];
217
+ if (value !== undefined) {
218
+ captured.add(value);
219
+ }
220
+ }
221
+ return Array.from(captured);
222
+ }
223
+ function capturingStreams(results, labelName) {
224
+ const captured = new Set();
225
+ for (const sample of results){
226
+ const value = sample.stream[labelName];
227
+ if (value !== undefined) {
228
+ captured.add(value);
229
+ }
230
+ }
231
+ return Array.from(captured);
232
+ }
233
+ const stringArrayToVariableOptions = (values)=>{
234
+ if (!values) return [];
235
+ return values.map((value)=>({
236
+ value,
237
+ label: value
238
+ }));
239
+ };
@@ -0,0 +1,16 @@
1
+ // Copyright The Perses Authors
2
+ // Licensed under the Apache License, Version 2.0 (the "License");
3
+ // you may not use this file except in compliance with the License.
4
+ // You may obtain a copy of the License at
5
+ //
6
+ // http://www.apache.org/licenses/LICENSE-2.0
7
+ //
8
+ // Unless required by applicable law or agreed to in writing, software
9
+ // distributed under the License is distributed on an "AS IS" BASIS,
10
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
+ // See the License for the specific language governing permissions and
12
+ // limitations under the License.
13
+ "use strict";
14
+ Object.defineProperty(exports, "__esModule", {
15
+ value: true
16
+ });
@@ -380,8 +380,11 @@ async function completeLabelName(completionCfg) {
380
380
  const start = completionCfg.timeRange?.start ? toUnixSeconds(new Date(completionCfg.timeRange.start).getTime()) : undefined;
381
381
  const end = completionCfg.timeRange?.end ? toUnixSeconds(new Date(completionCfg.timeRange.end).getTime()) : undefined;
382
382
  try {
383
- const response = await completionCfg.client.labels(start, end);
384
- if (response.status === 'success') {
383
+ const response = await completionCfg.client.labels({
384
+ start,
385
+ end
386
+ });
387
+ if (response.status === 'success' && response.data) {
385
388
  return response.data.map((label)=>({
386
389
  label
387
390
  }));
@@ -399,8 +402,12 @@ async function completeLabelValue(completionCfg, label) {
399
402
  const start = completionCfg.timeRange?.start ? toUnixSeconds(new Date(completionCfg.timeRange.start).getTime()) : undefined;
400
403
  const end = completionCfg.timeRange?.end ? toUnixSeconds(new Date(completionCfg.timeRange.end).getTime()) : undefined;
401
404
  try {
402
- const response = await completionCfg.client.labelValues(label, start, end);
403
- if (response.status === 'success') {
405
+ const response = await completionCfg.client.labelValues({
406
+ labelName: label,
407
+ start,
408
+ end
409
+ });
410
+ if (response.status === 'success' && response.data) {
404
411
  return response.data.map((value)=>({
405
412
  label: value ?? '',
406
413
  displayLabel: value ?? '(empty string)',