@perses-dev/prometheus-plugin 0.50.2 → 0.51.0-beta.2

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 (434) hide show
  1. package/LICENSE +183 -183
  2. package/README.md +41 -0
  3. package/__mf/css/async/2341.dacad691.css +1 -0
  4. package/__mf/css/async/5263.dacad691.css +1 -0
  5. package/__mf/css/async/6759.dacad691.css +1 -0
  6. package/__mf/font/lato-all-300-normal.322bdf14.woff +0 -0
  7. package/__mf/font/lato-all-400-normal.63513b00.woff +0 -0
  8. package/__mf/font/lato-all-700-normal.bb27db94.woff +0 -0
  9. package/__mf/font/lato-all-900-normal.a27049a3.woff +0 -0
  10. package/__mf/font/lato-latin-300-normal.c5195215.woff2 +0 -0
  11. package/__mf/font/lato-latin-400-normal.b7ffde23.woff2 +0 -0
  12. package/__mf/font/lato-latin-700-normal.d5eb20bc.woff2 +0 -0
  13. package/__mf/font/lato-latin-900-normal.d884a71c.woff2 +0 -0
  14. package/__mf/font/lato-latin-ext-300-normal.abcc64a9.woff2 +0 -0
  15. package/__mf/font/lato-latin-ext-400-normal.6ebed106.woff2 +0 -0
  16. package/__mf/font/lato-latin-ext-700-normal.8697d1d5.woff2 +0 -0
  17. package/__mf/font/lato-latin-ext-900-normal.20a2b415.woff2 +0 -0
  18. package/__mf/js/622.f7592106.js +5 -0
  19. package/__mf/js/Prometheus.328aad7c.js +5 -0
  20. package/__mf/js/async/1465.3b5e12d5.js +1 -0
  21. package/__mf/js/async/1495.6c8b8071.js +1 -0
  22. package/__mf/js/async/1620.6376bd14.js +2 -0
  23. package/__mf/js/async/1620.6376bd14.js.LICENSE.txt +9 -0
  24. package/__mf/js/async/1864.df7c4beb.js +1 -0
  25. package/__mf/js/async/1950.704c331e.js +1 -0
  26. package/__mf/js/async/1964.95da06f6.js +2 -0
  27. package/__mf/js/async/1964.95da06f6.js.LICENSE.txt +9 -0
  28. package/__mf/js/async/1996.01084c88.js +2 -0
  29. package/__mf/js/async/1996.01084c88.js.LICENSE.txt +24 -0
  30. package/__mf/js/async/212.bd5d617a.js +1 -0
  31. package/__mf/js/async/2316.fec4907a.js +1 -0
  32. package/__mf/js/async/232.f3523a60.js +1 -0
  33. package/__mf/js/async/2569.daf868a6.js +10 -0
  34. package/__mf/js/async/2569.daf868a6.js.LICENSE.txt +27 -0
  35. package/__mf/js/async/2675.c3b73822.js +1 -0
  36. package/__mf/js/async/3224.23f0dccf.js +1 -0
  37. package/__mf/js/async/3355.a4dbcdb0.js +1 -0
  38. package/__mf/js/async/3436.97c926a4.js +1 -0
  39. package/__mf/js/async/3818.dde21d04.js +1 -0
  40. package/__mf/js/async/3871.6915e369.js +1 -0
  41. package/__mf/js/async/3960.129d5ef5.js +2 -0
  42. package/__mf/js/async/3960.129d5ef5.js.LICENSE.txt +8 -0
  43. package/__mf/js/async/4075.b77ca1c7.js +1 -0
  44. package/__mf/js/async/4238.8e4d29d5.js +1 -0
  45. package/__mf/js/async/4323.4266fd6a.js +1 -0
  46. package/__mf/js/async/4421.1bcc1637.js +1 -0
  47. package/__mf/js/async/4489.3361e7bc.js +29 -0
  48. package/__mf/js/async/4489.3361e7bc.js.LICENSE.txt +59 -0
  49. package/__mf/js/async/5214.027c4332.js +1 -0
  50. package/__mf/js/async/5345.8c2e4b4a.js +1 -0
  51. package/__mf/js/async/537.6911ea2e.js +1 -0
  52. package/__mf/js/async/5387.fd6e16d6.js +1 -0
  53. package/__mf/js/async/5654.ecb41aea.js +38 -0
  54. package/__mf/js/async/5724.6ee6ec51.js +1 -0
  55. package/__mf/js/async/5774.9b0b6be1.js +1 -0
  56. package/__mf/js/async/5790.2273e061.js +1 -0
  57. package/__mf/js/async/5913.9d30fd07.js +73 -0
  58. package/__mf/js/async/5913.9d30fd07.js.LICENSE.txt +19 -0
  59. package/__mf/js/async/5914.bd342d22.js +74 -0
  60. package/__mf/js/async/5981.40bed0d0.js +2 -0
  61. package/__mf/js/async/5981.40bed0d0.js.LICENSE.txt +8 -0
  62. package/__mf/js/async/6292.7b8efa78.js +1 -0
  63. package/__mf/js/async/6333.865a46e0.js +2 -0
  64. package/__mf/js/async/6333.865a46e0.js.LICENSE.txt +9 -0
  65. package/__mf/js/async/6377.ca974d89.js +2 -0
  66. package/__mf/js/async/6377.ca974d89.js.LICENSE.txt +32 -0
  67. package/__mf/js/async/6770.adb1c939.js +1 -0
  68. package/__mf/js/async/684.ca510333.js +1 -0
  69. package/__mf/js/async/694.f861d67c.js +1 -0
  70. package/__mf/js/async/7272.a763aa92.js +1 -0
  71. package/__mf/js/async/738.aca54e25.js +1 -0
  72. package/__mf/js/async/7740.0c5363fd.js +1 -0
  73. package/__mf/js/async/8265.b9e2c31e.js +1 -0
  74. package/__mf/js/async/8488.5237550f.js +1 -0
  75. package/__mf/js/async/8587.4891ea90.js +1 -0
  76. package/__mf/js/async/8610.8300df79.js +1 -0
  77. package/__mf/js/async/87.fdc843ac.js +1 -0
  78. package/__mf/js/async/8930.9fbbc975.js +1 -0
  79. package/__mf/js/async/8997.18901f45.js +28 -0
  80. package/__mf/js/async/9173.e8fbead5.js +2 -0
  81. package/__mf/js/async/9173.e8fbead5.js.LICENSE.txt +19 -0
  82. package/__mf/js/async/__federation_expose_PrometheusDatasource.f6f57299.js +1 -0
  83. package/__mf/js/async/__federation_expose_PrometheusExplorer.5fcf955a.js +1 -0
  84. package/__mf/js/async/__federation_expose_PrometheusLabelNamesVariable.86d0ad5a.js +1 -0
  85. package/__mf/js/async/__federation_expose_PrometheusLabelValuesVariable.b2893484.js +1 -0
  86. package/__mf/js/async/__federation_expose_PrometheusPromQLVariable.cd16f6e8.js +1 -0
  87. package/__mf/js/async/__federation_expose_PrometheusTimeSeriesQuery.eb9eefa6.js +1 -0
  88. package/__mf/js/main.154a5b65.js +1 -0
  89. package/lib/bootstrap.d.ts +2 -0
  90. package/lib/bootstrap.d.ts.map +1 -0
  91. package/lib/bootstrap.js +19 -0
  92. package/lib/bootstrap.js.map +1 -0
  93. package/lib/cjs/bootstrap.js +26 -0
  94. package/{dist → lib}/cjs/components/PromQLEditor.js +9 -7
  95. package/lib/cjs/components/TreeNode.js +492 -0
  96. package/{dist → lib}/cjs/components/promql/ast.js +21 -21
  97. package/lib/cjs/components/promql/functionSignatures.js +651 -0
  98. package/lib/cjs/components/promql/serialize.js +88 -0
  99. package/{dist → lib}/cjs/components/promql/utils.js +12 -1
  100. package/{dist/cjs/components/parse.js → lib/cjs/components/query.js} +37 -4
  101. package/lib/cjs/env.d.js +14 -0
  102. package/lib/cjs/explore/PrometheusExplorer.js +203 -0
  103. package/lib/cjs/explore/PrometheusMetricsFinder/PrometheusMetricsFinder.js +268 -0
  104. package/lib/cjs/explore/PrometheusMetricsFinder/display/MetricChip.js +61 -0
  105. package/lib/cjs/explore/PrometheusMetricsFinder/display/list/MetricList.js +179 -0
  106. package/lib/cjs/explore/PrometheusMetricsFinder/filter/FilterInputs.js +231 -0
  107. package/lib/cjs/explore/PrometheusMetricsFinder/filter/FinderFilters.js +97 -0
  108. package/{dist/cjs/plugins/prometheus-time-series-query → lib/cjs/explore/PrometheusMetricsFinder}/index.js +1 -1
  109. package/lib/cjs/explore/PrometheusMetricsFinder/overview/MetricOverview.js +235 -0
  110. package/lib/cjs/explore/PrometheusMetricsFinder/overview/tabs/JobTab.js +144 -0
  111. package/lib/cjs/explore/PrometheusMetricsFinder/overview/tabs/OverviewTab.js +423 -0
  112. package/lib/cjs/explore/PrometheusMetricsFinder/overview/tabs/SimilarTab.js +53 -0
  113. package/lib/cjs/explore/PrometheusMetricsFinder/types.js +25 -0
  114. package/lib/cjs/explore/PrometheusMetricsFinder/utils.js +203 -0
  115. package/lib/cjs/explore/index.js +19 -0
  116. package/lib/cjs/getPluginModule.js +27 -0
  117. package/lib/cjs/index-federation.js +55 -0
  118. package/lib/cjs/index.js +28 -0
  119. package/{dist → lib}/cjs/model/api-types.js +1 -1
  120. package/{dist → lib}/cjs/model/prometheus-client.js +1 -1
  121. package/lib/cjs/plugins/PrometheusDatasourceEditor.js +109 -0
  122. package/lib/cjs/plugins/PrometheusLabelNamesVariable.js +34 -0
  123. package/lib/cjs/plugins/PrometheusLabelValuesVariable.js +38 -0
  124. package/lib/cjs/plugins/PrometheusPromQLVariable.js +42 -0
  125. package/lib/cjs/plugins/index.js +26 -0
  126. package/{dist → lib}/cjs/plugins/prometheus-datasource.js +9 -9
  127. package/{dist → lib}/cjs/plugins/prometheus-time-series-query/PrometheusTimeSeriesQueryEditor.js +11 -9
  128. package/{dist → lib}/cjs/plugins/prometheus-time-series-query/get-time-series-data.js +51 -29
  129. package/lib/cjs/plugins/prometheus-time-series-query/index.js +35 -0
  130. package/{dist → lib}/cjs/plugins/prometheus-variables.js +25 -101
  131. package/{dist → lib}/cjs/plugins/variable.js +1 -2
  132. package/lib/cjs/setup-tests.js +19 -0
  133. package/{dist → lib}/cjs/utils/utils.js +1 -2
  134. package/lib/components/PromQLEditor.d.ts.map +1 -0
  135. package/{dist → lib}/components/PromQLEditor.js +9 -7
  136. package/lib/components/PromQLEditor.js.map +1 -0
  137. package/lib/components/TreeNode.d.ts +15 -0
  138. package/lib/components/TreeNode.d.ts.map +1 -0
  139. package/lib/components/TreeNode.js +479 -0
  140. package/lib/components/TreeNode.js.map +1 -0
  141. package/lib/components/index.d.ts.map +1 -0
  142. package/lib/components/index.js.map +1 -0
  143. package/lib/components/promql/ast.d.ts.map +1 -0
  144. package/{dist → lib}/components/promql/ast.js +21 -21
  145. package/lib/components/promql/ast.js.map +1 -0
  146. package/{dist → lib}/components/promql/format.d.ts +1 -1
  147. package/lib/components/promql/format.d.ts.map +1 -0
  148. package/lib/components/promql/format.js.map +1 -0
  149. package/lib/components/promql/functionSignatures.d.ts +3 -0
  150. package/lib/components/promql/functionSignatures.d.ts.map +1 -0
  151. package/lib/components/promql/functionSignatures.js +643 -0
  152. package/lib/components/promql/functionSignatures.js.map +1 -0
  153. package/lib/components/promql/serialize.d.ts +4 -0
  154. package/lib/components/promql/serialize.d.ts.map +1 -0
  155. package/lib/components/promql/serialize.js +80 -0
  156. package/lib/components/promql/serialize.js.map +1 -0
  157. package/{dist → lib}/components/promql/utils.d.ts +1 -0
  158. package/lib/components/promql/utils.d.ts.map +1 -0
  159. package/{dist → lib}/components/promql/utils.js +9 -1
  160. package/lib/components/promql/utils.js.map +1 -0
  161. package/lib/components/query.d.ts +6 -0
  162. package/lib/components/query.d.ts.map +1 -0
  163. package/{dist/components/parse.js → lib/components/query.js} +27 -2
  164. package/lib/components/query.js.map +1 -0
  165. package/lib/env.d.js +15 -0
  166. package/lib/env.d.js.map +1 -0
  167. package/lib/explore/PrometheusExplorer.d.ts +3 -0
  168. package/lib/explore/PrometheusExplorer.d.ts.map +1 -0
  169. package/lib/explore/PrometheusExplorer.js +190 -0
  170. package/lib/explore/PrometheusExplorer.js.map +1 -0
  171. package/lib/explore/PrometheusMetricsFinder/PrometheusMetricsFinder.d.ts +31 -0
  172. package/lib/explore/PrometheusMetricsFinder/PrometheusMetricsFinder.d.ts.map +1 -0
  173. package/lib/explore/PrometheusMetricsFinder/PrometheusMetricsFinder.js +244 -0
  174. package/lib/explore/PrometheusMetricsFinder/PrometheusMetricsFinder.js.map +1 -0
  175. package/lib/explore/PrometheusMetricsFinder/display/MetricChip.d.ts +4 -0
  176. package/lib/explore/PrometheusMetricsFinder/display/MetricChip.d.ts.map +1 -0
  177. package/lib/explore/PrometheusMetricsFinder/display/MetricChip.js +53 -0
  178. package/lib/explore/PrometheusMetricsFinder/display/MetricChip.js.map +1 -0
  179. package/lib/explore/PrometheusMetricsFinder/display/list/MetricList.d.ts +27 -0
  180. package/lib/explore/PrometheusMetricsFinder/display/list/MetricList.d.ts.map +1 -0
  181. package/lib/explore/PrometheusMetricsFinder/display/list/MetricList.js +158 -0
  182. package/lib/explore/PrometheusMetricsFinder/display/list/MetricList.js.map +1 -0
  183. package/lib/explore/PrometheusMetricsFinder/filter/FilterInputs.d.ts +23 -0
  184. package/lib/explore/PrometheusMetricsFinder/filter/FilterInputs.d.ts.map +1 -0
  185. package/lib/explore/PrometheusMetricsFinder/filter/FilterInputs.js +209 -0
  186. package/lib/explore/PrometheusMetricsFinder/filter/FilterInputs.js.map +1 -0
  187. package/lib/explore/PrometheusMetricsFinder/filter/FinderFilters.d.ts +13 -0
  188. package/lib/explore/PrometheusMetricsFinder/filter/FinderFilters.d.ts.map +1 -0
  189. package/lib/explore/PrometheusMetricsFinder/filter/FinderFilters.js +84 -0
  190. package/lib/explore/PrometheusMetricsFinder/filter/FinderFilters.js.map +1 -0
  191. package/lib/explore/PrometheusMetricsFinder/index.d.ts +2 -0
  192. package/lib/explore/PrometheusMetricsFinder/index.d.ts.map +1 -0
  193. package/{dist/model/api-types.js → lib/explore/PrometheusMetricsFinder/index.js} +2 -2
  194. package/lib/explore/PrometheusMetricsFinder/index.js.map +1 -0
  195. package/lib/explore/PrometheusMetricsFinder/overview/MetricOverview.d.ts +23 -0
  196. package/lib/explore/PrometheusMetricsFinder/overview/MetricOverview.d.ts.map +1 -0
  197. package/lib/explore/PrometheusMetricsFinder/overview/MetricOverview.js +214 -0
  198. package/lib/explore/PrometheusMetricsFinder/overview/MetricOverview.js.map +1 -0
  199. package/lib/explore/PrometheusMetricsFinder/overview/tabs/JobTab.d.ts +28 -0
  200. package/lib/explore/PrometheusMetricsFinder/overview/tabs/JobTab.d.ts.map +1 -0
  201. package/lib/explore/PrometheusMetricsFinder/overview/tabs/JobTab.js +125 -0
  202. package/lib/explore/PrometheusMetricsFinder/overview/tabs/JobTab.js.map +1 -0
  203. package/lib/explore/PrometheusMetricsFinder/overview/tabs/OverviewTab.d.ts +25 -0
  204. package/lib/explore/PrometheusMetricsFinder/overview/tabs/OverviewTab.d.ts.map +1 -0
  205. package/lib/explore/PrometheusMetricsFinder/overview/tabs/OverviewTab.js +399 -0
  206. package/lib/explore/PrometheusMetricsFinder/overview/tabs/OverviewTab.js.map +1 -0
  207. package/lib/explore/PrometheusMetricsFinder/overview/tabs/SimilarTab.d.ts +12 -0
  208. package/lib/explore/PrometheusMetricsFinder/overview/tabs/SimilarTab.d.ts.map +1 -0
  209. package/lib/explore/PrometheusMetricsFinder/overview/tabs/SimilarTab.js +45 -0
  210. package/lib/explore/PrometheusMetricsFinder/overview/tabs/SimilarTab.js.map +1 -0
  211. package/lib/explore/PrometheusMetricsFinder/types.d.ts +22 -0
  212. package/lib/explore/PrometheusMetricsFinder/types.d.ts.map +1 -0
  213. package/lib/explore/PrometheusMetricsFinder/types.js +17 -0
  214. package/lib/explore/PrometheusMetricsFinder/types.js.map +1 -0
  215. package/lib/explore/PrometheusMetricsFinder/utils.d.ts +22 -0
  216. package/lib/explore/PrometheusMetricsFinder/utils.d.ts.map +1 -0
  217. package/lib/explore/PrometheusMetricsFinder/utils.js +185 -0
  218. package/lib/explore/PrometheusMetricsFinder/utils.js.map +1 -0
  219. package/lib/explore/index.d.ts +3 -0
  220. package/lib/explore/index.d.ts.map +1 -0
  221. package/lib/explore/index.js +4 -0
  222. package/lib/explore/index.js.map +1 -0
  223. package/lib/getPluginModule.d.ts +6 -0
  224. package/lib/getPluginModule.d.ts.map +1 -0
  225. package/lib/getPluginModule.js +16 -0
  226. package/lib/getPluginModule.js.map +1 -0
  227. package/lib/index-federation.d.ts +1 -0
  228. package/lib/index-federation.d.ts.map +1 -0
  229. package/lib/index-federation.js +15 -0
  230. package/{dist/components/index.js.map → lib/index-federation.js.map} +1 -1
  231. package/lib/index.d.ts +6 -0
  232. package/lib/index.d.ts.map +1 -0
  233. package/lib/index.js +7 -0
  234. package/lib/index.js.map +1 -0
  235. package/{dist → lib}/model/api-types.d.ts +18 -1
  236. package/lib/model/api-types.d.ts.map +1 -0
  237. package/{dist/plugins/prometheus-time-series-query/index.js → lib/model/api-types.js} +3 -3
  238. package/lib/model/api-types.js.map +1 -0
  239. package/lib/model/index.d.ts.map +1 -0
  240. package/lib/model/index.js.map +1 -0
  241. package/lib/model/parse-sample-values.d.ts.map +1 -0
  242. package/lib/model/parse-sample-values.js.map +1 -0
  243. package/lib/model/prometheus-client.d.ts.map +1 -0
  244. package/{dist → lib}/model/prometheus-client.js +1 -1
  245. package/lib/model/prometheus-client.js.map +1 -0
  246. package/lib/model/prometheus-selectors.d.ts.map +1 -0
  247. package/lib/model/prometheus-selectors.js.map +1 -0
  248. package/lib/model/time.d.ts.map +1 -0
  249. package/lib/model/time.js.map +1 -0
  250. package/lib/plugins/MatcherEditor.d.ts.map +1 -0
  251. package/lib/plugins/MatcherEditor.js.map +1 -0
  252. package/lib/plugins/PrometheusDatasourceEditor.d.ts.map +1 -0
  253. package/lib/plugins/PrometheusDatasourceEditor.js +96 -0
  254. package/lib/plugins/PrometheusDatasourceEditor.js.map +1 -0
  255. package/lib/plugins/PrometheusLabelNamesVariable.d.ts +4 -0
  256. package/lib/plugins/PrometheusLabelNamesVariable.d.ts.map +1 -0
  257. package/lib/plugins/PrometheusLabelNamesVariable.js +26 -0
  258. package/lib/plugins/PrometheusLabelNamesVariable.js.map +1 -0
  259. package/lib/plugins/PrometheusLabelValuesVariable.d.ts +4 -0
  260. package/lib/plugins/PrometheusLabelValuesVariable.d.ts.map +1 -0
  261. package/lib/plugins/PrometheusLabelValuesVariable.js +30 -0
  262. package/lib/plugins/PrometheusLabelValuesVariable.js.map +1 -0
  263. package/lib/plugins/PrometheusPromQLVariable.d.ts +4 -0
  264. package/lib/plugins/PrometheusPromQLVariable.d.ts.map +1 -0
  265. package/lib/plugins/PrometheusPromQLVariable.js +34 -0
  266. package/lib/plugins/PrometheusPromQLVariable.js.map +1 -0
  267. package/lib/plugins/index.d.ts +10 -0
  268. package/lib/plugins/index.d.ts.map +1 -0
  269. package/lib/plugins/index.js +11 -0
  270. package/lib/plugins/index.js.map +1 -0
  271. package/lib/plugins/prometheus-datasource.d.ts.map +1 -0
  272. package/{dist → lib}/plugins/prometheus-datasource.js +9 -9
  273. package/lib/plugins/prometheus-datasource.js.map +1 -0
  274. package/lib/plugins/prometheus-time-series-query/PrometheusTimeSeriesQuery.d.ts.map +1 -0
  275. package/lib/plugins/prometheus-time-series-query/PrometheusTimeSeriesQuery.js.map +1 -0
  276. package/lib/plugins/prometheus-time-series-query/PrometheusTimeSeriesQueryEditor.d.ts.map +1 -0
  277. package/{dist → lib}/plugins/prometheus-time-series-query/PrometheusTimeSeriesQueryEditor.js +9 -7
  278. package/lib/plugins/prometheus-time-series-query/PrometheusTimeSeriesQueryEditor.js.map +1 -0
  279. package/lib/plugins/prometheus-time-series-query/get-time-series-data.d.ts.map +1 -0
  280. package/{dist → lib}/plugins/prometheus-time-series-query/get-time-series-data.js +51 -29
  281. package/lib/plugins/prometheus-time-series-query/get-time-series-data.js.map +1 -0
  282. package/lib/plugins/prometheus-time-series-query/index.d.ts +7 -0
  283. package/lib/plugins/prometheus-time-series-query/index.d.ts.map +1 -0
  284. package/lib/plugins/prometheus-time-series-query/index.js +20 -0
  285. package/lib/plugins/prometheus-time-series-query/index.js.map +1 -0
  286. package/lib/plugins/prometheus-time-series-query/query-editor-model.d.ts.map +1 -0
  287. package/lib/plugins/prometheus-time-series-query/query-editor-model.js.map +1 -0
  288. package/lib/plugins/prometheus-time-series-query/replace-prom-builtin-variables.d.ts.map +1 -0
  289. package/lib/plugins/prometheus-time-series-query/replace-prom-builtin-variables.js.map +1 -0
  290. package/lib/plugins/prometheus-time-series-query/time-series-query-model.d.ts.map +1 -0
  291. package/lib/plugins/prometheus-time-series-query/time-series-query-model.js.map +1 -0
  292. package/lib/plugins/prometheus-variables.d.ts +14 -0
  293. package/lib/plugins/prometheus-variables.d.ts.map +1 -0
  294. package/{dist → lib}/plugins/prometheus-variables.js +15 -98
  295. package/lib/plugins/prometheus-variables.js.map +1 -0
  296. package/lib/plugins/types.d.ts.map +1 -0
  297. package/lib/plugins/types.js.map +1 -0
  298. package/lib/plugins/variable.d.ts.map +1 -0
  299. package/{dist → lib}/plugins/variable.js +1 -2
  300. package/lib/plugins/variable.js.map +1 -0
  301. package/lib/setup-tests.d.ts +2 -0
  302. package/lib/setup-tests.d.ts.map +1 -0
  303. package/lib/setup-tests.js +17 -0
  304. package/{dist/utils/index.js.map → lib/setup-tests.js.map} +1 -1
  305. package/lib/test/setup-tests.d.ts.map +1 -0
  306. package/lib/test/setup-tests.js.map +1 -0
  307. package/lib/utils/index.d.ts.map +1 -0
  308. package/lib/utils/index.js.map +1 -0
  309. package/lib/utils/utils.d.ts.map +1 -0
  310. package/{dist → lib}/utils/utils.js +1 -2
  311. package/lib/utils/utils.js.map +1 -0
  312. package/mf-manifest.json +898 -0
  313. package/mf-stats.json +1004 -0
  314. package/package.json +99 -38
  315. package/dist/cjs/components/TreeNode.js +0 -147
  316. package/dist/cjs/index.js +0 -61
  317. package/dist/cjs/plugins/PrometheusDatasourceEditor.js +0 -626
  318. package/dist/components/PromQLEditor.d.ts.map +0 -1
  319. package/dist/components/PromQLEditor.js.map +0 -1
  320. package/dist/components/TreeNode.d.ts +0 -10
  321. package/dist/components/TreeNode.d.ts.map +0 -1
  322. package/dist/components/TreeNode.js +0 -139
  323. package/dist/components/TreeNode.js.map +0 -1
  324. package/dist/components/index.d.ts.map +0 -1
  325. package/dist/components/parse.d.ts +0 -5
  326. package/dist/components/parse.d.ts.map +0 -1
  327. package/dist/components/parse.js.map +0 -1
  328. package/dist/components/promql/ast.d.ts.map +0 -1
  329. package/dist/components/promql/ast.js.map +0 -1
  330. package/dist/components/promql/format.d.ts.map +0 -1
  331. package/dist/components/promql/format.js.map +0 -1
  332. package/dist/components/promql/utils.d.ts.map +0 -1
  333. package/dist/components/promql/utils.js.map +0 -1
  334. package/dist/index.d.ts +0 -8
  335. package/dist/index.d.ts.map +0 -1
  336. package/dist/index.js +0 -24
  337. package/dist/index.js.map +0 -1
  338. package/dist/model/api-types.d.ts.map +0 -1
  339. package/dist/model/api-types.js.map +0 -1
  340. package/dist/model/index.d.ts.map +0 -1
  341. package/dist/model/index.js.map +0 -1
  342. package/dist/model/parse-sample-values.d.ts.map +0 -1
  343. package/dist/model/parse-sample-values.js.map +0 -1
  344. package/dist/model/prometheus-client.d.ts.map +0 -1
  345. package/dist/model/prometheus-client.js.map +0 -1
  346. package/dist/model/prometheus-selectors.d.ts.map +0 -1
  347. package/dist/model/prometheus-selectors.js.map +0 -1
  348. package/dist/model/time.d.ts.map +0 -1
  349. package/dist/model/time.js.map +0 -1
  350. package/dist/plugins/MatcherEditor.d.ts.map +0 -1
  351. package/dist/plugins/MatcherEditor.js.map +0 -1
  352. package/dist/plugins/PrometheusDatasourceEditor.d.ts.map +0 -1
  353. package/dist/plugins/PrometheusDatasourceEditor.js +0 -572
  354. package/dist/plugins/PrometheusDatasourceEditor.js.map +0 -1
  355. package/dist/plugins/prometheus-datasource.d.ts.map +0 -1
  356. package/dist/plugins/prometheus-datasource.js.map +0 -1
  357. package/dist/plugins/prometheus-time-series-query/PrometheusTimeSeriesQuery.d.ts.map +0 -1
  358. package/dist/plugins/prometheus-time-series-query/PrometheusTimeSeriesQuery.js.map +0 -1
  359. package/dist/plugins/prometheus-time-series-query/PrometheusTimeSeriesQueryEditor.d.ts.map +0 -1
  360. package/dist/plugins/prometheus-time-series-query/PrometheusTimeSeriesQueryEditor.js.map +0 -1
  361. package/dist/plugins/prometheus-time-series-query/get-time-series-data.d.ts.map +0 -1
  362. package/dist/plugins/prometheus-time-series-query/get-time-series-data.js.map +0 -1
  363. package/dist/plugins/prometheus-time-series-query/index.d.ts +0 -2
  364. package/dist/plugins/prometheus-time-series-query/index.d.ts.map +0 -1
  365. package/dist/plugins/prometheus-time-series-query/index.js.map +0 -1
  366. package/dist/plugins/prometheus-time-series-query/query-editor-model.d.ts.map +0 -1
  367. package/dist/plugins/prometheus-time-series-query/query-editor-model.js.map +0 -1
  368. package/dist/plugins/prometheus-time-series-query/replace-prom-builtin-variables.d.ts.map +0 -1
  369. package/dist/plugins/prometheus-time-series-query/replace-prom-builtin-variables.js.map +0 -1
  370. package/dist/plugins/prometheus-time-series-query/time-series-query-model.d.ts.map +0 -1
  371. package/dist/plugins/prometheus-time-series-query/time-series-query-model.js.map +0 -1
  372. package/dist/plugins/prometheus-variables.d.ts +0 -6
  373. package/dist/plugins/prometheus-variables.d.ts.map +0 -1
  374. package/dist/plugins/prometheus-variables.js.map +0 -1
  375. package/dist/plugins/types.d.ts.map +0 -1
  376. package/dist/plugins/types.js.map +0 -1
  377. package/dist/plugins/variable.d.ts.map +0 -1
  378. package/dist/plugins/variable.js.map +0 -1
  379. package/dist/test/setup-tests.d.ts.map +0 -1
  380. package/dist/test/setup-tests.js.map +0 -1
  381. package/dist/utils/index.d.ts.map +0 -1
  382. package/dist/utils/utils.d.ts.map +0 -1
  383. package/dist/utils/utils.js.map +0 -1
  384. package/plugin.json +0 -58
  385. /package/{dist → lib}/cjs/components/index.js +0 -0
  386. /package/{dist → lib}/cjs/components/promql/format.js +0 -0
  387. /package/{dist → lib}/cjs/model/index.js +0 -0
  388. /package/{dist → lib}/cjs/model/parse-sample-values.js +0 -0
  389. /package/{dist → lib}/cjs/model/prometheus-selectors.js +0 -0
  390. /package/{dist → lib}/cjs/model/time.js +0 -0
  391. /package/{dist → lib}/cjs/plugins/MatcherEditor.js +0 -0
  392. /package/{dist → lib}/cjs/plugins/prometheus-time-series-query/PrometheusTimeSeriesQuery.js +0 -0
  393. /package/{dist → lib}/cjs/plugins/prometheus-time-series-query/query-editor-model.js +0 -0
  394. /package/{dist → lib}/cjs/plugins/prometheus-time-series-query/replace-prom-builtin-variables.js +0 -0
  395. /package/{dist → lib}/cjs/plugins/prometheus-time-series-query/time-series-query-model.js +0 -0
  396. /package/{dist → lib}/cjs/plugins/types.js +0 -0
  397. /package/{dist → lib}/cjs/test/setup-tests.js +0 -0
  398. /package/{dist → lib}/cjs/utils/index.js +0 -0
  399. /package/{dist → lib}/components/PromQLEditor.d.ts +0 -0
  400. /package/{dist → lib}/components/index.d.ts +0 -0
  401. /package/{dist → lib}/components/index.js +0 -0
  402. /package/{dist → lib}/components/promql/ast.d.ts +0 -0
  403. /package/{dist → lib}/components/promql/format.js +0 -0
  404. /package/{dist → lib}/model/index.d.ts +0 -0
  405. /package/{dist → lib}/model/index.js +0 -0
  406. /package/{dist → lib}/model/parse-sample-values.d.ts +0 -0
  407. /package/{dist → lib}/model/parse-sample-values.js +0 -0
  408. /package/{dist → lib}/model/prometheus-client.d.ts +0 -0
  409. /package/{dist → lib}/model/prometheus-selectors.d.ts +0 -0
  410. /package/{dist → lib}/model/prometheus-selectors.js +0 -0
  411. /package/{dist → lib}/model/time.d.ts +0 -0
  412. /package/{dist → lib}/model/time.js +0 -0
  413. /package/{dist → lib}/plugins/MatcherEditor.d.ts +0 -0
  414. /package/{dist → lib}/plugins/MatcherEditor.js +0 -0
  415. /package/{dist → lib}/plugins/PrometheusDatasourceEditor.d.ts +0 -0
  416. /package/{dist → lib}/plugins/prometheus-datasource.d.ts +0 -0
  417. /package/{dist → lib}/plugins/prometheus-time-series-query/PrometheusTimeSeriesQuery.d.ts +0 -0
  418. /package/{dist → lib}/plugins/prometheus-time-series-query/PrometheusTimeSeriesQuery.js +0 -0
  419. /package/{dist → lib}/plugins/prometheus-time-series-query/PrometheusTimeSeriesQueryEditor.d.ts +0 -0
  420. /package/{dist → lib}/plugins/prometheus-time-series-query/get-time-series-data.d.ts +0 -0
  421. /package/{dist → lib}/plugins/prometheus-time-series-query/query-editor-model.d.ts +0 -0
  422. /package/{dist → lib}/plugins/prometheus-time-series-query/query-editor-model.js +0 -0
  423. /package/{dist → lib}/plugins/prometheus-time-series-query/replace-prom-builtin-variables.d.ts +0 -0
  424. /package/{dist → lib}/plugins/prometheus-time-series-query/replace-prom-builtin-variables.js +0 -0
  425. /package/{dist → lib}/plugins/prometheus-time-series-query/time-series-query-model.d.ts +0 -0
  426. /package/{dist → lib}/plugins/prometheus-time-series-query/time-series-query-model.js +0 -0
  427. /package/{dist → lib}/plugins/types.d.ts +0 -0
  428. /package/{dist → lib}/plugins/types.js +0 -0
  429. /package/{dist → lib}/plugins/variable.d.ts +0 -0
  430. /package/{dist → lib}/test/setup-tests.d.ts +0 -0
  431. /package/{dist → lib}/test/setup-tests.js +0 -0
  432. /package/{dist → lib}/utils/index.d.ts +0 -0
  433. /package/{dist → lib}/utils/index.js +0 -0
  434. /package/{dist → lib}/utils/utils.d.ts +0 -0
