@perses-dev/plugin-system 0.0.0-snapshot-scatterplot-fix-imports-95e1b59 → 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/DatasourceEditorForm/DatasourceEditorForm.js +82 -162
- package/dist/cjs/components/DatasourceSelect.js +8 -13
- 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/components/{TraceQueryEditor → MetricLabelInput}/index.js +2 -2
- package/dist/cjs/components/{TimeSeriesQueryEditor/TimeSeriesQueryEditor.js → MultiQueryEditor/MultiQueryEditor.js} +22 -18
- package/dist/cjs/components/{TimeSeriesQueryEditor/TimeSeriesQueryInput.js → MultiQueryEditor/QueryEditorContainer.js} +23 -11
- package/dist/cjs/{validation/duration.js → components/MultiQueryEditor/index.js} +14 -9
- package/dist/cjs/components/PanelSpecEditor/PanelSpecEditor.js +51 -59
- package/dist/cjs/components/PluginEditor/PluginEditor.js +16 -13
- package/dist/cjs/components/PluginEditor/plugin-editor-api.js +43 -32
- package/dist/cjs/components/PluginKindSelect/PluginKindSelect.js +55 -7
- package/dist/cjs/components/PluginRegistry/PluginRegistry.js +8 -9
- package/dist/cjs/components/PluginRegistry/plugin-indexes.js +17 -14
- package/dist/cjs/components/PluginSpecEditor/PluginSpecEditor.js +1 -1
- package/dist/cjs/components/ProjectSelect.js +5 -5
- package/dist/cjs/components/TimeRangeControls/TimeRangeControls.js +10 -71
- package/dist/cjs/components/Variables/VariableEditorForm/VariableEditorForm.js +391 -442
- package/dist/cjs/components/Variables/VariableEditorForm/VariablePreview.js +7 -7
- package/dist/cjs/components/Variables/VariableEditorForm/variable-editor-form-model.js +6 -11
- package/dist/cjs/components/Variables/variable-model.js +26 -27
- package/dist/cjs/components/index.js +3 -1
- package/dist/cjs/context/ProjectStoreProvider.js +7 -4
- 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/TraceQueryEditor/index.js → cjs/model/explore.js} +4 -3
- 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 -5
- package/dist/cjs/remote/remotePluginLoader.js +61 -0
- package/dist/cjs/runtime/DataQueriesProvider/DataQueriesProvider.js +18 -9
- package/dist/cjs/runtime/DataQueriesProvider/model.js +9 -8
- package/dist/cjs/runtime/QueryCountProvider.js +83 -0
- package/dist/cjs/runtime/TimeRangeProvider/TimeRangeProvider.js +17 -4
- 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 +4 -7
- package/dist/cjs/runtime/UsageMetricsProvider.js +99 -0
- package/dist/cjs/runtime/builtin-variables.js +2 -2
- package/dist/cjs/runtime/datasources.js +23 -14
- package/dist/cjs/runtime/index.js +4 -2
- package/dist/cjs/runtime/plugin-registry.js +36 -24
- package/dist/cjs/runtime/time-series-queries.js +23 -28
- package/dist/cjs/runtime/trace-queries.js +6 -3
- package/dist/cjs/runtime/{template-variables.js → variables.js} +29 -47
- package/dist/cjs/stories/shared-utils/decorators/WithDataQueries.js +1 -1
- package/dist/cjs/stories/shared-utils/decorators/WithPluginRegistry.js +1 -67
- package/dist/cjs/stories/shared-utils/decorators/WithPluginSystemBuiltinVariables.js +1 -1
- package/dist/cjs/stories/shared-utils/decorators/WithPluginSystemDatasourceStore.js +4 -4
- 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 +20 -19
- package/dist/cjs/test-utils/mock-plugin-registry.js +10 -10
- package/dist/cjs/utils/variables.js +24 -24
- package/dist/components/CalculationSelector/CalculationSelector.d.ts +2 -1
- package/dist/components/CalculationSelector/CalculationSelector.d.ts.map +1 -1
- package/dist/components/CalculationSelector/CalculationSelector.js.map +1 -1
- package/dist/components/DatasourceEditorForm/DatasourceEditorForm.d.ts +6 -5
- package/dist/components/DatasourceEditorForm/DatasourceEditorForm.d.ts.map +1 -1
- package/dist/components/DatasourceEditorForm/DatasourceEditorForm.js +85 -165
- package/dist/components/DatasourceEditorForm/DatasourceEditorForm.js.map +1 -1
- package/dist/components/DatasourceSelect.d.ts +3 -2
- package/dist/components/DatasourceSelect.d.ts.map +1 -1
- package/dist/components/DatasourceSelect.js +8 -13
- 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/{validation/duration.js → components/HTTPSettingsEditor/index.js} +2 -4
- package/dist/components/HTTPSettingsEditor/index.js.map +1 -0
- package/dist/components/LegendOptionsEditor/LegendOptionsEditor.d.ts +3 -1
- 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} +29 -18
- 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 +2 -2
- package/dist/components/OptionsEditorRadios/OptionsEditorRadios.d.ts.map +1 -1
- 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.map +1 -1
- package/dist/components/OptionsEditorTabs/OptionsEditorTabs.d.ts +3 -3
- package/dist/components/OptionsEditorTabs/OptionsEditorTabs.d.ts.map +1 -1
- package/dist/components/OptionsEditorTabs/OptionsEditorTabs.js.map +1 -1
- package/dist/components/PanelSpecEditor/PanelSpecEditor.d.ts +5 -2
- package/dist/components/PanelSpecEditor/PanelSpecEditor.d.ts.map +1 -1
- package/dist/components/PanelSpecEditor/PanelSpecEditor.js +53 -61
- package/dist/components/PanelSpecEditor/PanelSpecEditor.js.map +1 -1
- package/dist/components/PluginEditor/PluginEditor.d.ts +2 -1
- 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 +15 -8
- package/dist/components/PluginEditor/plugin-editor-api.d.ts.map +1 -1
- package/dist/components/PluginEditor/plugin-editor-api.js +43 -32
- package/dist/components/PluginEditor/plugin-editor-api.js.map +1 -1
- package/dist/components/PluginKindSelect/PluginKindSelect.d.ts +10 -4
- 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 +2 -2
- package/dist/components/PluginRegistry/PluginRegistry.d.ts.map +1 -1
- package/dist/components/PluginRegistry/PluginRegistry.js +8 -9
- 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 -4
- package/dist/components/PluginSpecEditor/PluginSpecEditor.d.ts.map +1 -1
- package/dist/components/PluginSpecEditor/PluginSpecEditor.js +1 -1
- package/dist/components/PluginSpecEditor/PluginSpecEditor.js.map +1 -1
- package/dist/components/ProjectSelect.d.ts +2 -1
- package/dist/components/ProjectSelect.d.ts.map +1 -1
- package/dist/components/ProjectSelect.js +5 -5
- package/dist/components/ProjectSelect.js.map +1 -1
- package/dist/components/TimeRangeControls/TimeRangeControls.d.ts +3 -2
- package/dist/components/TimeRangeControls/TimeRangeControls.d.ts.map +1 -1
- package/dist/components/TimeRangeControls/TimeRangeControls.js +12 -70
- package/dist/components/TimeRangeControls/TimeRangeControls.js.map +1 -1
- 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 -446
- package/dist/components/Variables/VariableEditorForm/VariableEditorForm.js.map +1 -1
- package/dist/components/Variables/VariableEditorForm/VariablePreview.d.ts +3 -2
- package/dist/components/Variables/VariableEditorForm/VariablePreview.d.ts.map +1 -1
- package/dist/components/Variables/VariableEditorForm/VariablePreview.js +7 -7
- package/dist/components/Variables/VariableEditorForm/VariablePreview.js.map +1 -1
- package/dist/components/Variables/VariableEditorForm/variable-editor-form-model.d.ts +2 -2
- package/dist/components/Variables/VariableEditorForm/variable-editor-form-model.d.ts.map +1 -1
- package/dist/components/Variables/VariableEditorForm/variable-editor-form-model.js +6 -11
- 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 +27 -28
- package/dist/components/Variables/variable-model.js.map +1 -1
- package/dist/components/index.d.ts +3 -1
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/index.js +3 -1
- package/dist/components/index.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 +7 -4
- 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/explore.d.ts +13 -0
- package/dist/model/explore.d.ts.map +1 -0
- package/dist/{validation/index.js → model/explore.js} +4 -6
- package/dist/model/explore.js.map +1 -0
- package/dist/model/legend.d.ts.map +1 -1
- package/dist/model/legend.js.map +1 -1
- package/dist/model/panels.d.ts +16 -4
- package/dist/model/panels.d.ts.map +1 -1
- package/dist/model/panels.js.map +1 -1
- package/dist/model/plugin-loading.js.map +1 -1
- package/dist/model/plugins.d.ts +31 -17
- 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 +2 -1
- package/dist/model/time-series-queries.d.ts.map +1 -1
- package/dist/model/time-series-queries.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/{components/TimeSeriesQueryEditor → remote}/index.js +2 -1
- 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 +18 -9
- package/dist/runtime/DataQueriesProvider/DataQueriesProvider.js.map +1 -1
- package/dist/runtime/DataQueriesProvider/model.d.ts +5 -6
- package/dist/runtime/DataQueriesProvider/model.d.ts.map +1 -1
- package/dist/runtime/DataQueriesProvider/model.js +9 -8
- 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 +2 -2
- package/dist/runtime/TimeRangeProvider/TimeRangeProvider.d.ts.map +1 -1
- package/dist/runtime/TimeRangeProvider/TimeRangeProvider.js +17 -4
- 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.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.map +1 -1
- package/dist/runtime/TimeRangeProvider/query-params.js +4 -7
- 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 +1 -1
- package/dist/runtime/builtin-variables.d.ts.map +1 -1
- package/dist/runtime/builtin-variables.js +2 -2
- 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 +23 -14
- 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 +10 -10
- package/dist/runtime/plugin-registry.d.ts.map +1 -1
- package/dist/runtime/plugin-registry.js +36 -24
- 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 +23 -28
- package/dist/runtime/time-series-queries.js.map +1 -1
- package/dist/runtime/trace-queries.d.ts +4 -3
- package/dist/runtime/trace-queries.d.ts.map +1 -1
- package/dist/runtime/trace-queries.js +7 -4
- package/dist/runtime/trace-queries.js.map +1 -1
- package/dist/runtime/{template-variables.d.ts → variables.d.ts} +4 -4
- package/dist/runtime/variables.d.ts.map +1 -0
- package/dist/runtime/{template-variables.js → variables.js} +28 -45
- package/dist/runtime/variables.js.map +1 -0
- package/dist/stories/shared-utils/decorators/WithDataQueries.d.ts +2 -1
- 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 -1
- 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 +2 -1
- 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 +2 -1
- package/dist/stories/shared-utils/decorators/WithPluginSystemDatasourceStore.d.ts.map +1 -1
- package/dist/stories/shared-utils/decorators/WithPluginSystemDatasourceStore.js +4 -4
- 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 +2 -1
- 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 +3 -3
- 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/test-plugins/bert/index.d.ts.map +1 -1
- package/dist/test/test-plugins/bert/index.js +20 -19
- package/dist/test/test-plugins/bert/index.js.map +1 -1
- package/dist/test-utils/mock-plugin-registry.d.ts +5 -3
- 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/TraceQueryEditor/TraceQueryEditor.js +0 -143
- package/dist/cjs/components/TraceQueryEditor/TraceQueryInput.js +0 -96
- package/dist/cjs/validation/datasource.js +0 -30
- package/dist/cjs/validation/resource.js +0 -24
- package/dist/cjs/validation/role.js +0 -86
- package/dist/cjs/validation/rolebinding.js +0 -55
- package/dist/cjs/validation/secret.js +0 -176
- package/dist/cjs/validation/user.js +0 -46
- package/dist/cjs/validation/variable.js +0 -48
- package/dist/components/TimeSeriesQueryEditor/TimeSeriesQueryEditor.d.ts +0 -7
- 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 -12
- 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 -8
- 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 -12
- 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 -12
- 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/duration.d.ts +0 -3
- package/dist/validation/duration.d.ts.map +0 -1
- package/dist/validation/duration.js.map +0 -1
- package/dist/validation/index.d.ts +0 -6
- 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 +0 -16
- 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 -67
- 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/user.d.ts +0 -93
- package/dist/validation/user.d.ts.map +0 -1
- package/dist/validation/user.js +0 -38
- package/dist/validation/user.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
|
@@ -22,75 +22,9 @@ Object.defineProperty(exports, "WithPluginRegistry", {
|
|
|
22
22
|
});
|
|
23
23
|
const _jsxruntime = require("react/jsx-runtime");
|
|
24
24
|
const _pluginsystem = require("@perses-dev/plugin-system");
|
|
25
|
-
const _pluginjson = /*#__PURE__*/ _interop_require_default(require("@perses-dev/prometheus-plugin/plugin.json"));
|
|
26
|
-
const _pluginjson1 = /*#__PURE__*/ _interop_require_default(require("@perses-dev/panels-plugin/plugin.json"));
|
|
27
|
-
function _interop_require_default(obj) {
|
|
28
|
-
return obj && obj.__esModule ? obj : {
|
|
29
|
-
default: obj
|
|
30
|
-
};
|
|
31
|
-
}
|
|
32
|
-
function _getRequireWildcardCache(nodeInterop) {
|
|
33
|
-
if (typeof WeakMap !== "function") return null;
|
|
34
|
-
var cacheBabelInterop = new WeakMap();
|
|
35
|
-
var cacheNodeInterop = new WeakMap();
|
|
36
|
-
return (_getRequireWildcardCache = function(nodeInterop) {
|
|
37
|
-
return nodeInterop ? cacheNodeInterop : cacheBabelInterop;
|
|
38
|
-
})(nodeInterop);
|
|
39
|
-
}
|
|
40
|
-
function _interop_require_wildcard(obj, nodeInterop) {
|
|
41
|
-
if (!nodeInterop && obj && obj.__esModule) {
|
|
42
|
-
return obj;
|
|
43
|
-
}
|
|
44
|
-
if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
|
|
45
|
-
return {
|
|
46
|
-
default: obj
|
|
47
|
-
};
|
|
48
|
-
}
|
|
49
|
-
var cache = _getRequireWildcardCache(nodeInterop);
|
|
50
|
-
if (cache && cache.has(obj)) {
|
|
51
|
-
return cache.get(obj);
|
|
52
|
-
}
|
|
53
|
-
var newObj = {
|
|
54
|
-
__proto__: null
|
|
55
|
-
};
|
|
56
|
-
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
57
|
-
for(var key in obj){
|
|
58
|
-
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
59
|
-
var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
|
|
60
|
-
if (desc && (desc.get || desc.set)) {
|
|
61
|
-
Object.defineProperty(newObj, key, desc);
|
|
62
|
-
} else {
|
|
63
|
-
newObj[key] = obj[key];
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
newObj.default = obj;
|
|
68
|
-
if (cache) {
|
|
69
|
-
cache.set(obj, newObj);
|
|
70
|
-
}
|
|
71
|
-
return newObj;
|
|
72
|
-
}
|
|
73
|
-
const bundledPluginLoader = (0, _pluginsystem.dynamicImportPluginLoader)([
|
|
74
|
-
{
|
|
75
|
-
resource: _pluginjson.default,
|
|
76
|
-
// This throws an error in CI (but not locally for some reason), likely because
|
|
77
|
-
// this package isn't a dependency for dashboards. We probably do not want to
|
|
78
|
-
// make it one solely for type-checking in storybook.
|
|
79
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
80
|
-
// @ts-ignore
|
|
81
|
-
importPlugin: ()=>Promise.resolve().then(()=>/*#__PURE__*/ _interop_require_wildcard(require("@perses-dev/prometheus-plugin")))
|
|
82
|
-
},
|
|
83
|
-
{
|
|
84
|
-
resource: _pluginjson1.default,
|
|
85
|
-
// Same comment as above.
|
|
86
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
87
|
-
// @ts-ignore
|
|
88
|
-
importPlugin: ()=>Promise.resolve().then(()=>/*#__PURE__*/ _interop_require_wildcard(require("@perses-dev/panels-plugin")))
|
|
89
|
-
}
|
|
90
|
-
]);
|
|
91
25
|
const WithPluginRegistry = (Story)=>{
|
|
92
26
|
return /*#__PURE__*/ (0, _jsxruntime.jsx)(_pluginsystem.PluginRegistry, {
|
|
93
|
-
pluginLoader:
|
|
27
|
+
pluginLoader: (0, _pluginsystem.remotePluginLoader)(),
|
|
94
28
|
defaultPluginKinds: {
|
|
95
29
|
TimeSeriesQuery: 'PrometheusTimeSeriesQuery',
|
|
96
30
|
TraceQuery: 'TempoTraceQuery'
|
|
@@ -34,7 +34,7 @@ const WithPluginSystemBuiltinVariables = (Story, context)=>{
|
|
|
34
34
|
const parameter = isWithBuiltinVariableParameter(initParameter) ? initParameter : {
|
|
35
35
|
props: defaultValue
|
|
36
36
|
};
|
|
37
|
-
const props = parameter
|
|
37
|
+
const props = parameter?.props;
|
|
38
38
|
return /*#__PURE__*/ (0, _jsxruntime.jsx)(_runtime.BuiltinVariableContext.Provider, {
|
|
39
39
|
value: props,
|
|
40
40
|
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(Story, {})
|
|
@@ -60,8 +60,8 @@ const WithPluginSystemDatasourceStore = (Story, context)=>{
|
|
|
60
60
|
}
|
|
61
61
|
throw new Error(`WithDatasourceStore is not configured to support kind: ${selector.kind}`);
|
|
62
62
|
},
|
|
63
|
-
listDatasourceSelectItems: async (
|
|
64
|
-
if (
|
|
63
|
+
listDatasourceSelectItems: async (datasourcePluginName)=>{
|
|
64
|
+
if (datasourcePluginName === 'PrometheusDatasource') {
|
|
65
65
|
return Promise.resolve([
|
|
66
66
|
{
|
|
67
67
|
items: [
|
|
@@ -75,7 +75,7 @@ const WithPluginSystemDatasourceStore = (Story, context)=>{
|
|
|
75
75
|
}
|
|
76
76
|
]);
|
|
77
77
|
}
|
|
78
|
-
throw new Error(`WithDatasourceStore is not configured to support kind: ${
|
|
78
|
+
throw new Error(`WithDatasourceStore is not configured to support kind: ${datasourcePluginName}`);
|
|
79
79
|
},
|
|
80
80
|
getSavedDatasources: ()=>{
|
|
81
81
|
return {};
|
|
@@ -93,7 +93,7 @@ const WithPluginSystemDatasourceStore = (Story, context)=>{
|
|
|
93
93
|
const parameter = isWithDatastoreStoreParameter(initParameter) ? initParameter : {
|
|
94
94
|
props: defaultValue
|
|
95
95
|
};
|
|
96
|
-
const props = parameter
|
|
96
|
+
const props = parameter?.props;
|
|
97
97
|
return /*#__PURE__*/ (0, _jsxruntime.jsx)(_pluginsystem.DatasourceStoreContext.Provider, {
|
|
98
98
|
value: props,
|
|
99
99
|
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(Story, {})
|
|
@@ -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,28 +14,28 @@
|
|
|
14
14
|
Object.defineProperty(exports, "__esModule", {
|
|
15
15
|
value: true
|
|
16
16
|
});
|
|
17
|
-
Object.defineProperty(exports, "
|
|
17
|
+
Object.defineProperty(exports, "WithPluginSystemVariables", {
|
|
18
18
|
enumerable: true,
|
|
19
19
|
get: function() {
|
|
20
|
-
return
|
|
20
|
+
return WithPluginSystemVariables;
|
|
21
21
|
}
|
|
22
22
|
});
|
|
23
23
|
const _jsxruntime = require("react/jsx-runtime");
|
|
24
24
|
const _runtime = require("../../../runtime");
|
|
25
25
|
// Type guard because storybook types parameters as `any`
|
|
26
|
-
function
|
|
26
|
+
function isWithVariableParameter(parameter) {
|
|
27
27
|
return !!parameter && typeof parameter === 'object' && 'props' in parameter;
|
|
28
28
|
}
|
|
29
|
-
const
|
|
30
|
-
const initParameter = context.parameters.
|
|
29
|
+
const WithPluginSystemVariables = (Story, context)=>{
|
|
30
|
+
const initParameter = context.parameters.withPluginSystemVariables;
|
|
31
31
|
const defaultValue = {
|
|
32
32
|
state: {}
|
|
33
33
|
};
|
|
34
|
-
const parameter =
|
|
34
|
+
const parameter = isWithVariableParameter(initParameter) ? initParameter : {
|
|
35
35
|
props: defaultValue
|
|
36
36
|
};
|
|
37
|
-
const props = parameter
|
|
38
|
-
return /*#__PURE__*/ (0, _jsxruntime.jsx)(_runtime.
|
|
37
|
+
const props = parameter?.props;
|
|
38
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsx)(_runtime.VariableContext.Provider, {
|
|
39
39
|
value: props,
|
|
40
40
|
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(Story, {})
|
|
41
41
|
});
|
|
@@ -29,7 +29,7 @@ function isWithTimeRangeParameter(parameter) {
|
|
|
29
29
|
const WithTimeRange = (Story, context)=>{
|
|
30
30
|
const initParameter = context.parameters.withTimeRange;
|
|
31
31
|
const parameter = isWithTimeRangeParameter(initParameter) ? initParameter : undefined;
|
|
32
|
-
const props = parameter
|
|
32
|
+
const props = parameter?.props;
|
|
33
33
|
return /*#__PURE__*/ (0, _jsxruntime.jsx)(_pluginsystem.TimeRangeProvider, {
|
|
34
34
|
refreshInterval: "0s",
|
|
35
35
|
timeRange: {
|
|
@@ -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
|
|
@@ -18,7 +18,7 @@ _export_star(require("./WithDataQueries"), exports);
|
|
|
18
18
|
_export_star(require("./WithPluginRegistry"), exports);
|
|
19
19
|
_export_star(require("./WithPluginSystemBuiltinVariables"), exports);
|
|
20
20
|
_export_star(require("./WithPluginSystemDatasourceStore"), exports);
|
|
21
|
-
_export_star(require("./
|
|
21
|
+
_export_star(require("./WithPluginSystemVariables"), exports);
|
|
22
22
|
_export_star(require("./WithTimeRange"), exports);
|
|
23
23
|
function _export_star(from, to) {
|
|
24
24
|
Object.keys(from).forEach(function(k) {
|
|
@@ -64,14 +64,35 @@ const MOCK_TIME_SERIES_DATA = {
|
|
|
64
64
|
]
|
|
65
65
|
};
|
|
66
66
|
const MOCK_TRACE_DATA = {
|
|
67
|
-
|
|
67
|
+
searchResult: [
|
|
68
68
|
{
|
|
69
69
|
durationMs: 1120,
|
|
70
|
-
|
|
71
|
-
|
|
70
|
+
serviceStats: {
|
|
71
|
+
'shop-backend': {
|
|
72
|
+
spanCount: 4,
|
|
73
|
+
errorCount: 0
|
|
74
|
+
},
|
|
75
|
+
'cart-service': {
|
|
76
|
+
spanCount: 2,
|
|
77
|
+
errorCount: 0
|
|
78
|
+
},
|
|
79
|
+
'article-service': {
|
|
80
|
+
spanCount: 2,
|
|
81
|
+
errorCount: 0
|
|
82
|
+
},
|
|
83
|
+
'auth-service': {
|
|
84
|
+
spanCount: 1,
|
|
85
|
+
errorCount: 0
|
|
86
|
+
},
|
|
87
|
+
postgres: {
|
|
88
|
+
spanCount: 1,
|
|
89
|
+
errorCount: 0
|
|
90
|
+
}
|
|
91
|
+
},
|
|
72
92
|
startTimeUnixMs: 1699916103945861,
|
|
73
93
|
traceId: '95ba9202315c29c801b5aa41452aa775',
|
|
74
|
-
|
|
94
|
+
rootServiceName: 'shop-backend',
|
|
95
|
+
rootTraceName: 'article-to-cart'
|
|
75
96
|
}
|
|
76
97
|
],
|
|
77
98
|
metadata: {
|
package/dist/cjs/test/render.js
CHANGED
|
@@ -25,13 +25,6 @@ const _react = require("@testing-library/react");
|
|
|
25
25
|
const _reactquery = require("@tanstack/react-query");
|
|
26
26
|
const _PluginRegistry = require("../components/PluginRegistry");
|
|
27
27
|
const _testplugins = require("./test-plugins");
|
|
28
|
-
const testLogger = {
|
|
29
|
-
log: console.log,
|
|
30
|
-
warn: console.warn,
|
|
31
|
-
error: ()=>{
|
|
32
|
-
// Don't log network errors in tests to the console
|
|
33
|
-
}
|
|
34
|
-
};
|
|
35
28
|
function renderWithContext(ui, renderOptions, contextOptions) {
|
|
36
29
|
// Create a new QueryClient for each test to avoid caching issues
|
|
37
30
|
const queryClient = new _reactquery.QueryClient({
|
|
@@ -40,15 +33,13 @@ function renderWithContext(ui, renderOptions, contextOptions) {
|
|
|
40
33
|
refetchOnWindowFocus: false,
|
|
41
34
|
retry: false
|
|
42
35
|
}
|
|
43
|
-
}
|
|
44
|
-
logger: testLogger
|
|
36
|
+
}
|
|
45
37
|
});
|
|
46
|
-
var _contextOptions_defaultPluginKinds;
|
|
47
38
|
return (0, _react.render)(/*#__PURE__*/ (0, _jsxruntime.jsx)(_reactquery.QueryClientProvider, {
|
|
48
39
|
client: queryClient,
|
|
49
40
|
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_PluginRegistry.PluginRegistry, {
|
|
50
41
|
pluginLoader: _testplugins.testPluginLoader,
|
|
51
|
-
defaultPluginKinds:
|
|
42
|
+
defaultPluginKinds: contextOptions?.defaultPluginKinds ?? {
|
|
52
43
|
TimeSeriesQuery: 'PrometheusTimeSeriesQuery'
|
|
53
44
|
},
|
|
54
45
|
children: ui
|
|
@@ -60,30 +60,31 @@ const BertPanel1 = {
|
|
|
60
60
|
option1: ''
|
|
61
61
|
})
|
|
62
62
|
};
|
|
63
|
+
function BertPanel2Editor({ value, onChange }) {
|
|
64
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsxs)("div", {
|
|
65
|
+
children: [
|
|
66
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)("label", {
|
|
67
|
+
htmlFor: "editor-input",
|
|
68
|
+
children: "BertPanel2 editor"
|
|
69
|
+
}),
|
|
70
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)("input", {
|
|
71
|
+
type: "text",
|
|
72
|
+
id: "editor-input",
|
|
73
|
+
value: value.option2,
|
|
74
|
+
onChange: (e)=>onChange({
|
|
75
|
+
...value,
|
|
76
|
+
option2: e.target.value
|
|
77
|
+
})
|
|
78
|
+
})
|
|
79
|
+
]
|
|
80
|
+
});
|
|
81
|
+
}
|
|
63
82
|
const BertPanel2 = {
|
|
64
83
|
PanelComponent: ()=>null,
|
|
65
84
|
panelOptionsEditorComponents: [
|
|
66
85
|
{
|
|
67
86
|
label: 'Settings',
|
|
68
|
-
content:
|
|
69
|
-
return /*#__PURE__*/ (0, _jsxruntime.jsxs)("div", {
|
|
70
|
-
children: [
|
|
71
|
-
/*#__PURE__*/ (0, _jsxruntime.jsx)("label", {
|
|
72
|
-
htmlFor: "editor-input",
|
|
73
|
-
children: "BertPanel2 editor"
|
|
74
|
-
}),
|
|
75
|
-
/*#__PURE__*/ (0, _jsxruntime.jsx)("input", {
|
|
76
|
-
type: "text",
|
|
77
|
-
id: "editor-input",
|
|
78
|
-
value: value.option2,
|
|
79
|
-
onChange: (e)=>onChange({
|
|
80
|
-
...value,
|
|
81
|
-
option2: e.target.value
|
|
82
|
-
})
|
|
83
|
-
})
|
|
84
|
-
]
|
|
85
|
-
});
|
|
86
|
-
}
|
|
87
|
+
content: BertPanel2Editor
|
|
87
88
|
},
|
|
88
89
|
{
|
|
89
90
|
label: 'Custom Tab',
|
|
@@ -33,17 +33,17 @@ function mockPluginRegistry(...mockPlugins) {
|
|
|
33
33
|
kind: 'PluginModule',
|
|
34
34
|
metadata: {
|
|
35
35
|
name: 'Fake Plugin Module for Tests',
|
|
36
|
-
|
|
37
|
-
updatedAt: '',
|
|
38
|
-
version: 0
|
|
36
|
+
version: '0'
|
|
39
37
|
},
|
|
40
38
|
spec: {
|
|
41
39
|
// Add metadata for all mock plugins
|
|
42
|
-
plugins: mockPlugins.map(({
|
|
43
|
-
pluginType,
|
|
40
|
+
plugins: mockPlugins.map(({ kind, spec: { name } })=>({
|
|
44
41
|
kind,
|
|
45
|
-
|
|
46
|
-
name
|
|
42
|
+
spec: {
|
|
43
|
+
name,
|
|
44
|
+
display: {
|
|
45
|
+
name: getMockPluginName(kind, name)
|
|
46
|
+
}
|
|
47
47
|
}
|
|
48
48
|
}))
|
|
49
49
|
}
|
|
@@ -51,7 +51,7 @@ function mockPluginRegistry(...mockPlugins) {
|
|
|
51
51
|
const mockPluginModule = {};
|
|
52
52
|
for (const mockPlugin of mockPlugins){
|
|
53
53
|
// "Export" on the module under the same name as the kind the plugin handles
|
|
54
|
-
mockPluginModule[mockPlugin.
|
|
54
|
+
mockPluginModule[mockPlugin.spec.name] = mockPlugin.plugin;
|
|
55
55
|
}
|
|
56
56
|
const pluginLoader = {
|
|
57
57
|
getInstalledPlugins () {
|
|
@@ -70,6 +70,6 @@ function mockPluginRegistry(...mockPlugins) {
|
|
|
70
70
|
}
|
|
71
71
|
};
|
|
72
72
|
}
|
|
73
|
-
function getMockPluginName(
|
|
74
|
-
return `${
|
|
73
|
+
function getMockPluginName(kind, name) {
|
|
74
|
+
return `${kind} Plugin for ${name}`;
|
|
75
75
|
}
|
|
@@ -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
|
|
@@ -21,53 +21,53 @@ function _export(target, all) {
|
|
|
21
21
|
});
|
|
22
22
|
}
|
|
23
23
|
_export(exports, {
|
|
24
|
-
|
|
25
|
-
return
|
|
24
|
+
parseVariables: function() {
|
|
25
|
+
return parseVariables;
|
|
26
26
|
},
|
|
27
|
-
|
|
28
|
-
return
|
|
27
|
+
replaceVariable: function() {
|
|
28
|
+
return replaceVariable;
|
|
29
29
|
},
|
|
30
|
-
|
|
31
|
-
return
|
|
30
|
+
replaceVariables: function() {
|
|
31
|
+
return replaceVariables;
|
|
32
32
|
}
|
|
33
33
|
});
|
|
34
|
-
function
|
|
35
|
-
const variables =
|
|
34
|
+
function replaceVariables(text, variableState) {
|
|
35
|
+
const variables = parseVariables(text);
|
|
36
36
|
let finalText = text;
|
|
37
37
|
variables// Sorting variables by their length.
|
|
38
38
|
// In order to not have a variable name have contained in another variable name.
|
|
39
39
|
// i.e.: $__range replacing $__range_ms => '3600_ms' instead of '3600000'
|
|
40
40
|
.sort((a, b)=>b.length - a.length).forEach((v)=>{
|
|
41
41
|
const variable = variableState[v];
|
|
42
|
-
if (variable &&
|
|
43
|
-
finalText =
|
|
42
|
+
if (variable && variable.value !== undefined) {
|
|
43
|
+
finalText = replaceVariable(finalText, v, variable?.value);
|
|
44
44
|
}
|
|
45
45
|
});
|
|
46
46
|
return finalText;
|
|
47
47
|
}
|
|
48
|
-
function
|
|
49
|
-
const
|
|
50
|
-
const
|
|
48
|
+
function replaceVariable(text, varName, variableValue) {
|
|
49
|
+
const variableSyntax = '$' + varName;
|
|
50
|
+
const alternativeVariableSyntax = '${' + varName + '}';
|
|
51
51
|
let replaceString = '';
|
|
52
|
-
if (Array.isArray(
|
|
53
|
-
replaceString = `(${
|
|
52
|
+
if (Array.isArray(variableValue)) {
|
|
53
|
+
replaceString = `(${variableValue.join('|')})`; // regex style
|
|
54
54
|
}
|
|
55
|
-
if (typeof
|
|
56
|
-
replaceString =
|
|
55
|
+
if (typeof variableValue === 'string') {
|
|
56
|
+
replaceString = variableValue;
|
|
57
57
|
}
|
|
58
|
-
text = text.replaceAll(
|
|
59
|
-
return text.replaceAll(
|
|
58
|
+
text = text.replaceAll(variableSyntax, replaceString);
|
|
59
|
+
return text.replaceAll(alternativeVariableSyntax, replaceString);
|
|
60
60
|
}
|
|
61
|
-
// This regular expression is designed to identify variable references in a
|
|
61
|
+
// This regular expression is designed to identify variable references in a string.
|
|
62
62
|
// It supports two formats for referencing variables:
|
|
63
63
|
// 1. $variableName - This is a simpler format, and the regular expression captures the variable name (\w+ matches one or more word characters).
|
|
64
64
|
// 2. ${variableName} - This is a more complex format and the regular expression captures the variable name (\w+ matches one or more word characters) in the curly braces.
|
|
65
65
|
// 3. [COMING SOON] ${variableName:value} - This is a more complex format that allows specifying a format function as well.
|
|
66
66
|
// TODO: Fix this lint error
|
|
67
67
|
// eslint-disable-next-line no-useless-escape
|
|
68
|
-
const
|
|
69
|
-
const
|
|
70
|
-
const regex =
|
|
68
|
+
const VARIABLE_REGEX = /\$(\w+)|\${(\w+)(?:\.([^:^\}]+))?(?::([^\}]+))?}/gm;
|
|
69
|
+
const parseVariables = (text)=>{
|
|
70
|
+
const regex = VARIABLE_REGEX;
|
|
71
71
|
const matches = new Set();
|
|
72
72
|
let match;
|
|
73
73
|
while((match = regex.exec(text)) !== null){
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { CalculationType } from '@perses-dev/core';
|
|
2
|
+
import { ReactElement } from 'react';
|
|
2
3
|
export interface CalculationSelectorProps {
|
|
3
4
|
value: CalculationType;
|
|
4
5
|
onChange: (unit: CalculationType) => void;
|
|
5
6
|
}
|
|
6
|
-
export declare function CalculationSelector({ value, onChange }: CalculationSelectorProps):
|
|
7
|
+
export declare function CalculationSelector({ value, onChange }: CalculationSelectorProps): ReactElement;
|
|
7
8
|
//# sourceMappingURL=CalculationSelector.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CalculationSelector.d.ts","sourceRoot":"","sources":["../../../src/components/CalculationSelector/CalculationSelector.tsx"],"names":[],"mappings":"AAcA,OAAO,EAA0C,eAAe,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"CalculationSelector.d.ts","sourceRoot":"","sources":["../../../src/components/CalculationSelector/CalculationSelector.tsx"],"names":[],"mappings":"AAcA,OAAO,EAA0C,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAC3F,OAAO,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAUrC,MAAM,WAAW,wBAAwB;IACvC,KAAK,EAAE,eAAe,CAAC;IACvB,QAAQ,EAAE,CAAC,IAAI,EAAE,eAAe,KAAK,IAAI,CAAC;CAC3C;AAED,wBAAgB,mBAAmB,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,wBAAwB,GAAG,YAAY,CAuB/F"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/CalculationSelector/CalculationSelector.tsx"],"sourcesContent":["// Copyright 2023 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { OptionsEditorControl, SettingsAutocomplete } from '@perses-dev/components';\nimport { CALCULATIONS_CONFIG, CalculationConfig, CalculationType } from '@perses-dev/core';\n\ntype AutocompleteCalculationOption = CalculationConfig & { id: CalculationType };\nconst CALC_OPTIONS: AutocompleteCalculationOption[] = Object.entries(CALCULATIONS_CONFIG).map(([id, config]) => {\n return {\n id: id as CalculationType,\n ...config,\n };\n});\n\nexport interface CalculationSelectorProps {\n value: CalculationType;\n onChange: (unit: CalculationType) => void;\n}\n\nexport function CalculationSelector({ value, onChange }: CalculationSelectorProps) {\n const handleCalculationChange = (_: unknown, newValue: AutocompleteCalculationOption) => {\n onChange(newValue.id);\n };\n\n const calcConfig = CALCULATIONS_CONFIG[value];\n\n return (\n <OptionsEditorControl\n label=\"Calculation\"\n control={\n <SettingsAutocomplete\n value={{\n ...calcConfig,\n id: value,\n }}\n options={CALC_OPTIONS}\n onChange={handleCalculationChange}\n disableClearable\n
|
|
1
|
+
{"version":3,"sources":["../../../src/components/CalculationSelector/CalculationSelector.tsx"],"sourcesContent":["// Copyright 2023 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { OptionsEditorControl, SettingsAutocomplete } from '@perses-dev/components';\nimport { CALCULATIONS_CONFIG, CalculationConfig, CalculationType } from '@perses-dev/core';\nimport { ReactElement } from 'react';\n\ntype AutocompleteCalculationOption = CalculationConfig & { id: CalculationType };\nconst CALC_OPTIONS: AutocompleteCalculationOption[] = Object.entries(CALCULATIONS_CONFIG).map(([id, config]) => {\n return {\n id: id as CalculationType,\n ...config,\n };\n});\n\nexport interface CalculationSelectorProps {\n value: CalculationType;\n onChange: (unit: CalculationType) => void;\n}\n\nexport function CalculationSelector({ value, onChange }: CalculationSelectorProps): ReactElement {\n const handleCalculationChange = (_: unknown, newValue: AutocompleteCalculationOption): void => {\n onChange(newValue.id);\n };\n\n const calcConfig = CALCULATIONS_CONFIG[value];\n\n return (\n <OptionsEditorControl\n label=\"Calculation\"\n control={\n <SettingsAutocomplete\n value={{\n ...calcConfig,\n id: value,\n }}\n options={CALC_OPTIONS}\n onChange={handleCalculationChange}\n disableClearable\n />\n }\n />\n );\n}\n"],"names":["OptionsEditorControl","SettingsAutocomplete","CALCULATIONS_CONFIG","CALC_OPTIONS","Object","entries","map","id","config","CalculationSelector","value","onChange","handleCalculationChange","_","newValue","calcConfig","label","control","options","disableClearable"],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;;AAEjC,SAASA,oBAAoB,EAAEC,oBAAoB,QAAQ,yBAAyB;AACpF,SAASC,mBAAmB,QAA4C,mBAAmB;AAI3F,MAAMC,eAAgDC,OAAOC,OAAO,CAACH,qBAAqBI,GAAG,CAAC,CAAC,CAACC,IAAIC,OAAO;IACzG,OAAO;QACLD,IAAIA;QACJ,GAAGC,MAAM;IACX;AACF;AAOA,OAAO,SAASC,oBAAoB,EAAEC,KAAK,EAAEC,QAAQ,EAA4B;IAC/E,MAAMC,0BAA0B,CAACC,GAAYC;QAC3CH,SAASG,SAASP,EAAE;IACtB;IAEA,MAAMQ,aAAab,mBAAmB,CAACQ,MAAM;IAE7C,qBACE,KAACV;QACCgB,OAAM;QACNC,uBACE,KAAChB;YACCS,OAAO;gBACL,GAAGK,UAAU;gBACbR,IAAIG;YACN;YACAQ,SAASf;YACTQ,UAAUC;YACVO,gBAAgB;;;AAK1B"}
|
|
@@ -1,14 +1,15 @@
|
|
|
1
|
-
import { Action, DatasourceDefinition
|
|
2
|
-
import { DispatchWithoutAction } from 'react';
|
|
1
|
+
import { Action, DatasourceDefinition } from '@perses-dev/core';
|
|
2
|
+
import { DispatchWithoutAction, ReactElement } from 'react';
|
|
3
3
|
interface DatasourceEditorFormProps {
|
|
4
4
|
initialDatasourceDefinition: DatasourceDefinition;
|
|
5
|
-
|
|
5
|
+
action: Action;
|
|
6
6
|
isDraft: boolean;
|
|
7
7
|
isReadonly?: boolean;
|
|
8
|
-
|
|
8
|
+
onActionChange?: (action: Action) => void;
|
|
9
|
+
onSave: (def: DatasourceDefinition) => void;
|
|
9
10
|
onClose: DispatchWithoutAction;
|
|
10
11
|
onDelete?: DispatchWithoutAction;
|
|
11
12
|
}
|
|
12
|
-
export declare function DatasourceEditorForm(props: DatasourceEditorFormProps):
|
|
13
|
+
export declare function DatasourceEditorForm(props: DatasourceEditorFormProps): ReactElement;
|
|
13
14
|
export {};
|
|
14
15
|
//# sourceMappingURL=DatasourceEditorForm.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DatasourceEditorForm.d.ts","sourceRoot":"","sources":["../../../src/components/DatasourceEditorForm/DatasourceEditorForm.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"DatasourceEditorForm.d.ts","sourceRoot":"","sources":["../../../src/components/DatasourceEditorForm/DatasourceEditorForm.tsx"],"names":[],"mappings":"AAgBA,OAAO,EAAE,MAAM,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAChE,OAAO,EAAE,qBAAqB,EAAE,YAAY,EAAY,MAAM,OAAO,CAAC;AAMtE,UAAU,yBAAyB;IACjC,2BAA2B,EAAE,oBAAoB,CAAC;IAClD,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,OAAO,CAAC;IACjB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,cAAc,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IAC1C,MAAM,EAAE,CAAC,GAAG,EAAE,oBAAoB,KAAK,IAAI,CAAC;IAC5C,OAAO,EAAE,qBAAqB,CAAC;IAC/B,QAAQ,CAAC,EAAE,qBAAqB,CAAC;CAClC;AAED,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,yBAAyB,GAAG,YAAY,CA6MnF"}
|