@perses-dev/plugin-system 0.55.0-beta.3 → 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 +2 -2
- package/dist/components/DatasourceEditorForm/DatasourceEditorForm.d.ts.map +1 -1
- package/dist/components/DatasourceEditorForm/DatasourceEditorForm.js +7 -7
- 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 +2 -2
- package/dist/components/DatasourceTestConnectionButton/DatasourceTestConnectionButton.d.ts.map +1 -1
- package/dist/components/DatasourceTestConnectionButton/DatasourceTestConnectionButton.js +4 -4
- package/dist/components/DatasourceTestConnectionButton/DatasourceTestConnectionButton.js.map +1 -1
- package/dist/components/DatasourceTestConnectionButton/index.js +1 -1
- package/dist/components/DatasourceTestConnectionButton/index.js.map +1 -1
- package/dist/components/HTTPSettingsEditor/HTTPSettingsEditor.d.ts +2 -2
- package/dist/components/HTTPSettingsEditor/HTTPSettingsEditor.d.ts.map +1 -1
- package/dist/components/HTTPSettingsEditor/HTTPSettingsEditor.js +9 -9
- 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 +4 -4
- package/dist/components/LayoutEditor/LayoutEditor.d.ts.map +1 -1
- package/dist/components/LayoutEditor/LayoutEditor.js +7 -7
- package/dist/components/LayoutEditor/LayoutEditor.js.map +1 -1
- package/dist/components/LayoutEditor/RepeatLayoutPreview.d.ts +1 -1
- package/dist/components/LayoutEditor/RepeatLayoutPreview.d.ts.map +1 -1
- package/dist/components/LayoutEditor/RepeatLayoutPreview.js +4 -4
- package/dist/components/LayoutEditor/RepeatLayoutPreview.js.map +1 -1
- package/dist/components/LayoutEditor/RepeatVariableEditor.d.ts +4 -4
- package/dist/components/LayoutEditor/RepeatVariableEditor.d.ts.map +1 -1
- package/dist/components/LayoutEditor/RepeatVariableEditor.js +3 -3
- package/dist/components/LayoutEditor/RepeatVariableEditor.js.map +1 -1
- package/dist/components/LayoutEditor/index.js +3 -3
- package/dist/components/LayoutEditor/index.js.map +1 -1
- 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 -3
- package/dist/components/MultiQueryEditor/MultiQueryEditor.d.ts.map +1 -1
- package/dist/components/MultiQueryEditor/MultiQueryEditor.js +6 -6
- package/dist/components/MultiQueryEditor/MultiQueryEditor.js.map +1 -1
- package/dist/components/MultiQueryEditor/QueryEditorContainer.d.ts +3 -3
- 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 +5 -5
- package/dist/components/PanelSpecEditor/PanelSpecEditor.d.ts.map +1 -1
- package/dist/components/PanelSpecEditor/PanelSpecEditor.js +9 -9
- 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 +7 -7
- 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 +3 -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 -3
- 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 +3 -3
- package/dist/components/PluginSpecEditor/DatasourceSpecEditor.d.ts.map +1 -1
- package/dist/components/PluginSpecEditor/DatasourceSpecEditor.js +3 -3
- package/dist/components/PluginSpecEditor/DatasourceSpecEditor.js.map +1 -1
- package/dist/components/PluginSpecEditor/PluginSpecEditor.d.ts +4 -4
- package/dist/components/PluginSpecEditor/PluginSpecEditor.d.ts.map +1 -1
- package/dist/components/PluginSpecEditor/PluginSpecEditor.js +4 -4
- 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 +10 -10
- 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.js +21 -21
- package/dist/components/index.js.map +1 -1
- package/dist/constants/index.js +2 -2
- package/dist/constants/index.js.map +1 -1
- 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 +2 -2
- package/dist/model/datasource.d.ts.map +1 -1
- package/dist/model/datasource.js.map +1 -1
- package/dist/model/explore.d.ts +2 -2
- package/dist/model/explore.d.ts.map +1 -1
- package/dist/model/explore.js.map +1 -1
- package/dist/model/index.js +17 -17
- package/dist/model/index.js.map +1 -1
- package/dist/model/json-queries.d.ts +3 -3
- package/dist/model/json-queries.d.ts.map +1 -1
- package/dist/model/json-queries.js.map +1 -1
- package/dist/model/legend.d.ts +2 -2
- package/dist/model/legend.d.ts.map +1 -1
- package/dist/model/legend.js +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 +4 -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 +1 -1
- package/dist/model/plugin-base.d.ts.map +1 -1
- package/dist/model/plugin-base.js.map +1 -1
- package/dist/model/plugin-loading.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 +14 -14
- 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 +3 -3
- package/dist/model/variables.d.ts.map +1 -1
- package/dist/model/variables.js.map +1 -1
- package/dist/remote/PluginLoaderComponent.d.ts +1 -1
- 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 -18
- 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 +10 -10
- 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 +6 -6
- 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 +4 -4
- package/dist/runtime/TimeRangeProvider/TimeRangeProviders.js.map +1 -1
- package/dist/runtime/TimeRangeProvider/TimeRangeSettingsProvider.d.ts +2 -2
- package/dist/runtime/TimeRangeProvider/TimeRangeSettingsProvider.d.ts.map +1 -1
- package/dist/runtime/TimeRangeProvider/TimeRangeSettingsProvider.js +3 -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 -2
- 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 -2
- 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.js +16 -16
- 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 +1 -1
- package/dist/runtime/item-actions.js.map +1 -1
- package/dist/runtime/json-queries.d.ts +2 -2
- package/dist/runtime/json-queries.d.ts.map +1 -1
- package/dist/runtime/json-queries.js +4 -4
- package/dist/runtime/json-queries.js.map +1 -1
- 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 -3
- 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 -1
- 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 +2 -2
- 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 +1 -1
- package/dist/test/mock-data.d.ts.map +1 -1
- 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.js +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 +1 -1
- package/dist/test/test-plugins/ernie/index.d.ts.map +1 -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 +4 -4
- 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/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 +7 -7
- 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 -271
- 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/DatasourceTestConnectionButton/DatasourceTestConnectionButton.js +0 -53
- package/dist/cjs/components/DatasourceTestConnectionButton/index.js +0 -30
- package/dist/cjs/components/HTTPSettingsEditor/HTTPSettingsEditor.js +0 -593
- 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/LayoutEditor/LayoutEditor.js +0 -123
- package/dist/cjs/components/LayoutEditor/RepeatLayoutPreview.js +0 -105
- package/dist/cjs/components/LayoutEditor/RepeatVariableEditor.js +0 -176
- package/dist/cjs/components/LayoutEditor/index.js +0 -32
- 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 -162
- 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 -144
- package/dist/cjs/components/PanelSpecEditor/index.js +0 -30
- package/dist/cjs/components/PluginEditor/PluginEditor.js +0 -99
- 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/DatasourceSpecEditor.js +0 -70
- package/dist/cjs/components/PluginSpecEditor/PluginSpecEditor.js +0 -69
- 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 -235
- 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 -50
- package/dist/cjs/constants/index.js +0 -31
- package/dist/cjs/constants/repeat.js +0 -32
- 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/alerts-queries.js +0 -16
- package/dist/cjs/model/annotations.js +0 -16
- package/dist/cjs/model/calculations.js +0 -178
- package/dist/cjs/model/datasource.js +0 -16
- package/dist/cjs/model/explore.js +0 -16
- package/dist/cjs/model/index.js +0 -46
- package/dist/cjs/model/json-queries.js +0 -16
- 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 -323
- package/dist/cjs/remote/index.js +0 -31
- package/dist/cjs/remote/remotePluginLoader.js +0 -101
- package/dist/cjs/runtime/DataQueriesProvider/DataQueriesProvider.js +0 -162
- 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 -215
- package/dist/cjs/runtime/TimeRangeProvider/TimeRangeProviders.js +0 -66
- package/dist/cjs/runtime/TimeRangeProvider/TimeRangeSettingsProvider.js +0 -126
- 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 -45
- package/dist/cjs/runtime/item-actions.js +0 -302
- package/dist/cjs/runtime/json-queries.js +0 -70
- 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 -56
- package/dist/cjs/test/index.js +0 -31
- package/dist/cjs/test/mock-data.js +0 -366
- 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 -26
- package/dist/cjs/test/test-plugins/bert/index.js +0 -99
- package/dist/cjs/test/test-plugins/ernie/index.js +0 -149
- 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,271 +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, "DatasourceEditorForm", {
|
|
18
|
-
enumerable: true,
|
|
19
|
-
get: function() {
|
|
20
|
-
return DatasourceEditorForm;
|
|
21
|
-
}
|
|
22
|
-
});
|
|
23
|
-
const _jsxruntime = require("react/jsx-runtime");
|
|
24
|
-
const _zod = require("@hookform/resolvers/zod");
|
|
25
|
-
const _material = require("@mui/material");
|
|
26
|
-
const _components = require("@perses-dev/components");
|
|
27
|
-
const _react = require("react");
|
|
28
|
-
const _reacthookform = require("react-hook-form");
|
|
29
|
-
const _context = require("../../context");
|
|
30
|
-
const _PluginEditor = require("../PluginEditor");
|
|
31
|
-
function DatasourceEditorForm(props) {
|
|
32
|
-
const { initialDatasourceDefinition, action, isDraft, isReadonly, onActionChange, onSave, onClose, onDelete, testConnection } = props;
|
|
33
|
-
const [isDiscardDialogOpened, setDiscardDialogOpened] = (0, _react.useState)(false);
|
|
34
|
-
const titleAction = (0, _components.getTitleAction)(action, isDraft);
|
|
35
|
-
const submitText = (0, _components.getSubmitText)(action, isDraft);
|
|
36
|
-
const { datasourceEditorSchema } = (0, _context.useValidationSchemas)();
|
|
37
|
-
const form = (0, _reacthookform.useForm)({
|
|
38
|
-
resolver: (0, _zod.zodResolver)(datasourceEditorSchema),
|
|
39
|
-
mode: 'onBlur',
|
|
40
|
-
defaultValues: initialDatasourceDefinition
|
|
41
|
-
});
|
|
42
|
-
/*
|
|
43
|
-
* Remove empty fields that are optional
|
|
44
|
-
*/ function clearFormData(data) {
|
|
45
|
-
const result = {
|
|
46
|
-
...data
|
|
47
|
-
};
|
|
48
|
-
if (result.spec.display?.name === undefined && result.spec.display?.description === undefined) {
|
|
49
|
-
delete result.spec.display;
|
|
50
|
-
}
|
|
51
|
-
return result;
|
|
52
|
-
}
|
|
53
|
-
const processForm = (data)=>{
|
|
54
|
-
onSave(clearFormData(data));
|
|
55
|
-
};
|
|
56
|
-
// When user click on cancel, several possibilities:
|
|
57
|
-
// - create action: ask for discard approval
|
|
58
|
-
// - update action: ask for discard approval if changed
|
|
59
|
-
// - read action: don´t ask for discard approval
|
|
60
|
-
function handleCancel() {
|
|
61
|
-
if (JSON.stringify(initialDatasourceDefinition) !== JSON.stringify(clearFormData(form.getValues()))) {
|
|
62
|
-
setDiscardDialogOpened(true);
|
|
63
|
-
} else {
|
|
64
|
-
onClose();
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
return /*#__PURE__*/ (0, _jsxruntime.jsxs)(_reacthookform.FormProvider, {
|
|
68
|
-
...form,
|
|
69
|
-
children: [
|
|
70
|
-
/*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Box, {
|
|
71
|
-
sx: {
|
|
72
|
-
display: 'flex',
|
|
73
|
-
alignItems: 'center',
|
|
74
|
-
padding: (theme)=>theme.spacing(1, 2),
|
|
75
|
-
borderBottom: (theme)=>`1px solid ${theme.palette.divider}`
|
|
76
|
-
},
|
|
77
|
-
children: [
|
|
78
|
-
/*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Typography, {
|
|
79
|
-
variant: "h2",
|
|
80
|
-
children: [
|
|
81
|
-
titleAction,
|
|
82
|
-
" Datasource"
|
|
83
|
-
]
|
|
84
|
-
}),
|
|
85
|
-
/*#__PURE__*/ (0, _jsxruntime.jsx)(_components.FormActions, {
|
|
86
|
-
action: action,
|
|
87
|
-
submitText: submitText,
|
|
88
|
-
isReadonly: isReadonly,
|
|
89
|
-
isValid: form.formState.isValid,
|
|
90
|
-
onActionChange: onActionChange,
|
|
91
|
-
onSubmit: form.handleSubmit(processForm),
|
|
92
|
-
onDelete: onDelete,
|
|
93
|
-
onCancel: handleCancel
|
|
94
|
-
})
|
|
95
|
-
]
|
|
96
|
-
}),
|
|
97
|
-
/*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Box, {
|
|
98
|
-
padding: 2,
|
|
99
|
-
sx: {
|
|
100
|
-
overflowY: 'scroll'
|
|
101
|
-
},
|
|
102
|
-
children: [
|
|
103
|
-
/*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Grid, {
|
|
104
|
-
container: true,
|
|
105
|
-
spacing: 2,
|
|
106
|
-
mb: 2,
|
|
107
|
-
children: [
|
|
108
|
-
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Grid, {
|
|
109
|
-
item: true,
|
|
110
|
-
xs: 4,
|
|
111
|
-
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_reacthookform.Controller, {
|
|
112
|
-
control: form.control,
|
|
113
|
-
name: "name",
|
|
114
|
-
render: ({ field, fieldState })=>/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.TextField, {
|
|
115
|
-
...field,
|
|
116
|
-
required: true,
|
|
117
|
-
fullWidth: true,
|
|
118
|
-
name: "name",
|
|
119
|
-
label: "Name",
|
|
120
|
-
InputLabelProps: {
|
|
121
|
-
shrink: action === 'read' ? true : undefined
|
|
122
|
-
},
|
|
123
|
-
InputProps: {
|
|
124
|
-
disabled: action === 'update' && !isDraft,
|
|
125
|
-
readOnly: action === 'read'
|
|
126
|
-
},
|
|
127
|
-
error: !!fieldState.error,
|
|
128
|
-
helperText: fieldState.error?.message,
|
|
129
|
-
value: field.value ?? '',
|
|
130
|
-
onChange: (event)=>{
|
|
131
|
-
field.onChange(event);
|
|
132
|
-
}
|
|
133
|
-
})
|
|
134
|
-
})
|
|
135
|
-
}),
|
|
136
|
-
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Grid, {
|
|
137
|
-
item: true,
|
|
138
|
-
xs: 8,
|
|
139
|
-
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_reacthookform.Controller, {
|
|
140
|
-
control: form.control,
|
|
141
|
-
name: "spec.display.name",
|
|
142
|
-
render: ({ field, fieldState })=>/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.TextField, {
|
|
143
|
-
...field,
|
|
144
|
-
fullWidth: true,
|
|
145
|
-
name: "title",
|
|
146
|
-
label: "Display Label",
|
|
147
|
-
InputLabelProps: {
|
|
148
|
-
shrink: action === 'read' ? true : undefined
|
|
149
|
-
},
|
|
150
|
-
InputProps: {
|
|
151
|
-
readOnly: action === 'read'
|
|
152
|
-
},
|
|
153
|
-
error: !!fieldState.error,
|
|
154
|
-
helperText: fieldState.error?.message,
|
|
155
|
-
value: field.value ?? '',
|
|
156
|
-
onChange: (event)=>{
|
|
157
|
-
field.onChange(event);
|
|
158
|
-
}
|
|
159
|
-
})
|
|
160
|
-
})
|
|
161
|
-
}),
|
|
162
|
-
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Grid, {
|
|
163
|
-
item: true,
|
|
164
|
-
xs: 12,
|
|
165
|
-
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_reacthookform.Controller, {
|
|
166
|
-
control: form.control,
|
|
167
|
-
name: "spec.display.description",
|
|
168
|
-
render: ({ field, fieldState })=>/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.TextField, {
|
|
169
|
-
...field,
|
|
170
|
-
fullWidth: true,
|
|
171
|
-
name: "description",
|
|
172
|
-
label: "Description",
|
|
173
|
-
InputLabelProps: {
|
|
174
|
-
shrink: action === 'read' ? true : undefined
|
|
175
|
-
},
|
|
176
|
-
InputProps: {
|
|
177
|
-
readOnly: action === 'read'
|
|
178
|
-
},
|
|
179
|
-
error: !!fieldState.error,
|
|
180
|
-
helperText: fieldState.error?.message,
|
|
181
|
-
value: field.value ?? '',
|
|
182
|
-
onChange: (event)=>{
|
|
183
|
-
field.onChange(event);
|
|
184
|
-
}
|
|
185
|
-
})
|
|
186
|
-
})
|
|
187
|
-
}),
|
|
188
|
-
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Grid, {
|
|
189
|
-
item: true,
|
|
190
|
-
xs: 6,
|
|
191
|
-
sx: {
|
|
192
|
-
paddingTop: '5px !important'
|
|
193
|
-
},
|
|
194
|
-
children: /*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Stack, {
|
|
195
|
-
children: [
|
|
196
|
-
/*#__PURE__*/ (0, _jsxruntime.jsx)(_reacthookform.Controller, {
|
|
197
|
-
control: form.control,
|
|
198
|
-
name: "spec.default",
|
|
199
|
-
render: ({ field })=>/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.FormControlLabel, {
|
|
200
|
-
label: "Set as default",
|
|
201
|
-
control: /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Switch, {
|
|
202
|
-
...field,
|
|
203
|
-
checked: !!field.value,
|
|
204
|
-
readOnly: action === 'read',
|
|
205
|
-
onChange: (event)=>{
|
|
206
|
-
if (action === 'read') return; // ReadOnly prop is not blocking user interaction...
|
|
207
|
-
field.onChange(event);
|
|
208
|
-
}
|
|
209
|
-
})
|
|
210
|
-
})
|
|
211
|
-
}),
|
|
212
|
-
/*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Typography, {
|
|
213
|
-
variant: "caption",
|
|
214
|
-
children: [
|
|
215
|
-
"Whether this datasource should be the default ",
|
|
216
|
-
form.getValues().spec.plugin.kind,
|
|
217
|
-
" to be used"
|
|
218
|
-
]
|
|
219
|
-
})
|
|
220
|
-
]
|
|
221
|
-
})
|
|
222
|
-
})
|
|
223
|
-
]
|
|
224
|
-
}),
|
|
225
|
-
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Divider, {}),
|
|
226
|
-
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Typography, {
|
|
227
|
-
py: 1,
|
|
228
|
-
variant: "h3",
|
|
229
|
-
children: "Plugin Options"
|
|
230
|
-
}),
|
|
231
|
-
/*#__PURE__*/ (0, _jsxruntime.jsx)(_reacthookform.Controller, {
|
|
232
|
-
control: form.control,
|
|
233
|
-
name: "spec.plugin",
|
|
234
|
-
render: ({ field })=>/*#__PURE__*/ (0, _jsxruntime.jsx)(_PluginEditor.PluginEditor, {
|
|
235
|
-
width: "100%",
|
|
236
|
-
pluginTypes: [
|
|
237
|
-
'Datasource'
|
|
238
|
-
],
|
|
239
|
-
pluginKindLabel: "Source",
|
|
240
|
-
withRunQueryButton: false,
|
|
241
|
-
value: {
|
|
242
|
-
selection: {
|
|
243
|
-
type: 'Datasource',
|
|
244
|
-
kind: field.value.kind
|
|
245
|
-
},
|
|
246
|
-
spec: field.value.spec
|
|
247
|
-
},
|
|
248
|
-
isReadonly: action === 'read',
|
|
249
|
-
onChange: (v)=>{
|
|
250
|
-
field.onChange({
|
|
251
|
-
kind: v.selection.kind,
|
|
252
|
-
spec: v.spec
|
|
253
|
-
});
|
|
254
|
-
},
|
|
255
|
-
testConnection: testConnection
|
|
256
|
-
})
|
|
257
|
-
})
|
|
258
|
-
]
|
|
259
|
-
}),
|
|
260
|
-
/*#__PURE__*/ (0, _jsxruntime.jsx)(_components.DiscardChangesConfirmationDialog, {
|
|
261
|
-
description: "Are you sure you want to discard your changes? Changes cannot be recovered.",
|
|
262
|
-
isOpen: isDiscardDialogOpened,
|
|
263
|
-
onCancel: ()=>setDiscardDialogOpened(false),
|
|
264
|
-
onDiscardChanges: ()=>{
|
|
265
|
-
setDiscardDialogOpened(false);
|
|
266
|
-
onClose();
|
|
267
|
-
}
|
|
268
|
-
})
|
|
269
|
-
]
|
|
270
|
-
});
|
|
271
|
-
}
|
|
@@ -1,30 +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("./DatasourceEditorForm"), exports);
|
|
18
|
-
function _export_star(from, to) {
|
|
19
|
-
Object.keys(from).forEach(function(k) {
|
|
20
|
-
if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) {
|
|
21
|
-
Object.defineProperty(to, k, {
|
|
22
|
-
enumerable: true,
|
|
23
|
-
get: function() {
|
|
24
|
-
return from[k];
|
|
25
|
-
}
|
|
26
|
-
});
|
|
27
|
-
}
|
|
28
|
-
});
|
|
29
|
-
return from;
|
|
30
|
-
}
|
|
@@ -1,266 +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 DatasourceName () {
|
|
25
|
-
return DatasourceName;
|
|
26
|
-
},
|
|
27
|
-
get DatasourceSelect () {
|
|
28
|
-
return DatasourceSelect;
|
|
29
|
-
},
|
|
30
|
-
get datasourceSelectValueToSelector () {
|
|
31
|
-
return datasourceSelectValueToSelector;
|
|
32
|
-
},
|
|
33
|
-
get isVariableDatasource () {
|
|
34
|
-
return isVariableDatasource;
|
|
35
|
-
},
|
|
36
|
-
get optionValueToSelector () {
|
|
37
|
-
return optionValueToSelector;
|
|
38
|
-
},
|
|
39
|
-
get selectorToOptionValue () {
|
|
40
|
-
return selectorToOptionValue;
|
|
41
|
-
},
|
|
42
|
-
get useDatasourceSelectValueToSelector () {
|
|
43
|
-
return useDatasourceSelectValueToSelector;
|
|
44
|
-
}
|
|
45
|
-
});
|
|
46
|
-
const _jsxruntime = require("react/jsx-runtime");
|
|
47
|
-
const _react = require("react");
|
|
48
|
-
const _material = require("@mui/material");
|
|
49
|
-
const _OpenInNew = /*#__PURE__*/ _interop_require_default(require("mdi-material-ui/OpenInNew"));
|
|
50
|
-
const _runtime = require("../../runtime");
|
|
51
|
-
const _utils = require("../../utils");
|
|
52
|
-
function _interop_require_default(obj) {
|
|
53
|
-
return obj && obj.__esModule ? obj : {
|
|
54
|
-
default: obj
|
|
55
|
-
};
|
|
56
|
-
}
|
|
57
|
-
const DATASOURCE_VARIABLE_VALUE_PREFIX = '__DATASOURCE_VARIABLE_VALUE__';
|
|
58
|
-
const VARIABLE_IDENTIFIER = '$';
|
|
59
|
-
const emptyDatasourceOption = {
|
|
60
|
-
name: '',
|
|
61
|
-
value: ''
|
|
62
|
-
};
|
|
63
|
-
function DatasourceSelect(props) {
|
|
64
|
-
const { datasourcePluginKind, value, project, readOnly, onChange, ...others } = props;
|
|
65
|
-
const { data, isLoading } = (0, _runtime.useListDatasourceSelectItems)(datasourcePluginKind, project);
|
|
66
|
-
const variables = (0, _runtime.useVariableValues)();
|
|
67
|
-
const defaultValue = (0, _react.useMemo)(()=>{
|
|
68
|
-
if (isVariableDatasource(value)) {
|
|
69
|
-
return value;
|
|
70
|
-
}
|
|
71
|
-
const group = (data ?? []).flatMap((itemGroup)=>itemGroup.items).find((item)=>{
|
|
72
|
-
return value.kind === item.selector.kind && value.name === item.selector.name && !item.overridden;
|
|
73
|
-
})?.selector.group;
|
|
74
|
-
return {
|
|
75
|
-
...value,
|
|
76
|
-
group
|
|
77
|
-
};
|
|
78
|
-
}, [
|
|
79
|
-
value,
|
|
80
|
-
data
|
|
81
|
-
]);
|
|
82
|
-
const options = (0, _react.useMemo)(()=>{
|
|
83
|
-
const datasourceOptions = (data || []).flatMap((itemGroup)=>itemGroup.items.map((item)=>({
|
|
84
|
-
groupLabel: itemGroup.group,
|
|
85
|
-
groupEditLink: itemGroup.editLink,
|
|
86
|
-
name: item.name,
|
|
87
|
-
overriding: item.overriding,
|
|
88
|
-
overridden: item.overridden,
|
|
89
|
-
saved: item.saved ?? true,
|
|
90
|
-
group: item.selector.group,
|
|
91
|
-
value: selectorToOptionValue(item.selector)
|
|
92
|
-
})));
|
|
93
|
-
const datasourceOptionsMap = new Map(datasourceOptions.map((option)=>[
|
|
94
|
-
option.name,
|
|
95
|
-
option
|
|
96
|
-
]));
|
|
97
|
-
const variableOptions = Object.entries(variables).flatMap(([name, variable])=>{
|
|
98
|
-
if (Array.isArray(variable.value)) return [];
|
|
99
|
-
const associatedDatasource = datasourceOptionsMap.get(variable.value ?? '');
|
|
100
|
-
if (!associatedDatasource) return [];
|
|
101
|
-
return {
|
|
102
|
-
groupLabel: 'Variables',
|
|
103
|
-
name: `${VARIABLE_IDENTIFIER}${name}`,
|
|
104
|
-
saved: true,
|
|
105
|
-
value: `${DATASOURCE_VARIABLE_VALUE_PREFIX}${VARIABLE_IDENTIFIER}${name}`
|
|
106
|
-
};
|
|
107
|
-
});
|
|
108
|
-
return [
|
|
109
|
-
...datasourceOptions,
|
|
110
|
-
...variableOptions
|
|
111
|
-
];
|
|
112
|
-
}, [
|
|
113
|
-
data,
|
|
114
|
-
variables
|
|
115
|
-
]);
|
|
116
|
-
// While loading available values, just use an empty datasource option so MUI select doesn't warn about values out of range
|
|
117
|
-
const optionValue = isLoading ? emptyDatasourceOption : options.find((option)=>option.value === selectorToOptionValue(defaultValue));
|
|
118
|
-
// When the user makes a selection, convert the string option value back to a DatasourceSelector
|
|
119
|
-
const handleChange = (selectedOption)=>{
|
|
120
|
-
if (selectedOption) {
|
|
121
|
-
const next = optionValueToSelector(selectedOption?.value || '');
|
|
122
|
-
onChange(next);
|
|
123
|
-
} else {
|
|
124
|
-
onChange({
|
|
125
|
-
kind: datasourcePluginKind
|
|
126
|
-
});
|
|
127
|
-
}
|
|
128
|
-
};
|
|
129
|
-
// We use a fake action event when we click on the action of the chip (hijack the "delete" feature).
|
|
130
|
-
// This is because the href link action is on the `deleteIcon` property already, but the `onDelete` property
|
|
131
|
-
// controls its visibility.
|
|
132
|
-
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
133
|
-
const fakeActionEvent = ()=>{};
|
|
134
|
-
return /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Autocomplete, {
|
|
135
|
-
readOnly: readOnly,
|
|
136
|
-
options: options,
|
|
137
|
-
renderInput: (params)=>/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.TextField, {
|
|
138
|
-
...params,
|
|
139
|
-
label: others.label,
|
|
140
|
-
placeholder: ""
|
|
141
|
-
}),
|
|
142
|
-
groupBy: (option)=>option.groupLabel || 'No group',
|
|
143
|
-
getOptionLabel: (option)=>{
|
|
144
|
-
return option.name;
|
|
145
|
-
},
|
|
146
|
-
onChange: (_, v)=>handleChange(v),
|
|
147
|
-
value: optionValue,
|
|
148
|
-
renderOption: (props, option)=>{
|
|
149
|
-
return /*#__PURE__*/ (0, _react.createElement)("li", {
|
|
150
|
-
...props,
|
|
151
|
-
key: option.value
|
|
152
|
-
}, /*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Stack, {
|
|
153
|
-
direction: "row",
|
|
154
|
-
alignItems: "center",
|
|
155
|
-
justifyContent: "space-between",
|
|
156
|
-
width: "100%",
|
|
157
|
-
children: [
|
|
158
|
-
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.ListItemText, {
|
|
159
|
-
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(DatasourceName, {
|
|
160
|
-
name: option.name,
|
|
161
|
-
overridden: option.overridden,
|
|
162
|
-
overriding: option.overriding
|
|
163
|
-
})
|
|
164
|
-
}),
|
|
165
|
-
!option.saved && /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.ListItemText, {
|
|
166
|
-
children: "Save the dashboard to enable this datasource"
|
|
167
|
-
}),
|
|
168
|
-
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.ListItemText, {
|
|
169
|
-
style: {
|
|
170
|
-
textAlign: 'right'
|
|
171
|
-
},
|
|
172
|
-
children: option.groupLabel && option.groupLabel.length > 0 && /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Chip, {
|
|
173
|
-
disabled: false,
|
|
174
|
-
label: option.groupLabel,
|
|
175
|
-
size: "small",
|
|
176
|
-
onDelete: option.groupEditLink ? fakeActionEvent : undefined,
|
|
177
|
-
deleteIcon: option.groupEditLink ? /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.IconButton, {
|
|
178
|
-
href: option.groupEditLink,
|
|
179
|
-
target: "_blank",
|
|
180
|
-
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_OpenInNew.default, {
|
|
181
|
-
fontSize: "small"
|
|
182
|
-
})
|
|
183
|
-
}) : undefined
|
|
184
|
-
})
|
|
185
|
-
})
|
|
186
|
-
]
|
|
187
|
-
}));
|
|
188
|
-
}
|
|
189
|
-
});
|
|
190
|
-
}
|
|
191
|
-
function DatasourceName(props) {
|
|
192
|
-
const { name, overridden, overriding } = props;
|
|
193
|
-
return /*#__PURE__*/ (0, _jsxruntime.jsxs)(_jsxruntime.Fragment, {
|
|
194
|
-
children: [
|
|
195
|
-
`${name} `,
|
|
196
|
-
!overridden && overriding && /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Box, {
|
|
197
|
-
display: "inline",
|
|
198
|
-
fontWeight: "normal",
|
|
199
|
-
color: (theme)=>theme.palette.primary.main,
|
|
200
|
-
children: "(overriding)"
|
|
201
|
-
}),
|
|
202
|
-
overridden && '(overridden)'
|
|
203
|
-
]
|
|
204
|
-
});
|
|
205
|
-
}
|
|
206
|
-
// Delimiter used to stringify/parse option values
|
|
207
|
-
const OPTION_VALUE_DELIMITER = '_____';
|
|
208
|
-
function selectorToOptionValue(selector) {
|
|
209
|
-
if (isVariableDatasource(selector)) {
|
|
210
|
-
return `${DATASOURCE_VARIABLE_VALUE_PREFIX}${selector}`;
|
|
211
|
-
}
|
|
212
|
-
return [
|
|
213
|
-
selector.kind,
|
|
214
|
-
selector.group ?? '',
|
|
215
|
-
selector.name ?? ''
|
|
216
|
-
].join(OPTION_VALUE_DELIMITER);
|
|
217
|
-
}
|
|
218
|
-
function optionValueToSelector(optionValue) {
|
|
219
|
-
if (optionValue.startsWith(DATASOURCE_VARIABLE_VALUE_PREFIX)) {
|
|
220
|
-
return optionValue.split(DATASOURCE_VARIABLE_VALUE_PREFIX)[1];
|
|
221
|
-
}
|
|
222
|
-
const words = optionValue.split(OPTION_VALUE_DELIMITER);
|
|
223
|
-
const kind = words[0];
|
|
224
|
-
const name = words[2];
|
|
225
|
-
if (kind === undefined || name === undefined) {
|
|
226
|
-
throw new Error('Invalid optionValue string');
|
|
227
|
-
}
|
|
228
|
-
return {
|
|
229
|
-
kind,
|
|
230
|
-
name: name === '' ? undefined : name
|
|
231
|
-
};
|
|
232
|
-
}
|
|
233
|
-
function isVariableDatasource(value) {
|
|
234
|
-
return typeof value === 'string' && value.startsWith(VARIABLE_IDENTIFIER);
|
|
235
|
-
}
|
|
236
|
-
const datasourceSelectValueToSelector = (value, variables, datasourceSelectItemGroups)=>{
|
|
237
|
-
if (!isVariableDatasource(value)) {
|
|
238
|
-
return value;
|
|
239
|
-
}
|
|
240
|
-
const [variableName] = (0, _utils.parseVariables)(value);
|
|
241
|
-
const variable = variables[variableName ?? ''];
|
|
242
|
-
// If the variable is not defined or if its value is an array, we cannot determine a selector and return undefined
|
|
243
|
-
if (!variable || Array.isArray(variable.value)) {
|
|
244
|
-
return undefined;
|
|
245
|
-
}
|
|
246
|
-
const associatedDatasource = (datasourceSelectItemGroups || []).flatMap((itemGroup)=>itemGroup.items).find((datasource)=>datasource.name === variable.value);
|
|
247
|
-
// If the variable value is not a datasource, we cannot determine a selector and return undefined
|
|
248
|
-
if (associatedDatasource === undefined) {
|
|
249
|
-
return undefined;
|
|
250
|
-
}
|
|
251
|
-
const datasourceSelector = {
|
|
252
|
-
kind: associatedDatasource.selector.kind,
|
|
253
|
-
name: associatedDatasource.selector.name
|
|
254
|
-
};
|
|
255
|
-
return datasourceSelector;
|
|
256
|
-
};
|
|
257
|
-
const useDatasourceSelectValueToSelector = (value, datasourcePluginKind)=>{
|
|
258
|
-
const { data } = (0, _runtime.useListDatasourceSelectItems)(datasourcePluginKind);
|
|
259
|
-
const variables = (0, _runtime.useVariableValues)();
|
|
260
|
-
if (!isVariableDatasource(value)) {
|
|
261
|
-
return value;
|
|
262
|
-
}
|
|
263
|
-
return datasourceSelectValueToSelector(value, variables, data) ?? {
|
|
264
|
-
kind: datasourcePluginKind
|
|
265
|
-
};
|
|
266
|
-
};
|
|
@@ -1,30 +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("./DatasourceSelect"), exports);
|
|
18
|
-
function _export_star(from, to) {
|
|
19
|
-
Object.keys(from).forEach(function(k) {
|
|
20
|
-
if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) {
|
|
21
|
-
Object.defineProperty(to, k, {
|
|
22
|
-
enumerable: true,
|
|
23
|
-
get: function() {
|
|
24
|
-
return from[k];
|
|
25
|
-
}
|
|
26
|
-
});
|
|
27
|
-
}
|
|
28
|
-
});
|
|
29
|
-
return from;
|
|
30
|
-
}
|
package/dist/cjs/components/DatasourceTestConnectionButton/DatasourceTestConnectionButton.js
DELETED
|
@@ -1,53 +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, "DatasourceTestConnectionButton", {
|
|
18
|
-
enumerable: true,
|
|
19
|
-
get: function() {
|
|
20
|
-
return DatasourceTestConnectionButton;
|
|
21
|
-
}
|
|
22
|
-
});
|
|
23
|
-
const _jsxruntime = require("react/jsx-runtime");
|
|
24
|
-
const _material = require("@mui/material");
|
|
25
|
-
const _components = require("@perses-dev/components");
|
|
26
|
-
const _react = require("react");
|
|
27
|
-
const DatasourceTestConnectionButton = ({ testConnection, disabled, ...buttonProps })=>{
|
|
28
|
-
const { successSnackbar, exceptionSnackbar } = (0, _components.useSnackbar)();
|
|
29
|
-
const [isTesting, setIsTesting] = (0, _react.useState)(false);
|
|
30
|
-
const handleClick = (0, _react.useCallback)(async ()=>{
|
|
31
|
-
setIsTesting(true);
|
|
32
|
-
try {
|
|
33
|
-
await testConnection();
|
|
34
|
-
successSnackbar('Datasource is healthy');
|
|
35
|
-
} catch (e) {
|
|
36
|
-
exceptionSnackbar(e instanceof Error ? e : new Error('Datasource is not healthy'));
|
|
37
|
-
} finally{
|
|
38
|
-
setIsTesting(false);
|
|
39
|
-
}
|
|
40
|
-
}, [
|
|
41
|
-
testConnection,
|
|
42
|
-
successSnackbar,
|
|
43
|
-
exceptionSnackbar
|
|
44
|
-
]);
|
|
45
|
-
return /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Button, {
|
|
46
|
-
onClick: handleClick,
|
|
47
|
-
color: "info",
|
|
48
|
-
variant: "outlined",
|
|
49
|
-
disabled: disabled || isTesting,
|
|
50
|
-
...buttonProps,
|
|
51
|
-
children: "Test Connection"
|
|
52
|
-
});
|
|
53
|
-
};
|