@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,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
|
-
Object.defineProperty(exports, "remotePluginLoader", {
|
|
18
|
-
enumerable: true,
|
|
19
|
-
get: function() {
|
|
20
|
-
return remotePluginLoader;
|
|
21
|
-
}
|
|
22
|
-
});
|
|
23
|
-
const _pluginsystem = require("@perses-dev/plugin-system");
|
|
24
|
-
const _client = require("@perses-dev/client");
|
|
25
|
-
const _PluginRuntime = require("./PluginRuntime");
|
|
26
|
-
const isPluginMetadata = (plugin)=>{
|
|
27
|
-
return typeof plugin === 'object' && plugin !== null && 'kind' in plugin && 'spec' in plugin && typeof plugin.spec === 'object' && plugin.spec !== null && 'name' in plugin.spec;
|
|
28
|
-
};
|
|
29
|
-
const isPluginModuleResource = (pluginModule)=>{
|
|
30
|
-
return typeof pluginModule === 'object' && pluginModule !== null && 'metadata' in pluginModule && 'spec' in pluginModule && typeof pluginModule.spec === 'object' && pluginModule.spec !== null && 'plugins' in pluginModule.spec && Array.isArray(pluginModule.spec.plugins) && pluginModule.spec.plugins.every(isPluginMetadata);
|
|
31
|
-
};
|
|
32
|
-
const DEFAULT_PLUGINS_API_PATH = '/api/v1/plugins';
|
|
33
|
-
const DEFAULT_PLUGINS_ASSETS_PATH = '/plugins';
|
|
34
|
-
const paramToOptions = (options)=>{
|
|
35
|
-
if (options === undefined) {
|
|
36
|
-
return {
|
|
37
|
-
pluginsApiPath: DEFAULT_PLUGINS_API_PATH,
|
|
38
|
-
pluginsAssetsPath: DEFAULT_PLUGINS_ASSETS_PATH
|
|
39
|
-
};
|
|
40
|
-
}
|
|
41
|
-
return {
|
|
42
|
-
pluginsApiPath: `${options?.apiPrefix ?? ''}${DEFAULT_PLUGINS_API_PATH}`,
|
|
43
|
-
pluginsAssetsPath: `${options?.baseURL ?? ''}${DEFAULT_PLUGINS_ASSETS_PATH}`
|
|
44
|
-
};
|
|
45
|
-
};
|
|
46
|
-
function remotePluginLoader(options) {
|
|
47
|
-
const { pluginsApiPath, pluginsAssetsPath } = paramToOptions(options);
|
|
48
|
-
const fetchFn = options?.fetchFn ?? _client.fetch;
|
|
49
|
-
return {
|
|
50
|
-
getInstalledPlugins: async ()=>{
|
|
51
|
-
const pluginsResponse = await fetchFn(pluginsApiPath);
|
|
52
|
-
const plugins = await pluginsResponse.json();
|
|
53
|
-
let pluginModules = [];
|
|
54
|
-
if (Array.isArray(plugins)) {
|
|
55
|
-
pluginModules = plugins.filter(isPluginModuleResource);
|
|
56
|
-
} else {
|
|
57
|
-
console.error('RemotePluginLoader: Error loading plugins, response is not an array');
|
|
58
|
-
}
|
|
59
|
-
if (!pluginModules.length) {
|
|
60
|
-
console.error('RemotePluginLoader: No valid plugins found');
|
|
61
|
-
}
|
|
62
|
-
return pluginModules;
|
|
63
|
-
},
|
|
64
|
-
importPluginModule: async (resource)=>{
|
|
65
|
-
const { name: pluginModuleName, version, registry } = resource.metadata;
|
|
66
|
-
const pluginModule = {};
|
|
67
|
-
const loadPromises = resource.spec.plugins.map(async (plugin)=>{
|
|
68
|
-
const remotePluginModule = await (0, _PluginRuntime.loadPlugin)({
|
|
69
|
-
moduleName: pluginModuleName,
|
|
70
|
-
pluginName: plugin.spec.name,
|
|
71
|
-
registry,
|
|
72
|
-
version,
|
|
73
|
-
baseURL: pluginsAssetsPath
|
|
74
|
-
});
|
|
75
|
-
const remotePlugin = remotePluginModule?.[plugin.spec.name];
|
|
76
|
-
if (remotePlugin) {
|
|
77
|
-
return {
|
|
78
|
-
kind: plugin.kind,
|
|
79
|
-
name: plugin.spec.name,
|
|
80
|
-
remotePlugin
|
|
81
|
-
};
|
|
82
|
-
} else {
|
|
83
|
-
console.error(`RemotePluginLoader: Error loading plugin ${plugin.spec.name}`);
|
|
84
|
-
return null;
|
|
85
|
-
}
|
|
86
|
-
});
|
|
87
|
-
const loadedPlugins = await Promise.all(loadPromises);
|
|
88
|
-
loadedPlugins.forEach((item)=>{
|
|
89
|
-
if (item?.remotePlugin) {
|
|
90
|
-
pluginModule[(0, _pluginsystem.getPluginModuleCompoundKey)({
|
|
91
|
-
kind: item.kind,
|
|
92
|
-
name: item.name,
|
|
93
|
-
registry,
|
|
94
|
-
version
|
|
95
|
-
})] = item.remotePlugin;
|
|
96
|
-
}
|
|
97
|
-
});
|
|
98
|
-
return pluginModule;
|
|
99
|
-
}
|
|
100
|
-
};
|
|
101
|
-
}
|
|
@@ -1,154 +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 DataQueriesContext () {
|
|
25
|
-
return DataQueriesContext;
|
|
26
|
-
},
|
|
27
|
-
get DataQueriesProvider () {
|
|
28
|
-
return DataQueriesProvider;
|
|
29
|
-
},
|
|
30
|
-
get useDataQueries () {
|
|
31
|
-
return useDataQueries;
|
|
32
|
-
},
|
|
33
|
-
get useDataQueriesContext () {
|
|
34
|
-
return useDataQueriesContext;
|
|
35
|
-
}
|
|
36
|
-
});
|
|
37
|
-
const _jsxruntime = require("react/jsx-runtime");
|
|
38
|
-
const _react = require("react");
|
|
39
|
-
const _timeseriesqueries = require("../time-series-queries");
|
|
40
|
-
const _tracequeries = require("../trace-queries");
|
|
41
|
-
const _profilequeries = require("../profile-queries");
|
|
42
|
-
const _alertsqueries = require("../alerts-queries");
|
|
43
|
-
const _silencesqueries = require("../silences-queries");
|
|
44
|
-
const _UsageMetricsProvider = require("../UsageMetricsProvider");
|
|
45
|
-
const _logqueries = require("../log-queries");
|
|
46
|
-
const _model = require("./model");
|
|
47
|
-
const DataQueriesContext = /*#__PURE__*/ (0, _react.createContext)(undefined);
|
|
48
|
-
function useDataQueriesContext() {
|
|
49
|
-
const ctx = (0, _react.useContext)(DataQueriesContext);
|
|
50
|
-
if (ctx === undefined) {
|
|
51
|
-
throw new Error('No DataQueriesContext found. Did you forget a Provider?');
|
|
52
|
-
}
|
|
53
|
-
return ctx;
|
|
54
|
-
}
|
|
55
|
-
function useDataQueries(queryType) {
|
|
56
|
-
const ctx = useDataQueriesContext();
|
|
57
|
-
// Filter query definitions based on the specified query type
|
|
58
|
-
const filteredQueryDefinitions = ctx.queryDefinitions.filter((definition)=>definition.kind === queryType);
|
|
59
|
-
// Filter the query results based on the specified query type
|
|
60
|
-
const filteredQueryResults = ctx.queryResults.filter((queryResult)=>queryResult?.definition?.kind === queryType);
|
|
61
|
-
// Filter the errors based on the specified query type
|
|
62
|
-
const filteredErrors = ctx.errors.filter((errors, index)=>ctx.queryResults[index]?.definition?.kind === queryType);
|
|
63
|
-
// Create a new context object with the filtered results and errors
|
|
64
|
-
return {
|
|
65
|
-
queryDefinitions: filteredQueryDefinitions,
|
|
66
|
-
queryResults: filteredQueryResults,
|
|
67
|
-
isFetching: filteredQueryResults.some((result)=>result.isFetching),
|
|
68
|
-
isLoading: filteredQueryResults.some((result)=>result.isLoading),
|
|
69
|
-
refetchAll: ctx.refetchAll,
|
|
70
|
-
errors: filteredErrors
|
|
71
|
-
};
|
|
72
|
-
}
|
|
73
|
-
function DataQueriesProvider(props) {
|
|
74
|
-
const { definitions, options, children, queryOptions } = props;
|
|
75
|
-
const usageMetrics = (0, _UsageMetricsProvider.useUsageMetrics)();
|
|
76
|
-
// Filter definitions for time series query and other future query plugins
|
|
77
|
-
const timeSeriesQueries = definitions.filter((definition)=>definition.kind === 'TimeSeriesQuery');
|
|
78
|
-
const timeSeriesResults = (0, _timeseriesqueries.useTimeSeriesQueries)(timeSeriesQueries, options, queryOptions);
|
|
79
|
-
const traceQueries = definitions.filter((definition)=>definition.kind === 'TraceQuery');
|
|
80
|
-
const traceResults = (0, _tracequeries.useTraceQueries)(traceQueries);
|
|
81
|
-
const profileQueries = definitions.filter((definition)=>definition.kind === 'ProfileQuery');
|
|
82
|
-
const profileResults = (0, _profilequeries.useProfileQueries)(profileQueries);
|
|
83
|
-
const logQueries = definitions.filter((definition)=>definition.kind === 'LogQuery');
|
|
84
|
-
const logResults = (0, _logqueries.useLogQueries)(logQueries);
|
|
85
|
-
const alertsQueries = definitions.filter((definition)=>definition.kind === 'AlertsQuery');
|
|
86
|
-
const alertsResults = (0, _alertsqueries.useAlertsQueries)(alertsQueries);
|
|
87
|
-
const silencesQueries = definitions.filter((definition)=>definition.kind === 'SilencesQuery');
|
|
88
|
-
const silencesResults = (0, _silencesqueries.useSilencesQueries)(silencesQueries);
|
|
89
|
-
const refetchAll = (0, _react.useCallback)(()=>{
|
|
90
|
-
timeSeriesResults.forEach((result)=>result.refetch());
|
|
91
|
-
traceResults.forEach((result)=>result.refetch());
|
|
92
|
-
profileResults.forEach((result)=>result.refetch());
|
|
93
|
-
logResults.forEach((result)=>result.refetch());
|
|
94
|
-
alertsResults.forEach((result)=>result.refetch());
|
|
95
|
-
silencesResults.forEach((result)=>result.refetch());
|
|
96
|
-
}, [
|
|
97
|
-
timeSeriesResults,
|
|
98
|
-
traceResults,
|
|
99
|
-
profileResults,
|
|
100
|
-
logResults,
|
|
101
|
-
alertsResults,
|
|
102
|
-
silencesResults
|
|
103
|
-
]);
|
|
104
|
-
const ctx = (0, _react.useMemo)(()=>{
|
|
105
|
-
const mergedQueryResults = [
|
|
106
|
-
...(0, _model.transformQueryResults)(timeSeriesResults, timeSeriesQueries),
|
|
107
|
-
...(0, _model.transformQueryResults)(traceResults, traceQueries),
|
|
108
|
-
...(0, _model.transformQueryResults)(profileResults, profileQueries),
|
|
109
|
-
...(0, _model.transformQueryResults)(logResults, logQueries),
|
|
110
|
-
...(0, _model.transformQueryResults)(alertsResults, alertsQueries),
|
|
111
|
-
...(0, _model.transformQueryResults)(silencesResults, silencesQueries)
|
|
112
|
-
];
|
|
113
|
-
if (queryOptions?.enabled) {
|
|
114
|
-
for (const result of mergedQueryResults){
|
|
115
|
-
if (!result.isLoading && !result.isFetching && !result.error) {
|
|
116
|
-
usageMetrics.markQuery(result.definition, 'success');
|
|
117
|
-
} else if (result.error) {
|
|
118
|
-
usageMetrics.markQuery(result.definition, 'error');
|
|
119
|
-
} else {
|
|
120
|
-
usageMetrics.markQuery(result.definition, 'pending');
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
return {
|
|
125
|
-
queryDefinitions: definitions,
|
|
126
|
-
queryResults: mergedQueryResults,
|
|
127
|
-
isFetching: mergedQueryResults.some((result)=>result.isFetching),
|
|
128
|
-
isLoading: mergedQueryResults.some((result)=>result.isLoading),
|
|
129
|
-
refetchAll,
|
|
130
|
-
errors: mergedQueryResults.map((result)=>result.error)
|
|
131
|
-
};
|
|
132
|
-
}, [
|
|
133
|
-
alertsQueries,
|
|
134
|
-
alertsResults,
|
|
135
|
-
logQueries,
|
|
136
|
-
logResults,
|
|
137
|
-
profileQueries,
|
|
138
|
-
profileResults,
|
|
139
|
-
silencesQueries,
|
|
140
|
-
silencesResults,
|
|
141
|
-
timeSeriesQueries,
|
|
142
|
-
timeSeriesResults,
|
|
143
|
-
traceQueries,
|
|
144
|
-
traceResults,
|
|
145
|
-
definitions,
|
|
146
|
-
queryOptions?.enabled,
|
|
147
|
-
refetchAll,
|
|
148
|
-
usageMetrics
|
|
149
|
-
]);
|
|
150
|
-
return /*#__PURE__*/ (0, _jsxruntime.jsx)(DataQueriesContext.Provider, {
|
|
151
|
-
value: ctx,
|
|
152
|
-
children: children
|
|
153
|
-
});
|
|
154
|
-
}
|
|
@@ -1,31 +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
|
-
_export_star(require("./DataQueriesProvider"), exports);
|
|
18
|
-
_export_star(require("./model"), exports);
|
|
19
|
-
function _export_star(from, to) {
|
|
20
|
-
Object.keys(from).forEach(function(k) {
|
|
21
|
-
if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) {
|
|
22
|
-
Object.defineProperty(to, k, {
|
|
23
|
-
enumerable: true,
|
|
24
|
-
get: function() {
|
|
25
|
-
return from[k];
|
|
26
|
-
}
|
|
27
|
-
});
|
|
28
|
-
}
|
|
29
|
-
});
|
|
30
|
-
return from;
|
|
31
|
-
}
|
|
@@ -1,34 +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
|
-
Object.defineProperty(exports, "transformQueryResults", {
|
|
18
|
-
enumerable: true,
|
|
19
|
-
get: function() {
|
|
20
|
-
return transformQueryResults;
|
|
21
|
-
}
|
|
22
|
-
});
|
|
23
|
-
function transformQueryResults(results, definitions) {
|
|
24
|
-
return results.map(({ data, isFetching, isLoading, refetch, error }, i)=>{
|
|
25
|
-
return {
|
|
26
|
-
definition: definitions[i],
|
|
27
|
-
data,
|
|
28
|
-
isFetching,
|
|
29
|
-
isLoading,
|
|
30
|
-
refetch,
|
|
31
|
-
error
|
|
32
|
-
};
|
|
33
|
-
});
|
|
34
|
-
}
|
|
@@ -1,114 +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 ReactRouterProvider () {
|
|
25
|
-
return ReactRouterProvider;
|
|
26
|
-
},
|
|
27
|
-
get RouterContext () {
|
|
28
|
-
return RouterContext;
|
|
29
|
-
},
|
|
30
|
-
get RouterProvider () {
|
|
31
|
-
return RouterProvider;
|
|
32
|
-
},
|
|
33
|
-
get useRouterContext () {
|
|
34
|
-
return useRouterContext;
|
|
35
|
-
}
|
|
36
|
-
});
|
|
37
|
-
const _jsxruntime = require("react/jsx-runtime");
|
|
38
|
-
const _react = /*#__PURE__*/ _interop_require_wildcard(require("react"));
|
|
39
|
-
const _reactrouterdom = require("react-router-dom");
|
|
40
|
-
function _getRequireWildcardCache(nodeInterop) {
|
|
41
|
-
if (typeof WeakMap !== "function") return null;
|
|
42
|
-
var cacheBabelInterop = new WeakMap();
|
|
43
|
-
var cacheNodeInterop = new WeakMap();
|
|
44
|
-
return (_getRequireWildcardCache = function(nodeInterop) {
|
|
45
|
-
return nodeInterop ? cacheNodeInterop : cacheBabelInterop;
|
|
46
|
-
})(nodeInterop);
|
|
47
|
-
}
|
|
48
|
-
function _interop_require_wildcard(obj, nodeInterop) {
|
|
49
|
-
if (!nodeInterop && obj && obj.__esModule) {
|
|
50
|
-
return obj;
|
|
51
|
-
}
|
|
52
|
-
if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
|
|
53
|
-
return {
|
|
54
|
-
default: obj
|
|
55
|
-
};
|
|
56
|
-
}
|
|
57
|
-
var cache = _getRequireWildcardCache(nodeInterop);
|
|
58
|
-
if (cache && cache.has(obj)) {
|
|
59
|
-
return cache.get(obj);
|
|
60
|
-
}
|
|
61
|
-
var newObj = {
|
|
62
|
-
__proto__: null
|
|
63
|
-
};
|
|
64
|
-
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
65
|
-
for(var key in obj){
|
|
66
|
-
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
67
|
-
var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
|
|
68
|
-
if (desc && (desc.get || desc.set)) {
|
|
69
|
-
Object.defineProperty(newObj, key, desc);
|
|
70
|
-
} else {
|
|
71
|
-
newObj[key] = obj[key];
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
newObj.default = obj;
|
|
76
|
-
if (cache) {
|
|
77
|
-
cache.set(obj, newObj);
|
|
78
|
-
}
|
|
79
|
-
return newObj;
|
|
80
|
-
}
|
|
81
|
-
const RouterContext = /*#__PURE__*/ (0, _react.createContext)(undefined);
|
|
82
|
-
function useRouterContext() {
|
|
83
|
-
const ctx = (0, _react.useContext)(RouterContext);
|
|
84
|
-
if (ctx === undefined) {
|
|
85
|
-
console.warn('No RouterContext found. Did you forget a <RouterProvider>?');
|
|
86
|
-
return {};
|
|
87
|
-
}
|
|
88
|
-
return ctx;
|
|
89
|
-
}
|
|
90
|
-
function RouterProvider(props) {
|
|
91
|
-
const { RouterComponent, navigate, children } = props;
|
|
92
|
-
const ctx = (0, _react.useMemo)(()=>{
|
|
93
|
-
return {
|
|
94
|
-
RouterComponent,
|
|
95
|
-
navigate
|
|
96
|
-
};
|
|
97
|
-
}, [
|
|
98
|
-
RouterComponent,
|
|
99
|
-
navigate
|
|
100
|
-
]);
|
|
101
|
-
return /*#__PURE__*/ (0, _jsxruntime.jsx)(RouterContext.Provider, {
|
|
102
|
-
value: ctx,
|
|
103
|
-
children: children
|
|
104
|
-
});
|
|
105
|
-
}
|
|
106
|
-
function ReactRouterProvider(props) {
|
|
107
|
-
const { children } = props;
|
|
108
|
-
const navigate = (0, _reactrouterdom.useNavigate)();
|
|
109
|
-
return /*#__PURE__*/ (0, _jsxruntime.jsx)(RouterProvider, {
|
|
110
|
-
RouterComponent: _reactrouterdom.Link,
|
|
111
|
-
navigate: navigate,
|
|
112
|
-
children: children
|
|
113
|
-
});
|
|
114
|
-
}
|
|
@@ -1,201 +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 TimeRangeContext () {
|
|
25
|
-
return TimeRangeContext;
|
|
26
|
-
},
|
|
27
|
-
get TimeRangeProvider () {
|
|
28
|
-
return TimeRangeProvider;
|
|
29
|
-
},
|
|
30
|
-
get useSuggestedStepMs () {
|
|
31
|
-
return useSuggestedStepMs;
|
|
32
|
-
},
|
|
33
|
-
get useTimeRange () {
|
|
34
|
-
return useTimeRange;
|
|
35
|
-
},
|
|
36
|
-
get useTimeRangeContext () {
|
|
37
|
-
return useTimeRangeContext;
|
|
38
|
-
}
|
|
39
|
-
});
|
|
40
|
-
const _jsxruntime = require("react/jsx-runtime");
|
|
41
|
-
const _react = /*#__PURE__*/ _interop_require_wildcard(require("react"));
|
|
42
|
-
const _spec = require("@perses-dev/spec");
|
|
43
|
-
const _reactquery = require("@tanstack/react-query");
|
|
44
|
-
const _refreshinterval = require("./refresh-interval");
|
|
45
|
-
function _getRequireWildcardCache(nodeInterop) {
|
|
46
|
-
if (typeof WeakMap !== "function") return null;
|
|
47
|
-
var cacheBabelInterop = new WeakMap();
|
|
48
|
-
var cacheNodeInterop = new WeakMap();
|
|
49
|
-
return (_getRequireWildcardCache = function(nodeInterop) {
|
|
50
|
-
return nodeInterop ? cacheNodeInterop : cacheBabelInterop;
|
|
51
|
-
})(nodeInterop);
|
|
52
|
-
}
|
|
53
|
-
function _interop_require_wildcard(obj, nodeInterop) {
|
|
54
|
-
if (!nodeInterop && obj && obj.__esModule) {
|
|
55
|
-
return obj;
|
|
56
|
-
}
|
|
57
|
-
if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
|
|
58
|
-
return {
|
|
59
|
-
default: obj
|
|
60
|
-
};
|
|
61
|
-
}
|
|
62
|
-
var cache = _getRequireWildcardCache(nodeInterop);
|
|
63
|
-
if (cache && cache.has(obj)) {
|
|
64
|
-
return cache.get(obj);
|
|
65
|
-
}
|
|
66
|
-
var newObj = {
|
|
67
|
-
__proto__: null
|
|
68
|
-
};
|
|
69
|
-
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
70
|
-
for(var key in obj){
|
|
71
|
-
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
72
|
-
var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
|
|
73
|
-
if (desc && (desc.get || desc.set)) {
|
|
74
|
-
Object.defineProperty(newObj, key, desc);
|
|
75
|
-
} else {
|
|
76
|
-
newObj[key] = obj[key];
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
newObj.default = obj;
|
|
81
|
-
if (cache) {
|
|
82
|
-
cache.set(obj, newObj);
|
|
83
|
-
}
|
|
84
|
-
return newObj;
|
|
85
|
-
}
|
|
86
|
-
const TimeRangeContext = /*#__PURE__*/ (0, _react.createContext)(undefined);
|
|
87
|
-
function useTimeRangeContext() {
|
|
88
|
-
const ctx = (0, _react.useContext)(TimeRangeContext);
|
|
89
|
-
if (ctx === undefined) {
|
|
90
|
-
throw new Error('No TimeRangeContext found. Did you forget a Provider?');
|
|
91
|
-
}
|
|
92
|
-
return ctx;
|
|
93
|
-
}
|
|
94
|
-
function useTimeRange() {
|
|
95
|
-
return useTimeRangeContext();
|
|
96
|
-
}
|
|
97
|
-
function useSuggestedStepMs(width) {
|
|
98
|
-
const { absoluteTimeRange } = useTimeRange();
|
|
99
|
-
if (width === undefined) return 0;
|
|
100
|
-
return (0, _spec.getSuggestedStepMs)(absoluteTimeRange, width);
|
|
101
|
-
}
|
|
102
|
-
function TimeRangeProvider(props) {
|
|
103
|
-
const { timeRange, refreshInterval, children, setTimeRange, setRefreshInterval } = props;
|
|
104
|
-
const queryClient = (0, _reactquery.useQueryClient)();
|
|
105
|
-
const [absoluteTimeRange, setAbsoluteTimeRange] = (0, _react.useState)((0, _spec.isRelativeTimeRange)(timeRange) ? (0, _spec.toAbsoluteTimeRange)(timeRange) : timeRange);
|
|
106
|
-
const handleSetTimeRange = (0, _react.useCallback)((value)=>{
|
|
107
|
-
setTimeRange(value);
|
|
108
|
-
setAbsoluteTimeRange((0, _spec.isRelativeTimeRange)(value) ? (0, _spec.toAbsoluteTimeRange)(value) : value);
|
|
109
|
-
}, [
|
|
110
|
-
setTimeRange
|
|
111
|
-
]);
|
|
112
|
-
// Refresh is called when clicking on the refresh button, it refreshes all queries including variables
|
|
113
|
-
const refresh = (0, _react.useCallback)(()=>{
|
|
114
|
-
setAbsoluteTimeRange((0, _spec.isRelativeTimeRange)(timeRange) ? (0, _spec.toAbsoluteTimeRange)(timeRange) : timeRange);
|
|
115
|
-
queryClient.invalidateQueries({
|
|
116
|
-
queryKey: [
|
|
117
|
-
'query'
|
|
118
|
-
]
|
|
119
|
-
}).finally(()=>queryClient.removeQueries({
|
|
120
|
-
queryKey: [
|
|
121
|
-
'query'
|
|
122
|
-
],
|
|
123
|
-
type: 'inactive'
|
|
124
|
-
}));
|
|
125
|
-
queryClient.invalidateQueries({
|
|
126
|
-
queryKey: [
|
|
127
|
-
'variable'
|
|
128
|
-
]
|
|
129
|
-
}).finally(()=>queryClient.removeQueries({
|
|
130
|
-
queryKey: [
|
|
131
|
-
'variable'
|
|
132
|
-
],
|
|
133
|
-
type: 'inactive'
|
|
134
|
-
}));
|
|
135
|
-
}, [
|
|
136
|
-
queryClient,
|
|
137
|
-
timeRange
|
|
138
|
-
]);
|
|
139
|
-
// Auto refresh is only refreshing queries of panels
|
|
140
|
-
const autoRefresh = (0, _react.useCallback)(()=>{
|
|
141
|
-
setAbsoluteTimeRange((0, _spec.isRelativeTimeRange)(timeRange) ? (0, _spec.toAbsoluteTimeRange)(timeRange) : timeRange);
|
|
142
|
-
queryClient.invalidateQueries({
|
|
143
|
-
queryKey: [
|
|
144
|
-
'query'
|
|
145
|
-
]
|
|
146
|
-
}).finally(()=>{
|
|
147
|
-
queryClient.removeQueries({
|
|
148
|
-
queryKey: [
|
|
149
|
-
'query'
|
|
150
|
-
],
|
|
151
|
-
type: 'inactive'
|
|
152
|
-
});
|
|
153
|
-
queryClient.removeQueries({
|
|
154
|
-
queryKey: [
|
|
155
|
-
'variable'
|
|
156
|
-
],
|
|
157
|
-
type: 'inactive'
|
|
158
|
-
}); // Timerange is in queryKey, can lead to memory leak when using relative timerange
|
|
159
|
-
});
|
|
160
|
-
}, [
|
|
161
|
-
queryClient,
|
|
162
|
-
timeRange
|
|
163
|
-
]);
|
|
164
|
-
const refreshIntervalInMs = (0, _react.useMemo)(()=>(0, _refreshinterval.getRefreshIntervalInMs)(refreshInterval), [
|
|
165
|
-
refreshInterval
|
|
166
|
-
]);
|
|
167
|
-
(0, _react.useEffect)(()=>{
|
|
168
|
-
if (refreshIntervalInMs > 0) {
|
|
169
|
-
const interval = setInterval(()=>{
|
|
170
|
-
autoRefresh();
|
|
171
|
-
}, refreshIntervalInMs);
|
|
172
|
-
return ()=>clearInterval(interval);
|
|
173
|
-
}
|
|
174
|
-
}, [
|
|
175
|
-
autoRefresh,
|
|
176
|
-
refreshIntervalInMs
|
|
177
|
-
]);
|
|
178
|
-
const ctx = (0, _react.useMemo)(()=>{
|
|
179
|
-
return {
|
|
180
|
-
timeRange: timeRange,
|
|
181
|
-
setTimeRange: handleSetTimeRange,
|
|
182
|
-
absoluteTimeRange: absoluteTimeRange,
|
|
183
|
-
refresh,
|
|
184
|
-
refreshInterval: refreshInterval,
|
|
185
|
-
refreshIntervalInMs: refreshIntervalInMs,
|
|
186
|
-
setRefreshInterval: setRefreshInterval
|
|
187
|
-
};
|
|
188
|
-
}, [
|
|
189
|
-
absoluteTimeRange,
|
|
190
|
-
handleSetTimeRange,
|
|
191
|
-
refresh,
|
|
192
|
-
refreshInterval,
|
|
193
|
-
refreshIntervalInMs,
|
|
194
|
-
setRefreshInterval,
|
|
195
|
-
timeRange
|
|
196
|
-
]);
|
|
197
|
-
return /*#__PURE__*/ (0, _jsxruntime.jsx)(TimeRangeContext.Provider, {
|
|
198
|
-
value: ctx,
|
|
199
|
-
children: children
|
|
200
|
-
});
|
|
201
|
-
}
|