@perses-dev/prometheus-plugin 0.0.0-snapshot-scatter-chart-embed-8efdfab → 0.0.0-snapshot-scatterplot-fix-imports-95e1b59

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 (87) hide show
  1. package/dist/cjs/components/PromQL.js +1 -1
  2. package/dist/cjs/index.js +7 -7
  3. package/dist/cjs/model/index.js +0 -1
  4. package/dist/cjs/model/parse-sample-values.js +3 -3
  5. package/dist/cjs/model/prometheus-client.js +8 -8
  6. package/dist/cjs/model/prometheus-selectors.js +3 -3
  7. package/dist/cjs/model/time.js +4 -4
  8. package/dist/cjs/plugins/MatcherEditor.js +1 -1
  9. package/dist/cjs/plugins/PrometheusDatasourceEditor.js +24 -26
  10. package/dist/cjs/plugins/prometheus-datasource.js +2 -2
  11. package/dist/cjs/plugins/prometheus-time-series-query/PrometheusTimeSeriesQueryEditor.js +67 -40
  12. package/dist/cjs/plugins/prometheus-time-series-query/get-time-series-data.js +3 -3
  13. package/dist/cjs/plugins/prometheus-time-series-query/query-editor-model.js +6 -6
  14. package/dist/cjs/plugins/prometheus-variables.js +10 -10
  15. package/dist/cjs/utils/utils.js +4 -4
  16. package/dist/components/PromQL.d.ts +2 -3
  17. package/dist/components/PromQL.d.ts.map +1 -1
  18. package/dist/components/PromQL.js +1 -1
  19. package/dist/components/PromQL.js.map +1 -1
  20. package/dist/model/api-types.d.ts +11 -11
  21. package/dist/model/api-types.d.ts.map +1 -1
  22. package/dist/model/api-types.js.map +1 -1
  23. package/dist/model/index.d.ts +0 -1
  24. package/dist/model/index.d.ts.map +1 -1
  25. package/dist/model/index.js +0 -1
  26. package/dist/model/index.js.map +1 -1
  27. package/dist/model/parse-sample-values.d.ts +1 -1
  28. package/dist/model/parse-sample-values.d.ts.map +1 -1
  29. package/dist/model/parse-sample-values.js.map +1 -1
  30. package/dist/model/prometheus-client.js +3 -3
  31. package/dist/model/prometheus-client.js.map +1 -1
  32. package/dist/model/prometheus-selectors.js.map +1 -1
  33. package/dist/model/time.js +1 -1
  34. package/dist/model/time.js.map +1 -1
  35. package/dist/plugins/MatcherEditor.d.ts +2 -3
  36. package/dist/plugins/MatcherEditor.d.ts.map +1 -1
  37. package/dist/plugins/MatcherEditor.js +1 -1
  38. package/dist/plugins/MatcherEditor.js.map +1 -1
  39. package/dist/plugins/PrometheusDatasourceEditor.d.ts +1 -2
  40. package/dist/plugins/PrometheusDatasourceEditor.d.ts.map +1 -1
  41. package/dist/plugins/PrometheusDatasourceEditor.js +21 -25
  42. package/dist/plugins/PrometheusDatasourceEditor.js.map +1 -1
  43. package/dist/plugins/prometheus-datasource.js +2 -2
  44. package/dist/plugins/prometheus-datasource.js.map +1 -1
  45. package/dist/plugins/prometheus-time-series-query/PrometheusTimeSeriesQuery.js.map +1 -1
  46. package/dist/plugins/prometheus-time-series-query/PrometheusTimeSeriesQueryEditor.d.ts +1 -2
  47. package/dist/plugins/prometheus-time-series-query/PrometheusTimeSeriesQueryEditor.d.ts.map +1 -1
  48. package/dist/plugins/prometheus-time-series-query/PrometheusTimeSeriesQueryEditor.js +70 -43
  49. package/dist/plugins/prometheus-time-series-query/PrometheusTimeSeriesQueryEditor.js.map +1 -1
  50. package/dist/plugins/prometheus-time-series-query/get-time-series-data.js +3 -3
  51. package/dist/plugins/prometheus-time-series-query/get-time-series-data.js.map +1 -1
  52. package/dist/plugins/prometheus-time-series-query/query-editor-model.d.ts +1 -1
  53. package/dist/plugins/prometheus-time-series-query/query-editor-model.d.ts.map +1 -1
  54. package/dist/plugins/prometheus-time-series-query/query-editor-model.js +3 -3
  55. package/dist/plugins/prometheus-time-series-query/query-editor-model.js.map +1 -1
  56. package/dist/plugins/prometheus-time-series-query/time-series-query-model.d.ts +2 -2
  57. package/dist/plugins/prometheus-time-series-query/time-series-query-model.d.ts.map +1 -1
  58. package/dist/plugins/prometheus-time-series-query/time-series-query-model.js +3 -1
  59. package/dist/plugins/prometheus-time-series-query/time-series-query-model.js.map +1 -1
  60. package/dist/plugins/prometheus-variables.d.ts.map +1 -1
  61. package/dist/plugins/prometheus-variables.js +10 -10
  62. package/dist/plugins/prometheus-variables.js.map +1 -1
  63. package/dist/plugins/types.d.ts +3 -3
  64. package/dist/plugins/types.d.ts.map +1 -1
  65. package/dist/plugins/variable.d.ts +2 -2
  66. package/dist/plugins/variable.d.ts.map +1 -1
  67. package/dist/plugins/variable.js.map +1 -1
  68. package/dist/utils/utils.d.ts +1 -1
  69. package/dist/utils/utils.d.ts.map +1 -1
  70. package/dist/utils/utils.js +1 -1
  71. package/dist/utils/utils.js.map +1 -1
  72. package/package.json +4 -4
  73. package/dist/cjs/model/templating.js +0 -28
  74. package/dist/cjs/plugins/prometheus-time-series-query/DashboardPrometheusTimeSeriesQueryEditor.js +0 -88
  75. package/dist/cjs/plugins/prometheus-time-series-query/ExplorePrometheusTimeSeriesQueryEditor.js +0 -123
  76. package/dist/model/templating.d.ts +0 -6
  77. package/dist/model/templating.d.ts.map +0 -1
  78. package/dist/model/templating.js +0 -20
  79. package/dist/model/templating.js.map +0 -1
  80. package/dist/plugins/prometheus-time-series-query/DashboardPrometheusTimeSeriesQueryEditor.d.ts +0 -21
  81. package/dist/plugins/prometheus-time-series-query/DashboardPrometheusTimeSeriesQueryEditor.d.ts.map +0 -1
  82. package/dist/plugins/prometheus-time-series-query/DashboardPrometheusTimeSeriesQueryEditor.js +0 -80
  83. package/dist/plugins/prometheus-time-series-query/DashboardPrometheusTimeSeriesQueryEditor.js.map +0 -1
  84. package/dist/plugins/prometheus-time-series-query/ExplorePrometheusTimeSeriesQueryEditor.d.ts +0 -21
  85. package/dist/plugins/prometheus-time-series-query/ExplorePrometheusTimeSeriesQueryEditor.d.ts.map +0 -1
  86. package/dist/plugins/prometheus-time-series-query/ExplorePrometheusTimeSeriesQueryEditor.js +0 -115
  87. package/dist/plugins/prometheus-time-series-query/ExplorePrometheusTimeSeriesQueryEditor.js.map +0 -1
