@perses-dev/plugin-system 0.55.0-beta.2 → 0.55.0-beta.6
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/components/Annotations/AnnotationEditorForm/AnnotationEditorForm.d.ts +3 -3
- package/dist/components/Annotations/AnnotationEditorForm/AnnotationEditorForm.d.ts.map +1 -1
- package/dist/components/Annotations/AnnotationEditorForm/AnnotationEditorForm.js +11 -11
- package/dist/components/Annotations/AnnotationEditorForm/AnnotationEditorForm.js.map +1 -1
- package/dist/components/Annotations/AnnotationEditorForm/AnnotationPreview.d.ts +3 -3
- package/dist/components/Annotations/AnnotationEditorForm/AnnotationPreview.d.ts.map +1 -1
- package/dist/components/Annotations/AnnotationEditorForm/AnnotationPreview.js +6 -6
- package/dist/components/Annotations/AnnotationEditorForm/AnnotationPreview.js.map +1 -1
- package/dist/components/Annotations/AnnotationEditorForm/index.js +1 -1
- package/dist/components/Annotations/AnnotationEditorForm/index.js.map +1 -1
- package/dist/components/Annotations/index.js +2 -2
- package/dist/components/Annotations/index.js.map +1 -1
- package/dist/components/CalculationSelector/CalculationSelector.d.ts +2 -2
- package/dist/components/CalculationSelector/CalculationSelector.d.ts.map +1 -1
- package/dist/components/CalculationSelector/CalculationSelector.js +2 -2
- package/dist/components/CalculationSelector/CalculationSelector.js.map +1 -1
- package/dist/components/CalculationSelector/index.js +1 -1
- package/dist/components/CalculationSelector/index.js.map +1 -1
- package/dist/components/DatasourceEditorForm/DatasourceEditorForm.d.ts +3 -2
- package/dist/components/DatasourceEditorForm/DatasourceEditorForm.d.ts.map +1 -1
- package/dist/components/DatasourceEditorForm/DatasourceEditorForm.js +10 -9
- package/dist/components/DatasourceEditorForm/DatasourceEditorForm.js.map +1 -1
- package/dist/components/DatasourceEditorForm/index.js +1 -1
- package/dist/components/DatasourceEditorForm/index.js.map +1 -1
- package/dist/components/DatasourceSelect/DatasourceSelect.d.ts +4 -4
- package/dist/components/DatasourceSelect/DatasourceSelect.d.ts.map +1 -1
- package/dist/components/DatasourceSelect/DatasourceSelect.js +7 -7
- package/dist/components/DatasourceSelect/DatasourceSelect.js.map +1 -1
- package/dist/components/DatasourceSelect/index.js +1 -1
- package/dist/components/DatasourceSelect/index.js.map +1 -1
- package/dist/components/DatasourceTestConnectionButton/DatasourceTestConnectionButton.d.ts +8 -0
- package/dist/components/DatasourceTestConnectionButton/DatasourceTestConnectionButton.d.ts.map +1 -0
- package/dist/components/DatasourceTestConnectionButton/DatasourceTestConnectionButton.js +45 -0
- package/dist/components/DatasourceTestConnectionButton/DatasourceTestConnectionButton.js.map +1 -0
- package/dist/components/DatasourceTestConnectionButton/index.d.ts +2 -0
- package/dist/components/DatasourceTestConnectionButton/index.d.ts.map +1 -0
- package/dist/{cjs/model/alerts-queries.js → components/DatasourceTestConnectionButton/index.js} +3 -4
- package/dist/components/DatasourceTestConnectionButton/index.js.map +1 -0
- package/dist/components/HTTPSettingsEditor/HTTPSettingsEditor.d.ts +3 -2
- package/dist/components/HTTPSettingsEditor/HTTPSettingsEditor.d.ts.map +1 -1
- package/dist/components/HTTPSettingsEditor/HTTPSettingsEditor.js +54 -29
- package/dist/components/HTTPSettingsEditor/HTTPSettingsEditor.js.map +1 -1
- package/dist/components/HTTPSettingsEditor/index.js +1 -1
- package/dist/components/HTTPSettingsEditor/index.js.map +1 -1
- package/dist/components/ItemSelectionActionsOptionsEditor/ItemSelectionActionsOptionsEditor.d.ts +1 -1
- package/dist/components/ItemSelectionActionsOptionsEditor/ItemSelectionActionsOptionsEditor.d.ts.map +1 -1
- package/dist/components/ItemSelectionActionsOptionsEditor/ItemSelectionActionsOptionsEditor.js +24 -24
- package/dist/components/ItemSelectionActionsOptionsEditor/ItemSelectionActionsOptionsEditor.js.map +1 -1
- package/dist/components/ItemSelectionActionsOptionsEditor/index.js +1 -1
- package/dist/components/ItemSelectionActionsOptionsEditor/index.js.map +1 -1
- package/dist/components/LayoutEditor/LayoutEditor.d.ts +16 -0
- package/dist/components/LayoutEditor/LayoutEditor.d.ts.map +1 -0
- package/dist/components/LayoutEditor/LayoutEditor.js +115 -0
- package/dist/components/LayoutEditor/LayoutEditor.js.map +1 -0
- package/dist/components/LayoutEditor/RepeatLayoutPreview.d.ts +7 -0
- package/dist/components/LayoutEditor/RepeatLayoutPreview.d.ts.map +1 -0
- package/dist/components/LayoutEditor/RepeatLayoutPreview.js +92 -0
- package/dist/components/LayoutEditor/RepeatLayoutPreview.js.map +1 -0
- package/dist/components/LayoutEditor/RepeatVariableEditor.d.ts +18 -0
- package/dist/components/LayoutEditor/RepeatVariableEditor.d.ts.map +1 -0
- package/dist/components/LayoutEditor/RepeatVariableEditor.js +168 -0
- package/dist/components/LayoutEditor/RepeatVariableEditor.js.map +1 -0
- package/dist/components/LayoutEditor/index.d.ts +4 -0
- package/dist/components/LayoutEditor/index.d.ts.map +1 -0
- package/dist/{cjs/model/explore.js → components/LayoutEditor/index.js} +5 -4
- package/dist/components/LayoutEditor/index.js.map +1 -0
- package/dist/components/LegendOptionsEditor/LegendOptionsEditor.d.ts +2 -2
- package/dist/components/LegendOptionsEditor/LegendOptionsEditor.d.ts.map +1 -1
- package/dist/components/LegendOptionsEditor/LegendOptionsEditor.js +5 -5
- package/dist/components/LegendOptionsEditor/LegendOptionsEditor.js.map +1 -1
- package/dist/components/LegendOptionsEditor/index.js +1 -1
- package/dist/components/LegendOptionsEditor/index.js.map +1 -1
- package/dist/components/LinksEditor/LinksEditor.d.ts +3 -3
- package/dist/components/LinksEditor/LinksEditor.d.ts.map +1 -1
- package/dist/components/LinksEditor/LinksEditor.js +6 -6
- package/dist/components/LinksEditor/LinksEditor.js.map +1 -1
- package/dist/components/LinksEditor/index.js +1 -1
- package/dist/components/LinksEditor/index.js.map +1 -1
- package/dist/components/MetricLabelInput/MetricLabelInput.d.ts +1 -1
- package/dist/components/MetricLabelInput/MetricLabelInput.d.ts.map +1 -1
- package/dist/components/MetricLabelInput/MetricLabelInput.js +2 -2
- package/dist/components/MetricLabelInput/MetricLabelInput.js.map +1 -1
- package/dist/components/MetricLabelInput/index.js +1 -1
- package/dist/components/MetricLabelInput/index.js.map +1 -1
- package/dist/components/MultiQueryEditor/MultiQueryEditor.d.ts +3 -4
- package/dist/components/MultiQueryEditor/MultiQueryEditor.d.ts.map +1 -1
- package/dist/components/MultiQueryEditor/MultiQueryEditor.js +12 -9
- package/dist/components/MultiQueryEditor/MultiQueryEditor.js.map +1 -1
- package/dist/components/MultiQueryEditor/QueryEditorContainer.d.ts +3 -4
- package/dist/components/MultiQueryEditor/QueryEditorContainer.d.ts.map +1 -1
- package/dist/components/MultiQueryEditor/QueryEditorContainer.js +14 -14
- package/dist/components/MultiQueryEditor/QueryEditorContainer.js.map +1 -1
- package/dist/components/MultiQueryEditor/index.js +2 -2
- package/dist/components/MultiQueryEditor/index.js.map +1 -1
- package/dist/components/MultiQueryEditor/utils.d.ts +1 -1
- package/dist/components/MultiQueryEditor/utils.d.ts.map +1 -1
- package/dist/components/MultiQueryEditor/utils.js.map +1 -1
- package/dist/components/OptionsEditorRadios/OptionsEditorRadios.d.ts +1 -1
- package/dist/components/OptionsEditorRadios/OptionsEditorRadios.d.ts.map +1 -1
- package/dist/components/OptionsEditorRadios/OptionsEditorRadios.js +4 -4
- package/dist/components/OptionsEditorRadios/OptionsEditorRadios.js.map +1 -1
- package/dist/components/OptionsEditorRadios/index.js +1 -1
- package/dist/components/OptionsEditorRadios/index.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/OptionsEditorTabPanel/index.js +1 -1
- package/dist/components/OptionsEditorTabPanel/index.js.map +1 -1
- package/dist/components/OptionsEditorTabs/OptionsEditorTabs.d.ts +1 -1
- package/dist/components/OptionsEditorTabs/OptionsEditorTabs.d.ts.map +1 -1
- package/dist/components/OptionsEditorTabs/OptionsEditorTabs.js +4 -4
- package/dist/components/OptionsEditorTabs/OptionsEditorTabs.js.map +1 -1
- package/dist/components/OptionsEditorTabs/index.js +1 -1
- package/dist/components/OptionsEditorTabs/index.js.map +1 -1
- package/dist/components/PanelSpecEditor/PanelAnnotationsEditor.d.ts +2 -2
- package/dist/components/PanelSpecEditor/PanelAnnotationsEditor.d.ts.map +1 -1
- package/dist/components/PanelSpecEditor/PanelAnnotationsEditor.js +9 -9
- package/dist/components/PanelSpecEditor/PanelAnnotationsEditor.js.map +1 -1
- package/dist/components/PanelSpecEditor/PanelSpecEditor.d.ts +7 -5
- package/dist/components/PanelSpecEditor/PanelSpecEditor.d.ts.map +1 -1
- package/dist/components/PanelSpecEditor/PanelSpecEditor.js +19 -10
- package/dist/components/PanelSpecEditor/PanelSpecEditor.js.map +1 -1
- package/dist/components/PanelSpecEditor/index.js +1 -1
- package/dist/components/PanelSpecEditor/index.js.map +1 -1
- package/dist/components/PluginEditor/PluginEditor.d.ts +2 -2
- package/dist/components/PluginEditor/PluginEditor.d.ts.map +1 -1
- package/dist/components/PluginEditor/PluginEditor.js +10 -9
- package/dist/components/PluginEditor/PluginEditor.js.map +1 -1
- package/dist/components/PluginEditor/index.js +2 -2
- package/dist/components/PluginEditor/index.js.map +1 -1
- package/dist/components/PluginEditor/plugin-editor-api.d.ts +4 -3
- package/dist/components/PluginEditor/plugin-editor-api.d.ts.map +1 -1
- package/dist/components/PluginEditor/plugin-editor-api.js +4 -4
- package/dist/components/PluginEditor/plugin-editor-api.js.map +1 -1
- package/dist/components/PluginKindSelect/PluginKindSelect.d.ts +3 -4
- package/dist/components/PluginKindSelect/PluginKindSelect.d.ts.map +1 -1
- package/dist/components/PluginKindSelect/PluginKindSelect.js +4 -4
- package/dist/components/PluginKindSelect/PluginKindSelect.js.map +1 -1
- package/dist/components/PluginKindSelect/index.js +1 -1
- package/dist/components/PluginKindSelect/index.js.map +1 -1
- package/dist/components/PluginRegistry/PluginRegistry.d.ts +2 -2
- package/dist/components/PluginRegistry/PluginRegistry.d.ts.map +1 -1
- package/dist/components/PluginRegistry/PluginRegistry.js +5 -5
- package/dist/components/PluginRegistry/PluginRegistry.js.map +1 -1
- package/dist/components/PluginRegistry/getPluginSearchHelper.d.ts +2 -2
- package/dist/components/PluginRegistry/getPluginSearchHelper.d.ts.map +1 -1
- package/dist/components/PluginRegistry/getPluginSearchHelper.js +2 -2
- package/dist/components/PluginRegistry/getPluginSearchHelper.js.map +1 -1
- package/dist/components/PluginRegistry/index.js +1 -1
- package/dist/components/PluginRegistry/index.js.map +1 -1
- package/dist/components/PluginRegistry/plugin-indexes.d.ts +2 -1
- package/dist/components/PluginRegistry/plugin-indexes.d.ts.map +1 -1
- package/dist/components/PluginRegistry/plugin-indexes.js +3 -3
- package/dist/components/PluginRegistry/plugin-indexes.js.map +1 -1
- package/dist/components/PluginSpecEditor/DatasourceSpecEditor.d.ts +10 -0
- package/dist/components/PluginSpecEditor/DatasourceSpecEditor.d.ts.map +1 -0
- package/dist/components/PluginSpecEditor/DatasourceSpecEditor.js +62 -0
- package/dist/components/PluginSpecEditor/DatasourceSpecEditor.js.map +1 -0
- package/dist/components/PluginSpecEditor/PluginSpecEditor.d.ts +5 -4
- package/dist/components/PluginSpecEditor/PluginSpecEditor.d.ts.map +1 -1
- package/dist/components/PluginSpecEditor/PluginSpecEditor.js +19 -5
- package/dist/components/PluginSpecEditor/PluginSpecEditor.js.map +1 -1
- package/dist/components/PluginSpecEditor/index.js +1 -1
- package/dist/components/PluginSpecEditor/index.js.map +1 -1
- package/dist/components/SelectionOptionsEditor/SelectionOptionsEditor.d.ts +1 -1
- package/dist/components/SelectionOptionsEditor/SelectionOptionsEditor.d.ts.map +1 -1
- package/dist/components/SelectionOptionsEditor/SelectionOptionsEditor.js +3 -3
- package/dist/components/SelectionOptionsEditor/SelectionOptionsEditor.js.map +1 -1
- package/dist/components/SelectionOptionsEditor/index.js +1 -1
- package/dist/components/SelectionOptionsEditor/index.js.map +1 -1
- package/dist/components/TimeRangeControls/TimeRangeControls.d.ts +2 -2
- package/dist/components/TimeRangeControls/TimeRangeControls.d.ts.map +1 -1
- package/dist/components/TimeRangeControls/TimeRangeControls.js +13 -14
- package/dist/components/TimeRangeControls/TimeRangeControls.js.map +1 -1
- package/dist/components/TimeRangeControls/index.js +1 -1
- package/dist/components/TimeRangeControls/index.js.map +1 -1
- package/dist/components/Variables/VariableEditorForm/VariableEditorForm.d.ts +3 -3
- package/dist/components/Variables/VariableEditorForm/VariableEditorForm.d.ts.map +1 -1
- package/dist/components/Variables/VariableEditorForm/VariableEditorForm.js +11 -11
- package/dist/components/Variables/VariableEditorForm/VariableEditorForm.js.map +1 -1
- package/dist/components/Variables/VariableEditorForm/VariablePreview.d.ts +2 -2
- package/dist/components/Variables/VariableEditorForm/VariablePreview.d.ts.map +1 -1
- package/dist/components/Variables/VariableEditorForm/VariablePreview.js +7 -7
- package/dist/components/Variables/VariableEditorForm/VariablePreview.js.map +1 -1
- package/dist/components/Variables/VariableEditorForm/index.js +3 -3
- package/dist/components/Variables/VariableEditorForm/index.js.map +1 -1
- package/dist/components/Variables/VariableEditorForm/variable-editor-form-model.d.ts +2 -2
- package/dist/components/Variables/VariableEditorForm/variable-editor-form-model.d.ts.map +1 -1
- package/dist/components/Variables/VariableEditorForm/variable-editor-form-model.js.map +1 -1
- package/dist/components/Variables/index.js +2 -2
- package/dist/components/Variables/index.js.map +1 -1
- package/dist/components/Variables/variable-model.d.ts +4 -4
- package/dist/components/Variables/variable-model.d.ts.map +1 -1
- package/dist/components/Variables/variable-model.js +3 -3
- package/dist/components/Variables/variable-model.js.map +1 -1
- package/dist/components/index.d.ts +2 -0
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/index.js +21 -19
- package/dist/components/index.js.map +1 -1
- package/dist/constants/index.d.ts +1 -0
- package/dist/constants/index.d.ts.map +1 -1
- package/dist/constants/index.js +2 -1
- package/dist/constants/index.js.map +1 -1
- package/dist/constants/repeat.d.ts +3 -0
- package/dist/constants/repeat.d.ts.map +1 -0
- package/dist/{cjs/model/datasource.js → constants/repeat.js} +4 -4
- package/dist/constants/repeat.js.map +1 -0
- package/dist/context/ValidationProvider.d.ts +5 -5
- package/dist/context/ValidationProvider.d.ts.map +1 -1
- package/dist/context/ValidationProvider.js +5 -5
- package/dist/context/ValidationProvider.js.map +1 -1
- package/dist/context/index.js +1 -1
- package/dist/context/index.js.map +1 -1
- package/dist/index.js +9 -9
- package/dist/index.js.map +1 -1
- package/dist/model/alerts-queries.d.ts +4 -4
- package/dist/model/alerts-queries.d.ts.map +1 -1
- package/dist/model/alerts-queries.js.map +1 -1
- package/dist/model/annotations.d.ts +3 -3
- package/dist/model/annotations.d.ts.map +1 -1
- package/dist/model/annotations.js.map +1 -1
- package/dist/model/calculations.d.ts +1 -1
- package/dist/model/calculations.d.ts.map +1 -1
- package/dist/model/calculations.js.map +1 -1
- package/dist/model/datasource.d.ts +10 -3
- package/dist/model/datasource.d.ts.map +1 -1
- package/dist/model/datasource.js +1 -1
- package/dist/model/datasource.js.map +1 -1
- package/dist/model/explore.d.ts +2 -3
- package/dist/model/explore.d.ts.map +1 -1
- package/dist/model/explore.js.map +1 -1
- package/dist/model/index.d.ts +1 -0
- package/dist/model/index.d.ts.map +1 -1
- package/dist/model/index.js +17 -16
- package/dist/model/index.js.map +1 -1
- package/dist/model/json-queries.d.ts +29 -0
- package/dist/model/json-queries.d.ts.map +1 -0
- package/dist/{cjs/model/annotations.js → model/json-queries.js} +5 -4
- package/dist/model/json-queries.js.map +1 -0
- package/dist/model/legend.d.ts +2 -2
- package/dist/model/legend.d.ts.map +1 -1
- package/dist/model/legend.js +2 -2
- package/dist/model/legend.js.map +1 -1
- package/dist/model/log-queries.d.ts +3 -3
- package/dist/model/log-queries.d.ts.map +1 -1
- package/dist/model/log-queries.js.map +1 -1
- package/dist/model/panels.d.ts +13 -4
- package/dist/model/panels.d.ts.map +1 -1
- package/dist/model/panels.js.map +1 -1
- package/dist/model/plugin-base.d.ts +3 -3
- package/dist/model/plugin-base.d.ts.map +1 -1
- package/dist/model/plugin-base.js.map +1 -1
- package/dist/model/plugin-loading.d.ts +1 -1
- package/dist/model/plugin-loading.d.ts.map +1 -1
- package/dist/model/plugin-loading.js +1 -1
- package/dist/model/plugin-loading.js.map +1 -1
- package/dist/model/plugins.d.ts +15 -13
- package/dist/model/plugins.d.ts.map +1 -1
- package/dist/model/plugins.js.map +1 -1
- package/dist/model/profile-queries.d.ts +4 -4
- package/dist/model/profile-queries.d.ts.map +1 -1
- package/dist/model/profile-queries.js.map +1 -1
- package/dist/model/silences-queries.d.ts +4 -4
- package/dist/model/silences-queries.d.ts.map +1 -1
- package/dist/model/silences-queries.js.map +1 -1
- package/dist/model/time-series-queries.d.ts +4 -4
- 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 +4 -4
- 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 +7 -3
- package/dist/model/variables.d.ts.map +1 -1
- package/dist/model/variables.js +1 -3
- package/dist/model/variables.js.map +1 -1
- package/dist/remote/PluginLoaderComponent.d.ts +1 -2
- package/dist/remote/PluginLoaderComponent.d.ts.map +1 -1
- package/dist/remote/PluginLoaderComponent.js +2 -2
- package/dist/remote/PluginLoaderComponent.js.map +1 -1
- package/dist/remote/PluginRuntime.d.ts +2 -2
- package/dist/remote/PluginRuntime.d.ts.map +1 -1
- package/dist/remote/PluginRuntime.js +18 -26
- package/dist/remote/PluginRuntime.js.map +1 -1
- package/dist/remote/index.js +2 -2
- package/dist/remote/index.js.map +1 -1
- package/dist/remote/remotePluginLoader.d.ts +2 -2
- package/dist/remote/remotePluginLoader.d.ts.map +1 -1
- package/dist/remote/remotePluginLoader.js +3 -3
- package/dist/remote/remotePluginLoader.js.map +1 -1
- package/dist/runtime/DataQueriesProvider/DataQueriesProvider.d.ts +3 -3
- package/dist/runtime/DataQueriesProvider/DataQueriesProvider.d.ts.map +1 -1
- package/dist/runtime/DataQueriesProvider/DataQueriesProvider.js +20 -12
- package/dist/runtime/DataQueriesProvider/DataQueriesProvider.js.map +1 -1
- package/dist/runtime/DataQueriesProvider/index.js +2 -2
- package/dist/runtime/DataQueriesProvider/index.js.map +1 -1
- package/dist/runtime/DataQueriesProvider/model.d.ts +3 -3
- package/dist/runtime/DataQueriesProvider/model.d.ts.map +1 -1
- package/dist/runtime/DataQueriesProvider/model.js.map +1 -1
- package/dist/runtime/RouterProvider.d.ts +2 -1
- package/dist/runtime/RouterProvider.d.ts.map +1 -1
- package/dist/runtime/RouterProvider.js +3 -3
- package/dist/runtime/RouterProvider.js.map +1 -1
- package/dist/runtime/TimeRangeProvider/TimeRangeProvider.d.ts +3 -2
- package/dist/runtime/TimeRangeProvider/TimeRangeProvider.d.ts.map +1 -1
- package/dist/runtime/TimeRangeProvider/TimeRangeProvider.js +22 -8
- package/dist/runtime/TimeRangeProvider/TimeRangeProvider.js.map +1 -1
- package/dist/runtime/TimeRangeProvider/TimeRangeProviders.d.ts +3 -2
- package/dist/runtime/TimeRangeProvider/TimeRangeProviders.d.ts.map +1 -1
- package/dist/runtime/TimeRangeProvider/TimeRangeProviders.js +5 -5
- package/dist/runtime/TimeRangeProvider/TimeRangeProviders.js.map +1 -1
- package/dist/runtime/TimeRangeProvider/TimeRangeSettingsProvider.d.ts +9 -2
- package/dist/runtime/TimeRangeProvider/TimeRangeSettingsProvider.d.ts.map +1 -1
- package/dist/runtime/TimeRangeProvider/TimeRangeSettingsProvider.js +16 -3
- package/dist/runtime/TimeRangeProvider/TimeRangeSettingsProvider.js.map +1 -1
- package/dist/runtime/TimeRangeProvider/index.js +4 -4
- package/dist/runtime/TimeRangeProvider/index.js.map +1 -1
- package/dist/runtime/TimeRangeProvider/query-params.d.ts +3 -3
- 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/TimeRangeProvider/refresh-interval.d.ts +1 -1
- package/dist/runtime/TimeRangeProvider/refresh-interval.d.ts.map +1 -1
- package/dist/runtime/TimeRangeProvider/refresh-interval.js +2 -2
- package/dist/runtime/TimeRangeProvider/refresh-interval.js.map +1 -1
- package/dist/runtime/UsageMetricsProvider.d.ts +3 -3
- package/dist/runtime/UsageMetricsProvider.d.ts.map +1 -1
- package/dist/runtime/UsageMetricsProvider.js +3 -3
- package/dist/runtime/UsageMetricsProvider.js.map +1 -1
- package/dist/runtime/alerts-queries.d.ts +2 -2
- package/dist/runtime/alerts-queries.d.ts.map +1 -1
- package/dist/runtime/alerts-queries.js +5 -5
- package/dist/runtime/alerts-queries.js.map +1 -1
- package/dist/runtime/annotations.d.ts +2 -2
- package/dist/runtime/annotations.d.ts.map +1 -1
- package/dist/runtime/annotations.js +6 -6
- package/dist/runtime/annotations.js.map +1 -1
- package/dist/runtime/builtin-variables.d.ts +2 -3
- package/dist/runtime/builtin-variables.d.ts.map +1 -1
- package/dist/runtime/builtin-variables.js +1 -1
- package/dist/runtime/builtin-variables.js.map +1 -1
- package/dist/runtime/datasources.d.ts +2 -3
- package/dist/runtime/datasources.d.ts.map +1 -1
- package/dist/runtime/datasources.js +2 -2
- package/dist/runtime/datasources.js.map +1 -1
- package/dist/runtime/index.d.ts +1 -0
- package/dist/runtime/index.d.ts.map +1 -1
- package/dist/runtime/index.js +16 -15
- package/dist/runtime/index.js.map +1 -1
- package/dist/runtime/item-actions.d.ts +3 -3
- package/dist/runtime/item-actions.d.ts.map +1 -1
- package/dist/runtime/item-actions.js +2 -2
- package/dist/runtime/item-actions.js.map +1 -1
- package/dist/runtime/json-queries.d.ts +11 -0
- package/dist/runtime/json-queries.d.ts.map +1 -0
- package/dist/runtime/json-queries.js +58 -0
- package/dist/runtime/json-queries.js.map +1 -0
- package/dist/runtime/log-queries.d.ts +3 -3
- package/dist/runtime/log-queries.d.ts.map +1 -1
- package/dist/runtime/log-queries.js +5 -5
- package/dist/runtime/log-queries.js.map +1 -1
- package/dist/runtime/plugin-registry.d.ts +3 -4
- package/dist/runtime/plugin-registry.d.ts.map +1 -1
- package/dist/runtime/plugin-registry.js +2 -2
- package/dist/runtime/plugin-registry.js.map +1 -1
- package/dist/runtime/profile-queries.d.ts +2 -2
- package/dist/runtime/profile-queries.d.ts.map +1 -1
- package/dist/runtime/profile-queries.js +4 -4
- package/dist/runtime/profile-queries.js.map +1 -1
- package/dist/runtime/silences-queries.d.ts +2 -2
- package/dist/runtime/silences-queries.d.ts.map +1 -1
- package/dist/runtime/silences-queries.js +5 -5
- package/dist/runtime/silences-queries.js.map +1 -1
- package/dist/runtime/time-series-queries.d.ts +3 -3
- package/dist/runtime/time-series-queries.d.ts.map +1 -1
- package/dist/runtime/time-series-queries.js +6 -6
- package/dist/runtime/time-series-queries.js.map +1 -1
- package/dist/runtime/trace-queries.d.ts +2 -2
- package/dist/runtime/trace-queries.d.ts.map +1 -1
- package/dist/runtime/trace-queries.js +6 -6
- package/dist/runtime/trace-queries.js.map +1 -1
- package/dist/runtime/utils.d.ts +1 -1
- package/dist/runtime/utils.d.ts.map +1 -1
- package/dist/runtime/utils.js.map +1 -1
- package/dist/runtime/variables.d.ts +1 -2
- package/dist/runtime/variables.d.ts.map +1 -1
- package/dist/runtime/variables.js +4 -4
- package/dist/runtime/variables.js.map +1 -1
- package/dist/schema/index.js +1 -1
- package/dist/schema/index.js.map +1 -1
- package/dist/schema/panel.d.ts +2 -2
- package/dist/schema/panel.d.ts.map +1 -1
- package/dist/schema/panel.js +18 -4
- package/dist/schema/panel.js.map +1 -1
- package/dist/test/index.js +2 -2
- package/dist/test/index.js.map +1 -1
- package/dist/test/mock-data.d.ts +2 -1
- package/dist/test/mock-data.d.ts.map +1 -1
- package/dist/test/mock-data.js +6 -0
- package/dist/test/mock-data.js.map +1 -1
- package/dist/test/render-hook.d.ts +2 -2
- package/dist/test/render-hook.d.ts.map +1 -1
- package/dist/test/render-hook.js +2 -2
- package/dist/test/render-hook.js.map +1 -1
- package/dist/test/render.d.ts +3 -3
- package/dist/test/render.d.ts.map +1 -1
- package/dist/test/render.js +3 -3
- package/dist/test/render.js.map +1 -1
- package/dist/test/setup-tests.d.ts +1 -1
- package/dist/test/setup-tests.d.ts.map +1 -1
- package/dist/test/setup-tests.js +3 -2
- package/dist/test/setup-tests.js.map +1 -1
- package/dist/test/test-plugins/bert/index.d.ts +3 -3
- package/dist/test/test-plugins/bert/index.d.ts.map +1 -1
- package/dist/test/test-plugins/bert/index.js.map +1 -1
- package/dist/test/test-plugins/ernie/index.d.ts +7 -1
- package/dist/test/test-plugins/ernie/index.d.ts.map +1 -1
- package/dist/test/test-plugins/ernie/index.js +58 -1
- package/dist/test/test-plugins/ernie/index.js.map +1 -1
- package/dist/test/test-plugins/index.d.ts +1 -1
- package/dist/test/test-plugins/index.d.ts.map +1 -1
- package/dist/test/test-plugins/index.js +5 -5
- package/dist/test/test-plugins/index.js.map +1 -1
- package/dist/test/utils.d.ts +2 -2
- package/dist/test/utils.d.ts.map +1 -1
- package/dist/test/utils.js +5 -5
- package/dist/test/utils.js.map +1 -1
- package/dist/test-utils/index.js +1 -1
- package/dist/test-utils/index.js.map +1 -1
- package/dist/test-utils/mock-plugin-registry.d.ts +2 -2
- 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/csv-export.d.ts.map +1 -1
- package/dist/utils/csv-export.js +1 -1
- package/dist/utils/csv-export.js.map +1 -1
- package/dist/utils/event.js +1 -1
- package/dist/utils/index.js +3 -3
- package/dist/utils/index.js.map +1 -1
- package/dist/utils/variables.js +1 -1
- package/package.json +11 -11
- package/dist/cjs/components/Annotations/AnnotationEditorForm/AnnotationEditorForm.js +0 -283
- package/dist/cjs/components/Annotations/AnnotationEditorForm/AnnotationPreview.js +0 -197
- package/dist/cjs/components/Annotations/AnnotationEditorForm/index.js +0 -30
- package/dist/cjs/components/Annotations/constants.js +0 -23
- package/dist/cjs/components/Annotations/index.js +0 -31
- package/dist/cjs/components/CalculationSelector/CalculationSelector.js +0 -49
- package/dist/cjs/components/CalculationSelector/index.js +0 -30
- package/dist/cjs/components/DatasourceEditorForm/DatasourceEditorForm.js +0 -270
- package/dist/cjs/components/DatasourceEditorForm/index.js +0 -30
- package/dist/cjs/components/DatasourceSelect/DatasourceSelect.js +0 -266
- package/dist/cjs/components/DatasourceSelect/index.js +0 -30
- package/dist/cjs/components/HTTPSettingsEditor/HTTPSettingsEditor.js +0 -568
- package/dist/cjs/components/HTTPSettingsEditor/index.js +0 -30
- package/dist/cjs/components/ItemSelectionActionsOptionsEditor/ItemSelectionActionsOptionsEditor.js +0 -1175
- package/dist/cjs/components/ItemSelectionActionsOptionsEditor/index.js +0 -30
- package/dist/cjs/components/LegendOptionsEditor/LegendOptionsEditor.js +0 -211
- package/dist/cjs/components/LegendOptionsEditor/index.js +0 -30
- package/dist/cjs/components/LinksEditor/LinksEditor.js +0 -162
- package/dist/cjs/components/LinksEditor/index.js +0 -30
- package/dist/cjs/components/MetricLabelInput/MetricLabelInput.js +0 -41
- package/dist/cjs/components/MetricLabelInput/index.js +0 -30
- package/dist/cjs/components/MultiQueryEditor/MultiQueryEditor.js +0 -159
- package/dist/cjs/components/MultiQueryEditor/QueryEditorContainer.js +0 -250
- package/dist/cjs/components/MultiQueryEditor/index.js +0 -31
- package/dist/cjs/components/MultiQueryEditor/utils.js +0 -36
- package/dist/cjs/components/OptionsEditorRadios/OptionsEditorRadios.js +0 -69
- package/dist/cjs/components/OptionsEditorRadios/index.js +0 -30
- package/dist/cjs/components/OptionsEditorTabPanel/OptionsEditorTabPanel.js +0 -39
- package/dist/cjs/components/OptionsEditorTabPanel/index.js +0 -30
- package/dist/cjs/components/OptionsEditorTabs/OptionsEditorTabs.js +0 -61
- package/dist/cjs/components/OptionsEditorTabs/index.js +0 -30
- package/dist/cjs/components/PanelSpecEditor/PanelAnnotationsEditor.js +0 -246
- package/dist/cjs/components/PanelSpecEditor/PanelSpecEditor.js +0 -135
- package/dist/cjs/components/PanelSpecEditor/index.js +0 -30
- package/dist/cjs/components/PluginEditor/PluginEditor.js +0 -98
- package/dist/cjs/components/PluginEditor/index.js +0 -31
- package/dist/cjs/components/PluginEditor/plugin-editor-api.js +0 -136
- package/dist/cjs/components/PluginKindSelect/PluginKindSelect.js +0 -109
- package/dist/cjs/components/PluginKindSelect/index.js +0 -30
- package/dist/cjs/components/PluginRegistry/PluginRegistry.js +0 -86
- package/dist/cjs/components/PluginRegistry/getPluginSearchHelper.js +0 -92
- package/dist/cjs/components/PluginRegistry/index.js +0 -30
- package/dist/cjs/components/PluginRegistry/plugin-indexes.js +0 -88
- package/dist/cjs/components/PluginSpecEditor/PluginSpecEditor.js +0 -55
- package/dist/cjs/components/PluginSpecEditor/index.js +0 -30
- package/dist/cjs/components/SelectionOptionsEditor/SelectionOptionsEditor.js +0 -43
- package/dist/cjs/components/SelectionOptionsEditor/index.js +0 -30
- package/dist/cjs/components/TimeRangeControls/TimeRangeControls.js +0 -236
- package/dist/cjs/components/TimeRangeControls/index.js +0 -30
- package/dist/cjs/components/Variables/VariableEditorForm/VariableEditorForm.js +0 -613
- package/dist/cjs/components/Variables/VariableEditorForm/VariablePreview.js +0 -193
- package/dist/cjs/components/Variables/VariableEditorForm/index.js +0 -32
- package/dist/cjs/components/Variables/VariableEditorForm/variable-editor-form-model.js +0 -143
- package/dist/cjs/components/Variables/index.js +0 -31
- package/dist/cjs/components/Variables/variable-model.js +0 -211
- package/dist/cjs/components/index.js +0 -48
- package/dist/cjs/constants/index.js +0 -30
- package/dist/cjs/constants/user-interface-text.js +0 -32
- package/dist/cjs/context/ValidationProvider.js +0 -77
- package/dist/cjs/context/index.js +0 -30
- package/dist/cjs/index.js +0 -38
- package/dist/cjs/model/calculations.js +0 -178
- package/dist/cjs/model/index.js +0 -45
- package/dist/cjs/model/legend.js +0 -111
- package/dist/cjs/model/log-queries.js +0 -16
- package/dist/cjs/model/log-volume-utils.js +0 -124
- package/dist/cjs/model/panels.js +0 -16
- package/dist/cjs/model/plugin-base.js +0 -16
- package/dist/cjs/model/plugin-loading.js +0 -56
- package/dist/cjs/model/plugins.js +0 -26
- package/dist/cjs/model/profile-queries.js +0 -16
- package/dist/cjs/model/silences-queries.js +0 -16
- package/dist/cjs/model/time-series-queries.js +0 -26
- package/dist/cjs/model/trace-queries.js +0 -16
- package/dist/cjs/model/variables.js +0 -16
- package/dist/cjs/remote/PersesPlugin.types.js +0 -16
- package/dist/cjs/remote/PluginLoaderComponent.js +0 -87
- package/dist/cjs/remote/PluginRuntime.js +0 -331
- package/dist/cjs/remote/index.js +0 -31
- package/dist/cjs/remote/remotePluginLoader.js +0 -101
- package/dist/cjs/runtime/DataQueriesProvider/DataQueriesProvider.js +0 -154
- package/dist/cjs/runtime/DataQueriesProvider/index.js +0 -31
- package/dist/cjs/runtime/DataQueriesProvider/model.js +0 -34
- package/dist/cjs/runtime/RouterProvider.js +0 -114
- package/dist/cjs/runtime/TimeRangeProvider/TimeRangeProvider.js +0 -201
- package/dist/cjs/runtime/TimeRangeProvider/TimeRangeProviders.js +0 -66
- package/dist/cjs/runtime/TimeRangeProvider/TimeRangeSettingsProvider.js +0 -113
- package/dist/cjs/runtime/TimeRangeProvider/index.js +0 -33
- package/dist/cjs/runtime/TimeRangeProvider/query-params.js +0 -250
- package/dist/cjs/runtime/TimeRangeProvider/refresh-interval.js +0 -30
- package/dist/cjs/runtime/UsageMetricsProvider.js +0 -102
- package/dist/cjs/runtime/alerts-queries.js +0 -101
- package/dist/cjs/runtime/annotations.js +0 -148
- package/dist/cjs/runtime/builtin-variables.js +0 -81
- package/dist/cjs/runtime/datasources.js +0 -80
- package/dist/cjs/runtime/index.js +0 -44
- package/dist/cjs/runtime/item-actions.js +0 -302
- package/dist/cjs/runtime/log-queries.js +0 -76
- package/dist/cjs/runtime/plugin-registry.js +0 -135
- package/dist/cjs/runtime/profile-queries.js +0 -73
- package/dist/cjs/runtime/silences-queries.js +0 -101
- package/dist/cjs/runtime/time-series-queries.js +0 -165
- package/dist/cjs/runtime/trace-queries.js +0 -106
- package/dist/cjs/runtime/utils.js +0 -39
- package/dist/cjs/runtime/variables.js +0 -160
- package/dist/cjs/schema/index.js +0 -30
- package/dist/cjs/schema/panel.js +0 -42
- package/dist/cjs/test/index.js +0 -31
- package/dist/cjs/test/mock-data.js +0 -357
- package/dist/cjs/test/render-hook.js +0 -31
- package/dist/cjs/test/render.js +0 -31
- package/dist/cjs/test/setup-tests.js +0 -20
- package/dist/cjs/test/test-plugins/bert/index.js +0 -99
- package/dist/cjs/test/test-plugins/ernie/index.js +0 -92
- package/dist/cjs/test/test-plugins/index.js +0 -81
- package/dist/cjs/test/utils.js +0 -58
- package/dist/cjs/test-utils/index.js +0 -30
- package/dist/cjs/test-utils/mock-plugin-registry.js +0 -81
- package/dist/cjs/utils/csv-export.js +0 -248
- package/dist/cjs/utils/event.js +0 -30
- package/dist/cjs/utils/index.js +0 -32
- package/dist/cjs/utils/variables.js +0 -44
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
// Copyright The Perses Authors
|
|
2
|
-
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
3
|
-
// you may not use this file except in compliance with the License.
|
|
4
|
-
// You may obtain a copy of the License at
|
|
5
|
-
//
|
|
6
|
-
// http://www.apache.org/licenses/LICENSE-2.0
|
|
7
|
-
//
|
|
8
|
-
// Unless required by applicable law or agreed to in writing, software
|
|
9
|
-
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
10
|
-
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11
|
-
// See the License for the specific language governing permissions and
|
|
12
|
-
// limitations under the License.
|
|
13
|
-
"use strict";
|
|
14
|
-
Object.defineProperty(exports, "__esModule", {
|
|
15
|
-
value: true
|
|
16
|
-
});
|
|
17
|
-
function _export(target, all) {
|
|
18
|
-
for(var name in all)Object.defineProperty(target, name, {
|
|
19
|
-
enumerable: true,
|
|
20
|
-
get: Object.getOwnPropertyDescriptor(all, name).get
|
|
21
|
-
});
|
|
22
|
-
}
|
|
23
|
-
_export(exports, {
|
|
24
|
-
get LOG_QUERY_KEY () {
|
|
25
|
-
return LOG_QUERY_KEY;
|
|
26
|
-
},
|
|
27
|
-
get useLogQueries () {
|
|
28
|
-
return useLogQueries;
|
|
29
|
-
}
|
|
30
|
-
});
|
|
31
|
-
const _reactquery = require("@tanstack/react-query");
|
|
32
|
-
const _datasources = require("./datasources");
|
|
33
|
-
const _pluginregistry = require("./plugin-registry");
|
|
34
|
-
const _TimeRangeProvider = require("./TimeRangeProvider");
|
|
35
|
-
const _variables = require("./variables");
|
|
36
|
-
const LOG_QUERY_KEY = 'LogQuery';
|
|
37
|
-
function useLogQueries(definitions) {
|
|
38
|
-
const { getPlugin } = (0, _pluginregistry.usePluginRegistry)();
|
|
39
|
-
const datasourceStore = (0, _datasources.useDatasourceStore)();
|
|
40
|
-
const { absoluteTimeRange } = (0, _TimeRangeProvider.useTimeRange)();
|
|
41
|
-
const variableValues = (0, _variables.useVariableValues)();
|
|
42
|
-
const context = {
|
|
43
|
-
timeRange: absoluteTimeRange,
|
|
44
|
-
variableState: variableValues,
|
|
45
|
-
datasourceStore,
|
|
46
|
-
refreshKey: ''
|
|
47
|
-
};
|
|
48
|
-
return (0, _reactquery.useQueries)({
|
|
49
|
-
queries: definitions.map((definition)=>{
|
|
50
|
-
const queryKey = [
|
|
51
|
-
'query',
|
|
52
|
-
LOG_QUERY_KEY,
|
|
53
|
-
definition,
|
|
54
|
-
absoluteTimeRange,
|
|
55
|
-
variableValues
|
|
56
|
-
];
|
|
57
|
-
const logQueryKind = definition?.spec?.plugin?.kind;
|
|
58
|
-
return {
|
|
59
|
-
queryKey: queryKey,
|
|
60
|
-
refetchOnMount: false,
|
|
61
|
-
refetchOnWindowFocus: false,
|
|
62
|
-
refetchOnReconnect: false,
|
|
63
|
-
staleTime: Infinity,
|
|
64
|
-
queryFn: async ({ signal })=>{
|
|
65
|
-
const plugin = await getPlugin({
|
|
66
|
-
kind: LOG_QUERY_KEY,
|
|
67
|
-
name: logQueryKind
|
|
68
|
-
});
|
|
69
|
-
const data = await plugin.getLogData(definition.spec.plugin.spec, context, signal);
|
|
70
|
-
return data;
|
|
71
|
-
},
|
|
72
|
-
structuralSharing: false
|
|
73
|
-
};
|
|
74
|
-
})
|
|
75
|
-
});
|
|
76
|
-
}
|
|
@@ -1,135 +0,0 @@
|
|
|
1
|
-
// Copyright The Perses Authors
|
|
2
|
-
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
3
|
-
// you may not use this file except in compliance with the License.
|
|
4
|
-
// You may obtain a copy of the License at
|
|
5
|
-
//
|
|
6
|
-
// http://www.apache.org/licenses/LICENSE-2.0
|
|
7
|
-
//
|
|
8
|
-
// Unless required by applicable law or agreed to in writing, software
|
|
9
|
-
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
10
|
-
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11
|
-
// See the License for the specific language governing permissions and
|
|
12
|
-
// limitations under the License.
|
|
13
|
-
"use strict";
|
|
14
|
-
Object.defineProperty(exports, "__esModule", {
|
|
15
|
-
value: true
|
|
16
|
-
});
|
|
17
|
-
function _export(target, all) {
|
|
18
|
-
for(var name in all)Object.defineProperty(target, name, {
|
|
19
|
-
enumerable: true,
|
|
20
|
-
get: Object.getOwnPropertyDescriptor(all, name).get
|
|
21
|
-
});
|
|
22
|
-
}
|
|
23
|
-
_export(exports, {
|
|
24
|
-
get PluginRegistryContext () {
|
|
25
|
-
return PluginRegistryContext;
|
|
26
|
-
},
|
|
27
|
-
get useListPluginMetadata () {
|
|
28
|
-
return useListPluginMetadata;
|
|
29
|
-
},
|
|
30
|
-
get usePlugin () {
|
|
31
|
-
return usePlugin;
|
|
32
|
-
},
|
|
33
|
-
get usePluginBuiltinVariableDefinitions () {
|
|
34
|
-
return usePluginBuiltinVariableDefinitions;
|
|
35
|
-
},
|
|
36
|
-
get usePluginRegistry () {
|
|
37
|
-
return usePluginRegistry;
|
|
38
|
-
},
|
|
39
|
-
get usePlugins () {
|
|
40
|
-
return usePlugins;
|
|
41
|
-
}
|
|
42
|
-
});
|
|
43
|
-
const _reactquery = require("@tanstack/react-query");
|
|
44
|
-
const _react = require("react");
|
|
45
|
-
const PluginRegistryContext = (0, _react.createContext)(undefined);
|
|
46
|
-
function usePluginRegistry() {
|
|
47
|
-
const ctx = (0, _react.useContext)(PluginRegistryContext);
|
|
48
|
-
if (ctx === undefined) {
|
|
49
|
-
throw new Error('PluginRegistryContext not found. Did you forget a provider?');
|
|
50
|
-
}
|
|
51
|
-
return ctx;
|
|
52
|
-
}
|
|
53
|
-
function usePlugin(pluginType, kind, options) {
|
|
54
|
-
// We never want to ask for a plugin when the kind isn't set yet, so disable those queries automatically
|
|
55
|
-
options = {
|
|
56
|
-
...options,
|
|
57
|
-
enabled: (options?.enabled ?? true) && pluginType !== undefined && kind !== ''
|
|
58
|
-
};
|
|
59
|
-
const { getPlugin } = usePluginRegistry();
|
|
60
|
-
return (0, _reactquery.useQuery)({
|
|
61
|
-
queryKey: [
|
|
62
|
-
'getPlugin',
|
|
63
|
-
pluginType,
|
|
64
|
-
kind
|
|
65
|
-
],
|
|
66
|
-
queryFn: ()=>getPlugin({
|
|
67
|
-
kind: pluginType,
|
|
68
|
-
name: kind
|
|
69
|
-
}),
|
|
70
|
-
...options
|
|
71
|
-
});
|
|
72
|
-
}
|
|
73
|
-
function usePlugins(pluginType, plugins) {
|
|
74
|
-
const { getPlugin } = usePluginRegistry();
|
|
75
|
-
// useQueries() does not support queries with duplicate keys, therefore we de-duplicate the plugin kinds before running useQueries()
|
|
76
|
-
// This resolves the following warning in the JS console: "[QueriesObserver]: Duplicate Queries found. This might result in unexpected behavior."
|
|
77
|
-
// https://github.com/TanStack/query/issues/8224#issuecomment-2523554831
|
|
78
|
-
// https://github.com/TanStack/query/issues/4187#issuecomment-1256336901
|
|
79
|
-
const kinds = [
|
|
80
|
-
...new Set(plugins.map((p)=>p.kind))
|
|
81
|
-
];
|
|
82
|
-
const result = (0, _reactquery.useQueries)({
|
|
83
|
-
queries: kinds.map((kind)=>{
|
|
84
|
-
return {
|
|
85
|
-
queryKey: [
|
|
86
|
-
'getPlugin',
|
|
87
|
-
pluginType,
|
|
88
|
-
kind
|
|
89
|
-
],
|
|
90
|
-
queryFn: ()=>getPlugin({
|
|
91
|
-
kind: pluginType,
|
|
92
|
-
name: kind
|
|
93
|
-
})
|
|
94
|
-
};
|
|
95
|
-
})
|
|
96
|
-
});
|
|
97
|
-
// Re-assemble array in original order
|
|
98
|
-
return plugins.map((p)=>result[kinds.indexOf(p.kind)]);
|
|
99
|
-
}
|
|
100
|
-
function useListPluginMetadata(pluginTypes, options) {
|
|
101
|
-
const { listPluginMetadata } = usePluginRegistry();
|
|
102
|
-
return (0, _reactquery.useQuery)({
|
|
103
|
-
queryKey: [
|
|
104
|
-
'listPluginMetadata',
|
|
105
|
-
pluginTypes
|
|
106
|
-
],
|
|
107
|
-
queryFn: ()=>listPluginMetadata(pluginTypes),
|
|
108
|
-
...options
|
|
109
|
-
});
|
|
110
|
-
}
|
|
111
|
-
function usePluginBuiltinVariableDefinitions() {
|
|
112
|
-
const { getPlugin, listPluginMetadata } = usePluginRegistry();
|
|
113
|
-
return (0, _reactquery.useQuery)({
|
|
114
|
-
queryKey: [
|
|
115
|
-
'usePluginBuiltinVariableDefinitions'
|
|
116
|
-
],
|
|
117
|
-
queryFn: async ()=>{
|
|
118
|
-
const datasources = await listPluginMetadata([
|
|
119
|
-
'Datasource'
|
|
120
|
-
]);
|
|
121
|
-
const datasourceNames = new Set(datasources.map((datasource)=>datasource.spec.name));
|
|
122
|
-
const result = [];
|
|
123
|
-
for (const name of datasourceNames){
|
|
124
|
-
const plugin = await getPlugin({
|
|
125
|
-
kind: 'Datasource',
|
|
126
|
-
name
|
|
127
|
-
});
|
|
128
|
-
if (plugin.getBuiltinVariableDefinitions) {
|
|
129
|
-
plugin.getBuiltinVariableDefinitions().forEach((definition)=>result.push(definition));
|
|
130
|
-
}
|
|
131
|
-
}
|
|
132
|
-
return result;
|
|
133
|
-
}
|
|
134
|
-
});
|
|
135
|
-
}
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
// Copyright The Perses Authors
|
|
2
|
-
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
3
|
-
// you may not use this file except in compliance with the License.
|
|
4
|
-
// You may obtain a copy of the License at
|
|
5
|
-
//
|
|
6
|
-
// http://www.apache.org/licenses/LICENSE-2.0
|
|
7
|
-
//
|
|
8
|
-
// Unless required by applicable law or agreed to in writing, software
|
|
9
|
-
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
10
|
-
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11
|
-
// See the License for the specific language governing permissions and
|
|
12
|
-
// limitations under the License.
|
|
13
|
-
"use strict";
|
|
14
|
-
Object.defineProperty(exports, "__esModule", {
|
|
15
|
-
value: true
|
|
16
|
-
});
|
|
17
|
-
function _export(target, all) {
|
|
18
|
-
for(var name in all)Object.defineProperty(target, name, {
|
|
19
|
-
enumerable: true,
|
|
20
|
-
get: Object.getOwnPropertyDescriptor(all, name).get
|
|
21
|
-
});
|
|
22
|
-
}
|
|
23
|
-
_export(exports, {
|
|
24
|
-
get PROFILE_QUERY_KEY () {
|
|
25
|
-
return PROFILE_QUERY_KEY;
|
|
26
|
-
},
|
|
27
|
-
get useProfileQueries () {
|
|
28
|
-
return useProfileQueries;
|
|
29
|
-
}
|
|
30
|
-
});
|
|
31
|
-
const _reactquery = require("@tanstack/react-query");
|
|
32
|
-
const _datasources = require("./datasources");
|
|
33
|
-
const _pluginregistry = require("./plugin-registry");
|
|
34
|
-
const _TimeRangeProvider = require("./TimeRangeProvider");
|
|
35
|
-
const PROFILE_QUERY_KEY = 'ProfileQuery';
|
|
36
|
-
function useProfileQueries(definitions) {
|
|
37
|
-
const { getPlugin } = (0, _pluginregistry.usePluginRegistry)();
|
|
38
|
-
const datasourceStore = (0, _datasources.useDatasourceStore)();
|
|
39
|
-
const { absoluteTimeRange } = (0, _TimeRangeProvider.useTimeRange)();
|
|
40
|
-
const context = {
|
|
41
|
-
datasourceStore,
|
|
42
|
-
absoluteTimeRange
|
|
43
|
-
};
|
|
44
|
-
// useQueries() handles data fetching from query plugins (e.g. traceQL queries, promQL queries)
|
|
45
|
-
// https://tanstack.com/query/v4/docs/react/reference/useQuery
|
|
46
|
-
return (0, _reactquery.useQueries)({
|
|
47
|
-
queries: definitions.map((definition)=>{
|
|
48
|
-
const queryKey = [
|
|
49
|
-
'query',
|
|
50
|
-
PROFILE_QUERY_KEY,
|
|
51
|
-
definition,
|
|
52
|
-
absoluteTimeRange
|
|
53
|
-
]; // `queryKey` watches and reruns `queryFn` if keys in the array change
|
|
54
|
-
const profileQueryKind = definition?.spec?.plugin?.kind;
|
|
55
|
-
return {
|
|
56
|
-
queryKey: queryKey,
|
|
57
|
-
refetchOnMount: false,
|
|
58
|
-
refetchOnWindowFocus: false,
|
|
59
|
-
refetchOnReconnect: false,
|
|
60
|
-
staleTime: Infinity,
|
|
61
|
-
queryFn: async ({ signal })=>{
|
|
62
|
-
const plugin = await getPlugin({
|
|
63
|
-
kind: PROFILE_QUERY_KEY,
|
|
64
|
-
name: profileQueryKind
|
|
65
|
-
});
|
|
66
|
-
const data = await plugin.getProfileData(definition.spec.plugin.spec, context, signal);
|
|
67
|
-
return data;
|
|
68
|
-
},
|
|
69
|
-
structuralSharing: false
|
|
70
|
-
};
|
|
71
|
-
})
|
|
72
|
-
});
|
|
73
|
-
}
|
|
@@ -1,101 +0,0 @@
|
|
|
1
|
-
// Copyright The Perses Authors
|
|
2
|
-
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
3
|
-
// you may not use this file except in compliance with the License.
|
|
4
|
-
// You may obtain a copy of the License at
|
|
5
|
-
//
|
|
6
|
-
// http://www.apache.org/licenses/LICENSE-2.0
|
|
7
|
-
//
|
|
8
|
-
// Unless required by applicable law or agreed to in writing, software
|
|
9
|
-
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
10
|
-
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11
|
-
// See the License for the specific language governing permissions and
|
|
12
|
-
// limitations under the License.
|
|
13
|
-
"use strict";
|
|
14
|
-
Object.defineProperty(exports, "__esModule", {
|
|
15
|
-
value: true
|
|
16
|
-
});
|
|
17
|
-
function _export(target, all) {
|
|
18
|
-
for(var name in all)Object.defineProperty(target, name, {
|
|
19
|
-
enumerable: true,
|
|
20
|
-
get: Object.getOwnPropertyDescriptor(all, name).get
|
|
21
|
-
});
|
|
22
|
-
}
|
|
23
|
-
_export(exports, {
|
|
24
|
-
get SILENCES_QUERY_KEY () {
|
|
25
|
-
return SILENCES_QUERY_KEY;
|
|
26
|
-
},
|
|
27
|
-
get useSilencesQueries () {
|
|
28
|
-
return useSilencesQueries;
|
|
29
|
-
}
|
|
30
|
-
});
|
|
31
|
-
const _reactquery = require("@tanstack/react-query");
|
|
32
|
-
const _datasources = require("./datasources");
|
|
33
|
-
const _pluginregistry = require("./plugin-registry");
|
|
34
|
-
const _variables = require("./variables");
|
|
35
|
-
const _utils = require("./utils");
|
|
36
|
-
const SILENCES_QUERY_KEY = 'SilencesQuery';
|
|
37
|
-
function useSilencesQueries(definitions) {
|
|
38
|
-
const { getPlugin } = (0, _pluginregistry.usePluginRegistry)();
|
|
39
|
-
const context = useSilencesQueryContext();
|
|
40
|
-
const pluginLoaderResponse = (0, _pluginregistry.usePlugins)('SilencesQuery', definitions.map((d)=>({
|
|
41
|
-
kind: d.spec.plugin.kind
|
|
42
|
-
})));
|
|
43
|
-
return (0, _reactquery.useQueries)({
|
|
44
|
-
queries: definitions.map((definition, idx)=>{
|
|
45
|
-
const plugin = pluginLoaderResponse[idx]?.data;
|
|
46
|
-
const { queryEnabled, queryKey } = getQueryOptions({
|
|
47
|
-
context,
|
|
48
|
-
definition,
|
|
49
|
-
plugin
|
|
50
|
-
});
|
|
51
|
-
const silencesQueryKind = definition?.spec?.plugin?.kind;
|
|
52
|
-
return {
|
|
53
|
-
enabled: queryEnabled,
|
|
54
|
-
queryKey: queryKey,
|
|
55
|
-
refetchOnMount: false,
|
|
56
|
-
refetchOnWindowFocus: false,
|
|
57
|
-
refetchOnReconnect: false,
|
|
58
|
-
staleTime: 60_000,
|
|
59
|
-
queryFn: async ({ signal })=>{
|
|
60
|
-
const plugin = await getPlugin({
|
|
61
|
-
kind: SILENCES_QUERY_KEY,
|
|
62
|
-
name: silencesQueryKind
|
|
63
|
-
});
|
|
64
|
-
const data = await plugin.getSilencesData(definition.spec.plugin.spec, context, signal);
|
|
65
|
-
return data;
|
|
66
|
-
}
|
|
67
|
-
};
|
|
68
|
-
})
|
|
69
|
-
});
|
|
70
|
-
}
|
|
71
|
-
function getQueryOptions({ plugin, definition, context }) {
|
|
72
|
-
const { variableState } = context;
|
|
73
|
-
const dependencies = plugin?.dependsOn ? plugin.dependsOn(definition.spec.plugin.spec, context) : {};
|
|
74
|
-
const variableDependencies = dependencies?.variables;
|
|
75
|
-
const filteredVariabledState = (0, _utils.filterVariableStateMap)(variableState, variableDependencies);
|
|
76
|
-
const variablesValueKey = (0, _utils.getVariableValuesKey)(filteredVariabledState);
|
|
77
|
-
// Note: no absoluteTimeRange in query key since silences are current state
|
|
78
|
-
const queryKey = [
|
|
79
|
-
'query',
|
|
80
|
-
SILENCES_QUERY_KEY,
|
|
81
|
-
definition,
|
|
82
|
-
variablesValueKey
|
|
83
|
-
];
|
|
84
|
-
let waitToLoad = false;
|
|
85
|
-
if (variableDependencies) {
|
|
86
|
-
waitToLoad = variableDependencies.some((v)=>variableState[v]?.loading);
|
|
87
|
-
}
|
|
88
|
-
const queryEnabled = plugin !== undefined && !waitToLoad;
|
|
89
|
-
return {
|
|
90
|
-
queryKey,
|
|
91
|
-
queryEnabled
|
|
92
|
-
};
|
|
93
|
-
}
|
|
94
|
-
function useSilencesQueryContext() {
|
|
95
|
-
const variableState = (0, _variables.useAllVariableValues)();
|
|
96
|
-
const datasourceStore = (0, _datasources.useDatasourceStore)();
|
|
97
|
-
return {
|
|
98
|
-
variableState,
|
|
99
|
-
datasourceStore
|
|
100
|
-
};
|
|
101
|
-
}
|
|
@@ -1,165 +0,0 @@
|
|
|
1
|
-
// Copyright The Perses Authors
|
|
2
|
-
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
3
|
-
// you may not use this file except in compliance with the License.
|
|
4
|
-
// You may obtain a copy of the License at
|
|
5
|
-
//
|
|
6
|
-
// http://www.apache.org/licenses/LICENSE-2.0
|
|
7
|
-
//
|
|
8
|
-
// Unless required by applicable law or agreed to in writing, software
|
|
9
|
-
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
10
|
-
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11
|
-
// See the License for the specific language governing permissions and
|
|
12
|
-
// limitations under the License.
|
|
13
|
-
"use strict";
|
|
14
|
-
Object.defineProperty(exports, "__esModule", {
|
|
15
|
-
value: true
|
|
16
|
-
});
|
|
17
|
-
function _export(target, all) {
|
|
18
|
-
for(var name in all)Object.defineProperty(target, name, {
|
|
19
|
-
enumerable: true,
|
|
20
|
-
get: Object.getOwnPropertyDescriptor(all, name).get
|
|
21
|
-
});
|
|
22
|
-
}
|
|
23
|
-
_export(exports, {
|
|
24
|
-
get TIME_SERIES_QUERY_KEY () {
|
|
25
|
-
return TIME_SERIES_QUERY_KEY;
|
|
26
|
-
},
|
|
27
|
-
get getActiveTimeSeriesQueries () {
|
|
28
|
-
return getActiveTimeSeriesQueries;
|
|
29
|
-
},
|
|
30
|
-
get useActiveTimeSeriesQueries () {
|
|
31
|
-
return useActiveTimeSeriesQueries;
|
|
32
|
-
},
|
|
33
|
-
get useTimeSeriesQueries () {
|
|
34
|
-
return useTimeSeriesQueries;
|
|
35
|
-
},
|
|
36
|
-
get useTimeSeriesQuery () {
|
|
37
|
-
return useTimeSeriesQuery;
|
|
38
|
-
}
|
|
39
|
-
});
|
|
40
|
-
const _reactquery = require("@tanstack/react-query");
|
|
41
|
-
const _TimeRangeProvider = require("./TimeRangeProvider");
|
|
42
|
-
const _datasources = require("./datasources");
|
|
43
|
-
const _pluginregistry = require("./plugin-registry");
|
|
44
|
-
const _utils = require("./utils");
|
|
45
|
-
const _variables = require("./variables");
|
|
46
|
-
const TIME_SERIES_QUERY_KEY = 'TimeSeriesQuery';
|
|
47
|
-
function getQueryOptions({ plugin, definition, context }) {
|
|
48
|
-
const { timeRange, suggestedStepMs, mode, variableState } = context;
|
|
49
|
-
const dependencies = plugin?.dependsOn ? plugin.dependsOn(definition.spec.plugin.spec, context) : {};
|
|
50
|
-
const variableDependencies = dependencies?.variables;
|
|
51
|
-
// Determine queryKey
|
|
52
|
-
const filteredVariabledState = (0, _utils.filterVariableStateMap)(variableState, variableDependencies);
|
|
53
|
-
const variablesValueKey = (0, _utils.getVariableValuesKey)(filteredVariabledState);
|
|
54
|
-
const queryKey = [
|
|
55
|
-
'query',
|
|
56
|
-
TIME_SERIES_QUERY_KEY,
|
|
57
|
-
definition,
|
|
58
|
-
timeRange,
|
|
59
|
-
variablesValueKey,
|
|
60
|
-
suggestedStepMs,
|
|
61
|
-
mode
|
|
62
|
-
];
|
|
63
|
-
// Determine queryEnabled
|
|
64
|
-
let waitToLoad = false;
|
|
65
|
-
if (variableDependencies) {
|
|
66
|
-
waitToLoad = variableDependencies.some((v)=>variableState[v]?.loading);
|
|
67
|
-
}
|
|
68
|
-
const queryEnabled = plugin !== undefined && !waitToLoad;
|
|
69
|
-
return {
|
|
70
|
-
queryKey,
|
|
71
|
-
queryEnabled
|
|
72
|
-
};
|
|
73
|
-
}
|
|
74
|
-
const useTimeSeriesQuery = (definition, options, queryOptions)=>{
|
|
75
|
-
const { data: plugin } = (0, _pluginregistry.usePlugin)(TIME_SERIES_QUERY_KEY, definition.spec.plugin.kind);
|
|
76
|
-
const context = useTimeSeriesQueryContext();
|
|
77
|
-
const { queryEnabled, queryKey } = getQueryOptions({
|
|
78
|
-
plugin,
|
|
79
|
-
definition,
|
|
80
|
-
context
|
|
81
|
-
});
|
|
82
|
-
return (0, _reactquery.useQuery)({
|
|
83
|
-
enabled: (queryOptions?.enabled ?? true) || queryEnabled,
|
|
84
|
-
queryKey: queryKey,
|
|
85
|
-
queryFn: ({ signal })=>{
|
|
86
|
-
// The 'enabled' option should prevent this from happening, but make TypeScript happy by checking
|
|
87
|
-
if (plugin === undefined) {
|
|
88
|
-
throw new Error('Expected plugin to be loaded');
|
|
89
|
-
}
|
|
90
|
-
// Keep options out of query key so we don't re-run queries because suggested step changes
|
|
91
|
-
const ctx = {
|
|
92
|
-
...context,
|
|
93
|
-
suggestedStepMs: options?.suggestedStepMs
|
|
94
|
-
};
|
|
95
|
-
return plugin.getTimeSeriesData(definition.spec.plugin.spec, ctx, signal);
|
|
96
|
-
}
|
|
97
|
-
});
|
|
98
|
-
};
|
|
99
|
-
function useTimeSeriesQueries(definitions, options, queryOptions) {
|
|
100
|
-
const { getPlugin } = (0, _pluginregistry.usePluginRegistry)();
|
|
101
|
-
const context = {
|
|
102
|
-
...useTimeSeriesQueryContext(),
|
|
103
|
-
mode: options?.mode,
|
|
104
|
-
suggestedStepMs: options?.suggestedStepMs
|
|
105
|
-
};
|
|
106
|
-
const pluginLoaderResponse = (0, _pluginregistry.usePlugins)(TIME_SERIES_QUERY_KEY, definitions.map((d)=>({
|
|
107
|
-
kind: d.spec.plugin.kind
|
|
108
|
-
})));
|
|
109
|
-
return (0, _reactquery.useQueries)({
|
|
110
|
-
queries: definitions.map((definition, idx)=>{
|
|
111
|
-
const plugin = pluginLoaderResponse[idx]?.data;
|
|
112
|
-
const { queryEnabled, queryKey } = getQueryOptions({
|
|
113
|
-
plugin,
|
|
114
|
-
definition,
|
|
115
|
-
context
|
|
116
|
-
});
|
|
117
|
-
return {
|
|
118
|
-
...queryOptions,
|
|
119
|
-
enabled: (queryOptions?.enabled ?? true) && queryEnabled,
|
|
120
|
-
refetchOnMount: false,
|
|
121
|
-
refetchOnWindowFocus: false,
|
|
122
|
-
refetchOnReconnect: false,
|
|
123
|
-
staleTime: Infinity,
|
|
124
|
-
queryKey: queryKey,
|
|
125
|
-
queryFn: async ({ signal })=>{
|
|
126
|
-
const plugin = await getPlugin({
|
|
127
|
-
kind: TIME_SERIES_QUERY_KEY,
|
|
128
|
-
name: definition.spec.plugin.kind
|
|
129
|
-
});
|
|
130
|
-
const data = await plugin.getTimeSeriesData(definition.spec.plugin.spec, context, signal);
|
|
131
|
-
return data;
|
|
132
|
-
}
|
|
133
|
-
};
|
|
134
|
-
})
|
|
135
|
-
});
|
|
136
|
-
}
|
|
137
|
-
/**
|
|
138
|
-
* Build the time series query context object from data available at runtime
|
|
139
|
-
*/ function useTimeSeriesQueryContext() {
|
|
140
|
-
const { absoluteTimeRange } = (0, _TimeRangeProvider.useTimeRange)();
|
|
141
|
-
const variableState = (0, _variables.useAllVariableValues)();
|
|
142
|
-
const datasourceStore = (0, _datasources.useDatasourceStore)();
|
|
143
|
-
return {
|
|
144
|
-
timeRange: absoluteTimeRange,
|
|
145
|
-
variableState,
|
|
146
|
-
datasourceStore
|
|
147
|
-
};
|
|
148
|
-
}
|
|
149
|
-
function useActiveTimeSeriesQueries() {
|
|
150
|
-
const queryClient = (0, _reactquery.useQueryClient)();
|
|
151
|
-
const queryCache = queryClient.getQueryCache();
|
|
152
|
-
return getActiveTimeSeriesQueries(queryCache);
|
|
153
|
-
}
|
|
154
|
-
function getActiveTimeSeriesQueries(cache) {
|
|
155
|
-
const queries = [];
|
|
156
|
-
for (const query of cache.findAll({
|
|
157
|
-
type: 'active'
|
|
158
|
-
})){
|
|
159
|
-
const firstPart = query.queryKey?.[0];
|
|
160
|
-
if (firstPart?.kind && firstPart.kind.startsWith(TIME_SERIES_QUERY_KEY)) {
|
|
161
|
-
queries.push(query);
|
|
162
|
-
}
|
|
163
|
-
}
|
|
164
|
-
return queries;
|
|
165
|
-
}
|
|
@@ -1,106 +0,0 @@
|
|
|
1
|
-
// Copyright The Perses Authors
|
|
2
|
-
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
3
|
-
// you may not use this file except in compliance with the License.
|
|
4
|
-
// You may obtain a copy of the License at
|
|
5
|
-
//
|
|
6
|
-
// http://www.apache.org/licenses/LICENSE-2.0
|
|
7
|
-
//
|
|
8
|
-
// Unless required by applicable law or agreed to in writing, software
|
|
9
|
-
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
10
|
-
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11
|
-
// See the License for the specific language governing permissions and
|
|
12
|
-
// limitations under the License.
|
|
13
|
-
"use strict";
|
|
14
|
-
Object.defineProperty(exports, "__esModule", {
|
|
15
|
-
value: true
|
|
16
|
-
});
|
|
17
|
-
function _export(target, all) {
|
|
18
|
-
for(var name in all)Object.defineProperty(target, name, {
|
|
19
|
-
enumerable: true,
|
|
20
|
-
get: Object.getOwnPropertyDescriptor(all, name).get
|
|
21
|
-
});
|
|
22
|
-
}
|
|
23
|
-
_export(exports, {
|
|
24
|
-
get TRACE_QUERY_KEY () {
|
|
25
|
-
return TRACE_QUERY_KEY;
|
|
26
|
-
},
|
|
27
|
-
get useTraceQueries () {
|
|
28
|
-
return useTraceQueries;
|
|
29
|
-
}
|
|
30
|
-
});
|
|
31
|
-
const _reactquery = require("@tanstack/react-query");
|
|
32
|
-
const _datasources = require("./datasources");
|
|
33
|
-
const _pluginregistry = require("./plugin-registry");
|
|
34
|
-
const _TimeRangeProvider = require("./TimeRangeProvider");
|
|
35
|
-
const _variables = require("./variables");
|
|
36
|
-
const _utils = require("./utils");
|
|
37
|
-
const TRACE_QUERY_KEY = 'TraceQuery';
|
|
38
|
-
function useTraceQueries(definitions) {
|
|
39
|
-
const { getPlugin } = (0, _pluginregistry.usePluginRegistry)();
|
|
40
|
-
const context = useTraceQueryContext();
|
|
41
|
-
const pluginLoaderResponse = (0, _pluginregistry.usePlugins)('TraceQuery', definitions.map((d)=>({
|
|
42
|
-
kind: d.spec.plugin.kind
|
|
43
|
-
})));
|
|
44
|
-
// useQueries() handles data fetching from query plugins (e.g. traceQL queries, promQL queries)
|
|
45
|
-
// https://tanstack.com/query/v4/docs/react/reference/useQuery
|
|
46
|
-
return (0, _reactquery.useQueries)({
|
|
47
|
-
queries: definitions.map((definition, idx)=>{
|
|
48
|
-
const plugin = pluginLoaderResponse[idx]?.data;
|
|
49
|
-
const { queryEnabled, queryKey } = getQueryOptions({
|
|
50
|
-
context,
|
|
51
|
-
definition,
|
|
52
|
-
plugin
|
|
53
|
-
});
|
|
54
|
-
const traceQueryKind = definition?.spec?.plugin?.kind;
|
|
55
|
-
return {
|
|
56
|
-
enabled: queryEnabled,
|
|
57
|
-
queryKey: queryKey,
|
|
58
|
-
refetchOnMount: false,
|
|
59
|
-
refetchOnWindowFocus: false,
|
|
60
|
-
refetchOnReconnect: false,
|
|
61
|
-
staleTime: Infinity,
|
|
62
|
-
queryFn: async ({ signal })=>{
|
|
63
|
-
const plugin = await getPlugin({
|
|
64
|
-
kind: TRACE_QUERY_KEY,
|
|
65
|
-
name: traceQueryKind
|
|
66
|
-
});
|
|
67
|
-
const data = await plugin.getTraceData(definition.spec.plugin.spec, context, signal);
|
|
68
|
-
return data;
|
|
69
|
-
}
|
|
70
|
-
};
|
|
71
|
-
})
|
|
72
|
-
});
|
|
73
|
-
}
|
|
74
|
-
function getQueryOptions({ plugin, definition, context }) {
|
|
75
|
-
const { variableState, absoluteTimeRange } = context;
|
|
76
|
-
const dependencies = plugin?.dependsOn ? plugin.dependsOn(definition.spec.plugin.spec, context) : {};
|
|
77
|
-
const variableDependencies = dependencies?.variables;
|
|
78
|
-
const filteredVariabledState = (0, _utils.filterVariableStateMap)(variableState, variableDependencies);
|
|
79
|
-
const variablesValueKey = (0, _utils.getVariableValuesKey)(filteredVariabledState);
|
|
80
|
-
const queryKey = [
|
|
81
|
-
'query',
|
|
82
|
-
TRACE_QUERY_KEY,
|
|
83
|
-
definition,
|
|
84
|
-
absoluteTimeRange,
|
|
85
|
-
variablesValueKey
|
|
86
|
-
];
|
|
87
|
-
let waitToLoad = false;
|
|
88
|
-
if (variableDependencies) {
|
|
89
|
-
waitToLoad = variableDependencies.some((v)=>variableState[v]?.loading);
|
|
90
|
-
}
|
|
91
|
-
const queryEnabled = plugin !== undefined && !waitToLoad;
|
|
92
|
-
return {
|
|
93
|
-
queryKey,
|
|
94
|
-
queryEnabled
|
|
95
|
-
};
|
|
96
|
-
}
|
|
97
|
-
function useTraceQueryContext() {
|
|
98
|
-
const { absoluteTimeRange } = (0, _TimeRangeProvider.useTimeRange)();
|
|
99
|
-
const variableState = (0, _variables.useAllVariableValues)();
|
|
100
|
-
const datasourceStore = (0, _datasources.useDatasourceStore)();
|
|
101
|
-
return {
|
|
102
|
-
variableState,
|
|
103
|
-
datasourceStore,
|
|
104
|
-
absoluteTimeRange
|
|
105
|
-
};
|
|
106
|
-
}
|