@@ -0,0 +1,492 @@
1
+ // Copyright 2025 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
+ // Forked from https://github.com/prometheus/prometheus/blob/65f610353919b1c7b42d3776c3a95b68046a6bba/web/ui/mantine-ui/src/pages/query/TreeNode.tsx
14
+ "use strict";
15
+ Object.defineProperty(exports, "__esModule", {
16
+ value: true
17
+ });
18
+ Object.defineProperty(exports, "default", {
19
+ enumerable: true,
20
+ get: function() {
21
+ return TreeNode;
22
+ }
23
+ });
24
+ const _jsxruntime = require("react/jsx-runtime");
25
+ const _material = require("@mui/material");
26
+ const _Circle = /*#__PURE__*/ _interop_require_default(require("mdi-material-ui/Circle"));
27
+ const _react = require("react");
28
+ const _AlertCircle = /*#__PURE__*/ _interop_require_default(require("mdi-material-ui/AlertCircle"));
29
+ const _ast = require("./promql/ast");
30
+ const _utils = require("./promql/utils");
31
+ const _format = require("./promql/format");
32
+ const _serialize = /*#__PURE__*/ _interop_require_default(require("./promql/serialize"));
33
+ const _functionSignatures = require("./promql/functionSignatures");
34
+ const _query = require("./query");
35
+ function _interop_require_default(obj) {
36
+ return obj && obj.__esModule ? obj : {
37
+ default: obj
38
+ };
39
+ }
40
+ // The indentation factor for each level of the tree.
41
+ const nodeIndent = 5;
42
+ const connectorWidth = nodeIndent * 5;
43
+ // max number of label names and values to show in the individual query status
44
+ const maxLabelNames = 10;
45
+ const maxLabelValues = 10;
46
+ // mergeChildStates basically returns the "worst" state found among the children.
47
+ const mergeChildStates = (states)=>{
48
+ if (states.includes('error')) {
49
+ return 'error';
50
+ }
51
+ if (states.includes('waiting')) {
52
+ return 'waiting';
53
+ }
54
+ if (states.includes('running')) {
55
+ return 'running';
56
+ }
57
+ return 'success';
58
+ };
59
+ function TreeNode({ node, parentEl, reverse, datasource, childIdx, reportNodeState }) {
60
+ const theme = (0, _material.useTheme)();
61
+ const children = (0, _utils.getNodeChildren)(node);
62
+ // A normal ref won't work properly here because the ref's `current` property
63
+ // going from `null` to defined won't trigger a re-render of the child
64
+ // component, since it's not a React state update. So we manually have to
65
+ // create a state update using a callback ref. See also
66
+ // https://tkdodo.eu/blog/avoiding-use-effect-with-callback-refs
67
+ const [nodeEl, setNodeEl] = (0, _react.useState)(null);
68
+ const nodeRef = (0, _react.useCallback)((node)=>setNodeEl(node), []);
69
+ const [resultStats, setResultStats] = (0, _react.useState)({
70
+ numSeries: 0,
71
+ labelExamples: {},
72
+ sortedLabelCards: []
73
+ });
74
+ const [connectorStyle, setConnectorStyle] = (0, _react.useState)({
75
+ borderColor: theme.palette.grey['500'],
76
+ borderLeftStyle: 'solid',
77
+ borderLeftWidth: 2,
78
+ width: connectorWidth,
79
+ left: -connectorWidth
80
+ });
81
+ const [childStates, setChildStates] = (0, _react.useState)(children.map(()=>'waiting'));
82
+ const mergedChildState = (0, _react.useMemo)(()=>mergeChildStates(childStates), [
83
+ childStates
84
+ ]);
85
+ // Optimize range vector selector fetches to give us the info we're looking for
86
+ // more cheaply. E.g. 'foo[7w]' can be expensive to fully fetch, but wrapping it
87
+ // in 'last_over_time(foo[7w])' is cheaper and also gives us all the info we
88
+ // need (number of series and labels).
89
+ let queryNode = node;
90
+ if (queryNode.type === _ast.nodeType.matrixSelector) {
91
+ queryNode = {
92
+ type: _ast.nodeType.call,
93
+ func: _functionSignatures.functionSignatures.last_over_time,
94
+ args: [
95
+ node
96
+ ]
97
+ };
98
+ }
99
+ // Individual query for the current node
100
+ const { data: instantQueryResponse, isFetching, error } = (0, _query.useInstantQuery)((0, _serialize.default)(queryNode) ?? '', datasource, mergedChildState === 'success');
101
+ // report the node state to the parent
102
+ (0, _react.useEffect)(()=>{
103
+ if (reportNodeState) {
104
+ if (mergedChildState === 'error' || error) {
105
+ reportNodeState(childIdx, 'error');
106
+ } else if (isFetching) {
107
+ reportNodeState(childIdx, 'running');
108
+ }
109
+ }
110
+ }, [
111
+ mergedChildState,
112
+ error,
113
+ isFetching,
114
+ reportNodeState,
115
+ childIdx
116
+ ]);
117
+ // This function is passed down to the child nodes so they can report their state.
118
+ const childReportNodeState = (0, _react.useCallback)((childIdx, state)=>{
119
+ setChildStates((prev)=>{
120
+ const newStates = [
121
+ ...prev
122
+ ];
123
+ newStates[childIdx] = state;
124
+ return newStates;
125
+ });
126
+ }, [
127
+ setChildStates
128
+ ]);
129
+ // Update the size and position of tree connector lines based on the node's and its parent's position.
130
+ (0, _react.useLayoutEffect)(()=>{
131
+ if (parentEl === undefined) {
132
+ // We're the root node.
133
+ return;
134
+ }
135
+ if (parentEl === null || nodeEl === null) {
136
+ // Either of the two connected nodes hasn't been rendered yet.
137
+ return;
138
+ }
139
+ const parentRect = parentEl.getBoundingClientRect();
140
+ const nodeRect = nodeEl.getBoundingClientRect();
141
+ if (reverse) {
142
+ setConnectorStyle((prevStyle)=>({
143
+ ...prevStyle,
144
+ top: 'calc(50% - 1px)',
145
+ bottom: nodeRect.bottom - parentRect.top,
146
+ borderTopLeftRadius: 10,
147
+ borderTopStyle: 'solid',
148
+ borderBottomLeftRadius: undefined
149
+ }));
150
+ } else {
151
+ setConnectorStyle((prevStyle)=>({
152
+ ...prevStyle,
153
+ top: parentRect.bottom - nodeRect.top,
154
+ bottom: 'calc(50% - 1px)',
155
+ borderBottomLeftRadius: 10,
156
+ borderBottomStyle: 'solid',
157
+ borderTopLeftRadius: undefined
158
+ }));
159
+ }
160
+ }, [
161
+ parentEl,
162
+ nodeEl,
163
+ reverse,
164
+ nodeRef,
165
+ setConnectorStyle
166
+ ]);
167
+ // Update the node info state based on the query result.
168
+ (0, _react.useEffect)(()=>{
169
+ if (instantQueryResponse?.status !== 'success') {
170
+ return;
171
+ }
172
+ if (reportNodeState) {
173
+ reportNodeState(childIdx, 'success');
174
+ }
175
+ let resultSeries = 0;
176
+ // labelValuesByName records the number of times each label value appears for each label name.
177
+ const labelValuesByName = {};
178
+ const { resultType, result } = instantQueryResponse.data;
179
+ if (resultType === 'scalar' || resultType === 'string') {
180
+ resultSeries = 1;
181
+ } else if (result && result.length > 0) {
182
+ resultSeries = result.length;
183
+ result.forEach((s)=>{
184
+ Object.entries(s.metric).forEach(([ln, lv])=>{
185
+ // TODO: If we ever want to include __name__ here again, we cannot use the
186
+ // last_over_time(foo[7d]) optimization since that removes the metric name.
187
+ if (ln !== '__name__') {
188
+ labelValuesByName[ln] = labelValuesByName[ln] ?? {};
189
+ labelValuesByName[ln][lv] = (labelValuesByName[ln][lv] ?? 0) + 1;
190
+ }
191
+ });
192
+ });
193
+ }
194
+ // labelCardinalities records the number of unique label values for each label name.
195
+ const labelCardinalities = {};
196
+ // labelExamples records the most common label values for each label name.
197
+ const labelExamples = {};
198
+ Object.entries(labelValuesByName).forEach(([ln, lvs])=>{
199
+ labelCardinalities[ln] = Object.keys(lvs).length;
200
+ // Sort label values by their number of occurrences within this label name.
201
+ labelExamples[ln] = Object.entries(lvs).sort(([, aCnt], [, bCnt])=>bCnt - aCnt).slice(0, maxLabelValues).map(([lv, cnt])=>({
202
+ value: lv,
203
+ count: cnt
204
+ }));
205
+ });
206
+ setResultStats({
207
+ numSeries: resultSeries,
208
+ sortedLabelCards: Object.entries(labelCardinalities).sort((a, b)=>b[1] - a[1]),
209
+ labelExamples
210
+ });
211
+ }, [
212
+ instantQueryResponse,
213
+ reportNodeState,
214
+ childIdx
215
+ ]);
216
+ const innerNode = /*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Stack, {
217
+ direction: "row",
218
+ gap: 2,
219
+ children: [
220
+ /*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Box, {
221
+ ref: nodeRef,
222
+ sx: {
223
+ position: 'relative',
224
+ display: 'inline-block',
225
+ padding: 1,
226
+ marginBottom: 1.5,
227
+ borderRadius: 2,
228
+ backgroundColor: theme.palette.background.code
229
+ },
230
+ children: [
231
+ parentEl !== undefined && // Connector line between this node and its parent.
232
+ /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Box, {
233
+ sx: {
234
+ position: 'absolute',
235
+ display: 'inline-block',
236
+ ...connectorStyle
237
+ }
238
+ }),
239
+ (0, _format.formatNode)(node, false, 1)
240
+ ]
241
+ }),
242
+ /*#__PURE__*/ (0, _jsxruntime.jsx)(QueryStatus, {
243
+ mergedChildState: mergedChildState,
244
+ isFetching: isFetching,
245
+ error: error,
246
+ resultStats: resultStats,
247
+ responseTime: instantQueryResponse?.responseTime
248
+ })
249
+ ]
250
+ });
251
+ if (node.type === _ast.nodeType.binaryExpr) {
252
+ return /*#__PURE__*/ (0, _jsxruntime.jsxs)("div", {
253
+ children: [
254
+ /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Box, {
255
+ ml: nodeIndent,
256
+ children: /*#__PURE__*/ (0, _jsxruntime.jsx)(TreeNode, {
257
+ node: children[0],
258
+ parentEl: nodeEl,
259
+ reverse: true,
260
+ datasource: datasource,
261
+ childIdx: 0,
262
+ reportNodeState: childReportNodeState
263
+ })
264
+ }),
265
+ innerNode,
266
+ /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Box, {
267
+ ml: nodeIndent,
268
+ children: /*#__PURE__*/ (0, _jsxruntime.jsx)(TreeNode, {
269
+ node: children[1],
270
+ parentEl: nodeEl,
271
+ reverse: false,
272
+ datasource: datasource,
273
+ childIdx: 1,
274
+ reportNodeState: childReportNodeState
275
+ })
276
+ })
277
+ ]
278
+ });
279
+ }
280
+ return /*#__PURE__*/ (0, _jsxruntime.jsxs)("div", {
281
+ children: [
282
+ innerNode,
283
+ children.map((child, idx)=>/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Box, {
284
+ ml: nodeIndent,
285
+ children: /*#__PURE__*/ (0, _jsxruntime.jsx)(TreeNode, {
286
+ node: child,
287
+ parentEl: nodeEl,
288
+ reverse: false,
289
+ datasource: datasource,
290
+ childIdx: idx,
291
+ reportNodeState: childReportNodeState
292
+ })
293
+ }, idx))
294
+ ]
295
+ });
296
+ }
297
+ function QueryStatus({ mergedChildState, isFetching, error, resultStats, responseTime }) {
298
+ if (mergedChildState === 'waiting') {
299
+ return /*#__PURE__*/ (0, _jsxruntime.jsx)(ProgressState, {
300
+ text: "Waiting for child query"
301
+ });
302
+ }
303
+ if (mergedChildState === 'running') {
304
+ return /*#__PURE__*/ (0, _jsxruntime.jsx)(ProgressState, {
305
+ text: "Running"
306
+ });
307
+ }
308
+ if (mergedChildState === 'error') {
309
+ return /*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Stack, {
310
+ children: [
311
+ /*#__PURE__*/ (0, _jsxruntime.jsx)(_AlertCircle.default, {}),
312
+ "Blocked on child query error"
313
+ ]
314
+ });
315
+ }
316
+ if (isFetching) {
317
+ return /*#__PURE__*/ (0, _jsxruntime.jsx)(ProgressState, {
318
+ text: "Loading"
319
+ });
320
+ }
321
+ if (error) {
322
+ return /*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Box, {
323
+ display: "flex",
324
+ alignItems: "center",
325
+ gap: 1,
326
+ sx: {
327
+ color: (theme)=>theme.palette.error.main
328
+ },
329
+ marginBottom: 1.5,
330
+ children: [
331
+ /*#__PURE__*/ (0, _jsxruntime.jsx)(_AlertCircle.default, {}),
332
+ /*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Typography, {
333
+ variant: "body2",
334
+ children: [
335
+ /*#__PURE__*/ (0, _jsxruntime.jsx)("strong", {
336
+ children: "Error executing query:"
337
+ }),
338
+ " ",
339
+ error.message
340
+ ]
341
+ })
342
+ ]
343
+ });
344
+ }
345
+ return /*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Stack, {
346
+ direction: "row",
347
+ gap: 1,
348
+ alignItems: "center",
349
+ marginBottom: 1.5,
350
+ children: [
351
+ /*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Typography, {
352
+ variant: "body2",
353
+ component: "span",
354
+ sx: {
355
+ color: (theme)=>theme.palette.grey[500]
356
+ },
357
+ children: [
358
+ resultStats.numSeries,
359
+ " result",
360
+ resultStats.numSeries !== 1 && 's',
361
+ "  –  ",
362
+ responseTime,
363
+ "ms",
364
+ resultStats.sortedLabelCards.length > 0 && /*#__PURE__*/ (0, _jsxruntime.jsx)(_jsxruntime.Fragment, {
365
+ children: "  –"
366
+ })
367
+ ]
368
+ }),
369
+ resultStats.sortedLabelCards.slice(0, maxLabelNames).map(([ln, cnt])=>/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Tooltip, {
370
+ title: /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Box, {
371
+ children: /*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.List, {
372
+ dense: true,
373
+ children: [
374
+ resultStats.labelExamples[ln]?.map(({ value, count })=>/*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.ListItem, {
375
+ sx: {
376
+ display: 'flex',
377
+ gap: 1,
378
+ py: 0,
379
+ px: 0.5
380
+ },
381
+ children: [
382
+ /*#__PURE__*/ (0, _jsxruntime.jsx)(_Circle.default, {
383
+ sx: {
384
+ fontSize: 8
385
+ }
386
+ }),
387
+ /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Typography, {
388
+ variant: "body2",
389
+ component: "span",
390
+ sx: {
391
+ color: (theme)=>theme.palette.mode === 'dark' // TODO we shouldnt have to do that I guess..
392
+ ? theme.palette.warning.dark : theme.palette.warning.main,
393
+ fontFamily: 'monospace'
394
+ },
395
+ children: (0, _utils.escapeString)(value)
396
+ }),
397
+ /*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Typography, {
398
+ variant: "body2",
399
+ component: "span",
400
+ children: [
401
+ "(",
402
+ count,
403
+ "x)"
404
+ ]
405
+ })
406
+ ]
407
+ }, value)),
408
+ cnt > maxLabelValues && /*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.ListItem, {
409
+ sx: {
410
+ display: 'flex',
411
+ gap: 1,
412
+ py: 0,
413
+ px: 0.5
414
+ },
415
+ children: [
416
+ /*#__PURE__*/ (0, _jsxruntime.jsx)(_Circle.default, {
417
+ sx: {
418
+ fontSize: 8
419
+ }
420
+ }),
421
+ /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Typography, {
422
+ variant: "body2",
423
+ children: ". . ."
424
+ })
425
+ ]
426
+ })
427
+ ]
428
+ })
429
+ }),
430
+ arrow: true,
431
+ children: /*#__PURE__*/ (0, _jsxruntime.jsxs)("span", {
432
+ style: {
433
+ cursor: 'pointer',
434
+ whiteSpace: 'nowrap'
435
+ },
436
+ children: [
437
+ /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Typography, {
438
+ variant: "body2",
439
+ component: "span",
440
+ sx: {
441
+ fontFamily: 'monospace',
442
+ color: (theme)=>theme.palette.success.main
443
+ },
444
+ children: ln
445
+ }),
446
+ /*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Typography, {
447
+ variant: "body2",
448
+ component: "span",
449
+ sx: {
450
+ color: (theme)=>theme.palette.grey[500]
451
+ },
452
+ children: [
453
+ ": ",
454
+ cnt
455
+ ]
456
+ })
457
+ ]
458
+ })
459
+ }, ln)),
460
+ resultStats.sortedLabelCards.length > maxLabelNames ? /*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Typography, {
461
+ variant: "body2",
462
+ children: [
463
+ "...",
464
+ resultStats.sortedLabelCards.length - maxLabelNames,
465
+ " more..."
466
+ ]
467
+ }) : null
468
+ ]
469
+ });
470
+ }
471
+ function ProgressState({ text }) {
472
+ return /*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Box, {
473
+ display: "flex",
474
+ alignItems: "center",
475
+ gap: 1,
476
+ marginBottom: 1.5,
477
+ children: [
478
+ /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.CircularProgress, {
479
+ size: 16,
480
+ color: "secondary"
481
+ }),
482
+ /*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Typography, {
483
+ variant: "body2",
484
+ color: "text.secondary",
485
+ children: [
486
+ text,
487
+ "..."
488
+ ]
489
+ })
490
+ ]
491
+ });
492
+ }
@@ -50,8 +50,7 @@ _export(exports, {
50
50
  return vectorMatchCardinality;
51
51
  }
52
52
  });
53
- var nodeType;
54
- (function(nodeType) {
53
+ var nodeType = /*#__PURE__*/ function(nodeType) {
55
54
  nodeType["aggregation"] = "aggregation";
56
55
  nodeType["binaryExpr"] = "binaryExpr";
57
56
  nodeType["call"] = "call";
@@ -63,9 +62,9 @@ var nodeType;
63
62
  nodeType["unaryExpr"] = "unaryExpr";
64
63
  nodeType["vectorSelector"] = "vectorSelector";
65
64
  nodeType["placeholder"] = "placeholder";
66
- })(nodeType || (nodeType = {}));
67
- var aggregationType;
68
- (function(aggregationType) {
65
+ return nodeType;
66
+ }({});
67
+ var aggregationType = /*#__PURE__*/ function(aggregationType) {
69
68
  aggregationType["sum"] = "sum";
70
69
  aggregationType["min"] = "min";
71
70
  aggregationType["max"] = "max";
@@ -80,9 +79,9 @@ var aggregationType;
80
79
  aggregationType["quantile"] = "quantile";
81
80
  aggregationType["limitK"] = "limitk";
82
81
  aggregationType["limitRatio"] = "limit_ratio";
83
- })(aggregationType || (aggregationType = {}));
84
- var binaryOperatorType;
85
- (function(binaryOperatorType) {
82
+ return aggregationType;
83
+ }({});
84
+ var binaryOperatorType = /*#__PURE__*/ function(binaryOperatorType) {
86
85
  binaryOperatorType["add"] = "+";
87
86
  binaryOperatorType["sub"] = "-";
88
87
  binaryOperatorType["mul"] = "*";
@@ -99,7 +98,8 @@ var binaryOperatorType;
99
98
  binaryOperatorType["or"] = "or";
100
99
  binaryOperatorType["unless"] = "unless";
101
100
  binaryOperatorType["atan2"] = "atan2";
102
- })(binaryOperatorType || (binaryOperatorType = {}));
101
+ return binaryOperatorType;
102
+ }({});
103
103
  const compOperatorTypes = [
104
104
  "==",
105
105
  "!=",
@@ -113,31 +113,31 @@ const setOperatorTypes = [
113
113
  "or",
114
114
  "unless"
115
115
  ];
116
- var unaryOperatorType;
117
- (function(unaryOperatorType) {
116
+ var unaryOperatorType = /*#__PURE__*/ function(unaryOperatorType) {
118
117
  unaryOperatorType["plus"] = "+";
119
118
  unaryOperatorType["minus"] = "-";
120
- })(unaryOperatorType || (unaryOperatorType = {}));
121
- var vectorMatchCardinality;
122
- (function(vectorMatchCardinality) {
119
+ return unaryOperatorType;
120
+ }({});
121
+ var vectorMatchCardinality = /*#__PURE__*/ function(vectorMatchCardinality) {
123
122
  vectorMatchCardinality["oneToOne"] = "one-to-one";
124
123
  vectorMatchCardinality["manyToOne"] = "many-to-one";
125
124
  vectorMatchCardinality["oneToMany"] = "one-to-many";
126
125
  vectorMatchCardinality["manyToMany"] = "many-to-many";
127
- })(vectorMatchCardinality || (vectorMatchCardinality = {}));
128
- var valueType;
129
- (function(valueType) {
126
+ return vectorMatchCardinality;
127
+ }({});
128
+ var valueType = /*#__PURE__*/ function(valueType) {
130
129
  // TODO: 'none' should never make it out of Prometheus. Do we need this here?
131
130
  valueType["none"] = "none";
132
131
  valueType["vector"] = "vector";
133
132
  valueType["scalar"] = "scalar";
134
133
  valueType["matrix"] = "matrix";
135
134
  valueType["string"] = "string";
136
- })(valueType || (valueType = {}));
137
- var matchType;
138
- (function(matchType) {
135
+ return valueType;
136
+ }({});
137
+ var matchType = /*#__PURE__*/ function(matchType) {
139
138
  matchType["equal"] = "=";
140
139
  matchType["notEqual"] = "!=";
141
140
  matchType["matchRegexp"] = "=~";
142
141
  matchType["matchNotRegexp"] = "!~";
143
- })(matchType || (matchType = {}));
142
+ return matchType;
143
+ }({});