@@ -1,20 +0,0 @@
1
- // Copyright 2023 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
- import { useTemplateVariableValues, replaceTemplateVariables, parseTemplateVariables } from '@perses-dev/plugin-system';
14
- export function useReplaceTemplateString(templateString) {
15
- const templateVariablesInTemplate = parseTemplateVariables(templateString || '');
16
- const variables = useTemplateVariableValues(templateVariablesInTemplate);
17
- return replaceTemplateVariables(templateString || '', variables);
18
- }
19
-
20
- //# sourceMappingURL=templating.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/model/templating.ts"],"sourcesContent":["// Copyright 2023 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { useTemplateVariableValues, replaceTemplateVariables, parseTemplateVariables } from '@perses-dev/plugin-system';\n\n/**\n * Type alias to indicate what parts of the API support template variables.\n */\nexport type TemplateString = string;\n\nexport function useReplaceTemplateString(templateString?: TemplateString) {\n const templateVariablesInTemplate = parseTemplateVariables(templateString || '');\n const variables = useTemplateVariableValues(templateVariablesInTemplate);\n return replaceTemplateVariables(templateString || '', variables);\n}\n"],"names":["useTemplateVariableValues","replaceTemplateVariables","parseTemplateVariables","useReplaceTemplateString","templateString","templateVariablesInTemplate","variables"],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,SAASA,yBAAyB,EAAEC,wBAAwB,EAAEC,sBAAsB,QAAQ,4BAA4B;AAOxH,OAAO,SAASC,yBAAyBC,cAA+B;IACtE,MAAMC,8BAA8BH,uBAAuBE,kBAAkB;IAC7E,MAAME,YAAYN,0BAA0BK;IAC5C,OAAOJ,yBAAyBG,kBAAkB,IAAIE;AACxD"}
@@ -1,21 +0,0 @@
1
- /// <reference types="react" />
2
- import { DatasourceSelector } from '@perses-dev/core/dist/model';
3
- import { DurationString, PrometheusDatasourceSelector } from '../../model';
4
- interface DashboardPrometheusTimeSeriesQueryEditorProps {
5
- selectedDatasource: PrometheusDatasourceSelector;
6
- handleDatasourceChange: (next: DatasourceSelector) => void;
7
- promURL: string | undefined;
8
- query: string;
9
- handleQueryChange: (e: string) => void;
10
- handleQueryBlur: () => void;
11
- format: string | undefined;
12
- handleFormatChange: (e: string) => void;
13
- handleFormatBlur: () => void;
14
- minStepPlaceholder: string;
15
- minStep: string | undefined;
16
- handleMinStepChange: (e: DurationString) => void;
17
- handleMinStepBlur: () => void;
18
- }
19
- export declare function DashboardPrometheusTimeSeriesQueryEditor(props: DashboardPrometheusTimeSeriesQueryEditorProps): JSX.Element;
20
- export {};
21
- //# sourceMappingURL=DashboardPrometheusTimeSeriesQueryEditor.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"DashboardPrometheusTimeSeriesQueryEditor.d.ts","sourceRoot":"","sources":["../../../src/plugins/prometheus-time-series-query/DashboardPrometheusTimeSeriesQueryEditor.tsx"],"names":[],"mappings":";AAeA,OAAO,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AACjE,OAAO,EAAE,cAAc,EAAwB,4BAA4B,EAAE,MAAM,aAAa,CAAC;AAGjG,UAAU,6CAA6C;IACrD,kBAAkB,EAAE,4BAA4B,CAAC;IACjD,sBAAsB,EAAE,CAAC,IAAI,EAAE,kBAAkB,KAAK,IAAI,CAAC;IAC3D,OAAO,EAAE,MAAM,GAAG,SAAS,CAAC;IAC5B,KAAK,EAAE,MAAM,CAAC;IACd,iBAAiB,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IACvC,eAAe,EAAE,MAAM,IAAI,CAAC;IAC5B,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3B,kBAAkB,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IACxC,gBAAgB,EAAE,MAAM,IAAI,CAAC;IAC7B,kBAAkB,EAAE,MAAM,CAAC;IAC3B,OAAO,EAAE,MAAM,GAAG,SAAS,CAAC;IAC5B,mBAAmB,EAAE,CAAC,CAAC,EAAE,cAAc,KAAK,IAAI,CAAC;IACjD,iBAAiB,EAAE,MAAM,IAAI,CAAC;CAC/B;AAED,wBAAgB,wCAAwC,CAAC,KAAK,EAAE,6CAA6C,eA2D5G"}
@@ -1,80 +0,0 @@
1
- // Copyright 2023 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
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
14
- import { Stack, TextField, FormControl, InputLabel } from '@mui/material';
15
- import { DatasourceSelect } from '@perses-dev/plugin-system';
16
- import { PROM_DATASOURCE_KIND } from '../../model';
17
- import { PromQLEditor } from '../../components';
18
- export function DashboardPrometheusTimeSeriesQueryEditor(props) {
19
- const { selectedDatasource , handleDatasourceChange , promURL , query , handleQueryChange , handleQueryBlur , format , handleFormatBlur , handleMinStepChange , handleFormatChange , handleMinStepBlur , minStepPlaceholder , minStep } = props;
20
- return /*#__PURE__*/ _jsxs(Stack, {
21
- spacing: 2,
22
- children: [
23
- /*#__PURE__*/ _jsxs(FormControl, {
24
- margin: "dense",
25
- fullWidth: false,
26
- children: [
27
- /*#__PURE__*/ _jsx(InputLabel, {
28
- id: "prom-datasource-label",
29
- children: "Prometheus Datasource"
30
- }),
31
- /*#__PURE__*/ _jsx(DatasourceSelect, {
32
- datasourcePluginKind: PROM_DATASOURCE_KIND,
33
- value: selectedDatasource,
34
- onChange: handleDatasourceChange,
35
- labelId: "prom-datasource-label",
36
- label: "Prometheus Datasource"
37
- })
38
- ]
39
- }),
40
- /*#__PURE__*/ _jsx(PromQLEditor, {
41
- completeConfig: {
42
- remote: {
43
- url: promURL
44
- }
45
- },
46
- value: query,
47
- onChange: handleQueryChange,
48
- onBlur: handleQueryBlur
49
- }),
50
- /*#__PURE__*/ _jsxs(Stack, {
51
- direction: "row",
52
- spacing: 2,
53
- children: [
54
- /*#__PURE__*/ _jsx(TextField, {
55
- fullWidth: true,
56
- label: "Legend Name",
57
- placeholder: "Tip: Use {{label_name}}. Example: {{instance}} will be replaced with values such as 'webserver-123' and 'webserver-456'.",
58
- helperText: "Name for each series in the legend and the tooltip.",
59
- value: format !== null && format !== void 0 ? format : '',
60
- onChange: (e)=>handleFormatChange(e.target.value),
61
- onBlur: handleFormatBlur
62
- }),
63
- /*#__PURE__*/ _jsx(TextField, {
64
- label: "Min Step",
65
- placeholder: minStepPlaceholder,
66
- helperText: "Step parameter of the query. Used by $__interval and $__rate_interval too.",
67
- value: minStep,
68
- onChange: (e)=>handleMinStepChange(e.target.value),
69
- onBlur: handleMinStepBlur,
70
- sx: {
71
- width: '250px'
72
- }
73
- })
74
- ]
75
- })
76
- ]
77
- });
78
- }
79
-
80
- //# sourceMappingURL=DashboardPrometheusTimeSeriesQueryEditor.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../src/plugins/prometheus-time-series-query/DashboardPrometheusTimeSeriesQueryEditor.tsx"],"sourcesContent":["// Copyright 2023 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { Stack, TextField, FormControl, InputLabel } from '@mui/material';\nimport { DatasourceSelect } from '@perses-dev/plugin-system';\nimport { DatasourceSelector } from '@perses-dev/core/dist/model';\nimport { DurationString, PROM_DATASOURCE_KIND, PrometheusDatasourceSelector } from '../../model';\nimport { PromQLEditor } from '../../components';\n\ninterface DashboardPrometheusTimeSeriesQueryEditorProps {\n selectedDatasource: PrometheusDatasourceSelector;\n handleDatasourceChange: (next: DatasourceSelector) => void;\n promURL: string | undefined;\n query: string;\n handleQueryChange: (e: string) => void;\n handleQueryBlur: () => void;\n format: string | undefined;\n handleFormatChange: (e: string) => void;\n handleFormatBlur: () => void;\n minStepPlaceholder: string;\n minStep: string | undefined;\n handleMinStepChange: (e: DurationString) => void;\n handleMinStepBlur: () => void;\n}\n\nexport function DashboardPrometheusTimeSeriesQueryEditor(props: DashboardPrometheusTimeSeriesQueryEditorProps) {\n const {\n selectedDatasource,\n handleDatasourceChange,\n promURL,\n query,\n handleQueryChange,\n handleQueryBlur,\n format,\n handleFormatBlur,\n handleMinStepChange,\n handleFormatChange,\n handleMinStepBlur,\n minStepPlaceholder,\n minStep,\n } = props;\n\n return (\n <Stack spacing={2}>\n <FormControl margin=\"dense\" fullWidth={false}>\n {/* TODO: How do we ensure unique ID values if there are multiple of these? Can we use React 18 useId and\n maintain 17 compatibility somehow with a polyfill/shim? */}\n <InputLabel id=\"prom-datasource-label\">Prometheus Datasource</InputLabel>\n <DatasourceSelect\n datasourcePluginKind={PROM_DATASOURCE_KIND}\n value={selectedDatasource}\n onChange={handleDatasourceChange}\n labelId=\"prom-datasource-label\"\n label=\"Prometheus Datasource\"\n />\n </FormControl>\n <PromQLEditor\n completeConfig={{ remote: { url: promURL } }}\n value={query}\n onChange={handleQueryChange}\n onBlur={handleQueryBlur}\n />\n <Stack direction=\"row\" spacing={2}>\n <TextField\n fullWidth\n label=\"Legend Name\"\n placeholder=\"Tip: Use {{label_name}}. Example: {{instance}} will be replaced with values such as 'webserver-123' and 'webserver-456'.\"\n helperText=\"Name for each series in the legend and the tooltip.\"\n value={format ?? ''}\n onChange={(e) => handleFormatChange(e.target.value)}\n onBlur={handleFormatBlur}\n />\n <TextField\n label=\"Min Step\"\n placeholder={minStepPlaceholder}\n helperText=\"Step parameter of the query. Used by $__interval and $__rate_interval too.\"\n value={minStep}\n onChange={(e) => handleMinStepChange(e.target.value as DurationString)}\n onBlur={handleMinStepBlur}\n sx={{ width: '250px' }}\n />\n </Stack>\n </Stack>\n );\n}\n"],"names":["Stack","TextField","FormControl","InputLabel","DatasourceSelect","PROM_DATASOURCE_KIND","PromQLEditor","DashboardPrometheusTimeSeriesQueryEditor","props","selectedDatasource","handleDatasourceChange","promURL","query","handleQueryChange","handleQueryBlur","format","handleFormatBlur","handleMinStepChange","handleFormatChange","handleMinStepBlur","minStepPlaceholder","minStep","spacing","margin","fullWidth","id","datasourcePluginKind","value","onChange","labelId","label","completeConfig","remote","url","onBlur","direction","placeholder","helperText","e","target","sx","width"],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;;AAEjC,SAASA,KAAK,EAAEC,SAAS,EAAEC,WAAW,EAAEC,UAAU,QAAQ,gBAAgB;AAC1E,SAASC,gBAAgB,QAAQ,4BAA4B;AAE7D,SAAyBC,oBAAoB,QAAsC,cAAc;AACjG,SAASC,YAAY,QAAQ,mBAAmB;AAkBhD,OAAO,SAASC,yCAAyCC,KAAoD;IAC3G,MAAM,EACJC,mBAAkB,EAClBC,uBAAsB,EACtBC,QAAO,EACPC,MAAK,EACLC,kBAAiB,EACjBC,gBAAe,EACfC,OAAM,EACNC,iBAAgB,EAChBC,oBAAmB,EACnBC,mBAAkB,EAClBC,kBAAiB,EACjBC,mBAAkB,EAClBC,QAAO,EACR,GAAGb;IAEJ,qBACE,MAACR;QAAMsB,SAAS;;0BACd,MAACpB;gBAAYqB,QAAO;gBAAQC,WAAW;;kCAGrC,KAACrB;wBAAWsB,IAAG;kCAAwB;;kCACvC,KAACrB;wBACCsB,sBAAsBrB;wBACtBsB,OAAOlB;wBACPmB,UAAUlB;wBACVmB,SAAQ;wBACRC,OAAM;;;;0BAGV,KAACxB;gBACCyB,gBAAgB;oBAAEC,QAAQ;wBAAEC,KAAKtB;oBAAQ;gBAAE;gBAC3CgB,OAAOf;gBACPgB,UAAUf;gBACVqB,QAAQpB;;0BAEV,MAACd;gBAAMmC,WAAU;gBAAMb,SAAS;;kCAC9B,KAACrB;wBACCuB,SAAS;wBACTM,OAAM;wBACNM,aAAY;wBACZC,YAAW;wBACXV,OAAOZ,mBAAAA,oBAAAA,SAAU;wBACjBa,UAAU,CAACU,IAAMpB,mBAAmBoB,EAAEC,OAAOZ;wBAC7CO,QAAQlB;;kCAEV,KAACf;wBACC6B,OAAM;wBACNM,aAAahB;wBACbiB,YAAW;wBACXV,OAAON;wBACPO,UAAU,CAACU,IAAMrB,oBAAoBqB,EAAEC,OAAOZ;wBAC9CO,QAAQf;wBACRqB,IAAI;4BAAEC,OAAO;wBAAQ;;;;;;AAK/B"}
@@ -1,21 +0,0 @@
1
- /// <reference types="react" />
2
- import { DatasourceSelector } from '@perses-dev/core/dist/model';
3
- import { DurationString, PrometheusDatasourceSelector } from '../../model';
4
- interface ExplorePrometheusTimeSeriesQueryEditorProps {
5
- selectedDatasource: PrometheusDatasourceSelector;
6
- handleDatasourceChange: (next: DatasourceSelector) => void;
7
- promURL: string | undefined;
8
- query: string;
9
- handleQueryChange: (e: string) => void;
10
- handleQueryBlur: () => void;
11
- format: string | undefined;
12
- handleFormatChange: (e: string) => void;
13
- handleFormatBlur: () => void;
14
- minStepPlaceholder: string;
15
- minStep: string | undefined;
16
- handleMinStepChange: (e: DurationString) => void;
17
- handleMinStepBlur: () => void;
18
- }
19
- export declare function ExplorePrometheusTimeSeriesQueryEditor(props: ExplorePrometheusTimeSeriesQueryEditorProps): JSX.Element;
20
- export {};
21
- //# sourceMappingURL=ExplorePrometheusTimeSeriesQueryEditor.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ExplorePrometheusTimeSeriesQueryEditor.d.ts","sourceRoot":"","sources":["../../../src/plugins/prometheus-time-series-query/ExplorePrometheusTimeSeriesQueryEditor.tsx"],"names":[],"mappings":";AAeA,OAAO,EAAE,kBAAkB,EAAmB,MAAM,6BAA6B,CAAC;AAClF,OAAO,EAAgB,cAAc,EAAwB,4BAA4B,EAAE,MAAM,aAAa,CAAC;AAG/G,UAAU,2CAA2C;IACnD,kBAAkB,EAAE,4BAA4B,CAAC;IACjD,sBAAsB,EAAE,CAAC,IAAI,EAAE,kBAAkB,KAAK,IAAI,CAAC;IAC3D,OAAO,EAAE,MAAM,GAAG,SAAS,CAAC;IAC5B,KAAK,EAAE,MAAM,CAAC;IACd,iBAAiB,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IACvC,eAAe,EAAE,MAAM,IAAI,CAAC;IAC5B,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3B,kBAAkB,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IACxC,gBAAgB,EAAE,MAAM,IAAI,CAAC;IAC7B,kBAAkB,EAAE,MAAM,CAAC;IAC3B,OAAO,EAAE,MAAM,GAAG,SAAS,CAAC;IAC5B,mBAAmB,EAAE,CAAC,CAAC,EAAE,cAAc,KAAK,IAAI,CAAC;IACjD,iBAAiB,EAAE,MAAM,IAAI,CAAC;CAC/B;AAED,wBAAgB,sCAAsC,CAAC,KAAK,EAAE,2CAA2C,eA+ExG"}
@@ -1,115 +0,0 @@
1
- // Copyright 2023 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
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
14
- import { Stack, TextField, FormControl, InputLabel, Grid } from '@mui/material';
15
- import { DatasourceSelect, ProjectSelect, useProjectStore } from '@perses-dev/plugin-system';
16
- import { DEFAULT_PROM, PROM_DATASOURCE_KIND } from '../../model';
17
- import { PromQLEditor } from '../../components';
18
- export function ExplorePrometheusTimeSeriesQueryEditor(props) {
19
- const { selectedDatasource , handleDatasourceChange , promURL , query , handleQueryChange , handleQueryBlur , format , handleFormatBlur , handleMinStepChange , handleFormatChange , handleMinStepBlur , minStepPlaceholder , minStep } = props;
20
- const { project , setProject } = useProjectStore();
21
- const handleProjectChange = (next)=>{
22
- handleDatasourceChange(DEFAULT_PROM);
23
- return setProject(next);
24
- };
25
- return /*#__PURE__*/ _jsxs(Stack, {
26
- spacing: 2,
27
- children: [
28
- /*#__PURE__*/ _jsxs(Grid, {
29
- container: true,
30
- spacing: 2,
31
- children: [
32
- /*#__PURE__*/ _jsx(Grid, {
33
- item: true,
34
- xs: 2,
35
- children: /*#__PURE__*/ _jsxs(FormControl, {
36
- margin: "dense",
37
- fullWidth: true,
38
- children: [
39
- /*#__PURE__*/ _jsx(InputLabel, {
40
- id: "project-label",
41
- children: "Projects"
42
- }),
43
- /*#__PURE__*/ _jsx(ProjectSelect, {
44
- labelId: "project-label",
45
- label: "Projects",
46
- value: project,
47
- onChange: handleProjectChange
48
- })
49
- ]
50
- })
51
- }),
52
- /*#__PURE__*/ _jsx(Grid, {
53
- item: true,
54
- children: /*#__PURE__*/ _jsxs(FormControl, {
55
- margin: "dense",
56
- fullWidth: true,
57
- children: [
58
- /*#__PURE__*/ _jsx(InputLabel, {
59
- id: "prom-datasource-label",
60
- children: "Prometheus Datasource"
61
- }),
62
- /*#__PURE__*/ _jsx(DatasourceSelect, {
63
- datasourcePluginKind: PROM_DATASOURCE_KIND,
64
- value: selectedDatasource,
65
- project: project.metadata.name,
66
- onChange: handleDatasourceChange,
67
- labelId: "prom-datasource-label",
68
- label: "Prometheus Datasource"
69
- })
70
- ]
71
- })
72
- })
73
- ]
74
- }),
75
- /*#__PURE__*/ _jsx(PromQLEditor, {
76
- completeConfig: {
77
- remote: {
78
- url: promURL
79
- }
80
- },
81
- value: query,
82
- onChange: handleQueryChange,
83
- onBlur: handleQueryBlur
84
- }),
85
- /*#__PURE__*/ _jsxs(Stack, {
86
- direction: "row",
87
- spacing: 2,
88
- children: [
89
- /*#__PURE__*/ _jsx(TextField, {
90
- fullWidth: true,
91
- label: "Legend Name",
92
- placeholder: "Tip: Use {{label_name}}. Example: {{instance}} will be replaced with values such as 'webserver-123' and 'webserver-456'.",
93
- helperText: "Name for each series in the legend and the tooltip.",
94
- value: format !== null && format !== void 0 ? format : '',
95
- onChange: (e)=>handleFormatChange(e.target.value),
96
- onBlur: handleFormatBlur
97
- }),
98
- /*#__PURE__*/ _jsx(TextField, {
99
- label: "Min Step",
100
- placeholder: minStepPlaceholder,
101
- helperText: "Step parameter of the query. Used by $__interval and $__rate_interval too.",
102
- value: minStep,
103
- onChange: (e)=>handleMinStepChange(e.target.value),
104
- onBlur: handleMinStepBlur,
105
- sx: {
106
- width: '250px'
107
- }
108
- })
109
- ]
110
- })
111
- ]
112
- });
113
- }
114
-
115
- //# sourceMappingURL=ExplorePrometheusTimeSeriesQueryEditor.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../src/plugins/prometheus-time-series-query/ExplorePrometheusTimeSeriesQueryEditor.tsx"],"sourcesContent":["// Copyright 2023 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { Stack, TextField, FormControl, InputLabel, Grid } from '@mui/material';\nimport { DatasourceSelect, ProjectSelect, useProjectStore } from '@perses-dev/plugin-system';\nimport { DatasourceSelector, ProjectResource } from '@perses-dev/core/dist/model';\nimport { DEFAULT_PROM, DurationString, PROM_DATASOURCE_KIND, PrometheusDatasourceSelector } from '../../model';\nimport { PromQLEditor } from '../../components';\n\ninterface ExplorePrometheusTimeSeriesQueryEditorProps {\n selectedDatasource: PrometheusDatasourceSelector;\n handleDatasourceChange: (next: DatasourceSelector) => void;\n promURL: string | undefined;\n query: string;\n handleQueryChange: (e: string) => void;\n handleQueryBlur: () => void;\n format: string | undefined;\n handleFormatChange: (e: string) => void;\n handleFormatBlur: () => void;\n minStepPlaceholder: string;\n minStep: string | undefined;\n handleMinStepChange: (e: DurationString) => void;\n handleMinStepBlur: () => void;\n}\n\nexport function ExplorePrometheusTimeSeriesQueryEditor(props: ExplorePrometheusTimeSeriesQueryEditorProps) {\n const {\n selectedDatasource,\n handleDatasourceChange,\n promURL,\n query,\n handleQueryChange,\n handleQueryBlur,\n format,\n handleFormatBlur,\n handleMinStepChange,\n handleFormatChange,\n handleMinStepBlur,\n minStepPlaceholder,\n minStep,\n } = props;\n\n const { project, setProject } = useProjectStore();\n\n const handleProjectChange = (next: ProjectResource) => {\n handleDatasourceChange(DEFAULT_PROM);\n return setProject(next);\n };\n\n return (\n <Stack spacing={2}>\n <Grid container spacing={2}>\n <Grid item xs={2}>\n <FormControl margin=\"dense\" fullWidth={true}>\n {/* TODO: How do we ensure unique ID values if there are multiple of these? Can we use React 18 useId and\n maintain 17 compatibility somehow with a polyfill/shim? */}\n <InputLabel id=\"project-label\">Projects</InputLabel>\n <ProjectSelect labelId=\"project-label\" label=\"Projects\" value={project} onChange={handleProjectChange} />\n </FormControl>\n </Grid>\n <Grid item>\n <FormControl margin=\"dense\" fullWidth={true}>\n {/* TODO: How do we ensure unique ID values if there are multiple of these? Can we use React 18 useId and\n maintain 17 compatibility somehow with a polyfill/shim? */}\n <InputLabel id=\"prom-datasource-label\">Prometheus Datasource</InputLabel>\n <DatasourceSelect\n datasourcePluginKind={PROM_DATASOURCE_KIND}\n value={selectedDatasource}\n project={project.metadata.name}\n onChange={handleDatasourceChange}\n labelId=\"prom-datasource-label\"\n label=\"Prometheus Datasource\"\n />\n </FormControl>\n </Grid>\n </Grid>\n <PromQLEditor\n completeConfig={{ remote: { url: promURL } }}\n value={query}\n onChange={handleQueryChange}\n onBlur={handleQueryBlur}\n />\n <Stack direction=\"row\" spacing={2}>\n <TextField\n fullWidth\n label=\"Legend Name\"\n placeholder=\"Tip: Use {{label_name}}. Example: {{instance}} will be replaced with values such as 'webserver-123' and 'webserver-456'.\"\n helperText=\"Name for each series in the legend and the tooltip.\"\n value={format ?? ''}\n onChange={(e) => handleFormatChange(e.target.value)}\n onBlur={handleFormatBlur}\n />\n <TextField\n label=\"Min Step\"\n placeholder={minStepPlaceholder}\n helperText=\"Step parameter of the query. Used by $__interval and $__rate_interval too.\"\n value={minStep}\n onChange={(e) => handleMinStepChange(e.target.value as DurationString)}\n onBlur={handleMinStepBlur}\n sx={{ width: '250px' }}\n />\n </Stack>\n </Stack>\n );\n}\n"],"names":["Stack","TextField","FormControl","InputLabel","Grid","DatasourceSelect","ProjectSelect","useProjectStore","DEFAULT_PROM","PROM_DATASOURCE_KIND","PromQLEditor","ExplorePrometheusTimeSeriesQueryEditor","props","selectedDatasource","handleDatasourceChange","promURL","query","handleQueryChange","handleQueryBlur","format","handleFormatBlur","handleMinStepChange","handleFormatChange","handleMinStepBlur","minStepPlaceholder","minStep","project","setProject","handleProjectChange","next","spacing","container","item","xs","margin","fullWidth","id","labelId","label","value","onChange","datasourcePluginKind","metadata","name","completeConfig","remote","url","onBlur","direction","placeholder","helperText","e","target","sx","width"],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;;AAEjC,SAASA,KAAK,EAAEC,SAAS,EAAEC,WAAW,EAAEC,UAAU,EAAEC,IAAI,QAAQ,gBAAgB;AAChF,SAASC,gBAAgB,EAAEC,aAAa,EAAEC,eAAe,QAAQ,4BAA4B;AAE7F,SAASC,YAAY,EAAkBC,oBAAoB,QAAsC,cAAc;AAC/G,SAASC,YAAY,QAAQ,mBAAmB;AAkBhD,OAAO,SAASC,uCAAuCC,KAAkD;IACvG,MAAM,EACJC,mBAAkB,EAClBC,uBAAsB,EACtBC,QAAO,EACPC,MAAK,EACLC,kBAAiB,EACjBC,gBAAe,EACfC,OAAM,EACNC,iBAAgB,EAChBC,oBAAmB,EACnBC,mBAAkB,EAClBC,kBAAiB,EACjBC,mBAAkB,EAClBC,QAAO,EACR,GAAGb;IAEJ,MAAM,EAAEc,QAAO,EAAEC,WAAU,EAAE,GAAGpB;IAEhC,MAAMqB,sBAAsB,CAACC;QAC3Bf,uBAAuBN;QACvB,OAAOmB,WAAWE;IACpB;IAEA,qBACE,MAAC7B;QAAM8B,SAAS;;0BACd,MAAC1B;gBAAK2B,SAAS;gBAACD,SAAS;;kCACvB,KAAC1B;wBAAK4B,IAAI;wBAACC,IAAI;kCACb,cAAA,MAAC/B;4BAAYgC,QAAO;4BAAQC,WAAW;;8CAGrC,KAAChC;oCAAWiC,IAAG;8CAAgB;;8CAC/B,KAAC9B;oCAAc+B,SAAQ;oCAAgBC,OAAM;oCAAWC,OAAOb;oCAASc,UAAUZ;;;;;kCAGtF,KAACxB;wBAAK4B,IAAI;kCACR,cAAA,MAAC9B;4BAAYgC,QAAO;4BAAQC,WAAW;;8CAGrC,KAAChC;oCAAWiC,IAAG;8CAAwB;;8CACvC,KAAC/B;oCACCoC,sBAAsBhC;oCACtB8B,OAAO1B;oCACPa,SAASA,QAAQgB,SAASC;oCAC1BH,UAAU1B;oCACVuB,SAAQ;oCACRC,OAAM;;;;;;;0BAKd,KAAC5B;gBACCkC,gBAAgB;oBAAEC,QAAQ;wBAAEC,KAAK/B;oBAAQ;gBAAE;gBAC3CwB,OAAOvB;gBACPwB,UAAUvB;gBACV8B,QAAQ7B;;0BAEV,MAAClB;gBAAMgD,WAAU;gBAAMlB,SAAS;;kCAC9B,KAAC7B;wBACCkC,SAAS;wBACTG,OAAM;wBACNW,aAAY;wBACZC,YAAW;wBACXX,OAAOpB,mBAAAA,oBAAAA,SAAU;wBACjBqB,UAAU,CAACW,IAAM7B,mBAAmB6B,EAAEC,OAAOb;wBAC7CQ,QAAQ3B;;kCAEV,KAACnB;wBACCqC,OAAM;wBACNW,aAAazB;wBACb0B,YAAW;wBACXX,OAAOd;wBACPe,UAAU,CAACW,IAAM9B,oBAAoB8B,EAAEC,OAAOb;wBAC9CQ,QAAQxB;wBACR8B,IAAI;4BAAEC,OAAO;wBAAQ;;;;;;AAK/B"}