@perses-dev/plugin-system 0.0.0-snapshot-scatter-chart-embed-8efdfab → 0.0.0-snapshot-explorer-plugin-c4a7621
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/components/CalculationSelector/CalculationSelector.js +1 -1
- package/dist/cjs/components/DatasourceEditorForm/DatasourceEditorForm.js +83 -163
- package/dist/cjs/components/DatasourceSelect.js +12 -15
- package/dist/cjs/components/HTTPSettingsEditor/HTTPSettingsEditor.js +528 -0
- package/dist/cjs/components/{TimeSeriesQueryEditor → HTTPSettingsEditor}/index.js +2 -2
- package/dist/cjs/components/LegendOptionsEditor/LegendOptionsEditor.js +8 -7
- package/dist/cjs/components/MetricLabelInput/MetricLabelInput.js +41 -0
- package/dist/cjs/{validation/resource.js → components/MetricLabelInput/index.js} +15 -9
- package/dist/cjs/components/{TraceQueryEditor/TraceQueryEditor.js → MultiQueryEditor/MultiQueryEditor.js} +39 -40
- package/dist/cjs/components/{TimeSeriesQueryEditor/TimeSeriesQueryInput.js → MultiQueryEditor/QueryEditorContainer.js} +23 -11
- package/dist/cjs/components/MultiQueryEditor/index.js +30 -0
- package/dist/cjs/components/OptionsEditorRadios/OptionsEditorRadios.js +3 -3
- package/dist/cjs/components/OptionsEditorTabPanel/OptionsEditorTabPanel.js +1 -1
- package/dist/cjs/components/OptionsEditorTabs/OptionsEditorTabs.js +3 -3
- package/dist/cjs/components/PanelSpecEditor/PanelSpecEditor.js +54 -62
- package/dist/cjs/components/PluginEditor/PluginEditor.js +16 -13
- package/dist/cjs/components/PluginEditor/plugin-editor-api.js +44 -33
- package/dist/cjs/components/PluginKindSelect/PluginKindSelect.js +55 -7
- package/dist/cjs/components/PluginRegistry/PluginRegistry.js +9 -10
- package/dist/cjs/components/PluginRegistry/plugin-indexes.js +20 -17
- package/dist/cjs/components/PluginSpecEditor/PluginSpecEditor.js +3 -3
- package/dist/cjs/components/ProjectSelect.js +7 -7
- package/dist/cjs/components/TimeRangeControls/TimeRangeControls.js +131 -0
- package/dist/cjs/components/{TraceQueryEditor → TimeRangeControls}/index.js +1 -1
- package/dist/cjs/components/Variables/VariableEditorForm/VariableEditorForm.js +394 -439
- package/dist/cjs/components/Variables/VariableEditorForm/VariablePreview.js +17 -15
- package/dist/cjs/components/Variables/VariableEditorForm/variable-editor-form-model.js +7 -12
- package/dist/cjs/components/Variables/variable-model.js +35 -37
- package/dist/cjs/components/index.js +4 -1
- package/dist/cjs/constants/user-interface-text.js +4 -1
- package/dist/cjs/context/ProjectStoreProvider.js +12 -9
- package/dist/cjs/context/ValidationProvider.js +69 -0
- package/dist/cjs/context/index.js +1 -0
- package/dist/cjs/index.js +1 -1
- package/dist/{components/TimeSeriesQueryEditor/index.js → cjs/model/explore.js} +4 -3
- package/dist/cjs/model/legend.js +5 -5
- package/dist/cjs/remote/PersesPlugin.types.js +16 -0
- package/dist/cjs/remote/PluginLoaderComponent.js +75 -0
- package/dist/cjs/remote/PluginRuntime.js +267 -0
- package/dist/cjs/{validation → remote}/index.js +2 -4
- package/dist/cjs/remote/remotePluginLoader.js +61 -0
- package/dist/cjs/runtime/DataQueriesProvider/DataQueriesProvider.js +23 -14
- package/dist/cjs/runtime/DataQueriesProvider/model.js +10 -9
- package/dist/cjs/runtime/QueryCountProvider.js +83 -0
- package/dist/cjs/runtime/TimeRangeProvider/TimeRangeProvider.js +37 -13
- package/dist/cjs/runtime/TimeRangeProvider/TimeRangeProviderWithQueryParams.js +3 -3
- package/dist/cjs/runtime/TimeRangeProvider/TimeRangeSettingsProvider.js +100 -0
- package/dist/cjs/runtime/TimeRangeProvider/index.js +2 -1
- package/dist/cjs/runtime/TimeRangeProvider/query-params.js +20 -23
- package/dist/cjs/runtime/UsageMetricsProvider.js +99 -0
- package/dist/cjs/runtime/builtin-variables.js +7 -7
- package/dist/cjs/runtime/datasources.js +30 -21
- package/dist/cjs/runtime/index.js +4 -2
- package/dist/cjs/runtime/plugin-registry.js +48 -36
- package/dist/cjs/runtime/time-series-queries.js +35 -40
- package/dist/cjs/runtime/trace-queries.js +9 -6
- package/dist/cjs/runtime/{template-variables.js → variables.js} +38 -48
- package/dist/cjs/stories/shared-utils/decorators/WithDataQueries.js +1 -1
- package/dist/cjs/stories/shared-utils/decorators/WithPluginRegistry.js +1 -65
- package/dist/cjs/stories/shared-utils/decorators/WithPluginSystemBuiltinVariables.js +1 -1
- package/dist/cjs/stories/shared-utils/decorators/WithPluginSystemDatasourceStore.js +5 -5
- package/dist/cjs/stories/shared-utils/decorators/{WithPluginSystemTemplateVariables.js → WithPluginSystemVariables.js} +9 -9
- package/dist/cjs/stories/shared-utils/decorators/WithTimeRange.js +1 -1
- package/dist/cjs/stories/shared-utils/decorators/index.js +2 -2
- package/dist/cjs/test/mock-data.js +25 -4
- package/dist/cjs/test/render.js +2 -11
- package/dist/cjs/test/test-plugins/bert/index.js +21 -20
- package/dist/cjs/test/test-plugins/ernie/index.js +2 -2
- package/dist/cjs/test/test-plugins/index.js +3 -1
- package/dist/cjs/test-utils/mock-plugin-registry.js +13 -13
- package/dist/cjs/utils/action.js +3 -3
- package/dist/cjs/utils/variables.js +24 -24
- 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 +1 -1
- package/dist/components/CalculationSelector/CalculationSelector.js.map +1 -1
- package/dist/components/DatasourceEditorForm/DatasourceEditorForm.d.ts +7 -7
- package/dist/components/DatasourceEditorForm/DatasourceEditorForm.d.ts.map +1 -1
- package/dist/components/DatasourceEditorForm/DatasourceEditorForm.js +86 -166
- package/dist/components/DatasourceEditorForm/DatasourceEditorForm.js.map +1 -1
- package/dist/components/DatasourceSelect.d.ts +4 -4
- package/dist/components/DatasourceSelect.d.ts.map +1 -1
- package/dist/components/DatasourceSelect.js +9 -12
- package/dist/components/DatasourceSelect.js.map +1 -1
- package/dist/components/HTTPSettingsEditor/HTTPSettingsEditor.d.ts +11 -0
- package/dist/components/HTTPSettingsEditor/HTTPSettingsEditor.d.ts.map +1 -0
- package/dist/components/HTTPSettingsEditor/HTTPSettingsEditor.js +474 -0
- package/dist/components/HTTPSettingsEditor/HTTPSettingsEditor.js.map +1 -0
- package/dist/components/HTTPSettingsEditor/index.d.ts +2 -0
- package/dist/components/HTTPSettingsEditor/index.d.ts.map +1 -0
- package/dist/components/HTTPSettingsEditor/index.js +15 -0
- package/dist/components/HTTPSettingsEditor/index.js.map +1 -0
- package/dist/components/LegendOptionsEditor/LegendOptionsEditor.d.ts +3 -2
- package/dist/components/LegendOptionsEditor/LegendOptionsEditor.d.ts.map +1 -1
- package/dist/components/LegendOptionsEditor/LegendOptionsEditor.js +10 -9
- package/dist/components/LegendOptionsEditor/LegendOptionsEditor.js.map +1 -1
- package/dist/components/MetricLabelInput/MetricLabelInput.d.ts +7 -0
- package/dist/components/MetricLabelInput/MetricLabelInput.d.ts.map +1 -0
- package/dist/components/MetricLabelInput/MetricLabelInput.js +33 -0
- package/dist/components/MetricLabelInput/MetricLabelInput.js.map +1 -0
- package/dist/components/MetricLabelInput/index.d.ts +2 -0
- package/dist/components/MetricLabelInput/index.d.ts.map +1 -0
- package/dist/components/MetricLabelInput/index.js +15 -0
- package/dist/components/MetricLabelInput/index.js.map +1 -0
- package/dist/components/MultiQueryEditor/MultiQueryEditor.d.ts +17 -0
- package/dist/components/MultiQueryEditor/MultiQueryEditor.d.ts.map +1 -0
- package/dist/components/{TimeSeriesQueryEditor/TimeSeriesQueryEditor.js → MultiQueryEditor/MultiQueryEditor.js} +42 -39
- package/dist/components/MultiQueryEditor/MultiQueryEditor.js.map +1 -0
- package/dist/components/MultiQueryEditor/QueryEditorContainer.d.ts +29 -0
- package/dist/components/MultiQueryEditor/QueryEditorContainer.d.ts.map +1 -0
- package/dist/components/{TimeSeriesQueryEditor/TimeSeriesQueryInput.js → MultiQueryEditor/QueryEditorContainer.js} +33 -10
- package/dist/components/MultiQueryEditor/QueryEditorContainer.js.map +1 -0
- package/dist/components/MultiQueryEditor/index.d.ts +2 -0
- package/dist/components/MultiQueryEditor/index.d.ts.map +1 -0
- package/dist/components/MultiQueryEditor/index.js +15 -0
- package/dist/components/{TraceQueryEditor → MultiQueryEditor}/index.js.map +1 -1
- package/dist/components/OptionsEditorRadios/OptionsEditorRadios.d.ts +4 -4
- package/dist/components/OptionsEditorRadios/OptionsEditorRadios.d.ts.map +1 -1
- package/dist/components/OptionsEditorRadios/OptionsEditorRadios.js +3 -3
- package/dist/components/OptionsEditorRadios/OptionsEditorRadios.js.map +1 -1
- package/dist/components/OptionsEditorTabPanel/OptionsEditorTabPanel.d.ts +2 -2
- package/dist/components/OptionsEditorTabPanel/OptionsEditorTabPanel.d.ts.map +1 -1
- package/dist/components/OptionsEditorTabPanel/OptionsEditorTabPanel.js +1 -1
- package/dist/components/OptionsEditorTabPanel/OptionsEditorTabPanel.js.map +1 -1
- package/dist/components/OptionsEditorTabs/OptionsEditorTabs.d.ts +5 -5
- package/dist/components/OptionsEditorTabs/OptionsEditorTabs.d.ts.map +1 -1
- package/dist/components/OptionsEditorTabs/OptionsEditorTabs.js +3 -3
- package/dist/components/OptionsEditorTabs/OptionsEditorTabs.js.map +1 -1
- package/dist/components/PanelSpecEditor/PanelSpecEditor.d.ts +5 -3
- package/dist/components/PanelSpecEditor/PanelSpecEditor.d.ts.map +1 -1
- package/dist/components/PanelSpecEditor/PanelSpecEditor.js +56 -64
- package/dist/components/PanelSpecEditor/PanelSpecEditor.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 +16 -13
- package/dist/components/PluginEditor/PluginEditor.js.map +1 -1
- package/dist/components/PluginEditor/plugin-editor-api.d.ts +16 -10
- package/dist/components/PluginEditor/plugin-editor-api.d.ts.map +1 -1
- package/dist/components/PluginEditor/plugin-editor-api.js +44 -33
- package/dist/components/PluginEditor/plugin-editor-api.js.map +1 -1
- package/dist/components/PluginKindSelect/PluginKindSelect.d.ts +11 -5
- package/dist/components/PluginKindSelect/PluginKindSelect.d.ts.map +1 -1
- package/dist/components/PluginKindSelect/PluginKindSelect.js +61 -10
- package/dist/components/PluginKindSelect/PluginKindSelect.js.map +1 -1
- package/dist/components/PluginRegistry/PluginRegistry.d.ts +4 -4
- package/dist/components/PluginRegistry/PluginRegistry.d.ts.map +1 -1
- package/dist/components/PluginRegistry/PluginRegistry.js +9 -10
- package/dist/components/PluginRegistry/PluginRegistry.js.map +1 -1
- package/dist/components/PluginRegistry/plugin-indexes.d.ts +4 -4
- package/dist/components/PluginRegistry/plugin-indexes.d.ts.map +1 -1
- package/dist/components/PluginRegistry/plugin-indexes.js +17 -14
- package/dist/components/PluginRegistry/plugin-indexes.js.map +1 -1
- package/dist/components/PluginSpecEditor/PluginSpecEditor.d.ts +5 -5
- package/dist/components/PluginSpecEditor/PluginSpecEditor.d.ts.map +1 -1
- package/dist/components/PluginSpecEditor/PluginSpecEditor.js +3 -3
- package/dist/components/PluginSpecEditor/PluginSpecEditor.js.map +1 -1
- package/dist/components/ProjectSelect.d.ts +3 -3
- package/dist/components/ProjectSelect.d.ts.map +1 -1
- package/dist/components/ProjectSelect.js +7 -7
- package/dist/components/ProjectSelect.js.map +1 -1
- package/dist/components/TimeRangeControls/TimeRangeControls.d.ts +14 -0
- package/dist/components/TimeRangeControls/TimeRangeControls.d.ts.map +1 -0
- package/dist/components/TimeRangeControls/TimeRangeControls.js +110 -0
- package/dist/components/TimeRangeControls/TimeRangeControls.js.map +1 -0
- package/dist/components/TimeRangeControls/index.d.ts +2 -0
- package/dist/components/TimeRangeControls/index.d.ts.map +1 -0
- package/dist/components/{TraceQueryEditor → TimeRangeControls}/index.js +1 -1
- package/dist/components/TimeRangeControls/index.js.map +1 -0
- package/dist/components/Variables/VariableEditorForm/VariableEditorForm.d.ts +4 -3
- package/dist/components/Variables/VariableEditorForm/VariableEditorForm.d.ts.map +1 -1
- package/dist/components/Variables/VariableEditorForm/VariableEditorForm.js +395 -442
- package/dist/components/Variables/VariableEditorForm/VariableEditorForm.js.map +1 -1
- package/dist/components/Variables/VariableEditorForm/VariablePreview.d.ts +3 -3
- package/dist/components/Variables/VariableEditorForm/VariablePreview.d.ts.map +1 -1
- package/dist/components/Variables/VariableEditorForm/VariablePreview.js +11 -11
- package/dist/components/Variables/VariableEditorForm/VariablePreview.js.map +1 -1
- package/dist/components/Variables/VariableEditorForm/variable-editor-form-model.d.ts +3 -3
- package/dist/components/Variables/VariableEditorForm/variable-editor-form-model.d.ts.map +1 -1
- package/dist/components/Variables/VariableEditorForm/variable-editor-form-model.js +7 -12
- package/dist/components/Variables/VariableEditorForm/variable-editor-form-model.js.map +1 -1
- package/dist/components/Variables/variable-model.d.ts +2 -1
- package/dist/components/Variables/variable-model.d.ts.map +1 -1
- package/dist/components/Variables/variable-model.js +29 -31
- package/dist/components/Variables/variable-model.js.map +1 -1
- package/dist/components/index.d.ts +4 -1
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/index.js +4 -1
- package/dist/components/index.js.map +1 -1
- package/dist/constants/user-interface-text.d.ts +2 -0
- package/dist/constants/user-interface-text.d.ts.map +1 -1
- package/dist/constants/user-interface-text.js +4 -1
- package/dist/constants/user-interface-text.js.map +1 -1
- package/dist/context/ProjectStoreProvider.d.ts +4 -4
- package/dist/context/ProjectStoreProvider.d.ts.map +1 -1
- package/dist/context/ProjectStoreProvider.js +9 -6
- package/dist/context/ProjectStoreProvider.js.map +1 -1
- package/dist/context/ValidationProvider.d.ts +19 -0
- package/dist/context/ValidationProvider.d.ts.map +1 -0
- package/dist/context/ValidationProvider.js +52 -0
- package/dist/context/ValidationProvider.js.map +1 -0
- package/dist/context/index.d.ts +1 -0
- package/dist/context/index.d.ts.map +1 -1
- package/dist/context/index.js +1 -0
- package/dist/context/index.js.map +1 -1
- package/dist/context/query-params.d.ts.map +1 -1
- package/dist/context/query-params.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/model/datasource.js +3 -1
- package/dist/model/datasource.js.map +1 -1
- package/dist/model/explore.d.ts +13 -0
- package/dist/model/explore.d.ts.map +1 -0
- package/dist/{validation/resource.js → model/explore.js} +4 -3
- package/dist/model/explore.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.map +1 -1
- package/dist/model/panels.d.ts +17 -5
- package/dist/model/panels.d.ts.map +1 -1
- package/dist/model/panels.js.map +1 -1
- package/dist/model/plugin-base.d.ts +0 -1
- package/dist/model/plugin-base.d.ts.map +1 -1
- package/dist/model/plugin-base.js.map +1 -1
- package/dist/model/plugin-loading.js.map +1 -1
- package/dist/model/plugins.d.ts +35 -21
- package/dist/model/plugins.d.ts.map +1 -1
- package/dist/model/plugins.js.map +1 -1
- package/dist/model/time-series-queries.d.ts +4 -3
- package/dist/model/time-series-queries.d.ts.map +1 -1
- package/dist/model/time-series-queries.js.map +1 -1
- package/dist/model/trace-queries.d.ts +1 -1
- package/dist/model/trace-queries.d.ts.map +1 -1
- package/dist/model/trace-queries.js.map +1 -1
- package/dist/model/variables.d.ts +2 -2
- package/dist/model/variables.d.ts.map +1 -1
- package/dist/model/variables.js +3 -1
- package/dist/model/variables.js.map +1 -1
- package/dist/remote/PersesPlugin.types.d.ts +7 -0
- package/dist/remote/PersesPlugin.types.d.ts.map +1 -0
- package/dist/remote/PersesPlugin.types.js +15 -0
- package/dist/remote/PersesPlugin.types.js.map +1 -0
- package/dist/remote/PluginLoaderComponent.d.ts +10 -0
- package/dist/remote/PluginLoaderComponent.d.ts.map +1 -0
- package/dist/remote/PluginLoaderComponent.js +67 -0
- package/dist/remote/PluginLoaderComponent.js.map +1 -0
- package/dist/remote/PluginRuntime.d.ts +11 -0
- package/dist/remote/PluginRuntime.d.ts.map +1 -0
- package/dist/remote/PluginRuntime.js +202 -0
- package/dist/remote/PluginRuntime.js.map +1 -0
- package/dist/remote/index.d.ts +3 -0
- package/dist/remote/index.d.ts.map +1 -0
- package/dist/{validation → remote}/index.js +2 -4
- package/dist/remote/index.js.map +1 -0
- package/dist/remote/remotePluginLoader.d.ts +3 -0
- package/dist/remote/remotePluginLoader.d.ts.map +1 -0
- package/dist/remote/remotePluginLoader.js +53 -0
- package/dist/remote/remotePluginLoader.js.map +1 -0
- package/dist/runtime/DataQueriesProvider/DataQueriesProvider.d.ts +2 -2
- package/dist/runtime/DataQueriesProvider/DataQueriesProvider.d.ts.map +1 -1
- package/dist/runtime/DataQueriesProvider/DataQueriesProvider.js +19 -10
- package/dist/runtime/DataQueriesProvider/DataQueriesProvider.js.map +1 -1
- package/dist/runtime/DataQueriesProvider/model.d.ts +6 -7
- package/dist/runtime/DataQueriesProvider/model.d.ts.map +1 -1
- package/dist/runtime/DataQueriesProvider/model.js +10 -9
- package/dist/runtime/DataQueriesProvider/model.js.map +1 -1
- package/dist/runtime/QueryCountProvider.d.ts +9 -0
- package/dist/runtime/QueryCountProvider.d.ts.map +1 -0
- package/dist/{validation/datasource.js → runtime/QueryCountProvider.js} +14 -10
- package/dist/runtime/QueryCountProvider.js.map +1 -0
- package/dist/runtime/TimeRangeProvider/TimeRangeProvider.d.ts +6 -2
- package/dist/runtime/TimeRangeProvider/TimeRangeProvider.d.ts.map +1 -1
- package/dist/runtime/TimeRangeProvider/TimeRangeProvider.js +30 -9
- package/dist/runtime/TimeRangeProvider/TimeRangeProvider.js.map +1 -1
- package/dist/runtime/TimeRangeProvider/TimeRangeProviderWithQueryParams.d.ts +2 -2
- package/dist/runtime/TimeRangeProvider/TimeRangeProviderWithQueryParams.d.ts.map +1 -1
- package/dist/runtime/TimeRangeProvider/TimeRangeProviderWithQueryParams.js +3 -3
- package/dist/runtime/TimeRangeProvider/TimeRangeProviderWithQueryParams.js.map +1 -1
- package/dist/runtime/TimeRangeProvider/TimeRangeSettingsProvider.d.ts +32 -0
- package/dist/runtime/TimeRangeProvider/TimeRangeSettingsProvider.d.ts.map +1 -0
- package/dist/runtime/TimeRangeProvider/TimeRangeSettingsProvider.js +82 -0
- package/dist/runtime/TimeRangeProvider/TimeRangeSettingsProvider.js.map +1 -0
- package/dist/runtime/TimeRangeProvider/index.d.ts +1 -0
- package/dist/runtime/TimeRangeProvider/index.d.ts.map +1 -1
- package/dist/runtime/TimeRangeProvider/index.js +2 -1
- package/dist/runtime/TimeRangeProvider/index.js.map +1 -1
- package/dist/runtime/TimeRangeProvider/query-params.d.ts +1 -1
- package/dist/runtime/TimeRangeProvider/query-params.d.ts.map +1 -1
- package/dist/runtime/TimeRangeProvider/query-params.js +8 -11
- package/dist/runtime/TimeRangeProvider/query-params.js.map +1 -1
- package/dist/runtime/TimeRangeProvider/refresh-interval.d.ts.map +1 -1
- package/dist/runtime/TimeRangeProvider/refresh-interval.js.map +1 -1
- package/dist/runtime/UsageMetricsProvider.d.ts +25 -0
- package/dist/runtime/UsageMetricsProvider.d.ts.map +1 -0
- package/dist/runtime/UsageMetricsProvider.js +77 -0
- package/dist/runtime/UsageMetricsProvider.js.map +1 -0
- 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 +4 -4
- package/dist/runtime/builtin-variables.js.map +1 -1
- package/dist/runtime/datasources.d.ts +5 -4
- package/dist/runtime/datasources.d.ts.map +1 -1
- package/dist/runtime/datasources.js +24 -15
- package/dist/runtime/datasources.js.map +1 -1
- package/dist/runtime/index.d.ts +3 -1
- package/dist/runtime/index.d.ts.map +1 -1
- package/dist/runtime/index.js +4 -2
- package/dist/runtime/index.js.map +1 -1
- package/dist/runtime/plugin-registry.d.ts +11 -11
- package/dist/runtime/plugin-registry.d.ts.map +1 -1
- package/dist/runtime/plugin-registry.js +40 -28
- package/dist/runtime/plugin-registry.js.map +1 -1
- package/dist/runtime/time-series-queries.d.ts +5 -4
- package/dist/runtime/time-series-queries.d.ts.map +1 -1
- package/dist/runtime/time-series-queries.js +28 -33
- package/dist/runtime/time-series-queries.js.map +1 -1
- package/dist/runtime/trace-queries.d.ts +5 -4
- package/dist/runtime/trace-queries.d.ts.map +1 -1
- package/dist/runtime/trace-queries.js +10 -7
- package/dist/runtime/trace-queries.js.map +1 -1
- package/dist/runtime/{template-variables.d.ts → variables.d.ts} +7 -7
- package/dist/runtime/variables.d.ts.map +1 -0
- package/dist/runtime/{template-variables.js → variables.js} +35 -44
- package/dist/runtime/variables.js.map +1 -0
- package/dist/stories/shared-utils/decorators/WithDataQueries.d.ts +3 -3
- package/dist/stories/shared-utils/decorators/WithDataQueries.d.ts.map +1 -1
- package/dist/stories/shared-utils/decorators/WithDataQueries.js +1 -1
- package/dist/stories/shared-utils/decorators/WithDataQueries.js.map +1 -1
- package/dist/stories/shared-utils/decorators/WithPluginRegistry.d.ts +2 -2
- package/dist/stories/shared-utils/decorators/WithPluginRegistry.d.ts.map +1 -1
- package/dist/stories/shared-utils/decorators/WithPluginRegistry.js +2 -22
- package/dist/stories/shared-utils/decorators/WithPluginRegistry.js.map +1 -1
- package/dist/stories/shared-utils/decorators/WithPluginSystemBuiltinVariables.d.ts +3 -3
- package/dist/stories/shared-utils/decorators/WithPluginSystemBuiltinVariables.d.ts.map +1 -1
- package/dist/stories/shared-utils/decorators/WithPluginSystemBuiltinVariables.js +1 -1
- package/dist/stories/shared-utils/decorators/WithPluginSystemBuiltinVariables.js.map +1 -1
- package/dist/stories/shared-utils/decorators/WithPluginSystemDatasourceStore.d.ts +3 -3
- package/dist/stories/shared-utils/decorators/WithPluginSystemDatasourceStore.d.ts.map +1 -1
- package/dist/stories/shared-utils/decorators/WithPluginSystemDatasourceStore.js +5 -5
- package/dist/stories/shared-utils/decorators/WithPluginSystemDatasourceStore.js.map +1 -1
- package/dist/stories/shared-utils/decorators/WithPluginSystemVariables.d.ts +13 -0
- package/dist/stories/shared-utils/decorators/WithPluginSystemVariables.d.ts.map +1 -0
- package/dist/stories/shared-utils/decorators/{WithPluginSystemTemplateVariables.js → WithPluginSystemVariables.js} +10 -10
- package/dist/stories/shared-utils/decorators/WithPluginSystemVariables.js.map +1 -0
- package/dist/stories/shared-utils/decorators/WithTimeRange.d.ts +3 -3
- package/dist/stories/shared-utils/decorators/WithTimeRange.d.ts.map +1 -1
- package/dist/stories/shared-utils/decorators/WithTimeRange.js +1 -1
- package/dist/stories/shared-utils/decorators/WithTimeRange.js.map +1 -1
- package/dist/stories/shared-utils/decorators/index.d.ts +1 -1
- package/dist/stories/shared-utils/decorators/index.d.ts.map +1 -1
- package/dist/stories/shared-utils/decorators/index.js +2 -2
- package/dist/stories/shared-utils/decorators/index.js.map +1 -1
- package/dist/test/mock-data.d.ts.map +1 -1
- package/dist/test/mock-data.js +25 -4
- package/dist/test/mock-data.js.map +1 -1
- package/dist/test/render.d.ts +4 -4
- package/dist/test/render.d.ts.map +1 -1
- package/dist/test/render.js +2 -11
- package/dist/test/render.js.map +1 -1
- package/dist/test/setup-tests.js.map +1 -1
- package/dist/test/test-plugins/bert/index.d.ts.map +1 -1
- package/dist/test/test-plugins/bert/index.js +21 -20
- package/dist/test/test-plugins/bert/index.js.map +1 -1
- package/dist/test/test-plugins/ernie/index.js +2 -2
- package/dist/test/test-plugins/ernie/index.js.map +1 -1
- package/dist/test-utils/mock-plugin-registry.d.ts +6 -4
- package/dist/test-utils/mock-plugin-registry.d.ts.map +1 -1
- package/dist/test-utils/mock-plugin-registry.js +10 -10
- package/dist/test-utils/mock-plugin-registry.js.map +1 -1
- package/dist/utils/variables.d.ts +4 -4
- package/dist/utils/variables.d.ts.map +1 -1
- package/dist/utils/variables.js +19 -19
- package/dist/utils/variables.js.map +1 -1
- package/package.json +7 -6
- package/dist/cjs/components/TimeSeriesQueryEditor/TimeSeriesQueryEditor.js +0 -146
- package/dist/cjs/components/TraceQueryEditor/TraceQueryInput.js +0 -96
- package/dist/cjs/validation/datasource.js +0 -30
- package/dist/cjs/validation/role.js +0 -85
- package/dist/cjs/validation/rolebinding.js +0 -55
- package/dist/cjs/validation/secret.js +0 -176
- package/dist/cjs/validation/variable.js +0 -48
- package/dist/components/TimeSeriesQueryEditor/TimeSeriesQueryEditor.d.ts +0 -8
- package/dist/components/TimeSeriesQueryEditor/TimeSeriesQueryEditor.d.ts.map +0 -1
- package/dist/components/TimeSeriesQueryEditor/TimeSeriesQueryEditor.js.map +0 -1
- package/dist/components/TimeSeriesQueryEditor/TimeSeriesQueryInput.d.ts +0 -13
- package/dist/components/TimeSeriesQueryEditor/TimeSeriesQueryInput.d.ts.map +0 -1
- package/dist/components/TimeSeriesQueryEditor/TimeSeriesQueryInput.js.map +0 -1
- package/dist/components/TimeSeriesQueryEditor/index.d.ts +0 -2
- package/dist/components/TimeSeriesQueryEditor/index.d.ts.map +0 -1
- package/dist/components/TimeSeriesQueryEditor/index.js.map +0 -1
- package/dist/components/TraceQueryEditor/TraceQueryEditor.d.ts +0 -9
- package/dist/components/TraceQueryEditor/TraceQueryEditor.d.ts.map +0 -1
- package/dist/components/TraceQueryEditor/TraceQueryEditor.js +0 -130
- package/dist/components/TraceQueryEditor/TraceQueryEditor.js.map +0 -1
- package/dist/components/TraceQueryEditor/TraceQueryInput.d.ts +0 -13
- package/dist/components/TraceQueryEditor/TraceQueryInput.d.ts.map +0 -1
- package/dist/components/TraceQueryEditor/TraceQueryInput.js +0 -83
- package/dist/components/TraceQueryEditor/TraceQueryInput.js.map +0 -1
- package/dist/components/TraceQueryEditor/index.d.ts +0 -2
- package/dist/components/TraceQueryEditor/index.d.ts.map +0 -1
- package/dist/runtime/template-variables.d.ts.map +0 -1
- package/dist/runtime/template-variables.js.map +0 -1
- package/dist/stories/shared-utils/decorators/WithPluginSystemTemplateVariables.d.ts +0 -13
- package/dist/stories/shared-utils/decorators/WithPluginSystemTemplateVariables.d.ts.map +0 -1
- package/dist/stories/shared-utils/decorators/WithPluginSystemTemplateVariables.js.map +0 -1
- package/dist/validation/datasource.d.ts +0 -19
- package/dist/validation/datasource.d.ts.map +0 -1
- package/dist/validation/datasource.js.map +0 -1
- package/dist/validation/index.d.ts +0 -5
- package/dist/validation/index.d.ts.map +0 -1
- package/dist/validation/index.js.map +0 -1
- package/dist/validation/resource.d.ts +0 -3
- package/dist/validation/resource.d.ts.map +0 -1
- package/dist/validation/resource.js.map +0 -1
- package/dist/validation/role.d.ts +0 -228
- package/dist/validation/role.d.ts.map +0 -1
- package/dist/validation/role.js +0 -66
- package/dist/validation/role.js.map +0 -1
- package/dist/validation/rolebinding.d.ts +0 -137
- package/dist/validation/rolebinding.d.ts.map +0 -1
- package/dist/validation/rolebinding.js +0 -47
- package/dist/validation/rolebinding.js.map +0 -1
- package/dist/validation/secret.d.ts +0 -964
- package/dist/validation/secret.d.ts.map +0 -1
- package/dist/validation/secret.js +0 -157
- package/dist/validation/secret.js.map +0 -1
- package/dist/validation/variable.d.ts +0 -96
- package/dist/validation/variable.d.ts.map +0 -1
- package/dist/validation/variable.js +0 -40
- package/dist/validation/variable.js.map +0 -1
|
@@ -26,84 +26,95 @@ const _immer = require("immer");
|
|
|
26
26
|
const _runtime = require("../../runtime");
|
|
27
27
|
function usePluginEditor(props) {
|
|
28
28
|
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
29
|
-
const {
|
|
30
|
-
// Keep a stable reference so we don't run the effect below when we don't need to
|
|
29
|
+
const { pluginTypes, value, onHideQueryEditorChange = ()=>{} } = props; // setting onHideQueryEditorChange to empty function here because useEvent requires a function
|
|
30
|
+
// Keep a stable reference, so we don't run the effect below when we don't need to
|
|
31
31
|
const onChange = (0, _core.useEvent)(props.onChange);
|
|
32
32
|
const onHideQuery = (0, _core.useEvent)(onHideQueryEditorChange);
|
|
33
33
|
// The previous spec state for PluginType and kind and a helper function for remembering current values
|
|
34
34
|
const prevSpecState = (0, _react.useRef)({
|
|
35
|
-
[
|
|
36
|
-
[value.kind]: value.spec
|
|
35
|
+
[value.selection.type]: {
|
|
36
|
+
[value.selection.kind]: value.spec
|
|
37
37
|
}
|
|
38
38
|
});
|
|
39
39
|
const rememberCurrentSpecState = (0, _core.useEvent)(()=>{
|
|
40
|
-
let byPluginType = prevSpecState.current[
|
|
40
|
+
let byPluginType = prevSpecState.current[value.selection.type];
|
|
41
41
|
if (byPluginType === undefined) {
|
|
42
42
|
byPluginType = {};
|
|
43
|
-
prevSpecState.current[
|
|
43
|
+
prevSpecState.current[value.selection.type] = byPluginType;
|
|
44
44
|
}
|
|
45
|
-
byPluginType[value.kind] = value.spec;
|
|
45
|
+
byPluginType[value.selection.kind] = value.spec;
|
|
46
46
|
});
|
|
47
47
|
// The previous hide query state for each panel kind
|
|
48
48
|
const hideQueryState = (0, _react.useRef)({
|
|
49
|
-
[value.kind]: false
|
|
49
|
+
[value.selection.kind]: false
|
|
50
50
|
});
|
|
51
|
-
const { defaultPluginKinds
|
|
52
|
-
const
|
|
53
|
-
const
|
|
51
|
+
const { defaultPluginKinds } = (0, _runtime.usePluginRegistry)();
|
|
52
|
+
const defaultPluginType = pluginTypes[0];
|
|
53
|
+
const defaultPluginKind = defaultPluginType ? defaultPluginKinds?.[defaultPluginType] : undefined;
|
|
54
|
+
const defaultPluginSelection = defaultPluginType && defaultPluginKind ? {
|
|
55
|
+
type: defaultPluginType,
|
|
56
|
+
kind: defaultPluginKind
|
|
57
|
+
} : undefined;
|
|
58
|
+
const initPendingSelection = !value.selection && defaultPluginSelection ? defaultPluginSelection : undefined;
|
|
54
59
|
// When kind changes and we haven't loaded that plugin before, we will need to enter a "pending" state so that we
|
|
55
60
|
// can generate proper initial spec values that match the new plugin kind
|
|
56
|
-
const [
|
|
57
|
-
|
|
61
|
+
const [pendingSelection, setPendingSelection] = (0, _react.useState)(initPendingSelection);
|
|
62
|
+
// Take a default kind in case user write explicitly an empty kind in the initial value
|
|
63
|
+
(0, _react.useEffect)(()=>{
|
|
64
|
+
if (value.selection.kind === '') {
|
|
65
|
+
value.selection.kind = defaultPluginKind || '';
|
|
66
|
+
}
|
|
67
|
+
}, [
|
|
68
|
+
value.selection,
|
|
69
|
+
defaultPluginKind
|
|
70
|
+
]);
|
|
71
|
+
const { data: plugin, isFetching, error } = (0, _runtime.usePlugin)(pendingSelection?.type, pendingSelection?.kind || '');
|
|
58
72
|
(0, _react.useEffect)(()=>{
|
|
59
73
|
// Nothing to do if no new plugin kind is pending
|
|
60
|
-
if (
|
|
74
|
+
if (!pendingSelection) return;
|
|
61
75
|
// Can't get spec value until we have a plugin
|
|
62
76
|
if (plugin === undefined) return;
|
|
63
77
|
// Fire an onChange to change to the pending kind with initial values from the plugin
|
|
64
78
|
rememberCurrentSpecState();
|
|
65
79
|
onChange({
|
|
66
|
-
|
|
67
|
-
spec: plugin.createInitialOptions()
|
|
80
|
+
selection: pendingSelection,
|
|
81
|
+
spec: plugin.createInitialOptions ? plugin.createInitialOptions() : {}
|
|
68
82
|
});
|
|
69
|
-
if (
|
|
83
|
+
if (pendingSelection.type === 'Panel') {
|
|
70
84
|
const panelPlugin = plugin;
|
|
71
|
-
hideQueryState.current[
|
|
72
|
-
if (!!panelPlugin.hideQueryEditor !== hideQueryState.current[value.kind]) {
|
|
85
|
+
hideQueryState.current[pendingSelection.kind] = !!panelPlugin.hideQueryEditor;
|
|
86
|
+
if (!!panelPlugin.hideQueryEditor !== hideQueryState.current[value.selection.kind]) {
|
|
73
87
|
onHideQuery(!!panelPlugin.hideQueryEditor);
|
|
74
88
|
}
|
|
75
89
|
}
|
|
76
|
-
|
|
90
|
+
setPendingSelection(undefined);
|
|
77
91
|
}, [
|
|
78
|
-
|
|
92
|
+
pendingSelection,
|
|
79
93
|
plugin,
|
|
80
94
|
rememberCurrentSpecState,
|
|
81
95
|
onChange,
|
|
82
96
|
onHideQuery,
|
|
83
97
|
hideQueryState,
|
|
84
|
-
|
|
85
|
-
value.kind
|
|
98
|
+
value.selection
|
|
86
99
|
]);
|
|
87
100
|
/**
|
|
88
101
|
* When the user tries to change the plugin kind, make sure we have the correct spec for that plugin kind before we
|
|
89
102
|
* make the switch.
|
|
90
|
-
*/ const
|
|
91
|
-
var _prevSpecState_current_pluginType;
|
|
92
|
-
const nextKind = e.target.value;
|
|
103
|
+
*/ const onSelectionChange = (nextSelection)=>{
|
|
93
104
|
// If we already have state for this plugin type/kind from a previous selection, just use it
|
|
94
|
-
const previousState =
|
|
105
|
+
const previousState = prevSpecState.current[nextSelection.type]?.[nextSelection.kind];
|
|
95
106
|
if (previousState !== undefined) {
|
|
96
107
|
rememberCurrentSpecState();
|
|
97
108
|
onChange({
|
|
98
|
-
|
|
109
|
+
selection: nextSelection,
|
|
99
110
|
spec: previousState
|
|
100
111
|
});
|
|
101
112
|
} else {
|
|
102
113
|
// Otherwise, kick off the async loading process
|
|
103
|
-
|
|
114
|
+
setPendingSelection(nextSelection);
|
|
104
115
|
}
|
|
105
|
-
if (
|
|
106
|
-
onHideQuery(!!hideQueryState.current[
|
|
116
|
+
if (nextSelection.type === 'Panel' && hideQueryState.current[nextSelection.kind] !== undefined && hideQueryState.current[value.selection.kind] !== hideQueryState.current[nextSelection.kind]) {
|
|
117
|
+
onHideQuery(!!hideQueryState.current[nextSelection.kind]);
|
|
107
118
|
}
|
|
108
119
|
};
|
|
109
120
|
/**
|
|
@@ -114,10 +125,10 @@ function usePluginEditor(props) {
|
|
|
114
125
|
}));
|
|
115
126
|
};
|
|
116
127
|
return {
|
|
117
|
-
|
|
128
|
+
pendingSelection,
|
|
118
129
|
isLoading: isFetching,
|
|
119
130
|
error,
|
|
120
|
-
|
|
131
|
+
onSelectionChange,
|
|
121
132
|
onSpecChange,
|
|
122
133
|
rememberCurrentSpecState
|
|
123
134
|
};
|
|
@@ -25,28 +25,76 @@ const _material = require("@mui/material");
|
|
|
25
25
|
const _react = require("react");
|
|
26
26
|
const _runtime = require("../../runtime");
|
|
27
27
|
const PluginKindSelect = /*#__PURE__*/ (0, _react.forwardRef)((props, ref)=>{
|
|
28
|
-
const {
|
|
29
|
-
const { data
|
|
28
|
+
const { pluginTypes, value: propValue, onChange, ...others } = props;
|
|
29
|
+
const { data, isLoading } = (0, _runtime.useListPluginMetadata)(pluginTypes);
|
|
30
30
|
// Pass an empty value while options are still loading so MUI doesn't complain about us using an "out of range" value
|
|
31
|
-
const value = propValue
|
|
31
|
+
const value = !propValue || isLoading ? '' : selectionToOptionValue(propValue);
|
|
32
|
+
const handleChange = (event)=>{
|
|
33
|
+
onChange?.(optionValueToSelection(event.target.value));
|
|
34
|
+
};
|
|
35
|
+
const renderValue = (0, _react.useCallback)((selected)=>{
|
|
36
|
+
if (selected === '') {
|
|
37
|
+
return '';
|
|
38
|
+
}
|
|
39
|
+
const selectedValue = optionValueToSelection(selected);
|
|
40
|
+
return data?.find((v)=>v.kind === selectedValue.type && v.spec.name === selectedValue.kind)?.spec.display.name;
|
|
41
|
+
}, [
|
|
42
|
+
data
|
|
43
|
+
]);
|
|
32
44
|
// TODO: Does this need a loading indicator of some kind?
|
|
33
45
|
return /*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.TextField, {
|
|
34
46
|
select: true,
|
|
35
47
|
inputRef: ref,
|
|
36
48
|
...others,
|
|
37
49
|
value: value,
|
|
50
|
+
"aria-label": value,
|
|
51
|
+
onChange: handleChange,
|
|
52
|
+
SelectProps: {
|
|
53
|
+
renderValue
|
|
54
|
+
},
|
|
38
55
|
"data-testid": "plugin-kind-select",
|
|
39
56
|
children: [
|
|
40
57
|
isLoading && /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.MenuItem, {
|
|
41
58
|
value: "",
|
|
42
59
|
children: "Loading..."
|
|
43
60
|
}),
|
|
44
|
-
data
|
|
61
|
+
data?.map((metadata)=>/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.MenuItem, {
|
|
45
62
|
"data-testid": "option",
|
|
46
|
-
value:
|
|
47
|
-
|
|
48
|
-
|
|
63
|
+
value: selectionToOptionValue({
|
|
64
|
+
type: metadata.kind,
|
|
65
|
+
kind: metadata.spec.name
|
|
66
|
+
}),
|
|
67
|
+
children: metadata.spec.display.name
|
|
68
|
+
}, metadata.kind + metadata.spec.name))
|
|
49
69
|
]
|
|
50
70
|
});
|
|
51
71
|
});
|
|
52
72
|
PluginKindSelect.displayName = 'PluginKindSelect';
|
|
73
|
+
// Delimiter used to stringify/parse option values
|
|
74
|
+
const OPTION_VALUE_DELIMITER = '_____';
|
|
75
|
+
/**
|
|
76
|
+
* Given a PluginEditorSelection,
|
|
77
|
+
* returns a string value like `{type}_____{kind}` that can be used as a Select input value.
|
|
78
|
+
* @param selector
|
|
79
|
+
*/ function selectionToOptionValue(selector) {
|
|
80
|
+
return [
|
|
81
|
+
selector.type,
|
|
82
|
+
selector.kind
|
|
83
|
+
].join(OPTION_VALUE_DELIMITER);
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Given an option value name like `{type}_____{kind}`,
|
|
87
|
+
* returns a PluginEditorSelection to be used by the query data model.
|
|
88
|
+
* @param optionValue
|
|
89
|
+
*/ function optionValueToSelection(optionValue) {
|
|
90
|
+
const words = optionValue.split(OPTION_VALUE_DELIMITER);
|
|
91
|
+
const type = words[0];
|
|
92
|
+
const kind = words[1];
|
|
93
|
+
if (type === undefined || kind === undefined) {
|
|
94
|
+
throw new Error('Invalid optionValue string');
|
|
95
|
+
}
|
|
96
|
+
return {
|
|
97
|
+
type,
|
|
98
|
+
kind
|
|
99
|
+
};
|
|
100
|
+
}
|
|
@@ -26,7 +26,7 @@ const _react = require("react");
|
|
|
26
26
|
const _runtime = require("../../runtime");
|
|
27
27
|
const _pluginindexes = require("./plugin-indexes");
|
|
28
28
|
function PluginRegistry(props) {
|
|
29
|
-
const { pluginLoader: { getInstalledPlugins
|
|
29
|
+
const { pluginLoader: { getInstalledPlugins, importPluginModule }, children, defaultPluginKinds } = props;
|
|
30
30
|
const getPluginIndexes = (0, _pluginindexes.usePluginIndexes)(getInstalledPlugins);
|
|
31
31
|
// De-dupe calls to import plugin modules
|
|
32
32
|
const importCache = (0, _react.useRef)(new Map());
|
|
@@ -42,31 +42,30 @@ function PluginRegistry(props) {
|
|
|
42
42
|
}
|
|
43
43
|
return request;
|
|
44
44
|
});
|
|
45
|
-
const getPlugin = (0, _react.useCallback)(async (
|
|
45
|
+
const getPlugin = (0, _react.useCallback)(async (kind, name)=>{
|
|
46
46
|
// Get the indexes of the installed plugins
|
|
47
47
|
const pluginIndexes = await getPluginIndexes();
|
|
48
48
|
// Figure out what module the plugin is in by looking in the index
|
|
49
|
-
const typeAndKindKey = (0, _pluginindexes.getTypeAndKindKey)(
|
|
50
|
-
const resource = pluginIndexes.
|
|
49
|
+
const typeAndKindKey = (0, _pluginindexes.getTypeAndKindKey)(kind, name);
|
|
50
|
+
const resource = pluginIndexes.pluginResourcesByNameAndKind.get(typeAndKindKey);
|
|
51
51
|
if (resource === undefined) {
|
|
52
|
-
throw new Error(`A ${
|
|
52
|
+
throw new Error(`A ${name} plugin for kind '${kind}' is not installed`);
|
|
53
53
|
}
|
|
54
54
|
// Treat the plugin module as a bunch of named exports that have plugins
|
|
55
55
|
const pluginModule = await loadPluginModule(resource);
|
|
56
56
|
// We currently assume that plugin modules will have named exports that match the kinds they handle
|
|
57
|
-
const plugin = pluginModule[
|
|
57
|
+
const plugin = pluginModule[name];
|
|
58
58
|
if (plugin === undefined) {
|
|
59
|
-
throw new Error(`The ${
|
|
59
|
+
throw new Error(`The ${name} plugin for kind '${kind}' is missing from the ${resource.metadata.name} plugin module`);
|
|
60
60
|
}
|
|
61
61
|
return plugin;
|
|
62
62
|
}, [
|
|
63
63
|
getPluginIndexes,
|
|
64
64
|
loadPluginModule
|
|
65
65
|
]);
|
|
66
|
-
const listPluginMetadata = (0, _react.useCallback)(async (
|
|
66
|
+
const listPluginMetadata = (0, _react.useCallback)(async (pluginTypes)=>{
|
|
67
67
|
const pluginIndexes = await getPluginIndexes();
|
|
68
|
-
|
|
69
|
-
return (_pluginIndexes_pluginMetadataByType_get = pluginIndexes.pluginMetadataByType.get(pluginType)) !== null && _pluginIndexes_pluginMetadataByType_get !== void 0 ? _pluginIndexes_pluginMetadataByType_get : [];
|
|
68
|
+
return pluginTypes.flatMap((type)=>pluginIndexes.pluginMetadataByKind.get(type) ?? []);
|
|
70
69
|
}, [
|
|
71
70
|
getPluginIndexes
|
|
72
71
|
]);
|
|
@@ -21,11 +21,11 @@ function _export(target, all) {
|
|
|
21
21
|
});
|
|
22
22
|
}
|
|
23
23
|
_export(exports, {
|
|
24
|
-
usePluginIndexes: function() {
|
|
25
|
-
return usePluginIndexes;
|
|
26
|
-
},
|
|
27
24
|
getTypeAndKindKey: function() {
|
|
28
25
|
return getTypeAndKindKey;
|
|
26
|
+
},
|
|
27
|
+
usePluginIndexes: function() {
|
|
28
|
+
return usePluginIndexes;
|
|
29
29
|
}
|
|
30
30
|
});
|
|
31
31
|
const _core = require("@perses-dev/core");
|
|
@@ -36,29 +36,32 @@ function usePluginIndexes(getInstalledPlugins) {
|
|
|
36
36
|
const createPluginIndexes = (0, _core.useEvent)(async ()=>{
|
|
37
37
|
const installedPlugins = await getInstalledPlugins();
|
|
38
38
|
// Create the two indexes from the installed plugins
|
|
39
|
-
const
|
|
40
|
-
const
|
|
39
|
+
const pluginResourcesByNameAndKind = new Map();
|
|
40
|
+
const pluginMetadataByKind = new Map();
|
|
41
41
|
for (const resource of installedPlugins){
|
|
42
42
|
for (const pluginMetadata of resource.spec.plugins){
|
|
43
|
-
const {
|
|
43
|
+
const { kind, spec: { name } } = pluginMetadata;
|
|
44
44
|
// Index the plugin by type and kind to point at the module that contains it
|
|
45
|
-
const key = getTypeAndKindKey(
|
|
46
|
-
if (
|
|
47
|
-
console.warn(`Got more than one ${
|
|
45
|
+
const key = getTypeAndKindKey(kind, name);
|
|
46
|
+
if (pluginResourcesByNameAndKind.has(key)) {
|
|
47
|
+
console.warn(`Got more than one ${kind} plugin for kind ${name}`);
|
|
48
48
|
}
|
|
49
|
-
|
|
49
|
+
pluginResourcesByNameAndKind.set(key, resource);
|
|
50
50
|
// Index the metadata by plugin type
|
|
51
|
-
let list =
|
|
51
|
+
let list = pluginMetadataByKind.get(kind);
|
|
52
52
|
if (list === undefined) {
|
|
53
53
|
list = [];
|
|
54
|
-
|
|
54
|
+
pluginMetadataByKind.set(kind, list);
|
|
55
55
|
}
|
|
56
|
-
list.push(
|
|
56
|
+
list.push({
|
|
57
|
+
...pluginMetadata,
|
|
58
|
+
module: resource.metadata
|
|
59
|
+
});
|
|
57
60
|
}
|
|
58
61
|
}
|
|
59
62
|
return {
|
|
60
|
-
|
|
61
|
-
|
|
63
|
+
pluginResourcesByNameAndKind,
|
|
64
|
+
pluginMetadataByKind
|
|
62
65
|
};
|
|
63
66
|
});
|
|
64
67
|
// De-dupe creating plugin indexes (i.e. requests to get installed plugins)
|
|
@@ -77,6 +80,6 @@ function usePluginIndexes(getInstalledPlugins) {
|
|
|
77
80
|
]);
|
|
78
81
|
return getPluginIndexes;
|
|
79
82
|
}
|
|
80
|
-
function getTypeAndKindKey(
|
|
81
|
-
return `${
|
|
83
|
+
function getTypeAndKindKey(kind, name) {
|
|
84
|
+
return `${kind}:${name}`;
|
|
82
85
|
}
|
|
@@ -24,8 +24,8 @@ const _jsxruntime = require("react/jsx-runtime");
|
|
|
24
24
|
const _components = require("@perses-dev/components");
|
|
25
25
|
const _runtime = require("../../runtime");
|
|
26
26
|
function PluginSpecEditor(props) {
|
|
27
|
-
const { pluginType
|
|
28
|
-
const { data: plugin
|
|
27
|
+
const { pluginSelection: { type: pluginType, kind: pluginKind }, ...others } = props;
|
|
28
|
+
const { data: plugin, isLoading, error } = (0, _runtime.usePlugin)(pluginType, pluginKind);
|
|
29
29
|
if (error) {
|
|
30
30
|
return /*#__PURE__*/ (0, _jsxruntime.jsx)(_components.ErrorAlert, {
|
|
31
31
|
error: error
|
|
@@ -41,7 +41,7 @@ function PluginSpecEditor(props) {
|
|
|
41
41
|
if (pluginType === 'Panel') {
|
|
42
42
|
throw new Error('This editor should not be used for panel type. Please use Panel Spec Editor instead.');
|
|
43
43
|
}
|
|
44
|
-
const { OptionsEditorComponent
|
|
44
|
+
const { OptionsEditorComponent } = plugin;
|
|
45
45
|
if (OptionsEditorComponent !== undefined) {
|
|
46
46
|
return /*#__PURE__*/ (0, _jsxruntime.jsx)(OptionsEditorComponent, {
|
|
47
47
|
...others
|
|
@@ -24,8 +24,8 @@ const _jsxruntime = require("react/jsx-runtime");
|
|
|
24
24
|
const _material = require("@mui/material");
|
|
25
25
|
const _context = require("../context");
|
|
26
26
|
function ProjectSelect(props) {
|
|
27
|
-
const { onChange
|
|
28
|
-
const { data
|
|
27
|
+
const { onChange, value, ...others } = props;
|
|
28
|
+
const { data, isLoading } = (0, _context.useProjectList)();
|
|
29
29
|
// While loading available values, just use an empty string so MUI select doesn't warn about values out of range
|
|
30
30
|
const optionValue = isLoading ? '' : projectToOptionValue(value);
|
|
31
31
|
// When the user makes a selection, convert the string option value back to a DatasourceSelector
|
|
@@ -44,7 +44,7 @@ function ProjectSelect(props) {
|
|
|
44
44
|
onChange: handleChange,
|
|
45
45
|
children: [
|
|
46
46
|
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.MenuItem, {
|
|
47
|
-
value:
|
|
47
|
+
value: "none",
|
|
48
48
|
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Stack, {
|
|
49
49
|
direction: "row",
|
|
50
50
|
alignItems: "center",
|
|
@@ -56,7 +56,7 @@ function ProjectSelect(props) {
|
|
|
56
56
|
})
|
|
57
57
|
})
|
|
58
58
|
}),
|
|
59
|
-
data
|
|
59
|
+
data?.map((project)=>[
|
|
60
60
|
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.MenuItem, {
|
|
61
61
|
value: project.metadata.name,
|
|
62
62
|
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Stack, {
|
|
@@ -79,8 +79,7 @@ function ProjectSelect(props) {
|
|
|
79
79
|
* returns a string value that can be used as a Select input value.
|
|
80
80
|
* @param selector
|
|
81
81
|
*/ function projectToOptionValue(project) {
|
|
82
|
-
|
|
83
|
-
return (_project_metadata_name = project.metadata.name) !== null && _project_metadata_name !== void 0 ? _project_metadata_name : 'none';
|
|
82
|
+
return project.metadata.name ?? 'none';
|
|
84
83
|
}
|
|
85
84
|
/**
|
|
86
85
|
* Given an option value name,
|
|
@@ -91,6 +90,7 @@ function ProjectSelect(props) {
|
|
|
91
90
|
kind: 'Project',
|
|
92
91
|
metadata: {
|
|
93
92
|
name: optionValue
|
|
94
|
-
}
|
|
93
|
+
},
|
|
94
|
+
spec: {}
|
|
95
95
|
};
|
|
96
96
|
}
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
// Copyright 2024 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: all[name]
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
_export(exports, {
|
|
24
|
+
DEFAULT_REFRESH_INTERVAL_OPTIONS: function() {
|
|
25
|
+
return DEFAULT_REFRESH_INTERVAL_OPTIONS;
|
|
26
|
+
},
|
|
27
|
+
TimeRangeControls: function() {
|
|
28
|
+
return TimeRangeControls;
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
const _jsxruntime = require("react/jsx-runtime");
|
|
32
|
+
const _Refresh = /*#__PURE__*/ _interop_require_default(require("mdi-material-ui/Refresh"));
|
|
33
|
+
const _material = require("@mui/material");
|
|
34
|
+
const _components = require("@perses-dev/components");
|
|
35
|
+
const _react = require("react");
|
|
36
|
+
const _constants = require("../../constants");
|
|
37
|
+
const _runtime = require("../../runtime");
|
|
38
|
+
function _interop_require_default(obj) {
|
|
39
|
+
return obj && obj.__esModule ? obj : {
|
|
40
|
+
default: obj
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
const DEFAULT_REFRESH_INTERVAL_OPTIONS = [
|
|
44
|
+
{
|
|
45
|
+
value: {
|
|
46
|
+
pastDuration: '0s'
|
|
47
|
+
},
|
|
48
|
+
display: 'Off'
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
value: {
|
|
52
|
+
pastDuration: '5s'
|
|
53
|
+
},
|
|
54
|
+
display: '5s'
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
value: {
|
|
58
|
+
pastDuration: '10s'
|
|
59
|
+
},
|
|
60
|
+
display: '10s'
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
value: {
|
|
64
|
+
pastDuration: '15s'
|
|
65
|
+
},
|
|
66
|
+
display: '15s'
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
value: {
|
|
70
|
+
pastDuration: '30s'
|
|
71
|
+
},
|
|
72
|
+
display: '30s'
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
value: {
|
|
76
|
+
pastDuration: '60s'
|
|
77
|
+
},
|
|
78
|
+
display: '1m'
|
|
79
|
+
}
|
|
80
|
+
];
|
|
81
|
+
const DEFAULT_HEIGHT = '34px';
|
|
82
|
+
function TimeRangeControls({ heightPx, showTimeRangeSelector = true, showRefreshButton = true, showRefreshInterval = true, showCustomTimeRange, timePresets }) {
|
|
83
|
+
const { timeRange, setTimeRange, refresh, refreshInterval, setRefreshInterval } = (0, _runtime.useTimeRange)();
|
|
84
|
+
const showCustomTimeRangeValue = (0, _runtime.useShowCustomTimeRangeSetting)(showCustomTimeRange);
|
|
85
|
+
const timePresetsValue = (0, _runtime.useTimeRangeOptionsSetting)(timePresets);
|
|
86
|
+
// Convert height to a string, then use the string for styling
|
|
87
|
+
const height = heightPx === undefined ? DEFAULT_HEIGHT : `${heightPx}px`;
|
|
88
|
+
// add time preset if one does not match duration given in time range
|
|
89
|
+
if ('pastDuration' in timeRange && !timePresetsValue.some((option)=>option.value.pastDuration === timeRange['pastDuration'])) {
|
|
90
|
+
timePresetsValue.push((0, _components.buildRelativeTimeOption)(timeRange['pastDuration']));
|
|
91
|
+
}
|
|
92
|
+
// set the new refresh interval both in the dashboard context & as query param
|
|
93
|
+
const handleRefreshIntervalChange = (0, _react.useCallback)((duration)=>{
|
|
94
|
+
setRefreshInterval(duration);
|
|
95
|
+
}, [
|
|
96
|
+
setRefreshInterval
|
|
97
|
+
]);
|
|
98
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Stack, {
|
|
99
|
+
direction: "row",
|
|
100
|
+
spacing: 1,
|
|
101
|
+
children: [
|
|
102
|
+
showTimeRangeSelector && /*#__PURE__*/ (0, _jsxruntime.jsx)(_components.TimeRangeSelector, {
|
|
103
|
+
timeOptions: timePresetsValue,
|
|
104
|
+
value: timeRange,
|
|
105
|
+
onChange: setTimeRange,
|
|
106
|
+
height: height,
|
|
107
|
+
showCustomTimeRange: showCustomTimeRangeValue
|
|
108
|
+
}),
|
|
109
|
+
showRefreshButton && /*#__PURE__*/ (0, _jsxruntime.jsx)(_components.InfoTooltip, {
|
|
110
|
+
description: _constants.TOOLTIP_TEXT.refresh,
|
|
111
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_components.ToolbarIconButton, {
|
|
112
|
+
"aria-label": _constants.TOOLTIP_TEXT.refresh,
|
|
113
|
+
onClick: refresh,
|
|
114
|
+
sx: {
|
|
115
|
+
height
|
|
116
|
+
},
|
|
117
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_Refresh.default, {})
|
|
118
|
+
})
|
|
119
|
+
}),
|
|
120
|
+
showRefreshInterval && /*#__PURE__*/ (0, _jsxruntime.jsx)(_components.InfoTooltip, {
|
|
121
|
+
description: _constants.TOOLTIP_TEXT.refreshInterval,
|
|
122
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_components.RefreshIntervalPicker, {
|
|
123
|
+
timeOptions: DEFAULT_REFRESH_INTERVAL_OPTIONS,
|
|
124
|
+
value: refreshInterval,
|
|
125
|
+
onChange: handleRefreshIntervalChange,
|
|
126
|
+
height: height
|
|
127
|
+
})
|
|
128
|
+
})
|
|
129
|
+
]
|
|
130
|
+
});
|
|
131
|
+
}
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
Object.defineProperty(exports, "__esModule", {
|
|
15
15
|
value: true
|
|
16
16
|
});
|
|
17
|
-
_export_star(require("./
|
|
17
|
+
_export_star(require("./TimeRangeControls"), exports);
|
|
18
18
|
function _export_star(from, to) {
|
|
19
19
|
Object.keys(from).forEach(function(k) {
|
|
20
20
|
if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) {
|