@perses-dev/plugin-system 0.43.0-rc2 → 0.44.0-rc0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/components/CalculationSelector/CalculationSelector.js +1 -1
- package/dist/cjs/components/DatasourceEditorForm/DatasourceEditorForm.js +8 -8
- package/dist/cjs/components/DatasourceSelect.js +11 -9
- package/dist/cjs/components/LegendOptionsEditor/LegendOptionsEditor.js +1 -1
- package/dist/cjs/components/OptionsEditorRadios/OptionsEditorRadios.js +3 -3
- package/dist/cjs/components/OptionsEditorTabPanel/OptionsEditorTabPanel.js +1 -1
- package/dist/cjs/components/OptionsEditorTabs/OptionsEditorTabs.js +3 -3
- package/dist/cjs/components/PanelSpecEditor/PanelSpecEditor.js +49 -11
- package/dist/cjs/components/PluginEditor/PluginEditor.js +2 -3
- package/dist/cjs/components/PluginEditor/plugin-editor-api.js +3 -3
- package/dist/cjs/components/PluginKindSelect/PluginKindSelect.js +2 -2
- package/dist/cjs/components/PluginRegistry/PluginRegistry.js +1 -1
- package/dist/cjs/components/PluginRegistry/plugin-indexes.js +4 -4
- package/dist/cjs/components/PluginSpecEditor/PluginSpecEditor.js +3 -3
- package/dist/cjs/components/ProjectSelect.js +2 -2
- package/dist/cjs/components/TimeSeriesQueryEditor/TimeSeriesQueryEditor.js +3 -3
- package/dist/cjs/components/TimeSeriesQueryEditor/TimeSeriesQueryInput.js +3 -3
- package/dist/cjs/components/TraceQueryEditor/TraceQueryEditor.js +143 -0
- package/dist/cjs/components/TraceQueryEditor/TraceQueryInput.js +96 -0
- package/dist/cjs/components/TraceQueryEditor/index.js +30 -0
- package/dist/cjs/components/Variables/VariableEditorForm/VariableEditorForm.js +29 -23
- package/dist/cjs/components/Variables/VariableEditorForm/VariablePreview.js +10 -8
- package/dist/cjs/components/Variables/VariableEditorForm/variable-editor-form-model.js +1 -1
- package/dist/cjs/components/Variables/variable-model.js +12 -13
- package/dist/cjs/context/ProjectStoreProvider.js +5 -5
- package/dist/cjs/model/legend.js +5 -5
- package/dist/cjs/runtime/DataQueriesProvider/DataQueriesProvider.js +6 -6
- package/dist/cjs/runtime/DataQueriesProvider/model.js +3 -3
- package/dist/cjs/runtime/TimeRangeProvider/TimeRangeProvider.js +8 -6
- package/dist/cjs/runtime/TimeRangeProvider/TimeRangeProviderWithQueryParams.js +3 -3
- package/dist/cjs/runtime/TimeRangeProvider/query-params.js +16 -16
- package/dist/cjs/runtime/builtin-variables.js +5 -5
- package/dist/cjs/runtime/datasources.js +7 -7
- package/dist/cjs/runtime/plugin-registry.js +12 -12
- package/dist/cjs/runtime/template-variables.js +15 -7
- package/dist/cjs/runtime/time-series-queries.js +14 -14
- package/dist/cjs/runtime/trace-queries.js +24 -7
- package/dist/cjs/stories/shared-utils/decorators/WithPluginRegistry.js +3 -1
- package/dist/cjs/stories/shared-utils/decorators/WithPluginSystemDatasourceStore.js +1 -1
- package/dist/cjs/test/test-plugins/bert/index.js +2 -2
- package/dist/cjs/test/test-plugins/ernie/index.js +2 -2
- package/dist/cjs/test/test-plugins/index.js +3 -1
- package/dist/cjs/test-utils/mock-plugin-registry.js +4 -4
- package/dist/cjs/utils/action.js +3 -3
- package/dist/cjs/utils/variables.js +4 -4
- package/dist/cjs/validation/role.js +3 -3
- package/dist/cjs/validation/secret.js +3 -3
- package/dist/components/CalculationSelector/CalculationSelector.d.ts +1 -2
- package/dist/components/CalculationSelector/CalculationSelector.d.ts.map +1 -1
- package/dist/components/CalculationSelector/CalculationSelector.js +1 -1
- package/dist/components/CalculationSelector/CalculationSelector.js.map +1 -1
- package/dist/components/DatasourceEditorForm/DatasourceEditorForm.d.ts +1 -1
- package/dist/components/DatasourceEditorForm/DatasourceEditorForm.d.ts.map +1 -1
- package/dist/components/DatasourceEditorForm/DatasourceEditorForm.js +8 -8
- package/dist/components/DatasourceEditorForm/DatasourceEditorForm.js.map +1 -1
- package/dist/components/DatasourceSelect.d.ts +3 -4
- package/dist/components/DatasourceSelect.d.ts.map +1 -1
- package/dist/components/DatasourceSelect.js +8 -6
- package/dist/components/DatasourceSelect.js.map +1 -1
- package/dist/components/LegendOptionsEditor/LegendOptionsEditor.d.ts +1 -2
- package/dist/components/LegendOptionsEditor/LegendOptionsEditor.d.ts.map +1 -1
- package/dist/components/LegendOptionsEditor/LegendOptionsEditor.js +1 -1
- package/dist/components/LegendOptionsEditor/LegendOptionsEditor.js.map +1 -1
- package/dist/components/OptionsEditorRadios/OptionsEditorRadios.d.ts +3 -3
- package/dist/components/OptionsEditorRadios/OptionsEditorRadios.d.ts.map +1 -1
- package/dist/components/OptionsEditorRadios/OptionsEditorRadios.js +3 -3
- package/dist/components/OptionsEditorRadios/OptionsEditorRadios.js.map +1 -1
- package/dist/components/OptionsEditorTabPanel/OptionsEditorTabPanel.d.ts +1 -1
- package/dist/components/OptionsEditorTabPanel/OptionsEditorTabPanel.d.ts.map +1 -1
- package/dist/components/OptionsEditorTabPanel/OptionsEditorTabPanel.js +1 -1
- package/dist/components/OptionsEditorTabPanel/OptionsEditorTabPanel.js.map +1 -1
- package/dist/components/OptionsEditorTabs/OptionsEditorTabs.d.ts +3 -3
- package/dist/components/OptionsEditorTabs/OptionsEditorTabs.d.ts.map +1 -1
- package/dist/components/OptionsEditorTabs/OptionsEditorTabs.js +3 -3
- package/dist/components/OptionsEditorTabs/OptionsEditorTabs.js.map +1 -1
- package/dist/components/PanelSpecEditor/PanelSpecEditor.d.ts +1 -2
- package/dist/components/PanelSpecEditor/PanelSpecEditor.d.ts.map +1 -1
- package/dist/components/PanelSpecEditor/PanelSpecEditor.js +49 -11
- package/dist/components/PanelSpecEditor/PanelSpecEditor.js.map +1 -1
- package/dist/components/PluginEditor/PluginEditor.d.ts +1 -2
- package/dist/components/PluginEditor/PluginEditor.d.ts.map +1 -1
- package/dist/components/PluginEditor/PluginEditor.js +2 -3
- package/dist/components/PluginEditor/PluginEditor.js.map +1 -1
- package/dist/components/PluginEditor/plugin-editor-api.d.ts +3 -3
- package/dist/components/PluginEditor/plugin-editor-api.d.ts.map +1 -1
- package/dist/components/PluginEditor/plugin-editor-api.js +3 -3
- package/dist/components/PluginEditor/plugin-editor-api.js.map +1 -1
- package/dist/components/PluginKindSelect/PluginKindSelect.d.ts +1 -1
- package/dist/components/PluginKindSelect/PluginKindSelect.d.ts.map +1 -1
- package/dist/components/PluginKindSelect/PluginKindSelect.js +2 -2
- package/dist/components/PluginKindSelect/PluginKindSelect.js.map +1 -1
- package/dist/components/PluginRegistry/PluginRegistry.d.ts +1 -1
- package/dist/components/PluginRegistry/PluginRegistry.d.ts.map +1 -1
- package/dist/components/PluginRegistry/PluginRegistry.js +1 -1
- package/dist/components/PluginRegistry/PluginRegistry.js.map +1 -1
- package/dist/components/PluginRegistry/plugin-indexes.js +1 -1
- package/dist/components/PluginRegistry/plugin-indexes.js.map +1 -1
- package/dist/components/PluginSpecEditor/PluginSpecEditor.d.ts +1 -2
- package/dist/components/PluginSpecEditor/PluginSpecEditor.d.ts.map +1 -1
- package/dist/components/PluginSpecEditor/PluginSpecEditor.js +3 -3
- package/dist/components/PluginSpecEditor/PluginSpecEditor.js.map +1 -1
- package/dist/components/ProjectSelect.d.ts +2 -3
- package/dist/components/ProjectSelect.d.ts.map +1 -1
- package/dist/components/ProjectSelect.js +2 -2
- package/dist/components/ProjectSelect.js.map +1 -1
- package/dist/components/TimeSeriesQueryEditor/TimeSeriesQueryEditor.d.ts +1 -2
- package/dist/components/TimeSeriesQueryEditor/TimeSeriesQueryEditor.d.ts.map +1 -1
- package/dist/components/TimeSeriesQueryEditor/TimeSeriesQueryEditor.js +3 -3
- package/dist/components/TimeSeriesQueryEditor/TimeSeriesQueryEditor.js.map +1 -1
- package/dist/components/TimeSeriesQueryEditor/TimeSeriesQueryInput.d.ts +1 -2
- package/dist/components/TimeSeriesQueryEditor/TimeSeriesQueryInput.d.ts.map +1 -1
- package/dist/components/TimeSeriesQueryEditor/TimeSeriesQueryInput.js +3 -3
- package/dist/components/TimeSeriesQueryEditor/TimeSeriesQueryInput.js.map +1 -1
- package/dist/components/TraceQueryEditor/TraceQueryEditor.d.ts +8 -0
- package/dist/components/TraceQueryEditor/TraceQueryEditor.d.ts.map +1 -0
- package/dist/components/TraceQueryEditor/TraceQueryEditor.js +130 -0
- package/dist/components/TraceQueryEditor/TraceQueryEditor.js.map +1 -0
- package/dist/components/TraceQueryEditor/TraceQueryInput.d.ts +12 -0
- package/dist/components/TraceQueryEditor/TraceQueryInput.d.ts.map +1 -0
- package/dist/components/TraceQueryEditor/TraceQueryInput.js +83 -0
- package/dist/components/TraceQueryEditor/TraceQueryInput.js.map +1 -0
- package/dist/components/TraceQueryEditor/index.d.ts +2 -0
- package/dist/components/TraceQueryEditor/index.d.ts.map +1 -0
- package/dist/components/TraceQueryEditor/index.js +15 -0
- package/dist/components/TraceQueryEditor/index.js.map +1 -0
- package/dist/components/Variables/VariableEditorForm/VariableEditorForm.d.ts +1 -1
- package/dist/components/Variables/VariableEditorForm/VariableEditorForm.d.ts.map +1 -1
- package/dist/components/Variables/VariableEditorForm/VariableEditorForm.js +26 -22
- package/dist/components/Variables/VariableEditorForm/VariableEditorForm.js.map +1 -1
- package/dist/components/Variables/VariableEditorForm/VariablePreview.d.ts +2 -3
- package/dist/components/Variables/VariableEditorForm/VariablePreview.d.ts.map +1 -1
- package/dist/components/Variables/VariableEditorForm/VariablePreview.js +4 -4
- package/dist/components/Variables/VariableEditorForm/VariablePreview.js.map +1 -1
- package/dist/components/Variables/VariableEditorForm/variable-editor-form-model.d.ts +1 -1
- package/dist/components/Variables/VariableEditorForm/variable-editor-form-model.d.ts.map +1 -1
- package/dist/components/Variables/VariableEditorForm/variable-editor-form-model.js +1 -1
- package/dist/components/Variables/VariableEditorForm/variable-editor-form-model.js.map +1 -1
- package/dist/components/Variables/variable-model.d.ts.map +1 -1
- package/dist/components/Variables/variable-model.js +6 -7
- package/dist/components/Variables/variable-model.js.map +1 -1
- package/dist/context/ProjectStoreProvider.d.ts +1 -1
- package/dist/context/ProjectStoreProvider.d.ts.map +1 -1
- package/dist/context/ProjectStoreProvider.js +2 -2
- package/dist/context/ProjectStoreProvider.js.map +1 -1
- package/dist/context/query-params.js.map +1 -1
- package/dist/model/datasource.js +3 -1
- package/dist/model/datasource.js.map +1 -1
- package/dist/model/legend.d.ts +2 -2
- package/dist/model/legend.d.ts.map +1 -1
- package/dist/model/legend.js.map +1 -1
- package/dist/model/panels.d.ts +3 -2
- package/dist/model/panels.d.ts.map +1 -1
- package/dist/model/panels.js.map +1 -1
- package/dist/model/plugin-loading.js.map +1 -1
- package/dist/model/plugins.d.ts +4 -4
- package/dist/model/plugins.d.ts.map +1 -1
- package/dist/model/plugins.js.map +1 -1
- package/dist/model/time-series-queries.d.ts +2 -2
- package/dist/model/time-series-queries.d.ts.map +1 -1
- package/dist/model/time-series-queries.js.map +1 -1
- package/dist/model/trace-queries.d.ts +3 -2
- package/dist/model/trace-queries.d.ts.map +1 -1
- package/dist/model/trace-queries.js.map +1 -1
- package/dist/model/variables.d.ts +2 -2
- package/dist/model/variables.d.ts.map +1 -1
- package/dist/model/variables.js +3 -1
- package/dist/model/variables.js.map +1 -1
- package/dist/runtime/DataQueriesProvider/DataQueriesProvider.d.ts +1 -1
- package/dist/runtime/DataQueriesProvider/DataQueriesProvider.d.ts.map +1 -1
- package/dist/runtime/DataQueriesProvider/DataQueriesProvider.js +2 -2
- package/dist/runtime/DataQueriesProvider/DataQueriesProvider.js.map +1 -1
- package/dist/runtime/DataQueriesProvider/model.d.ts +2 -2
- package/dist/runtime/DataQueriesProvider/model.d.ts.map +1 -1
- package/dist/runtime/DataQueriesProvider/model.js +3 -3
- package/dist/runtime/DataQueriesProvider/model.js.map +1 -1
- package/dist/runtime/TimeRangeProvider/TimeRangeProvider.d.ts +1 -1
- package/dist/runtime/TimeRangeProvider/TimeRangeProvider.d.ts.map +1 -1
- package/dist/runtime/TimeRangeProvider/TimeRangeProvider.js +1 -1
- package/dist/runtime/TimeRangeProvider/TimeRangeProvider.js.map +1 -1
- package/dist/runtime/TimeRangeProvider/TimeRangeProviderWithQueryParams.d.ts +1 -1
- package/dist/runtime/TimeRangeProvider/TimeRangeProviderWithQueryParams.d.ts.map +1 -1
- package/dist/runtime/TimeRangeProvider/TimeRangeProviderWithQueryParams.js +3 -3
- package/dist/runtime/TimeRangeProvider/TimeRangeProviderWithQueryParams.js.map +1 -1
- package/dist/runtime/TimeRangeProvider/query-params.d.ts +1 -1
- package/dist/runtime/TimeRangeProvider/query-params.d.ts.map +1 -1
- package/dist/runtime/TimeRangeProvider/query-params.js +4 -4
- package/dist/runtime/TimeRangeProvider/query-params.js.map +1 -1
- package/dist/runtime/builtin-variables.d.ts +1 -1
- package/dist/runtime/builtin-variables.d.ts.map +1 -1
- package/dist/runtime/builtin-variables.js +2 -2
- package/dist/runtime/builtin-variables.js.map +1 -1
- package/dist/runtime/datasources.js +1 -1
- package/dist/runtime/datasources.js.map +1 -1
- package/dist/runtime/plugin-registry.d.ts +2 -2
- package/dist/runtime/plugin-registry.d.ts.map +1 -1
- package/dist/runtime/plugin-registry.js +4 -4
- package/dist/runtime/plugin-registry.js.map +1 -1
- package/dist/runtime/template-variables.d.ts +4 -4
- package/dist/runtime/template-variables.d.ts.map +1 -1
- package/dist/runtime/template-variables.js +10 -2
- package/dist/runtime/template-variables.js.map +1 -1
- package/dist/runtime/time-series-queries.js +7 -7
- package/dist/runtime/time-series-queries.js.map +1 -1
- package/dist/runtime/trace-queries.d.ts +6 -2
- package/dist/runtime/trace-queries.d.ts.map +1 -1
- package/dist/runtime/trace-queries.js +21 -7
- package/dist/runtime/trace-queries.js.map +1 -1
- package/dist/stories/shared-utils/decorators/WithDataQueries.d.ts +2 -3
- package/dist/stories/shared-utils/decorators/WithDataQueries.d.ts.map +1 -1
- package/dist/stories/shared-utils/decorators/WithDataQueries.js.map +1 -1
- package/dist/stories/shared-utils/decorators/WithPluginRegistry.d.ts +1 -2
- package/dist/stories/shared-utils/decorators/WithPluginRegistry.d.ts.map +1 -1
- package/dist/stories/shared-utils/decorators/WithPluginSystemBuiltinVariables.d.ts +2 -3
- package/dist/stories/shared-utils/decorators/WithPluginSystemBuiltinVariables.d.ts.map +1 -1
- package/dist/stories/shared-utils/decorators/WithPluginSystemBuiltinVariables.js.map +1 -1
- package/dist/stories/shared-utils/decorators/WithPluginSystemDatasourceStore.d.ts +2 -3
- package/dist/stories/shared-utils/decorators/WithPluginSystemDatasourceStore.d.ts.map +1 -1
- package/dist/stories/shared-utils/decorators/WithPluginSystemDatasourceStore.js +1 -1
- package/dist/stories/shared-utils/decorators/WithPluginSystemDatasourceStore.js.map +1 -1
- package/dist/stories/shared-utils/decorators/WithPluginSystemTemplateVariables.d.ts +2 -3
- package/dist/stories/shared-utils/decorators/WithPluginSystemTemplateVariables.d.ts.map +1 -1
- package/dist/stories/shared-utils/decorators/WithPluginSystemTemplateVariables.js.map +1 -1
- package/dist/stories/shared-utils/decorators/WithTimeRange.d.ts +2 -3
- package/dist/stories/shared-utils/decorators/WithTimeRange.d.ts.map +1 -1
- package/dist/stories/shared-utils/decorators/WithTimeRange.js.map +1 -1
- package/dist/test/render.d.ts +1 -1
- package/dist/test/render.d.ts.map +1 -1
- package/dist/test/render.js.map +1 -1
- package/dist/test/setup-tests.js.map +1 -1
- package/dist/test/test-plugins/bert/index.js +2 -2
- package/dist/test/test-plugins/bert/index.js.map +1 -1
- package/dist/test/test-plugins/ernie/index.js +2 -2
- package/dist/test/test-plugins/ernie/index.js.map +1 -1
- package/dist/test-utils/mock-plugin-registry.d.ts +1 -1
- package/dist/test-utils/mock-plugin-registry.d.ts.map +1 -1
- package/dist/test-utils/mock-plugin-registry.js +1 -1
- package/dist/test-utils/mock-plugin-registry.js.map +1 -1
- package/dist/utils/variables.js.map +1 -1
- package/dist/validation/datasource.d.ts +1 -1
- package/dist/validation/datasource.d.ts.map +1 -1
- package/dist/validation/datasource.js.map +1 -1
- package/dist/validation/resource.js.map +1 -1
- package/dist/validation/role.d.ts +43 -43
- package/dist/validation/role.d.ts.map +1 -1
- package/dist/validation/role.js.map +1 -1
- package/dist/validation/rolebinding.d.ts +10 -10
- package/dist/validation/rolebinding.d.ts.map +1 -1
- package/dist/validation/rolebinding.js.map +1 -1
- package/dist/validation/secret.d.ts +19 -19
- package/dist/validation/secret.d.ts.map +1 -1
- package/dist/validation/secret.js.map +1 -1
- package/dist/validation/variable.d.ts +1 -1
- package/dist/validation/variable.d.ts.map +1 -1
- package/dist/validation/variable.js.map +1 -1
- package/package.json +4 -4
|
@@ -0,0 +1,96 @@
|
|
|
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
|
+
"use strict";
|
|
14
|
+
Object.defineProperty(exports, "__esModule", {
|
|
15
|
+
value: true
|
|
16
|
+
});
|
|
17
|
+
Object.defineProperty(exports, "TraceQueryInput", {
|
|
18
|
+
enumerable: true,
|
|
19
|
+
get: function() {
|
|
20
|
+
return TraceQueryInput;
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
const _jsxruntime = require("react/jsx-runtime");
|
|
24
|
+
const _material = require("@mui/material");
|
|
25
|
+
const _ChevronDown = /*#__PURE__*/ _interop_require_default(require("mdi-material-ui/ChevronDown"));
|
|
26
|
+
const _ChevronRight = /*#__PURE__*/ _interop_require_default(require("mdi-material-ui/ChevronRight"));
|
|
27
|
+
const _DeleteOutline = /*#__PURE__*/ _interop_require_default(require("mdi-material-ui/DeleteOutline"));
|
|
28
|
+
const _immer = /*#__PURE__*/ _interop_require_default(require("immer"));
|
|
29
|
+
const _PluginEditor = require("../PluginEditor");
|
|
30
|
+
function _interop_require_default(obj) {
|
|
31
|
+
return obj && obj.__esModule ? obj : {
|
|
32
|
+
default: obj
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
const TraceQueryInput = ({ index, query, isCollapsed, onDelete, onChange, onCollapseExpand })=>{
|
|
36
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Stack, {
|
|
37
|
+
spacing: 1,
|
|
38
|
+
children: [
|
|
39
|
+
/*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Stack, {
|
|
40
|
+
direction: "row",
|
|
41
|
+
alignItems: "center",
|
|
42
|
+
borderBottom: 1,
|
|
43
|
+
borderColor: (theme)=>theme.palette.divider,
|
|
44
|
+
children: [
|
|
45
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.IconButton, {
|
|
46
|
+
size: "small",
|
|
47
|
+
onClick: ()=>onCollapseExpand(index),
|
|
48
|
+
children: isCollapsed ? /*#__PURE__*/ (0, _jsxruntime.jsx)(_ChevronRight.default, {}) : /*#__PURE__*/ (0, _jsxruntime.jsx)(_ChevronDown.default, {})
|
|
49
|
+
}),
|
|
50
|
+
/*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Typography, {
|
|
51
|
+
variant: "overline",
|
|
52
|
+
component: "h4",
|
|
53
|
+
children: [
|
|
54
|
+
"Query ",
|
|
55
|
+
index + 1
|
|
56
|
+
]
|
|
57
|
+
}),
|
|
58
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.IconButton, {
|
|
59
|
+
size: "small",
|
|
60
|
+
// Use `visibility` to ensure that the row has the same height when delete button is visible or not visible
|
|
61
|
+
sx: {
|
|
62
|
+
marginLeft: 'auto',
|
|
63
|
+
visibility: `${onDelete ? 'visible' : 'hidden'}`
|
|
64
|
+
},
|
|
65
|
+
onClick: ()=>onDelete && onDelete(index),
|
|
66
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_DeleteOutline.default, {})
|
|
67
|
+
})
|
|
68
|
+
]
|
|
69
|
+
}),
|
|
70
|
+
!isCollapsed && /*#__PURE__*/ (0, _jsxruntime.jsx)(QueryEditor, {
|
|
71
|
+
value: query,
|
|
72
|
+
onChange: (next)=>onChange(index, next)
|
|
73
|
+
})
|
|
74
|
+
]
|
|
75
|
+
}, index);
|
|
76
|
+
};
|
|
77
|
+
/**
|
|
78
|
+
* Displays an editor for TraceQueryDefinition objects.
|
|
79
|
+
*/ function QueryEditor(props) {
|
|
80
|
+
const { value, onChange, ...others } = props;
|
|
81
|
+
const { spec: { plugin } } = value;
|
|
82
|
+
const handlePluginChange = (next)=>{
|
|
83
|
+
onChange((0, _immer.default)(value, (draft)=>{
|
|
84
|
+
draft.spec.plugin = next;
|
|
85
|
+
}));
|
|
86
|
+
};
|
|
87
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Box, {
|
|
88
|
+
...others,
|
|
89
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_PluginEditor.PluginEditor, {
|
|
90
|
+
pluginType: "TraceQuery",
|
|
91
|
+
pluginKindLabel: "Query Type",
|
|
92
|
+
value: plugin,
|
|
93
|
+
onChange: handlePluginChange
|
|
94
|
+
})
|
|
95
|
+
});
|
|
96
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
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
|
+
"use strict";
|
|
14
|
+
Object.defineProperty(exports, "__esModule", {
|
|
15
|
+
value: true
|
|
16
|
+
});
|
|
17
|
+
_export_star(require("./TraceQueryEditor"), exports);
|
|
18
|
+
function _export_star(from, to) {
|
|
19
|
+
Object.keys(from).forEach(function(k) {
|
|
20
|
+
if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) {
|
|
21
|
+
Object.defineProperty(to, k, {
|
|
22
|
+
enumerable: true,
|
|
23
|
+
get: function() {
|
|
24
|
+
return from[k];
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
});
|
|
29
|
+
return from;
|
|
30
|
+
}
|
|
@@ -54,7 +54,9 @@ function _interop_require_wildcard(obj, nodeInterop) {
|
|
|
54
54
|
if (cache && cache.has(obj)) {
|
|
55
55
|
return cache.get(obj);
|
|
56
56
|
}
|
|
57
|
-
var newObj = {
|
|
57
|
+
var newObj = {
|
|
58
|
+
__proto__: null
|
|
59
|
+
};
|
|
58
60
|
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
59
61
|
for(var key in obj){
|
|
60
62
|
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
@@ -78,7 +80,7 @@ function FallbackPreview() {
|
|
|
78
80
|
});
|
|
79
81
|
}
|
|
80
82
|
function VariableEditorForm(props) {
|
|
81
|
-
const { initialVariableDefinition
|
|
83
|
+
const { initialVariableDefinition, initialAction, isDraft, isReadonly, onSave, onClose, onDelete } = props;
|
|
82
84
|
const initialState = (0, _variableeditorformmodel.getInitialState)(initialVariableDefinition);
|
|
83
85
|
const [state, setState] = (0, _useimmer.useImmer)(initialState);
|
|
84
86
|
const [isDiscardDialogOpened, setDiscardDialogOpened] = (0, _react.useState)(false);
|
|
@@ -126,7 +128,6 @@ function VariableEditorForm(props) {
|
|
|
126
128
|
state,
|
|
127
129
|
onClose
|
|
128
130
|
]);
|
|
129
|
-
var _state_title, _state_description, _state_listVariableFields_capturingRegexp, _state_listVariableFields_sort, _state_listVariableFields_customAllValue;
|
|
130
131
|
return /*#__PURE__*/ (0, _jsxruntime.jsxs)(_reacthookform.FormProvider, {
|
|
131
132
|
...form,
|
|
132
133
|
children: [
|
|
@@ -220,9 +221,9 @@ function VariableEditorForm(props) {
|
|
|
220
221
|
xs: 8,
|
|
221
222
|
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_reacthookform.Controller, {
|
|
222
223
|
name: "name",
|
|
223
|
-
render: ({ field
|
|
224
|
+
render: ({ field, fieldState })=>{
|
|
224
225
|
var _fieldState_error;
|
|
225
|
-
/*#__PURE__*/
|
|
226
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.TextField, {
|
|
226
227
|
...field,
|
|
227
228
|
required: true,
|
|
228
229
|
fullWidth: true,
|
|
@@ -252,9 +253,10 @@ function VariableEditorForm(props) {
|
|
|
252
253
|
xs: 4,
|
|
253
254
|
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_reacthookform.Controller, {
|
|
254
255
|
name: "title",
|
|
255
|
-
render: ({ field
|
|
256
|
+
render: ({ field, fieldState })=>/*#__PURE__*/ {
|
|
256
257
|
var _fieldState_error;
|
|
257
|
-
|
|
258
|
+
var _state_title;
|
|
259
|
+
return (0, _jsxruntime.jsx)(_material.TextField, {
|
|
258
260
|
...field,
|
|
259
261
|
fullWidth: true,
|
|
260
262
|
label: "Display Label",
|
|
@@ -282,9 +284,10 @@ function VariableEditorForm(props) {
|
|
|
282
284
|
xs: 8,
|
|
283
285
|
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_reacthookform.Controller, {
|
|
284
286
|
name: "description",
|
|
285
|
-
render: ({ field
|
|
287
|
+
render: ({ field, fieldState })=>/*#__PURE__*/ {
|
|
286
288
|
var _fieldState_error;
|
|
287
|
-
|
|
289
|
+
var _state_description;
|
|
290
|
+
return (0, _jsxruntime.jsx)(_material.TextField, {
|
|
288
291
|
...field,
|
|
289
292
|
fullWidth: true,
|
|
290
293
|
label: "Description",
|
|
@@ -312,9 +315,9 @@ function VariableEditorForm(props) {
|
|
|
312
315
|
xs: 4,
|
|
313
316
|
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_reacthookform.Controller, {
|
|
314
317
|
name: "kind",
|
|
315
|
-
render: ({ field
|
|
318
|
+
render: ({ field, fieldState })=>{
|
|
316
319
|
var _fieldState_error;
|
|
317
|
-
/*#__PURE__*/
|
|
320
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.TextField, {
|
|
318
321
|
select: true,
|
|
319
322
|
...field,
|
|
320
323
|
fullWidth: true,
|
|
@@ -364,9 +367,9 @@ function VariableEditorForm(props) {
|
|
|
364
367
|
}),
|
|
365
368
|
/*#__PURE__*/ (0, _jsxruntime.jsx)(_reacthookform.Controller, {
|
|
366
369
|
name: "textVariableFields.value",
|
|
367
|
-
render: ({ field
|
|
370
|
+
render: ({ field, fieldState })=>{
|
|
368
371
|
var _fieldState_error;
|
|
369
|
-
/*#__PURE__*/
|
|
372
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.TextField, {
|
|
370
373
|
...field,
|
|
371
374
|
label: "Value",
|
|
372
375
|
InputLabelProps: {
|
|
@@ -389,7 +392,7 @@ function VariableEditorForm(props) {
|
|
|
389
392
|
}),
|
|
390
393
|
/*#__PURE__*/ (0, _jsxruntime.jsx)(_reacthookform.Controller, {
|
|
391
394
|
name: "textVariableFields.constant",
|
|
392
|
-
render: ({ field
|
|
395
|
+
render: ({ field })=>/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.FormControlLabel, {
|
|
393
396
|
label: "Constant",
|
|
394
397
|
control: /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Switch, {
|
|
395
398
|
...field,
|
|
@@ -443,7 +446,7 @@ function VariableEditorForm(props) {
|
|
|
443
446
|
}),
|
|
444
447
|
/*#__PURE__*/ (0, _jsxruntime.jsx)(_reacthookform.Controller, {
|
|
445
448
|
name: "listVariableFields.plugin",
|
|
446
|
-
render: ({ field
|
|
449
|
+
render: ({ field })=>/*#__PURE__*/ (0, _jsxruntime.jsx)(_PluginEditor.PluginEditor, {
|
|
447
450
|
width: "100%",
|
|
448
451
|
pluginType: "Variable",
|
|
449
452
|
pluginKindLabel: "Source",
|
|
@@ -462,9 +465,10 @@ function VariableEditorForm(props) {
|
|
|
462
465
|
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Stack, {
|
|
463
466
|
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_reacthookform.Controller, {
|
|
464
467
|
name: "listVariableFields.capturingRegexp",
|
|
465
|
-
render: ({ field
|
|
468
|
+
render: ({ field, fieldState })=>/*#__PURE__*/ {
|
|
466
469
|
var _fieldState_error;
|
|
467
|
-
|
|
470
|
+
var _state_listVariableFields_capturingRegexp;
|
|
471
|
+
return (0, _jsxruntime.jsx)(_material.TextField, {
|
|
468
472
|
...field,
|
|
469
473
|
label: "Capturing Regexp Filter",
|
|
470
474
|
InputLabelProps: {
|
|
@@ -494,9 +498,10 @@ function VariableEditorForm(props) {
|
|
|
494
498
|
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Stack, {
|
|
495
499
|
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_reacthookform.Controller, {
|
|
496
500
|
name: "listVariableFields.sort",
|
|
497
|
-
render: ({ field
|
|
501
|
+
render: ({ field, fieldState })=>/*#__PURE__*/ {
|
|
498
502
|
var _fieldState_error;
|
|
499
|
-
|
|
503
|
+
var _state_listVariableFields_sort;
|
|
504
|
+
return (0, _jsxruntime.jsxs)(_material.TextField, {
|
|
500
505
|
select: true,
|
|
501
506
|
...field,
|
|
502
507
|
fullWidth: true,
|
|
@@ -565,7 +570,7 @@ function VariableEditorForm(props) {
|
|
|
565
570
|
children: [
|
|
566
571
|
/*#__PURE__*/ (0, _jsxruntime.jsx)(_reacthookform.Controller, {
|
|
567
572
|
name: "listVariableFields.allowMultiple",
|
|
568
|
-
render: ({ field
|
|
573
|
+
render: ({ field })=>/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.FormControlLabel, {
|
|
569
574
|
label: "Allow Multiple Values",
|
|
570
575
|
control: /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Switch, {
|
|
571
576
|
...field,
|
|
@@ -592,7 +597,7 @@ function VariableEditorForm(props) {
|
|
|
592
597
|
children: [
|
|
593
598
|
/*#__PURE__*/ (0, _jsxruntime.jsx)(_reacthookform.Controller, {
|
|
594
599
|
name: "listVariableFields.allowAllValue",
|
|
595
|
-
render: ({ field
|
|
600
|
+
render: ({ field })=>/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.FormControlLabel, {
|
|
596
601
|
label: "Allow All option",
|
|
597
602
|
control: /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Switch, {
|
|
598
603
|
...field,
|
|
@@ -616,9 +621,10 @@ function VariableEditorForm(props) {
|
|
|
616
621
|
}),
|
|
617
622
|
state.listVariableFields.allowAllValue && /*#__PURE__*/ (0, _jsxruntime.jsx)(_reacthookform.Controller, {
|
|
618
623
|
name: "listVariableFields.customAllValue",
|
|
619
|
-
render: ({ field
|
|
624
|
+
render: ({ field, fieldState })=>/*#__PURE__*/ {
|
|
620
625
|
var _fieldState_error;
|
|
621
|
-
|
|
626
|
+
var _state_listVariableFields_customAllValue;
|
|
627
|
+
return (0, _jsxruntime.jsx)(_material.TextField, {
|
|
622
628
|
...field,
|
|
623
629
|
fullWidth: true,
|
|
624
630
|
label: "Custom All Value",
|
|
@@ -21,11 +21,11 @@ function _export(target, all) {
|
|
|
21
21
|
});
|
|
22
22
|
}
|
|
23
23
|
_export(exports, {
|
|
24
|
-
VariablePreview: function() {
|
|
25
|
-
return VariablePreview;
|
|
26
|
-
},
|
|
27
24
|
VariableListPreview: function() {
|
|
28
25
|
return VariableListPreview;
|
|
26
|
+
},
|
|
27
|
+
VariablePreview: function() {
|
|
28
|
+
return VariablePreview;
|
|
29
29
|
}
|
|
30
30
|
});
|
|
31
31
|
const _jsxruntime = require("react/jsx-runtime");
|
|
@@ -62,7 +62,9 @@ function _interop_require_wildcard(obj, nodeInterop) {
|
|
|
62
62
|
if (cache && cache.has(obj)) {
|
|
63
63
|
return cache.get(obj);
|
|
64
64
|
}
|
|
65
|
-
var newObj = {
|
|
65
|
+
var newObj = {
|
|
66
|
+
__proto__: null
|
|
67
|
+
};
|
|
66
68
|
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
67
69
|
for(var key in obj){
|
|
68
70
|
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
@@ -82,9 +84,9 @@ function _interop_require_wildcard(obj, nodeInterop) {
|
|
|
82
84
|
}
|
|
83
85
|
const DEFAULT_MAX_PREVIEW_VALUES = 50;
|
|
84
86
|
function VariablePreview(props) {
|
|
85
|
-
const { values
|
|
87
|
+
const { values, onRefresh, isLoading, error } = props;
|
|
86
88
|
const [maxValues, setMaxValues] = (0, _react.useState)(DEFAULT_MAX_PREVIEW_VALUES);
|
|
87
|
-
const { infoSnackbar
|
|
89
|
+
const { infoSnackbar } = (0, _components.useSnackbar)();
|
|
88
90
|
const showAll = ()=>{
|
|
89
91
|
setMaxValues(undefined);
|
|
90
92
|
};
|
|
@@ -170,8 +172,8 @@ function VariablePreview(props) {
|
|
|
170
172
|
});
|
|
171
173
|
}
|
|
172
174
|
function VariableListPreview(props) {
|
|
173
|
-
const { definition
|
|
174
|
-
const { data
|
|
175
|
+
const { definition, onRefresh } = props;
|
|
176
|
+
const { data, isFetching, error } = (0, _variablemodel.useListVariablePluginValues)(definition);
|
|
175
177
|
const errorMessage = error === null || error === void 0 ? void 0 : error.message;
|
|
176
178
|
return /*#__PURE__*/ (0, _jsxruntime.jsx)(VariablePreview, {
|
|
177
179
|
values: (data === null || data === void 0 ? void 0 : data.map((val)=>val.value)) || [],
|
|
@@ -67,7 +67,7 @@ function getInitialState(initialVariableDefinition) {
|
|
|
67
67
|
};
|
|
68
68
|
}
|
|
69
69
|
function getVariableDefinitionFromState(state) {
|
|
70
|
-
const { name
|
|
70
|
+
const { name, title, kind, description } = state;
|
|
71
71
|
const display = {
|
|
72
72
|
name: title,
|
|
73
73
|
description: description
|
|
@@ -15,23 +15,23 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
15
15
|
value: true
|
|
16
16
|
});
|
|
17
17
|
function _export(target, all) {
|
|
18
|
-
for(var
|
|
18
|
+
for(var name in all)Object.defineProperty(target, name, {
|
|
19
19
|
enumerable: true,
|
|
20
|
-
get: all[
|
|
20
|
+
get: all[name]
|
|
21
21
|
});
|
|
22
22
|
}
|
|
23
23
|
_export(exports, {
|
|
24
|
+
VARIABLE_TYPES: function() {
|
|
25
|
+
return VARIABLE_TYPES;
|
|
26
|
+
},
|
|
24
27
|
filterVariableList: function() {
|
|
25
28
|
return filterVariableList;
|
|
26
29
|
},
|
|
27
|
-
useListVariablePluginValues: function() {
|
|
28
|
-
return useListVariablePluginValues;
|
|
29
|
-
},
|
|
30
30
|
getVariableValuesKey: function() {
|
|
31
31
|
return getVariableValuesKey;
|
|
32
32
|
},
|
|
33
|
-
|
|
34
|
-
return
|
|
33
|
+
useListVariablePluginValues: function() {
|
|
34
|
+
return useListVariablePluginValues;
|
|
35
35
|
}
|
|
36
36
|
});
|
|
37
37
|
const _reactquery = require("@tanstack/react-query");
|
|
@@ -62,10 +62,10 @@ function filterVariableList(data, capturedRegexp) {
|
|
|
62
62
|
return result;
|
|
63
63
|
}
|
|
64
64
|
function useListVariablePluginValues(definition) {
|
|
65
|
-
const { data: variablePlugin
|
|
65
|
+
const { data: variablePlugin } = (0, _runtime.usePlugin)('Variable', definition.spec.plugin.kind);
|
|
66
66
|
const datasourceStore = (0, _runtime.useDatasourceStore)();
|
|
67
|
-
const allVariables = (0, _runtime.
|
|
68
|
-
const { absoluteTimeRange: timeRange
|
|
67
|
+
const allVariables = (0, _runtime.useVariableValues)();
|
|
68
|
+
const { absoluteTimeRange: timeRange, refreshKey } = (0, _runtime.useTimeRange)();
|
|
69
69
|
const variablePluginCtx = {
|
|
70
70
|
timeRange,
|
|
71
71
|
datasourceStore,
|
|
@@ -78,7 +78,7 @@ function useListVariablePluginValues(definition) {
|
|
|
78
78
|
const dependencies = variablePlugin.dependsOn(spec, variablePluginCtx);
|
|
79
79
|
dependsOnVariables = dependencies.variables;
|
|
80
80
|
}
|
|
81
|
-
const variables = (0, _runtime.
|
|
81
|
+
const variables = (0, _runtime.useVariableValues)(dependsOnVariables);
|
|
82
82
|
let waitToLoad = false;
|
|
83
83
|
if (dependsOnVariables) {
|
|
84
84
|
waitToLoad = dependsOnVariables.some((v)=>{
|
|
@@ -88,7 +88,6 @@ function useListVariablePluginValues(definition) {
|
|
|
88
88
|
}
|
|
89
89
|
const variablesValueKey = getVariableValuesKey(variables);
|
|
90
90
|
return (0, _reactquery.useQuery)([
|
|
91
|
-
name,
|
|
92
91
|
definition,
|
|
93
92
|
variablesValueKey,
|
|
94
93
|
timeRange,
|
|
@@ -102,7 +101,7 @@ function useListVariablePluginValues(definition) {
|
|
|
102
101
|
if (resp === undefined) {
|
|
103
102
|
return [];
|
|
104
103
|
}
|
|
105
|
-
if (capturingRegexp
|
|
104
|
+
if (!capturingRegexp) {
|
|
106
105
|
return resp.data;
|
|
107
106
|
}
|
|
108
107
|
return filterVariableList(resp.data, capturingRegexp);
|
|
@@ -24,14 +24,14 @@ _export(exports, {
|
|
|
24
24
|
ProjectStoreContext: function() {
|
|
25
25
|
return ProjectStoreContext;
|
|
26
26
|
},
|
|
27
|
+
ProjectStoreProvider: function() {
|
|
28
|
+
return ProjectStoreProvider;
|
|
29
|
+
},
|
|
27
30
|
useProjectList: function() {
|
|
28
31
|
return useProjectList;
|
|
29
32
|
},
|
|
30
33
|
useProjectStore: function() {
|
|
31
34
|
return useProjectStore;
|
|
32
|
-
},
|
|
33
|
-
ProjectStoreProvider: function() {
|
|
34
|
-
return ProjectStoreProvider;
|
|
35
35
|
}
|
|
36
36
|
});
|
|
37
37
|
const _jsxruntime = require("react/jsx-runtime");
|
|
@@ -55,8 +55,8 @@ function useProjectStore() {
|
|
|
55
55
|
return ctx;
|
|
56
56
|
}
|
|
57
57
|
function ProjectStoreProvider(props) {
|
|
58
|
-
const { children
|
|
59
|
-
const { project
|
|
58
|
+
const { children, enabledURLParams } = props;
|
|
59
|
+
const { project, setProject } = (0, _queryparams.useSetProjectParams)(enabledURLParams);
|
|
60
60
|
const contextValue = (0, _react.useMemo)(()=>({
|
|
61
61
|
project: {
|
|
62
62
|
kind: 'Project',
|
package/dist/cjs/model/legend.js
CHANGED
|
@@ -21,21 +21,21 @@ function _export(target, all) {
|
|
|
21
21
|
});
|
|
22
22
|
}
|
|
23
23
|
_export(exports, {
|
|
24
|
-
|
|
25
|
-
return
|
|
24
|
+
LEGEND_MODE_CONFIG: function() {
|
|
25
|
+
return LEGEND_MODE_CONFIG;
|
|
26
26
|
},
|
|
27
27
|
LEGEND_POSITIONS_CONFIG: function() {
|
|
28
28
|
return LEGEND_POSITIONS_CONFIG;
|
|
29
29
|
},
|
|
30
|
-
LEGEND_MODE_CONFIG: function() {
|
|
31
|
-
return LEGEND_MODE_CONFIG;
|
|
32
|
-
},
|
|
33
30
|
LEGEND_SIZE_CONFIG: function() {
|
|
34
31
|
return LEGEND_SIZE_CONFIG;
|
|
35
32
|
},
|
|
36
33
|
LEGEND_VALUE_CONFIG: function() {
|
|
37
34
|
return LEGEND_VALUE_CONFIG;
|
|
38
35
|
},
|
|
36
|
+
legendValues: function() {
|
|
37
|
+
return legendValues;
|
|
38
|
+
},
|
|
39
39
|
validateLegendSpec: function() {
|
|
40
40
|
return validateLegendSpec;
|
|
41
41
|
}
|
|
@@ -24,14 +24,14 @@ _export(exports, {
|
|
|
24
24
|
DataQueriesContext: function() {
|
|
25
25
|
return DataQueriesContext;
|
|
26
26
|
},
|
|
27
|
-
|
|
28
|
-
return
|
|
27
|
+
DataQueriesProvider: function() {
|
|
28
|
+
return DataQueriesProvider;
|
|
29
29
|
},
|
|
30
30
|
useDataQueries: function() {
|
|
31
31
|
return useDataQueries;
|
|
32
32
|
},
|
|
33
|
-
|
|
34
|
-
return
|
|
33
|
+
useDataQueriesContext: function() {
|
|
34
|
+
return useDataQueriesContext;
|
|
35
35
|
}
|
|
36
36
|
});
|
|
37
37
|
const _jsxruntime = require("react/jsx-runtime");
|
|
@@ -56,7 +56,7 @@ function useDataQueries(queryType) {
|
|
|
56
56
|
});
|
|
57
57
|
// Filter the errors based on the specified query type
|
|
58
58
|
const filteredErrors = ctx.errors.filter((errors, index)=>{
|
|
59
|
-
var
|
|
59
|
+
var _ctx_queryResults_index_definition, _ctx_queryResults_index;
|
|
60
60
|
return ((_ctx_queryResults_index = ctx.queryResults[index]) === null || _ctx_queryResults_index === void 0 ? void 0 : (_ctx_queryResults_index_definition = _ctx_queryResults_index.definition) === null || _ctx_queryResults_index_definition === void 0 ? void 0 : _ctx_queryResults_index_definition.kind) === queryType;
|
|
61
61
|
});
|
|
62
62
|
// Create a new context object with the filtered results and errors
|
|
@@ -70,7 +70,7 @@ function useDataQueries(queryType) {
|
|
|
70
70
|
return filteredCtx;
|
|
71
71
|
}
|
|
72
72
|
function DataQueriesProvider(props) {
|
|
73
|
-
const { definitions
|
|
73
|
+
const { definitions, options, children, queryOptions } = props;
|
|
74
74
|
// Returns a query kind, for example "TimeSeriesQuery" = getQueryType("PrometheusTimeSeriesQuery")
|
|
75
75
|
const getQueryType = (0, _model.useQueryType)();
|
|
76
76
|
const queryDefinitions = definitions.map((definition)=>{
|
|
@@ -31,7 +31,7 @@ _export(exports, {
|
|
|
31
31
|
const _react = require("react");
|
|
32
32
|
const _pluginregistry = require("../plugin-registry");
|
|
33
33
|
function transformQueryResults(results, definitions) {
|
|
34
|
-
return results.map(({ data
|
|
34
|
+
return results.map(({ data, isFetching, isLoading, refetch, error }, i)=>{
|
|
35
35
|
return {
|
|
36
36
|
definition: definitions[i],
|
|
37
37
|
data,
|
|
@@ -43,8 +43,8 @@ function transformQueryResults(results, definitions) {
|
|
|
43
43
|
});
|
|
44
44
|
}
|
|
45
45
|
function useQueryType() {
|
|
46
|
-
const { data: timeSeriesQueryPlugins
|
|
47
|
-
const { data: traceQueryPlugins
|
|
46
|
+
const { data: timeSeriesQueryPlugins, isLoading: isTimeSeriesQueryLoading } = (0, _pluginregistry.useListPluginMetadata)('TimeSeriesQuery');
|
|
47
|
+
const { data: traceQueryPlugins, isLoading: isTraceQueryPluginLoading } = (0, _pluginregistry.useListPluginMetadata)('TraceQuery');
|
|
48
48
|
// For example, `map: {"TimeSeriesQuery":["PrometheusTimeSeriesQuery"],"TraceQuery":["TempoTraceQuery"]}`
|
|
49
49
|
const queryTypeMap = (0, _react.useMemo)(()=>{
|
|
50
50
|
const map = {
|
|
@@ -24,14 +24,14 @@ _export(exports, {
|
|
|
24
24
|
TimeRangeContext: function() {
|
|
25
25
|
return TimeRangeContext;
|
|
26
26
|
},
|
|
27
|
-
|
|
28
|
-
return
|
|
27
|
+
TimeRangeProvider: function() {
|
|
28
|
+
return TimeRangeProvider;
|
|
29
29
|
},
|
|
30
30
|
useTimeRange: function() {
|
|
31
31
|
return useTimeRange;
|
|
32
32
|
},
|
|
33
|
-
|
|
34
|
-
return
|
|
33
|
+
useTimeRangeContext: function() {
|
|
34
|
+
return useTimeRangeContext;
|
|
35
35
|
}
|
|
36
36
|
});
|
|
37
37
|
const _jsxruntime = require("react/jsx-runtime");
|
|
@@ -59,7 +59,9 @@ function _interop_require_wildcard(obj, nodeInterop) {
|
|
|
59
59
|
if (cache && cache.has(obj)) {
|
|
60
60
|
return cache.get(obj);
|
|
61
61
|
}
|
|
62
|
-
var newObj = {
|
|
62
|
+
var newObj = {
|
|
63
|
+
__proto__: null
|
|
64
|
+
};
|
|
63
65
|
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
64
66
|
for(var key in obj){
|
|
65
67
|
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
@@ -89,7 +91,7 @@ function useTimeRange() {
|
|
|
89
91
|
return useTimeRangeContext();
|
|
90
92
|
}
|
|
91
93
|
function TimeRangeProvider(props) {
|
|
92
|
-
const { timeRange
|
|
94
|
+
const { timeRange, refreshInterval, children, setTimeRange, setRefreshInterval } = props;
|
|
93
95
|
const [localTimeRange, setLocalTimeRange] = (0, _react.useState)(timeRange);
|
|
94
96
|
const [localRefreshInterval, setLocalefreshInterval] = (0, _react.useState)(refreshInterval);
|
|
95
97
|
const [refreshCounter, setRefreshCounter] = (0, _react.useState)(0);
|
|
@@ -30,9 +30,9 @@ function _interop_require_default(obj) {
|
|
|
30
30
|
};
|
|
31
31
|
}
|
|
32
32
|
function TimeRangeProviderWithQueryParams(props) {
|
|
33
|
-
const { initialTimeRange
|
|
34
|
-
const { timeRange
|
|
35
|
-
const { refreshInterval
|
|
33
|
+
const { initialTimeRange, initialRefreshInterval, children } = props;
|
|
34
|
+
const { timeRange, setTimeRange } = (0, _queryparams.useTimeRangeParams)(initialTimeRange);
|
|
35
|
+
const { refreshInterval, setRefreshInterval } = (0, _queryparams.useSetRefreshIntervalParams)(initialRefreshInterval);
|
|
36
36
|
return /*#__PURE__*/ (0, _jsxruntime.jsx)(_TimeRangeProvider.TimeRangeProvider, {
|
|
37
37
|
timeRange: timeRange,
|
|
38
38
|
refreshInterval: refreshInterval,
|