@perses-dev/plugin-system 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.
- package/dist/cjs/components/CalculationSelector/CalculationSelector.js +1 -1
- package/dist/cjs/components/DatasourceEditorForm/DatasourceEditorForm.js +16 -16
- 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 +5 -5
- package/dist/cjs/components/PluginEditor/PluginEditor.js +2 -2
- 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/TimeRangeControls/TimeRangeControls.js +192 -0
- package/dist/cjs/components/TimeRangeControls/index.js +30 -0
- package/dist/cjs/components/TimeSeriesQueryEditor/TimeSeriesQueryEditor.js +23 -31
- package/dist/cjs/components/TimeSeriesQueryEditor/TimeSeriesQueryInput.js +3 -3
- package/dist/cjs/components/TraceQueryEditor/TraceQueryEditor.js +2 -2
- package/dist/cjs/components/TraceQueryEditor/TraceQueryInput.js +3 -3
- 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/components/index.js +1 -0
- package/dist/cjs/constants/user-interface-text.js +4 -1
- 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 +21 -10
- 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 +4 -4
- 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/duration.js +25 -0
- package/dist/cjs/validation/index.js +1 -0
- package/dist/cjs/validation/resource.js +1 -1
- package/dist/cjs/validation/role.js +4 -3
- package/dist/cjs/validation/secret.js +3 -3
- package/dist/cjs/validation/user.js +46 -0
- 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 +3 -4
- package/dist/components/DatasourceEditorForm/DatasourceEditorForm.d.ts.map +1 -1
- package/dist/components/DatasourceEditorForm/DatasourceEditorForm.js +16 -16
- 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 +5 -5
- 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 -2
- package/dist/components/PluginEditor/PluginEditor.js.map +1 -1
- package/dist/components/PluginEditor/plugin-editor-api.d.ts +3 -4
- 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 +4 -4
- 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/TimeRangeControls/TimeRangeControls.d.ts +13 -0
- package/dist/components/TimeRangeControls/TimeRangeControls.d.ts.map +1 -0
- package/dist/components/TimeRangeControls/TimeRangeControls.js +168 -0
- package/dist/components/TimeRangeControls/TimeRangeControls.js.map +1 -0
- package/dist/components/TimeRangeControls/index.d.ts +2 -0
- package/dist/components/TimeRangeControls/index.d.ts.map +1 -0
- package/dist/components/TimeRangeControls/index.js +15 -0
- package/dist/components/TimeRangeControls/index.js.map +1 -0
- 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 +24 -32
- 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 +1 -2
- package/dist/components/TraceQueryEditor/TraceQueryEditor.d.ts.map +1 -1
- package/dist/components/TraceQueryEditor/TraceQueryEditor.js +2 -2
- package/dist/components/TraceQueryEditor/TraceQueryEditor.js.map +1 -1
- package/dist/components/TraceQueryEditor/TraceQueryInput.d.ts +1 -2
- package/dist/components/TraceQueryEditor/TraceQueryInput.d.ts.map +1 -1
- package/dist/components/TraceQueryEditor/TraceQueryInput.js +3 -3
- package/dist/components/TraceQueryEditor/TraceQueryInput.js.map +1 -1
- 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/components/index.d.ts +1 -0
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/index.js +1 -0
- package/dist/components/index.js.map +1 -1
- package/dist/constants/user-interface-text.d.ts +2 -0
- package/dist/constants/user-interface-text.d.ts.map +1 -1
- package/dist/constants/user-interface-text.js +4 -1
- package/dist/constants/user-interface-text.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 +1 -1
- package/dist/model/panels.d.ts.map +1 -1
- package/dist/model/plugin-base.d.ts +0 -1
- package/dist/model/plugin-base.d.ts.map +1 -1
- package/dist/model/plugin-base.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 +1 -1
- 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 +5 -1
- package/dist/runtime/TimeRangeProvider/TimeRangeProvider.d.ts.map +1 -1
- package/dist/runtime/TimeRangeProvider/TimeRangeProvider.js +14 -6
- 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 +3 -3
- 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 +1 -1
- package/dist/runtime/trace-queries.d.ts.map +1 -1
- package/dist/runtime/trace-queries.js +4 -4
- 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/duration.d.ts +3 -0
- package/dist/validation/duration.d.ts.map +1 -0
- package/dist/validation/duration.js +17 -0
- package/dist/validation/duration.js.map +1 -0
- package/dist/validation/index.d.ts +1 -0
- package/dist/validation/index.d.ts.map +1 -1
- package/dist/validation/index.js +1 -0
- package/dist/validation/index.js.map +1 -1
- package/dist/validation/resource.js +1 -1
- package/dist/validation/resource.js.map +1 -1
- package/dist/validation/role.d.ts +47 -47
- package/dist/validation/role.d.ts.map +1 -1
- package/dist/validation/role.js +1 -0
- 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/user.d.ts +93 -0
- package/dist/validation/user.d.ts.map +1 -0
- package/dist/validation/user.js +38 -0
- package/dist/validation/user.js.map +1 -0
- 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
|
@@ -32,16 +32,28 @@ function _interop_require_default(obj) {
|
|
|
32
32
|
default: obj
|
|
33
33
|
};
|
|
34
34
|
}
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
const
|
|
41
|
-
|
|
35
|
+
function TimeSeriesQueryEditor({ queries = [], onChange }) {
|
|
36
|
+
var _timeSeriesPlugins_;
|
|
37
|
+
// Build the default query plugin
|
|
38
|
+
// Use as default the plugin kind explicitly set as default or the first in the list
|
|
39
|
+
const { defaultPluginKinds } = (0, _runtime.usePluginRegistry)();
|
|
40
|
+
const { data: timeSeriesPlugins } = (0, _runtime.useListPluginMetadata)(_runtime.TIME_SERIES_QUERY_KEY);
|
|
41
|
+
var _defaultPluginKinds_TIME_SERIES_QUERY_KEY, _ref;
|
|
42
|
+
const defaultTimeSeriesQueryKind = (_ref = (_defaultPluginKinds_TIME_SERIES_QUERY_KEY = defaultPluginKinds === null || defaultPluginKinds === void 0 ? void 0 : defaultPluginKinds[_runtime.TIME_SERIES_QUERY_KEY]) !== null && _defaultPluginKinds_TIME_SERIES_QUERY_KEY !== void 0 ? _defaultPluginKinds_TIME_SERIES_QUERY_KEY : timeSeriesPlugins === null || timeSeriesPlugins === void 0 ? void 0 : (_timeSeriesPlugins_ = timeSeriesPlugins[0]) === null || _timeSeriesPlugins_ === void 0 ? void 0 : _timeSeriesPlugins_.kind) !== null && _ref !== void 0 ? _ref : '';
|
|
43
|
+
const { data: defaultQueryPlugin } = (0, _runtime.usePlugin)(_runtime.TIME_SERIES_QUERY_KEY, defaultTimeSeriesQueryKind, {
|
|
42
44
|
useErrorBoundary: true,
|
|
43
45
|
enabled: true
|
|
44
46
|
});
|
|
47
|
+
// This default query definition is used if no query is provided initially or when we add a new query
|
|
48
|
+
const defaultInitialQueryDefinition = {
|
|
49
|
+
kind: _runtime.TIME_SERIES_QUERY_KEY,
|
|
50
|
+
spec: {
|
|
51
|
+
plugin: {
|
|
52
|
+
kind: defaultTimeSeriesQueryKind,
|
|
53
|
+
spec: (defaultQueryPlugin === null || defaultQueryPlugin === void 0 ? void 0 : defaultQueryPlugin.createInitialOptions()) || {}
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
};
|
|
45
57
|
// State for which queries are collapsed
|
|
46
58
|
// TODO: Would be easier if we had IDs for queries.
|
|
47
59
|
const [queriesCollapsed, setQueriesCollapsed] = (0, _react.useState)(queries.map(()=>false));
|
|
@@ -60,21 +72,12 @@ function TimeSeriesQueryEditor({ queries =[] , onChange }) {
|
|
|
60
72
|
const handleQueryAdd = ()=>{
|
|
61
73
|
if (!defaultQueryPlugin) return;
|
|
62
74
|
onChange((0, _immer.produce)(queries, (draft)=>{
|
|
63
|
-
const queryDef = {
|
|
64
|
-
kind: DEFAULT_QUERY_PLUGIN_TYPE,
|
|
65
|
-
spec: {
|
|
66
|
-
plugin: {
|
|
67
|
-
kind: defaultTimeSeriesQueryKind,
|
|
68
|
-
spec: defaultQueryPlugin.createInitialOptions()
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
};
|
|
72
75
|
if (draft) {
|
|
73
|
-
draft.push(
|
|
76
|
+
draft.push(defaultInitialQueryDefinition);
|
|
74
77
|
} else {
|
|
75
78
|
draft = [
|
|
76
79
|
...queries,
|
|
77
|
-
|
|
80
|
+
defaultInitialQueryDefinition
|
|
78
81
|
];
|
|
79
82
|
}
|
|
80
83
|
}));
|
|
@@ -104,20 +107,9 @@ function TimeSeriesQueryEditor({ queries =[] , onChange }) {
|
|
|
104
107
|
];
|
|
105
108
|
});
|
|
106
109
|
};
|
|
107
|
-
var _defaultPluginKinds_TimeSeriesQuery;
|
|
108
110
|
// show one query input if queries is empty
|
|
109
111
|
const queryDefinitions = queries.length ? queries : [
|
|
110
|
-
|
|
111
|
-
kind: 'TimeSeriesQuery',
|
|
112
|
-
spec: {
|
|
113
|
-
plugin: {
|
|
114
|
-
kind: (_defaultPluginKinds_TimeSeriesQuery = defaultPluginKinds === null || defaultPluginKinds === void 0 ? void 0 : defaultPluginKinds['TimeSeriesQuery']) !== null && _defaultPluginKinds_TimeSeriesQuery !== void 0 ? _defaultPluginKinds_TimeSeriesQuery : '',
|
|
115
|
-
spec: {
|
|
116
|
-
query: ''
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
}
|
|
112
|
+
defaultInitialQueryDefinition
|
|
121
113
|
];
|
|
122
114
|
return /*#__PURE__*/ (0, _jsxruntime.jsxs)(_jsxruntime.Fragment, {
|
|
123
115
|
children: [
|
|
@@ -128,7 +120,7 @@ function TimeSeriesQueryEditor({ queries =[] , onChange }) {
|
|
|
128
120
|
query: query,
|
|
129
121
|
isCollapsed: !!queriesCollapsed[i],
|
|
130
122
|
onChange: handleQueryChange,
|
|
131
|
-
onDelete:
|
|
123
|
+
onDelete: queries.length > 1 ? handleQueryDelete : undefined,
|
|
132
124
|
onCollapseExpand: handleQueryCollapseExpand
|
|
133
125
|
}, i))
|
|
134
126
|
}),
|
|
@@ -32,7 +32,7 @@ function _interop_require_default(obj) {
|
|
|
32
32
|
default: obj
|
|
33
33
|
};
|
|
34
34
|
}
|
|
35
|
-
const TimeSeriesQueryInput = ({ index
|
|
35
|
+
const TimeSeriesQueryInput = ({ index, query, isCollapsed, onDelete, onChange, onCollapseExpand })=>{
|
|
36
36
|
return /*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Stack, {
|
|
37
37
|
spacing: 1,
|
|
38
38
|
children: [
|
|
@@ -77,8 +77,8 @@ const TimeSeriesQueryInput = ({ index , query , isCollapsed , onDelete , onChang
|
|
|
77
77
|
/**
|
|
78
78
|
* Displays an editor for TimeSeriesQueryDefinition objects.
|
|
79
79
|
*/ function QueryEditor(props) {
|
|
80
|
-
const { value
|
|
81
|
-
const { spec: { plugin
|
|
80
|
+
const { value, onChange, ...others } = props;
|
|
81
|
+
const { spec: { plugin } } = value;
|
|
82
82
|
const handlePluginChange = (next)=>{
|
|
83
83
|
onChange((0, _immer.default)(value, (draft)=>{
|
|
84
84
|
draft.spec.plugin = next;
|
|
@@ -33,13 +33,13 @@ function _interop_require_default(obj) {
|
|
|
33
33
|
};
|
|
34
34
|
}
|
|
35
35
|
const DEFAULT_QUERY_PLUGIN_TYPE = 'TraceQuery';
|
|
36
|
-
function TraceQueryEditor({ queries =[]
|
|
36
|
+
function TraceQueryEditor({ queries = [], onChange }) {
|
|
37
37
|
const hasMoreThanOneQuery = queries.length > 1;
|
|
38
38
|
const defaultTraceQueryKind = 'TempoTraceQuery';
|
|
39
39
|
// State for which queries are collapsed
|
|
40
40
|
// TODO: Would be easier if we had IDs for queries.
|
|
41
41
|
const [queriesCollapsed, setQueriesCollapsed] = (0, _react.useState)(queries.map(()=>false));
|
|
42
|
-
const { data: defaultQueryPlugin
|
|
42
|
+
const { data: defaultQueryPlugin } = (0, _runtime.usePlugin)(DEFAULT_QUERY_PLUGIN_TYPE, defaultTraceQueryKind, {
|
|
43
43
|
useErrorBoundary: true,
|
|
44
44
|
enabled: true
|
|
45
45
|
});
|
|
@@ -32,7 +32,7 @@ function _interop_require_default(obj) {
|
|
|
32
32
|
default: obj
|
|
33
33
|
};
|
|
34
34
|
}
|
|
35
|
-
const TraceQueryInput = ({ index
|
|
35
|
+
const TraceQueryInput = ({ index, query, isCollapsed, onDelete, onChange, onCollapseExpand })=>{
|
|
36
36
|
return /*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Stack, {
|
|
37
37
|
spacing: 1,
|
|
38
38
|
children: [
|
|
@@ -77,8 +77,8 @@ const TraceQueryInput = ({ index , query , isCollapsed , onDelete , onChange , o
|
|
|
77
77
|
/**
|
|
78
78
|
* Displays an editor for TraceQueryDefinition objects.
|
|
79
79
|
*/ function QueryEditor(props) {
|
|
80
|
-
const { value
|
|
81
|
-
const { spec: { plugin
|
|
80
|
+
const { value, onChange, ...others } = props;
|
|
81
|
+
const { spec: { plugin } } = value;
|
|
82
82
|
const handlePluginChange = (next)=>{
|
|
83
83
|
onChange((0, _immer.default)(value, (draft)=>{
|
|
84
84
|
draft.spec.plugin = next;
|
|
@@ -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);
|
|
@@ -26,6 +26,7 @@ _export_star(require("./PluginKindSelect"), exports);
|
|
|
26
26
|
_export_star(require("./PluginRegistry"), exports);
|
|
27
27
|
_export_star(require("./PluginSpecEditor"), exports);
|
|
28
28
|
_export_star(require("./TimeSeriesQueryEditor"), exports);
|
|
29
|
+
_export_star(require("./TimeRangeControls"), exports);
|
|
29
30
|
_export_star(require("./Variables"), exports);
|
|
30
31
|
_export_star(require("./ProjectSelect"), exports);
|
|
31
32
|
function _export_star(from, to) {
|
|
@@ -23,5 +23,8 @@ Object.defineProperty(exports, "TOOLTIP_TEXT", {
|
|
|
23
23
|
const TOOLTIP_TEXT = {
|
|
24
24
|
// Variable editor buttons
|
|
25
25
|
refreshVariableValues: 'Refresh values',
|
|
26
|
-
copyVariableValues: 'Copy values to clipboard'
|
|
26
|
+
copyVariableValues: 'Copy values to clipboard',
|
|
27
|
+
// Time range controls buttons
|
|
28
|
+
refresh: 'Refresh',
|
|
29
|
+
refreshInterval: 'Auto refresh interval'
|
|
27
30
|
};
|
|
@@ -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,17 @@ _export(exports, {
|
|
|
24
24
|
TimeRangeContext: function() {
|
|
25
25
|
return TimeRangeContext;
|
|
26
26
|
},
|
|
27
|
-
|
|
28
|
-
return
|
|
27
|
+
TimeRangeProvider: function() {
|
|
28
|
+
return TimeRangeProvider;
|
|
29
|
+
},
|
|
30
|
+
useSuggestedStepMs: function() {
|
|
31
|
+
return useSuggestedStepMs;
|
|
29
32
|
},
|
|
30
33
|
useTimeRange: function() {
|
|
31
34
|
return useTimeRange;
|
|
32
35
|
},
|
|
33
|
-
|
|
34
|
-
return
|
|
36
|
+
useTimeRangeContext: function() {
|
|
37
|
+
return useTimeRangeContext;
|
|
35
38
|
}
|
|
36
39
|
});
|
|
37
40
|
const _jsxruntime = require("react/jsx-runtime");
|
|
@@ -59,7 +62,9 @@ function _interop_require_wildcard(obj, nodeInterop) {
|
|
|
59
62
|
if (cache && cache.has(obj)) {
|
|
60
63
|
return cache.get(obj);
|
|
61
64
|
}
|
|
62
|
-
var newObj = {
|
|
65
|
+
var newObj = {
|
|
66
|
+
__proto__: null
|
|
67
|
+
};
|
|
63
68
|
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
64
69
|
for(var key in obj){
|
|
65
70
|
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
@@ -88,18 +93,24 @@ function useTimeRangeContext() {
|
|
|
88
93
|
function useTimeRange() {
|
|
89
94
|
return useTimeRangeContext();
|
|
90
95
|
}
|
|
96
|
+
function useSuggestedStepMs(width) {
|
|
97
|
+
const { absoluteTimeRange } = useTimeRange();
|
|
98
|
+
if (width === undefined) return 0;
|
|
99
|
+
return (0, _core.getSuggestedStepMs)(absoluteTimeRange, width);
|
|
100
|
+
}
|
|
91
101
|
function TimeRangeProvider(props) {
|
|
92
|
-
const { timeRange
|
|
102
|
+
const { timeRange, refreshInterval, children, setTimeRange, setRefreshInterval } = props;
|
|
93
103
|
const [localTimeRange, setLocalTimeRange] = (0, _react.useState)(timeRange);
|
|
94
|
-
const [localRefreshInterval,
|
|
104
|
+
const [localRefreshInterval, setLocalRefreshInterval] = (0, _react.useState)(refreshInterval);
|
|
95
105
|
const [refreshCounter, setRefreshCounter] = (0, _react.useState)(0);
|
|
96
106
|
(0, _react.useEffect)(()=>{
|
|
97
107
|
setLocalTimeRange(timeRange);
|
|
98
108
|
}, [
|
|
99
|
-
timeRange
|
|
109
|
+
timeRange,
|
|
110
|
+
refreshCounter
|
|
100
111
|
]);
|
|
101
112
|
(0, _react.useEffect)(()=>{
|
|
102
|
-
|
|
113
|
+
setLocalRefreshInterval(refreshInterval);
|
|
103
114
|
}, [
|
|
104
115
|
refreshInterval
|
|
105
116
|
]);
|
|
@@ -118,7 +129,7 @@ function TimeRangeProvider(props) {
|
|
|
118
129
|
refreshKey: `${absoluteTimeRange.start}:${absoluteTimeRange.end}:${localRefreshInterval}:${refreshCounter}`,
|
|
119
130
|
refreshInterval: localRefreshInterval,
|
|
120
131
|
refreshIntervalInMs: (0, _refreshinterval.getRefreshIntervalInMs)(localRefreshInterval),
|
|
121
|
-
setRefreshInterval: setRefreshInterval !== null && setRefreshInterval !== void 0 ? setRefreshInterval :
|
|
132
|
+
setRefreshInterval: setRefreshInterval !== null && setRefreshInterval !== void 0 ? setRefreshInterval : setLocalRefreshInterval
|
|
122
133
|
};
|
|
123
134
|
}, [
|
|
124
135
|
localTimeRange,
|