@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
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Copyright
|
|
1
|
+
// Copyright 2025 The Perses Authors
|
|
2
2
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
3
3
|
// you may not use this file except in compliance with the License.
|
|
4
4
|
// You may obtain a copy of the License at
|
|
@@ -14,11 +14,17 @@
|
|
|
14
14
|
Object.defineProperty(exports, "__esModule", {
|
|
15
15
|
value: true
|
|
16
16
|
});
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
17
|
+
_export_star(require("./MetricLabelInput"), 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,4 +1,4 @@
|
|
|
1
|
-
// Copyright
|
|
1
|
+
// Copyright 2024 The Perses Authors
|
|
2
2
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
3
3
|
// you may not use this file except in compliance with the License.
|
|
4
4
|
// You may obtain a copy of the License at
|
|
@@ -14,35 +14,53 @@
|
|
|
14
14
|
Object.defineProperty(exports, "__esModule", {
|
|
15
15
|
value: true
|
|
16
16
|
});
|
|
17
|
-
Object.defineProperty(exports, "
|
|
17
|
+
Object.defineProperty(exports, "MultiQueryEditor", {
|
|
18
18
|
enumerable: true,
|
|
19
19
|
get: function() {
|
|
20
|
-
return
|
|
20
|
+
return MultiQueryEditor;
|
|
21
21
|
}
|
|
22
22
|
});
|
|
23
23
|
const _jsxruntime = require("react/jsx-runtime");
|
|
24
|
-
const _material = require("@mui/material");
|
|
25
|
-
const _Plus = /*#__PURE__*/ _interop_require_default(require("mdi-material-ui/Plus"));
|
|
26
24
|
const _react = require("react");
|
|
27
25
|
const _immer = require("immer");
|
|
26
|
+
const _material = require("@mui/material");
|
|
27
|
+
const _Plus = /*#__PURE__*/ _interop_require_default(require("mdi-material-ui/Plus"));
|
|
28
28
|
const _runtime = require("../../runtime");
|
|
29
|
-
const
|
|
29
|
+
const _QueryEditorContainer = require("./QueryEditorContainer");
|
|
30
30
|
function _interop_require_default(obj) {
|
|
31
31
|
return obj && obj.__esModule ? obj : {
|
|
32
32
|
default: obj
|
|
33
33
|
};
|
|
34
34
|
}
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
//
|
|
41
|
-
|
|
42
|
-
const { data:
|
|
43
|
-
|
|
35
|
+
function useDefaultQueryDefinition(queryTypes) {
|
|
36
|
+
// Build the default query plugin
|
|
37
|
+
// This will be used only if the queries are empty, to open a starting query
|
|
38
|
+
// Firs the default query type
|
|
39
|
+
const defaultQueryType = queryTypes[0];
|
|
40
|
+
// Then the default plugin kind
|
|
41
|
+
// Use as default the plugin kind explicitly set as default or the first in the list
|
|
42
|
+
const { data: queryPlugins } = (0, _runtime.useListPluginMetadata)(queryTypes);
|
|
43
|
+
const { defaultPluginKinds } = (0, _runtime.usePluginRegistry)();
|
|
44
|
+
const defaultQueryKind = defaultPluginKinds?.[defaultQueryType] ?? queryPlugins?.[0]?.spec.name ?? '';
|
|
45
|
+
const { data: defaultQueryPlugin } = (0, _runtime.usePlugin)(defaultQueryType, defaultQueryKind, {
|
|
46
|
+
throwOnError: true,
|
|
44
47
|
enabled: true
|
|
45
48
|
});
|
|
49
|
+
// This default query definition is used if no query is provided initially or when we add a new query
|
|
50
|
+
return {
|
|
51
|
+
kind: defaultQueryType,
|
|
52
|
+
spec: {
|
|
53
|
+
plugin: {
|
|
54
|
+
kind: defaultQueryKind,
|
|
55
|
+
spec: defaultQueryPlugin?.createInitialOptions() || {}
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
function MultiQueryEditor({ queryTypes, queries = [], onChange }) {
|
|
61
|
+
const defaultInitialQueryDefinition = useDefaultQueryDefinition(queryTypes);
|
|
62
|
+
// State for which queries are collapsed
|
|
63
|
+
const [queriesCollapsed, setQueriesCollapsed] = (0, _react.useState)(queries.map(()=>false));
|
|
46
64
|
// Query handlers
|
|
47
65
|
const handleQueryChange = (index, queryDef)=>{
|
|
48
66
|
onChange((0, _immer.produce)(queries, (draft)=>{
|
|
@@ -56,23 +74,13 @@ function TraceQueryEditor({ queries =[] , onChange }) {
|
|
|
56
74
|
}));
|
|
57
75
|
};
|
|
58
76
|
const handleQueryAdd = ()=>{
|
|
59
|
-
if (!defaultQueryPlugin) return;
|
|
60
77
|
onChange((0, _immer.produce)(queries, (draft)=>{
|
|
61
|
-
const queryDef = {
|
|
62
|
-
kind: DEFAULT_QUERY_PLUGIN_TYPE,
|
|
63
|
-
spec: {
|
|
64
|
-
plugin: {
|
|
65
|
-
kind: defaultTraceQueryKind,
|
|
66
|
-
spec: defaultQueryPlugin.createInitialOptions()
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
};
|
|
70
78
|
if (draft) {
|
|
71
|
-
draft.push(
|
|
79
|
+
draft.push(defaultInitialQueryDefinition);
|
|
72
80
|
} else {
|
|
73
81
|
draft = [
|
|
74
82
|
...queries,
|
|
75
|
-
|
|
83
|
+
defaultInitialQueryDefinition
|
|
76
84
|
];
|
|
77
85
|
}
|
|
78
86
|
}));
|
|
@@ -104,28 +112,19 @@ function TraceQueryEditor({ queries =[] , onChange }) {
|
|
|
104
112
|
};
|
|
105
113
|
// show one query input if queries is empty
|
|
106
114
|
const queryDefinitions = queries.length ? queries : [
|
|
107
|
-
|
|
108
|
-
kind: 'TraceQuery',
|
|
109
|
-
spec: {
|
|
110
|
-
plugin: {
|
|
111
|
-
kind: 'TempoTraceQuery',
|
|
112
|
-
spec: {
|
|
113
|
-
query: ''
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
}
|
|
115
|
+
defaultInitialQueryDefinition
|
|
118
116
|
];
|
|
119
117
|
return /*#__PURE__*/ (0, _jsxruntime.jsxs)(_jsxruntime.Fragment, {
|
|
120
118
|
children: [
|
|
121
119
|
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Stack, {
|
|
122
120
|
spacing: 1,
|
|
123
|
-
children: queryDefinitions.map((query, i)=>/*#__PURE__*/ (0, _jsxruntime.jsx)(
|
|
121
|
+
children: queryDefinitions.map((query, i)=>/*#__PURE__*/ (0, _jsxruntime.jsx)(_QueryEditorContainer.QueryEditorContainer, {
|
|
122
|
+
queryTypes: queryTypes,
|
|
124
123
|
index: i,
|
|
125
124
|
query: query,
|
|
126
125
|
isCollapsed: !!queriesCollapsed[i],
|
|
127
126
|
onChange: handleQueryChange,
|
|
128
|
-
onDelete:
|
|
127
|
+
onDelete: queries.length > 1 ? handleQueryDelete : undefined,
|
|
129
128
|
onCollapseExpand: handleQueryCollapseExpand
|
|
130
129
|
}, i))
|
|
131
130
|
}),
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Copyright
|
|
1
|
+
// Copyright 2024 The Perses Authors
|
|
2
2
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
3
3
|
// you may not use this file except in compliance with the License.
|
|
4
4
|
// You may obtain a copy of the License at
|
|
@@ -14,10 +14,10 @@
|
|
|
14
14
|
Object.defineProperty(exports, "__esModule", {
|
|
15
15
|
value: true
|
|
16
16
|
});
|
|
17
|
-
Object.defineProperty(exports, "
|
|
17
|
+
Object.defineProperty(exports, "QueryEditorContainer", {
|
|
18
18
|
enumerable: true,
|
|
19
19
|
get: function() {
|
|
20
|
-
return
|
|
20
|
+
return QueryEditorContainer;
|
|
21
21
|
}
|
|
22
22
|
});
|
|
23
23
|
const _jsxruntime = require("react/jsx-runtime");
|
|
@@ -32,7 +32,7 @@ function _interop_require_default(obj) {
|
|
|
32
32
|
default: obj
|
|
33
33
|
};
|
|
34
34
|
}
|
|
35
|
-
const
|
|
35
|
+
const QueryEditorContainer = ({ queryTypes, index, query, isCollapsed, onDelete, onChange, onCollapseExpand })=>{
|
|
36
36
|
return /*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Stack, {
|
|
37
37
|
spacing: 1,
|
|
38
38
|
children: [
|
|
@@ -51,7 +51,7 @@ const TimeSeriesQueryInput = ({ index , query , isCollapsed , onDelete , onChang
|
|
|
51
51
|
variant: "overline",
|
|
52
52
|
component: "h4",
|
|
53
53
|
children: [
|
|
54
|
-
"Query ",
|
|
54
|
+
"Query #",
|
|
55
55
|
index + 1
|
|
56
56
|
]
|
|
57
57
|
}),
|
|
@@ -68,6 +68,7 @@ const TimeSeriesQueryInput = ({ index , query , isCollapsed , onDelete , onChang
|
|
|
68
68
|
]
|
|
69
69
|
}),
|
|
70
70
|
!isCollapsed && /*#__PURE__*/ (0, _jsxruntime.jsx)(QueryEditor, {
|
|
71
|
+
queryTypes: queryTypes,
|
|
71
72
|
value: query,
|
|
72
73
|
onChange: (next)=>onChange(index, next)
|
|
73
74
|
})
|
|
@@ -75,21 +76,32 @@ const TimeSeriesQueryInput = ({ index , query , isCollapsed , onDelete , onChang
|
|
|
75
76
|
}, index);
|
|
76
77
|
};
|
|
77
78
|
/**
|
|
78
|
-
*
|
|
79
|
+
* Editor for a query definition. This component is responsible for rendering the plugin editor for the given query.
|
|
80
|
+
* This will allow user to select a plugin extending from the given supported query types, and then edit the plugin
|
|
81
|
+
* spec for this plugin.
|
|
82
|
+
* @param props
|
|
83
|
+
* @constructor
|
|
79
84
|
*/ function QueryEditor(props) {
|
|
80
|
-
const { value
|
|
81
|
-
const { spec: { plugin } } = value;
|
|
85
|
+
const { value, onChange, queryTypes, ...others } = props;
|
|
82
86
|
const handlePluginChange = (next)=>{
|
|
83
87
|
onChange((0, _immer.default)(value, (draft)=>{
|
|
84
|
-
draft.
|
|
88
|
+
draft.kind = next.selection.type;
|
|
89
|
+
draft.spec.plugin.kind = next.selection.kind;
|
|
90
|
+
draft.spec.plugin.spec = next.spec;
|
|
85
91
|
}));
|
|
86
92
|
};
|
|
87
93
|
return /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Box, {
|
|
88
94
|
...others,
|
|
89
95
|
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_PluginEditor.PluginEditor, {
|
|
90
|
-
|
|
96
|
+
pluginTypes: queryTypes,
|
|
91
97
|
pluginKindLabel: "Query Type",
|
|
92
|
-
value:
|
|
98
|
+
value: {
|
|
99
|
+
selection: {
|
|
100
|
+
kind: value.spec.plugin.kind,
|
|
101
|
+
type: value.kind
|
|
102
|
+
},
|
|
103
|
+
spec: value.spec.plugin.spec
|
|
104
|
+
},
|
|
93
105
|
onChange: handlePluginChange
|
|
94
106
|
})
|
|
95
107
|
});
|
|
@@ -0,0 +1,30 @@
|
|
|
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
|
+
_export_star(require("./MultiQueryEditor"), 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
|
+
}
|
|
@@ -25,7 +25,7 @@ const _material = require("@mui/material");
|
|
|
25
25
|
const _react = require("react");
|
|
26
26
|
const _OptionsEditorTabPanel = require("../OptionsEditorTabPanel");
|
|
27
27
|
const OptionsEditorRadios = (props)=>{
|
|
28
|
-
const { tabs
|
|
28
|
+
const { tabs, defaultTab, onModeChange, isReadonly } = props;
|
|
29
29
|
const [activeTab, setActiveTab] = (0, _react.useState)(defaultTab);
|
|
30
30
|
const handleChange = (_, value)=>{
|
|
31
31
|
const v = parseInt(value);
|
|
@@ -46,7 +46,7 @@ const OptionsEditorRadios = (props)=>{
|
|
|
46
46
|
value: activeTab,
|
|
47
47
|
onChange: handleChange,
|
|
48
48
|
"aria-labelledby": "Configuration radio",
|
|
49
|
-
children: tabs.map(({ label
|
|
49
|
+
children: tabs.map(({ label }, i)=>{
|
|
50
50
|
return /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.FormControlLabel, {
|
|
51
51
|
disabled: isReadonly,
|
|
52
52
|
value: i,
|
|
@@ -57,7 +57,7 @@ const OptionsEditorRadios = (props)=>{
|
|
|
57
57
|
})
|
|
58
58
|
})
|
|
59
59
|
}),
|
|
60
|
-
tabs.map(({ label
|
|
60
|
+
tabs.map(({ label, content }, i)=>{
|
|
61
61
|
return /*#__PURE__*/ (0, _jsxruntime.jsx)(_OptionsEditorTabPanel.OptionsEditorTabPanel, {
|
|
62
62
|
value: activeTab,
|
|
63
63
|
index: i,
|
|
@@ -23,7 +23,7 @@ Object.defineProperty(exports, "OptionsEditorTabPanel", {
|
|
|
23
23
|
const _jsxruntime = require("react/jsx-runtime");
|
|
24
24
|
const _material = require("@mui/material");
|
|
25
25
|
function OptionsEditorTabPanel(props) {
|
|
26
|
-
const { children
|
|
26
|
+
const { children, value, index, ...other } = props;
|
|
27
27
|
const isActive = value === index;
|
|
28
28
|
return /*#__PURE__*/ (0, _jsxruntime.jsx)("div", {
|
|
29
29
|
role: "tabpanel",
|
|
@@ -24,7 +24,7 @@ const _jsxruntime = require("react/jsx-runtime");
|
|
|
24
24
|
const _material = require("@mui/material");
|
|
25
25
|
const _react = require("react");
|
|
26
26
|
const _OptionsEditorTabPanel = require("../OptionsEditorTabPanel");
|
|
27
|
-
const OptionsEditorTabs = ({ tabs
|
|
27
|
+
const OptionsEditorTabs = ({ tabs })=>{
|
|
28
28
|
const [activeTab, setActiveTab] = (0, _react.useState)(0);
|
|
29
29
|
const handleChange = (_, newValue)=>{
|
|
30
30
|
setActiveTab(newValue);
|
|
@@ -40,7 +40,7 @@ const OptionsEditorTabs = ({ tabs })=>{
|
|
|
40
40
|
value: activeTab,
|
|
41
41
|
onChange: handleChange,
|
|
42
42
|
"aria-label": "Panel configuration tabs",
|
|
43
|
-
children: tabs.map(({ label
|
|
43
|
+
children: tabs.map(({ label }, i)=>{
|
|
44
44
|
return /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Tab, {
|
|
45
45
|
label: label,
|
|
46
46
|
id: `options-editor-tab-${i}`,
|
|
@@ -49,7 +49,7 @@ const OptionsEditorTabs = ({ tabs })=>{
|
|
|
49
49
|
})
|
|
50
50
|
})
|
|
51
51
|
}),
|
|
52
|
-
tabs.map(({ label
|
|
52
|
+
tabs.map(({ label, content }, i)=>{
|
|
53
53
|
return /*#__PURE__*/ (0, _jsxruntime.jsx)(_OptionsEditorTabPanel.OptionsEditorTabPanel, {
|
|
54
54
|
value: activeTab,
|
|
55
55
|
index: i,
|
|
@@ -22,95 +22,87 @@ Object.defineProperty(exports, "PanelSpecEditor", {
|
|
|
22
22
|
});
|
|
23
23
|
const _jsxruntime = require("react/jsx-runtime");
|
|
24
24
|
const _components = require("@perses-dev/components");
|
|
25
|
+
const _reacthookform = require("react-hook-form");
|
|
25
26
|
const _runtime = require("../../runtime");
|
|
26
27
|
const _OptionsEditorTabs = require("../OptionsEditorTabs");
|
|
27
|
-
const
|
|
28
|
-
const _TraceQueryEditor = require("../TraceQueryEditor");
|
|
28
|
+
const _MultiQueryEditor = require("../MultiQueryEditor");
|
|
29
29
|
function PanelSpecEditor(props) {
|
|
30
|
-
const { panelDefinition
|
|
31
|
-
const { kind
|
|
32
|
-
const { data: plugin
|
|
30
|
+
const { control, panelDefinition, onJSONChange, onQueriesChange, onPluginSpecChange } = props;
|
|
31
|
+
const { kind } = panelDefinition.spec.plugin;
|
|
32
|
+
const { data: plugin, isPending, error } = (0, _runtime.usePlugin)('Panel', kind);
|
|
33
33
|
if (error) {
|
|
34
34
|
return /*#__PURE__*/ (0, _jsxruntime.jsx)(_components.ErrorAlert, {
|
|
35
35
|
error: error
|
|
36
36
|
});
|
|
37
37
|
}
|
|
38
38
|
// TODO: Proper loading indicator
|
|
39
|
-
if (
|
|
39
|
+
if (isPending) {
|
|
40
40
|
return null;
|
|
41
41
|
}
|
|
42
42
|
if (plugin === undefined) {
|
|
43
43
|
throw new Error(`Missing implementation for panel plugin with kind '${kind}'`);
|
|
44
44
|
}
|
|
45
|
-
const
|
|
46
|
-
var _panelDefinition_spec, _queriesList_;
|
|
47
|
-
const queriesList = panelDefinition === null || panelDefinition === void 0 ? void 0 : (_panelDefinition_spec = panelDefinition.spec) === null || _panelDefinition_spec === void 0 ? void 0 : _panelDefinition_spec.queries;
|
|
48
|
-
if (queriesList === undefined) {
|
|
49
|
-
return '';
|
|
50
|
-
}
|
|
51
|
-
const queryType = (_queriesList_ = queriesList[0]) === null || _queriesList_ === void 0 ? void 0 : _queriesList_.kind;
|
|
52
|
-
return queryType;
|
|
53
|
-
};
|
|
54
|
-
// Get the corresponding queryEditor depending on the queryType
|
|
55
|
-
const getQueryEditorComponent = ()=>{
|
|
56
|
-
const queryType = getQueryType();
|
|
57
|
-
// default case handles cause where there is no queryType yet (e.g. UI > 'editing' mode > 'Add Panel')
|
|
58
|
-
switch(queryType){
|
|
59
|
-
case 'TimeSeriesQuery':
|
|
60
|
-
var _panelDefinition_spec_queries;
|
|
61
|
-
return /*#__PURE__*/ (0, _jsxruntime.jsx)(_TimeSeriesQueryEditor.TimeSeriesQueryEditor, {
|
|
62
|
-
queries: (_panelDefinition_spec_queries = panelDefinition.spec.queries) !== null && _panelDefinition_spec_queries !== void 0 ? _panelDefinition_spec_queries : [],
|
|
63
|
-
onChange: onQueriesChange
|
|
64
|
-
});
|
|
65
|
-
case 'TraceQuery':
|
|
66
|
-
var _panelDefinition_spec_queries1;
|
|
67
|
-
return /*#__PURE__*/ (0, _jsxruntime.jsx)(_TraceQueryEditor.TraceQueryEditor, {
|
|
68
|
-
queries: (_panelDefinition_spec_queries1 = panelDefinition.spec.queries) !== null && _panelDefinition_spec_queries1 !== void 0 ? _panelDefinition_spec_queries1 : [],
|
|
69
|
-
onChange: onQueriesChange
|
|
70
|
-
});
|
|
71
|
-
default:
|
|
72
|
-
// ScatterChart only handles trace queries for now
|
|
73
|
-
if (kind === 'ScatterChart') {
|
|
74
|
-
var _panelDefinition_spec_queries2;
|
|
75
|
-
return /*#__PURE__*/ (0, _jsxruntime.jsx)(_TraceQueryEditor.TraceQueryEditor, {
|
|
76
|
-
queries: (_panelDefinition_spec_queries2 = panelDefinition.spec.queries) !== null && _panelDefinition_spec_queries2 !== void 0 ? _panelDefinition_spec_queries2 : [],
|
|
77
|
-
onChange: onQueriesChange
|
|
78
|
-
});
|
|
79
|
-
}
|
|
80
|
-
var _panelDefinition_spec_queries3;
|
|
81
|
-
return /*#__PURE__*/ (0, _jsxruntime.jsx)(_TimeSeriesQueryEditor.TimeSeriesQueryEditor, {
|
|
82
|
-
queries: (_panelDefinition_spec_queries3 = panelDefinition.spec.queries) !== null && _panelDefinition_spec_queries3 !== void 0 ? _panelDefinition_spec_queries3 : [],
|
|
83
|
-
onChange: onQueriesChange
|
|
84
|
-
});
|
|
85
|
-
}
|
|
86
|
-
};
|
|
87
|
-
const { panelOptionsEditorComponents , hideQueryEditor } = plugin;
|
|
45
|
+
const { panelOptionsEditorComponents, hideQueryEditor } = plugin;
|
|
88
46
|
let tabs = [];
|
|
89
47
|
if (!hideQueryEditor) {
|
|
90
48
|
tabs.push({
|
|
91
49
|
label: 'Query',
|
|
92
|
-
content:
|
|
50
|
+
content: /*#__PURE__*/ (0, _jsxruntime.jsx)(_reacthookform.Controller, {
|
|
51
|
+
control: control,
|
|
52
|
+
name: "panelDefinition.spec.queries",
|
|
53
|
+
render: ({ field })=>/*#__PURE__*/ (0, _jsxruntime.jsx)(_MultiQueryEditor.MultiQueryEditor, {
|
|
54
|
+
queryTypes: plugin.supportedQueryTypes ?? [],
|
|
55
|
+
queries: panelDefinition.spec.queries ?? [],
|
|
56
|
+
onChange: (queries)=>{
|
|
57
|
+
field.onChange(queries);
|
|
58
|
+
onQueriesChange(queries);
|
|
59
|
+
}
|
|
60
|
+
})
|
|
61
|
+
})
|
|
93
62
|
});
|
|
94
63
|
}
|
|
95
64
|
if (panelOptionsEditorComponents !== undefined) {
|
|
96
|
-
tabs = tabs.concat(panelOptionsEditorComponents.map(({ label
|
|
65
|
+
tabs = tabs.concat(panelOptionsEditorComponents.map(({ label, content: OptionsEditorComponent })=>({
|
|
97
66
|
label,
|
|
98
|
-
content: /*#__PURE__*/ (0, _jsxruntime.jsx)(
|
|
99
|
-
|
|
100
|
-
|
|
67
|
+
content: /*#__PURE__*/ (0, _jsxruntime.jsx)(_reacthookform.Controller, {
|
|
68
|
+
control: control,
|
|
69
|
+
name: "panelDefinition.spec.plugin.spec",
|
|
70
|
+
render: ({ field })=>/*#__PURE__*/ (0, _jsxruntime.jsx)(OptionsEditorComponent, {
|
|
71
|
+
value: panelDefinition.spec.plugin.spec,
|
|
72
|
+
onChange: (spec)=>{
|
|
73
|
+
field.onChange(spec);
|
|
74
|
+
onPluginSpecChange(spec);
|
|
75
|
+
}
|
|
76
|
+
})
|
|
101
77
|
})
|
|
102
78
|
})));
|
|
103
79
|
}
|
|
104
|
-
// always show json editor by default
|
|
80
|
+
// always show json editor and links editor by default
|
|
81
|
+
tabs.push({
|
|
82
|
+
label: 'Links',
|
|
83
|
+
content: /*#__PURE__*/ (0, _jsxruntime.jsx)(_components.LinksEditor, {
|
|
84
|
+
control: control
|
|
85
|
+
})
|
|
86
|
+
});
|
|
105
87
|
tabs.push({
|
|
106
88
|
label: 'JSON',
|
|
107
|
-
content: /*#__PURE__*/ (0, _jsxruntime.jsx)(
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
89
|
+
content: /*#__PURE__*/ (0, _jsxruntime.jsx)(_reacthookform.Controller, {
|
|
90
|
+
control: control,
|
|
91
|
+
name: "panelDefinition",
|
|
92
|
+
render: ({ field })=>/*#__PURE__*/ (0, _jsxruntime.jsx)(_components.JSONEditor, {
|
|
93
|
+
maxHeight: "80vh",
|
|
94
|
+
value: panelDefinition,
|
|
95
|
+
onChange: (json)=>{
|
|
96
|
+
field.onChange(JSON.parse(json));
|
|
97
|
+
onJSONChange(json);
|
|
98
|
+
}
|
|
99
|
+
})
|
|
111
100
|
})
|
|
112
101
|
});
|
|
113
|
-
return /*#__PURE__*/ (0, _jsxruntime.jsx)(
|
|
114
|
-
|
|
115
|
-
|
|
102
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsx)(_runtime.QueryCountProvider, {
|
|
103
|
+
queryCount: (panelDefinition.spec.queries ?? []).length,
|
|
104
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_OptionsEditorTabs.OptionsEditorTabs, {
|
|
105
|
+
tabs: tabs
|
|
106
|
+
}, tabs.length)
|
|
107
|
+
});
|
|
116
108
|
}
|
|
@@ -22,40 +22,43 @@ Object.defineProperty(exports, "PluginEditor", {
|
|
|
22
22
|
});
|
|
23
23
|
const _jsxruntime = require("react/jsx-runtime");
|
|
24
24
|
const _material = require("@mui/material");
|
|
25
|
+
const _components = require("@perses-dev/components");
|
|
25
26
|
const _PluginKindSelect = require("../PluginKindSelect");
|
|
26
27
|
const _PluginSpecEditor = require("../PluginSpecEditor");
|
|
27
28
|
const _plugineditorapi = require("./plugin-editor-api");
|
|
28
29
|
function PluginEditor(props) {
|
|
29
30
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
30
|
-
const { value
|
|
31
|
-
const {
|
|
31
|
+
const { value, pluginTypes, pluginKindLabel, onChange: _, isReadonly, ...others } = props;
|
|
32
|
+
const { pendingSelection, isLoading, error, onSelectionChange, onSpecChange } = (0, _plugineditorapi.usePluginEditor)(props);
|
|
32
33
|
return /*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Box, {
|
|
33
34
|
...others,
|
|
34
35
|
children: [
|
|
35
36
|
/*#__PURE__*/ (0, _jsxruntime.jsx)(_PluginKindSelect.PluginKindSelect, {
|
|
36
37
|
fullWidth: false,
|
|
37
38
|
sx: {
|
|
38
|
-
mb:
|
|
39
|
+
mb: 2,
|
|
39
40
|
minWidth: 120
|
|
40
41
|
},
|
|
41
42
|
margin: "dense",
|
|
42
43
|
label: pluginKindLabel,
|
|
43
|
-
|
|
44
|
+
pluginTypes: pluginTypes,
|
|
44
45
|
disabled: isLoading,
|
|
45
|
-
value:
|
|
46
|
+
value: pendingSelection ? pendingSelection : value.selection,
|
|
46
47
|
InputProps: {
|
|
47
48
|
readOnly: isReadonly
|
|
48
49
|
},
|
|
49
50
|
error: !!error,
|
|
50
|
-
helperText: error
|
|
51
|
-
onChange:
|
|
51
|
+
helperText: error?.message,
|
|
52
|
+
onChange: onSelectionChange
|
|
52
53
|
}),
|
|
53
|
-
/*#__PURE__*/ (0, _jsxruntime.jsx)(
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
54
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_components.ErrorBoundary, {
|
|
55
|
+
FallbackComponent: _components.ErrorAlert,
|
|
56
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_PluginSpecEditor.PluginSpecEditor, {
|
|
57
|
+
pluginSelection: value.selection,
|
|
58
|
+
value: value.spec,
|
|
59
|
+
onChange: onSpecChange,
|
|
60
|
+
isReadonly: isReadonly
|
|
61
|
+
})
|
|
59
62
|
})
|
|
60
63
|
]
|
|
61
64
|
});
|