@perses-dev/plugin-system 0.0.0-snapshot-scatterplot-fix-imports-95e1b59 → 0.0.0-snapshot-histogram-types-78c5104
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 +534 -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} +30 -23
- package/dist/cjs/components/{TimeSeriesQueryEditor/TimeSeriesQueryInput.js → MultiQueryEditor/QueryEditorContainer.js} +25 -13
- package/dist/cjs/{stories/shared-utils → components/MultiQueryEditor}/index.js +2 -2
- 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/TimeSeriesQueryEditor/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 +273 -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 +10 -9
- package/dist/cjs/{stories/shared-utils/decorators/WithPluginRegistry.js → runtime/QueryCountProvider.js} +22 -39
- 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 +49 -28
- package/dist/cjs/runtime/time-series-queries.js +23 -28
- package/dist/cjs/runtime/trace-queries.js +1 -2
- package/dist/cjs/runtime/{template-variables.js → variables.js} +29 -47
- 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 +5 -4
- 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 +480 -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 -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} +37 -23
- 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/{TraceQueryEditor/TraceQueryInput.js → MultiQueryEditor/QueryEditorContainer.js} +35 -12
- 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 +27 -5
- 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/{stories/shared-utils/index.js → remote/PersesPlugin.types.js} +3 -3
- 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 +10 -0
- package/dist/remote/PluginRuntime.d.ts.map +1 -0
- package/dist/remote/PluginRuntime.js +211 -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/TraceQueryEditor → 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 +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/duration.js → runtime/QueryCountProvider.js} +13 -4
- 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 +49 -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 +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 +2 -3
- 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/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 +10 -11
- package/dist/cjs/components/TraceQueryEditor/TraceQueryEditor.js +0 -143
- package/dist/cjs/components/TraceQueryEditor/TraceQueryInput.js +0 -96
- package/dist/cjs/stories/shared-utils/decorators/WithDataQueries.js +0 -41
- package/dist/cjs/stories/shared-utils/decorators/WithPluginSystemBuiltinVariables.js +0 -42
- package/dist/cjs/stories/shared-utils/decorators/WithPluginSystemDatasourceStore.js +0 -101
- package/dist/cjs/stories/shared-utils/decorators/WithPluginSystemTemplateVariables.js +0 -42
- package/dist/cjs/stories/shared-utils/decorators/WithTimeRange.js +0 -41
- package/dist/cjs/stories/shared-utils/decorators/index.js +0 -35
- package/dist/cjs/validation/datasource.js +0 -30
- package/dist/cjs/validation/duration.js +0 -25
- 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 +0 -83
- 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.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/WithDataQueries.d.ts +0 -12
- package/dist/stories/shared-utils/decorators/WithDataQueries.d.ts.map +0 -1
- package/dist/stories/shared-utils/decorators/WithDataQueries.js +0 -33
- package/dist/stories/shared-utils/decorators/WithDataQueries.js.map +0 -1
- package/dist/stories/shared-utils/decorators/WithPluginRegistry.d.ts +0 -3
- package/dist/stories/shared-utils/decorators/WithPluginRegistry.d.ts.map +0 -1
- package/dist/stories/shared-utils/decorators/WithPluginRegistry.js +0 -46
- package/dist/stories/shared-utils/decorators/WithPluginRegistry.js.map +0 -1
- package/dist/stories/shared-utils/decorators/WithPluginSystemBuiltinVariables.d.ts +0 -12
- package/dist/stories/shared-utils/decorators/WithPluginSystemBuiltinVariables.d.ts.map +0 -1
- package/dist/stories/shared-utils/decorators/WithPluginSystemBuiltinVariables.js +0 -39
- package/dist/stories/shared-utils/decorators/WithPluginSystemBuiltinVariables.js.map +0 -1
- package/dist/stories/shared-utils/decorators/WithPluginSystemDatasourceStore.d.ts +0 -12
- package/dist/stories/shared-utils/decorators/WithPluginSystemDatasourceStore.d.ts.map +0 -1
- package/dist/stories/shared-utils/decorators/WithPluginSystemDatasourceStore.js +0 -95
- package/dist/stories/shared-utils/decorators/WithPluginSystemDatasourceStore.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 +0 -39
- package/dist/stories/shared-utils/decorators/WithPluginSystemTemplateVariables.js.map +0 -1
- package/dist/stories/shared-utils/decorators/WithTimeRange.d.ts +0 -12
- package/dist/stories/shared-utils/decorators/WithTimeRange.d.ts.map +0 -1
- package/dist/stories/shared-utils/decorators/WithTimeRange.js +0 -33
- package/dist/stories/shared-utils/decorators/WithTimeRange.js.map +0 -1
- package/dist/stories/shared-utils/decorators/index.d.ts +0 -7
- package/dist/stories/shared-utils/decorators/index.d.ts.map +0 -1
- package/dist/stories/shared-utils/decorators/index.js +0 -20
- package/dist/stories/shared-utils/decorators/index.js.map +0 -1
- package/dist/stories/shared-utils/index.d.ts +0 -2
- package/dist/stories/shared-utils/index.d.ts.map +0 -1
- package/dist/stories/shared-utils/index.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 +0 -22
- 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
|
@@ -0,0 +1,273 @@
|
|
|
1
|
+
/* eslint-disable @typescript-eslint/no-require-imports */ // Copyright 2024 The Perses Authors
|
|
2
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
3
|
+
// you may not use this file except in compliance with the License.
|
|
4
|
+
// You may obtain a copy of the License at
|
|
5
|
+
//
|
|
6
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
|
7
|
+
//
|
|
8
|
+
// Unless required by applicable law or agreed to in writing, software
|
|
9
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
10
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11
|
+
// See the License for the specific language governing permissions and
|
|
12
|
+
// limitations under the License.
|
|
13
|
+
"use strict";
|
|
14
|
+
Object.defineProperty(exports, "__esModule", {
|
|
15
|
+
value: true
|
|
16
|
+
});
|
|
17
|
+
function _export(target, all) {
|
|
18
|
+
for(var name in all)Object.defineProperty(target, name, {
|
|
19
|
+
enumerable: true,
|
|
20
|
+
get: all[name]
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
_export(exports, {
|
|
24
|
+
loadPlugin: function() {
|
|
25
|
+
return loadPlugin;
|
|
26
|
+
},
|
|
27
|
+
usePluginRuntime: function() {
|
|
28
|
+
return usePluginRuntime;
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
const _runtime = require("@module-federation/enhanced/runtime");
|
|
32
|
+
const _reactquery = /*#__PURE__*/ _interop_require_wildcard(require("@tanstack/react-query"));
|
|
33
|
+
const _react = /*#__PURE__*/ _interop_require_default(require("react"));
|
|
34
|
+
const _reactdom = /*#__PURE__*/ _interop_require_default(require("react-dom"));
|
|
35
|
+
const _reacthookform = /*#__PURE__*/ _interop_require_wildcard(require("react-hook-form"));
|
|
36
|
+
const _reactrouterdom = /*#__PURE__*/ _interop_require_wildcard(require("react-router-dom"));
|
|
37
|
+
function _interop_require_default(obj) {
|
|
38
|
+
return obj && obj.__esModule ? obj : {
|
|
39
|
+
default: obj
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
function _getRequireWildcardCache(nodeInterop) {
|
|
43
|
+
if (typeof WeakMap !== "function") return null;
|
|
44
|
+
var cacheBabelInterop = new WeakMap();
|
|
45
|
+
var cacheNodeInterop = new WeakMap();
|
|
46
|
+
return (_getRequireWildcardCache = function(nodeInterop) {
|
|
47
|
+
return nodeInterop ? cacheNodeInterop : cacheBabelInterop;
|
|
48
|
+
})(nodeInterop);
|
|
49
|
+
}
|
|
50
|
+
function _interop_require_wildcard(obj, nodeInterop) {
|
|
51
|
+
if (!nodeInterop && obj && obj.__esModule) {
|
|
52
|
+
return obj;
|
|
53
|
+
}
|
|
54
|
+
if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
|
|
55
|
+
return {
|
|
56
|
+
default: obj
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
var cache = _getRequireWildcardCache(nodeInterop);
|
|
60
|
+
if (cache && cache.has(obj)) {
|
|
61
|
+
return cache.get(obj);
|
|
62
|
+
}
|
|
63
|
+
var newObj = {
|
|
64
|
+
__proto__: null
|
|
65
|
+
};
|
|
66
|
+
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
67
|
+
for(var key in obj){
|
|
68
|
+
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
69
|
+
var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
|
|
70
|
+
if (desc && (desc.get || desc.set)) {
|
|
71
|
+
Object.defineProperty(newObj, key, desc);
|
|
72
|
+
} else {
|
|
73
|
+
newObj[key] = obj[key];
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
newObj.default = obj;
|
|
78
|
+
if (cache) {
|
|
79
|
+
cache.set(obj, newObj);
|
|
80
|
+
}
|
|
81
|
+
return newObj;
|
|
82
|
+
}
|
|
83
|
+
let instance = null;
|
|
84
|
+
const getPluginRuntime = ()=>{
|
|
85
|
+
if (instance === null) {
|
|
86
|
+
const pluginRuntime = (0, _runtime.init)({
|
|
87
|
+
name: '@perses/perses-ui-host',
|
|
88
|
+
remotes: [],
|
|
89
|
+
shared: {
|
|
90
|
+
react: {
|
|
91
|
+
version: _react.default.version,
|
|
92
|
+
lib: ()=>_react.default,
|
|
93
|
+
shareConfig: {
|
|
94
|
+
singleton: true,
|
|
95
|
+
requiredVersion: `^${_react.default.version}`
|
|
96
|
+
}
|
|
97
|
+
},
|
|
98
|
+
'react-dom': {
|
|
99
|
+
version: '18.3.1',
|
|
100
|
+
lib: ()=>_reactdom.default,
|
|
101
|
+
shareConfig: {
|
|
102
|
+
singleton: true,
|
|
103
|
+
requiredVersion: `^18.3.1`
|
|
104
|
+
}
|
|
105
|
+
},
|
|
106
|
+
'react-router-dom': {
|
|
107
|
+
version: '6.26.0',
|
|
108
|
+
lib: ()=>_reactrouterdom,
|
|
109
|
+
shareConfig: {
|
|
110
|
+
singleton: true,
|
|
111
|
+
requiredVersion: '^6.26.0'
|
|
112
|
+
}
|
|
113
|
+
},
|
|
114
|
+
'@tanstack/react-query': {
|
|
115
|
+
version: '5.64.2',
|
|
116
|
+
lib: ()=>_reactquery,
|
|
117
|
+
shareConfig: {
|
|
118
|
+
singleton: true,
|
|
119
|
+
requiredVersion: '^5.64.2'
|
|
120
|
+
}
|
|
121
|
+
},
|
|
122
|
+
'react-hook-form': {
|
|
123
|
+
version: '7.52.2',
|
|
124
|
+
lib: ()=>_reacthookform,
|
|
125
|
+
shareConfig: {
|
|
126
|
+
singleton: true,
|
|
127
|
+
requiredVersion: '^7.52.2'
|
|
128
|
+
}
|
|
129
|
+
},
|
|
130
|
+
echarts: {
|
|
131
|
+
version: '5.5.0',
|
|
132
|
+
lib: ()=>require('echarts'),
|
|
133
|
+
shareConfig: {
|
|
134
|
+
singleton: true,
|
|
135
|
+
requiredVersion: '^5.5.0'
|
|
136
|
+
}
|
|
137
|
+
},
|
|
138
|
+
'@perses-dev/components': {
|
|
139
|
+
version: '0.51.0-beta.0',
|
|
140
|
+
lib: ()=>require('@perses-dev/components'),
|
|
141
|
+
shareConfig: {
|
|
142
|
+
singleton: true,
|
|
143
|
+
requiredVersion: '^0.51.0-beta.0'
|
|
144
|
+
}
|
|
145
|
+
},
|
|
146
|
+
'@perses-dev/plugin-system': {
|
|
147
|
+
version: '0.51.0-beta.0',
|
|
148
|
+
lib: ()=>require('@perses-dev/plugin-system'),
|
|
149
|
+
shareConfig: {
|
|
150
|
+
singleton: true,
|
|
151
|
+
requiredVersion: '^0.51.0-beta.0'
|
|
152
|
+
}
|
|
153
|
+
},
|
|
154
|
+
'@perses-dev/explore': {
|
|
155
|
+
version: '0.51.0-beta.0',
|
|
156
|
+
lib: ()=>require('@perses-dev/explore'),
|
|
157
|
+
shareConfig: {
|
|
158
|
+
singleton: true,
|
|
159
|
+
requiredVersion: '^0.51.0-beta.0'
|
|
160
|
+
}
|
|
161
|
+
},
|
|
162
|
+
'@perses-dev/dashboards': {
|
|
163
|
+
version: '0.51.0-beta.0',
|
|
164
|
+
lib: ()=>require('@perses-dev/dashboards'),
|
|
165
|
+
shareConfig: {
|
|
166
|
+
singleton: true,
|
|
167
|
+
requiredVersion: '^0.51.0-beta.0'
|
|
168
|
+
}
|
|
169
|
+
},
|
|
170
|
+
// Below are the shared modules that are used by the plugins, this can be part of the SDK
|
|
171
|
+
'date-fns': {
|
|
172
|
+
version: '4.1.0',
|
|
173
|
+
lib: ()=>require('date-fns'),
|
|
174
|
+
shareConfig: {
|
|
175
|
+
singleton: true,
|
|
176
|
+
requiredVersion: '^4.1.0'
|
|
177
|
+
}
|
|
178
|
+
},
|
|
179
|
+
'date-fns-tz': {
|
|
180
|
+
version: '3.2.0',
|
|
181
|
+
lib: ()=>require('date-fns-tz'),
|
|
182
|
+
shareConfig: {
|
|
183
|
+
singleton: true,
|
|
184
|
+
requiredVersion: '^3.2.0'
|
|
185
|
+
}
|
|
186
|
+
},
|
|
187
|
+
lodash: {
|
|
188
|
+
version: '4.17.21',
|
|
189
|
+
lib: ()=>require('lodash'),
|
|
190
|
+
shareConfig: {
|
|
191
|
+
singleton: true,
|
|
192
|
+
requiredVersion: '^4.17.21'
|
|
193
|
+
}
|
|
194
|
+
},
|
|
195
|
+
'@emotion/react': {
|
|
196
|
+
version: '11.11.3',
|
|
197
|
+
lib: ()=>require('@emotion/react'),
|
|
198
|
+
shareConfig: {
|
|
199
|
+
singleton: true,
|
|
200
|
+
requiredVersion: '^11.11.3'
|
|
201
|
+
}
|
|
202
|
+
},
|
|
203
|
+
'@emotion/styled': {
|
|
204
|
+
version: '11.11.0',
|
|
205
|
+
lib: ()=>require('@emotion/styled'),
|
|
206
|
+
shareConfig: {
|
|
207
|
+
singleton: true,
|
|
208
|
+
requiredVersion: '^11.11.0'
|
|
209
|
+
}
|
|
210
|
+
},
|
|
211
|
+
'@hookform/resolvers/zod': {
|
|
212
|
+
version: '3.3.4',
|
|
213
|
+
lib: ()=>require('@hookform/resolvers/zod'),
|
|
214
|
+
shareConfig: {
|
|
215
|
+
singleton: true,
|
|
216
|
+
requiredVersion: '^3.3.4'
|
|
217
|
+
}
|
|
218
|
+
},
|
|
219
|
+
'use-resize-observer': {
|
|
220
|
+
version: '9.1.0',
|
|
221
|
+
lib: ()=>require('use-resize-observer'),
|
|
222
|
+
shareConfig: {
|
|
223
|
+
singleton: true,
|
|
224
|
+
requiredVersion: '^9.1.0'
|
|
225
|
+
}
|
|
226
|
+
},
|
|
227
|
+
'mdi-material-ui': {
|
|
228
|
+
version: '7.4.0',
|
|
229
|
+
lib: ()=>require('mdi-material-ui'),
|
|
230
|
+
shareConfig: {
|
|
231
|
+
singleton: true,
|
|
232
|
+
requiredVersion: '^7.4.0'
|
|
233
|
+
}
|
|
234
|
+
},
|
|
235
|
+
immer: {
|
|
236
|
+
version: '10.1.1',
|
|
237
|
+
lib: ()=>require('immer'),
|
|
238
|
+
shareConfig: {
|
|
239
|
+
singleton: true,
|
|
240
|
+
requiredVersion: '^10.1.1'
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
});
|
|
245
|
+
instance = pluginRuntime;
|
|
246
|
+
return instance;
|
|
247
|
+
}
|
|
248
|
+
return instance;
|
|
249
|
+
};
|
|
250
|
+
const registerRemote = (name, baseURL)=>{
|
|
251
|
+
const pluginRuntime = getPluginRuntime();
|
|
252
|
+
const existingRemote = pluginRuntime.options.remotes.find((remote)=>remote.name === name);
|
|
253
|
+
if (!existingRemote) {
|
|
254
|
+
const remoteEntryURL = baseURL ? `${baseURL}/${name}/mf-manifest.json` : `/plugins/${name}/mf-manifest.json`;
|
|
255
|
+
pluginRuntime.registerRemotes([
|
|
256
|
+
{
|
|
257
|
+
name,
|
|
258
|
+
entry: remoteEntryURL,
|
|
259
|
+
alias: name
|
|
260
|
+
}
|
|
261
|
+
]);
|
|
262
|
+
}
|
|
263
|
+
};
|
|
264
|
+
const loadPlugin = async (moduleName, pluginName, baseURL)=>{
|
|
265
|
+
registerRemote(moduleName, baseURL);
|
|
266
|
+
return (0, _runtime.loadRemote)(`${moduleName}/${pluginName}`);
|
|
267
|
+
};
|
|
268
|
+
function usePluginRuntime({ plugin }) {
|
|
269
|
+
return {
|
|
270
|
+
pluginRuntime: getPluginRuntime(),
|
|
271
|
+
loadPlugin: ()=>loadPlugin(plugin.moduleName, plugin.name, plugin.baseURL)
|
|
272
|
+
};
|
|
273
|
+
}
|
|
@@ -14,11 +14,8 @@
|
|
|
14
14
|
Object.defineProperty(exports, "__esModule", {
|
|
15
15
|
value: true
|
|
16
16
|
});
|
|
17
|
-
_export_star(require("./
|
|
18
|
-
_export_star(require("./
|
|
19
|
-
_export_star(require("./resource"), exports);
|
|
20
|
-
_export_star(require("./secret"), exports);
|
|
21
|
-
_export_star(require("./variable"), exports);
|
|
17
|
+
_export_star(require("./PluginLoaderComponent"), exports);
|
|
18
|
+
_export_star(require("./remotePluginLoader"), exports);
|
|
22
19
|
function _export_star(from, to) {
|
|
23
20
|
Object.keys(from).forEach(function(k) {
|
|
24
21
|
if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) {
|
|
@@ -0,0 +1,61 @@
|
|
|
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
|
+
Object.defineProperty(exports, "remotePluginLoader", {
|
|
18
|
+
enumerable: true,
|
|
19
|
+
get: function() {
|
|
20
|
+
return remotePluginLoader;
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
const _PluginRuntime = require("./PluginRuntime");
|
|
24
|
+
const isPluginMetadata = (plugin)=>{
|
|
25
|
+
return typeof plugin === 'object' && plugin !== null && 'kind' in plugin && 'spec' in plugin && typeof plugin.spec === 'object' && plugin.spec !== null && 'name' in plugin.spec;
|
|
26
|
+
};
|
|
27
|
+
const isPluginModuleResource = (pluginModule)=>{
|
|
28
|
+
return typeof pluginModule === 'object' && pluginModule !== null && 'metadata' in pluginModule && 'spec' in pluginModule && typeof pluginModule.spec === 'object' && pluginModule.spec !== null && 'plugins' in pluginModule.spec && Array.isArray(pluginModule.spec.plugins) && pluginModule.spec.plugins.every(isPluginMetadata);
|
|
29
|
+
};
|
|
30
|
+
const remotePluginLoader = (baseURL)=>{
|
|
31
|
+
return {
|
|
32
|
+
getInstalledPlugins: async ()=>{
|
|
33
|
+
const pluginsResponse = await fetch(`${baseURL ? baseURL : ''}/api/v1/plugins`);
|
|
34
|
+
const plugins = await pluginsResponse.json();
|
|
35
|
+
let pluginModules = [];
|
|
36
|
+
if (Array.isArray(plugins)) {
|
|
37
|
+
pluginModules = plugins.filter(isPluginModuleResource);
|
|
38
|
+
} else {
|
|
39
|
+
console.error('RemotePluginLoader: Error loading plugins, response is not an array');
|
|
40
|
+
}
|
|
41
|
+
if (!pluginModules.length) {
|
|
42
|
+
console.error('RemotePluginLoader: No valid plugins found');
|
|
43
|
+
}
|
|
44
|
+
return pluginModules;
|
|
45
|
+
},
|
|
46
|
+
importPluginModule: async (resource)=>{
|
|
47
|
+
const pluginModuleName = resource.metadata.name;
|
|
48
|
+
const pluginModule = {};
|
|
49
|
+
for (const plugin of resource.spec.plugins){
|
|
50
|
+
const remotePluginModule = await (0, _PluginRuntime.loadPlugin)(pluginModuleName, plugin.spec.name);
|
|
51
|
+
const remotePlugin = remotePluginModule?.[plugin.spec.name];
|
|
52
|
+
if (remotePlugin) {
|
|
53
|
+
pluginModule[plugin.spec.name] = remotePlugin;
|
|
54
|
+
} else {
|
|
55
|
+
console.error(`RemotePluginLoader: Error loading plugin ${plugin.spec.name}`);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
return pluginModule;
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
};
|
|
@@ -38,6 +38,7 @@ const _jsxruntime = require("react/jsx-runtime");
|
|
|
38
38
|
const _react = require("react");
|
|
39
39
|
const _timeseriesqueries = require("../time-series-queries");
|
|
40
40
|
const _tracequeries = require("../trace-queries");
|
|
41
|
+
const _UsageMetricsProvider = require("../UsageMetricsProvider");
|
|
41
42
|
const _model = require("./model");
|
|
42
43
|
const DataQueriesContext = /*#__PURE__*/ (0, _react.createContext)(undefined);
|
|
43
44
|
function useDataQueriesContext() {
|
|
@@ -50,15 +51,9 @@ function useDataQueriesContext() {
|
|
|
50
51
|
function useDataQueries(queryType) {
|
|
51
52
|
const ctx = useDataQueriesContext();
|
|
52
53
|
// Filter the query results based on the specified query type
|
|
53
|
-
const filteredQueryResults = ctx.queryResults.filter((queryResult)=>
|
|
54
|
-
var _queryResult_definition;
|
|
55
|
-
return (queryResult === null || queryResult === void 0 ? void 0 : (_queryResult_definition = queryResult.definition) === null || _queryResult_definition === void 0 ? void 0 : _queryResult_definition.kind) === queryType;
|
|
56
|
-
});
|
|
54
|
+
const filteredQueryResults = ctx.queryResults.filter((queryResult)=>queryResult?.definition?.kind === queryType);
|
|
57
55
|
// Filter the errors based on the specified query type
|
|
58
|
-
const filteredErrors = ctx.errors.filter((errors, index)=>
|
|
59
|
-
var _ctx_queryResults_index_definition, _ctx_queryResults_index;
|
|
60
|
-
return ((_ctx_queryResults_index = ctx.queryResults[index]) === null || _ctx_queryResults_index === void 0 ? void 0 : (_ctx_queryResults_index_definition = _ctx_queryResults_index.definition) === null || _ctx_queryResults_index_definition === void 0 ? void 0 : _ctx_queryResults_index_definition.kind) === queryType;
|
|
61
|
-
});
|
|
56
|
+
const filteredErrors = ctx.errors.filter((errors, index)=>ctx.queryResults[index]?.definition?.kind === queryType);
|
|
62
57
|
// Create a new context object with the filtered results and errors
|
|
63
58
|
const filteredCtx = {
|
|
64
59
|
queryResults: filteredQueryResults,
|
|
@@ -82,6 +77,7 @@ function DataQueriesProvider(props) {
|
|
|
82
77
|
}
|
|
83
78
|
};
|
|
84
79
|
});
|
|
80
|
+
const usageMetrics = (0, _UsageMetricsProvider.useUsageMetrics)();
|
|
85
81
|
// Filter definitions for time series query and other future query plugins
|
|
86
82
|
const timeSeriesQueries = queryDefinitions.filter((definition)=>definition.kind === 'TimeSeriesQuery');
|
|
87
83
|
const timeSeriesResults = (0, _timeseriesqueries.useTimeSeriesQueries)(timeSeriesQueries, options, queryOptions);
|
|
@@ -99,6 +95,17 @@ function DataQueriesProvider(props) {
|
|
|
99
95
|
...(0, _model.transformQueryResults)(timeSeriesResults, timeSeriesQueries),
|
|
100
96
|
...(0, _model.transformQueryResults)(traceResults, traceQueries)
|
|
101
97
|
];
|
|
98
|
+
if (queryOptions?.enabled) {
|
|
99
|
+
for (const result of mergedQueryResults){
|
|
100
|
+
if (!result.isLoading && !result.isFetching && !result.error) {
|
|
101
|
+
usageMetrics.markQuery(result.definition, 'success');
|
|
102
|
+
} else if (result.error) {
|
|
103
|
+
usageMetrics.markQuery(result.definition, 'error');
|
|
104
|
+
} else {
|
|
105
|
+
usageMetrics.markQuery(result.definition, 'pending');
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
}
|
|
102
109
|
return {
|
|
103
110
|
queryResults: mergedQueryResults,
|
|
104
111
|
isFetching: mergedQueryResults.some((result)=>result.isFetching),
|
|
@@ -111,7 +118,9 @@ function DataQueriesProvider(props) {
|
|
|
111
118
|
timeSeriesResults,
|
|
112
119
|
traceQueries,
|
|
113
120
|
traceResults,
|
|
114
|
-
refetchAll
|
|
121
|
+
refetchAll,
|
|
122
|
+
queryOptions?.enabled,
|
|
123
|
+
usageMetrics
|
|
115
124
|
]);
|
|
116
125
|
return /*#__PURE__*/ (0, _jsxruntime.jsx)(DataQueriesContext.Provider, {
|
|
117
126
|
value: ctx,
|
|
@@ -43,8 +43,12 @@ function transformQueryResults(results, definitions) {
|
|
|
43
43
|
});
|
|
44
44
|
}
|
|
45
45
|
function useQueryType() {
|
|
46
|
-
const { data: timeSeriesQueryPlugins, isLoading: isTimeSeriesQueryLoading } = (0, _pluginregistry.useListPluginMetadata)(
|
|
47
|
-
|
|
46
|
+
const { data: timeSeriesQueryPlugins, isLoading: isTimeSeriesQueryLoading } = (0, _pluginregistry.useListPluginMetadata)([
|
|
47
|
+
'TimeSeriesQuery'
|
|
48
|
+
]);
|
|
49
|
+
const { data: traceQueryPlugins, isLoading: isTraceQueryPluginLoading } = (0, _pluginregistry.useListPluginMetadata)([
|
|
50
|
+
'TraceQuery'
|
|
51
|
+
]);
|
|
48
52
|
// For example, `map: {"TimeSeriesQuery":["PrometheusTimeSeriesQuery"],"TraceQuery":["TempoTraceQuery"]}`
|
|
49
53
|
const queryTypeMap = (0, _react.useMemo)(()=>{
|
|
50
54
|
const map = {
|
|
@@ -53,14 +57,12 @@ function useQueryType() {
|
|
|
53
57
|
};
|
|
54
58
|
if (timeSeriesQueryPlugins) {
|
|
55
59
|
timeSeriesQueryPlugins.forEach((plugin)=>{
|
|
56
|
-
|
|
57
|
-
(_map_plugin_pluginType = map[plugin.pluginType]) === null || _map_plugin_pluginType === void 0 ? void 0 : _map_plugin_pluginType.push(plugin.kind);
|
|
60
|
+
map[plugin.kind]?.push(plugin.spec.name);
|
|
58
61
|
});
|
|
59
62
|
}
|
|
60
63
|
if (traceQueryPlugins) {
|
|
61
64
|
traceQueryPlugins.forEach((plugin)=>{
|
|
62
|
-
|
|
63
|
-
(_map_plugin_pluginType = map[plugin.pluginType]) === null || _map_plugin_pluginType === void 0 ? void 0 : _map_plugin_pluginType.push(plugin.kind);
|
|
65
|
+
map[plugin.kind]?.push(plugin.spec.name);
|
|
64
66
|
});
|
|
65
67
|
}
|
|
66
68
|
return map;
|
|
@@ -76,14 +78,13 @@ function useQueryType() {
|
|
|
76
78
|
case 'TempoTraceQuery':
|
|
77
79
|
return isTraceQueryPluginLoading;
|
|
78
80
|
}
|
|
79
|
-
|
|
81
|
+
return isTraceQueryPluginLoading || isTimeSeriesQueryLoading;
|
|
80
82
|
};
|
|
81
83
|
if (isLoading(pluginKind)) {
|
|
82
84
|
return undefined;
|
|
83
85
|
}
|
|
84
86
|
for(const queryType in queryTypeMap){
|
|
85
|
-
|
|
86
|
-
if ((_queryTypeMap_queryType = queryTypeMap[queryType]) === null || _queryTypeMap_queryType === void 0 ? void 0 : _queryTypeMap_queryType.includes(pluginKind)) {
|
|
87
|
+
if (queryTypeMap[queryType]?.includes(pluginKind)) {
|
|
87
88
|
return queryType;
|
|
88
89
|
}
|
|
89
90
|
}
|
|
@@ -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,21 +14,22 @@
|
|
|
14
14
|
Object.defineProperty(exports, "__esModule", {
|
|
15
15
|
value: true
|
|
16
16
|
});
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
17
|
+
function _export(target, all) {
|
|
18
|
+
for(var name in all)Object.defineProperty(target, name, {
|
|
19
|
+
enumerable: true,
|
|
20
|
+
get: all[name]
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
_export(exports, {
|
|
24
|
+
QueryCountProvider: function() {
|
|
25
|
+
return QueryCountProvider;
|
|
26
|
+
},
|
|
27
|
+
useQueryCountContext: function() {
|
|
28
|
+
return useQueryCountContext;
|
|
21
29
|
}
|
|
22
30
|
});
|
|
23
31
|
const _jsxruntime = require("react/jsx-runtime");
|
|
24
|
-
const
|
|
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
|
+
const _react = /*#__PURE__*/ _interop_require_wildcard(require("react"));
|
|
32
33
|
function _getRequireWildcardCache(nodeInterop) {
|
|
33
34
|
if (typeof WeakMap !== "function") return null;
|
|
34
35
|
var cacheBabelInterop = new WeakMap();
|
|
@@ -70,31 +71,13 @@ function _interop_require_wildcard(obj, nodeInterop) {
|
|
|
70
71
|
}
|
|
71
72
|
return newObj;
|
|
72
73
|
}
|
|
73
|
-
const
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
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
|
-
const WithPluginRegistry = (Story)=>{
|
|
92
|
-
return /*#__PURE__*/ (0, _jsxruntime.jsx)(_pluginsystem.PluginRegistry, {
|
|
93
|
-
pluginLoader: bundledPluginLoader,
|
|
94
|
-
defaultPluginKinds: {
|
|
95
|
-
TimeSeriesQuery: 'PrometheusTimeSeriesQuery',
|
|
96
|
-
TraceQuery: 'TempoTraceQuery'
|
|
97
|
-
},
|
|
98
|
-
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(Story, {})
|
|
74
|
+
const QueryCountContext = /*#__PURE__*/ (0, _react.createContext)(0);
|
|
75
|
+
const QueryCountProvider = ({ queryCount, children })=>{
|
|
76
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsx)(QueryCountContext.Provider, {
|
|
77
|
+
value: queryCount,
|
|
78
|
+
children: children
|
|
99
79
|
});
|
|
100
80
|
};
|
|
81
|
+
const useQueryCountContext = ()=>{
|
|
82
|
+
return (0, _react.useContext)(QueryCountContext);
|
|
83
|
+
};
|
|
@@ -119,24 +119,37 @@ function TimeRangeProvider(props) {
|
|
|
119
119
|
}, [
|
|
120
120
|
setRefreshCounter
|
|
121
121
|
]);
|
|
122
|
+
const refreshIntervalInMs = (0, _refreshinterval.getRefreshIntervalInMs)(localRefreshInterval);
|
|
123
|
+
(0, _react.useEffect)(()=>{
|
|
124
|
+
if (refreshIntervalInMs > 0) {
|
|
125
|
+
const interval = setInterval(()=>{
|
|
126
|
+
refresh();
|
|
127
|
+
}, refreshIntervalInMs);
|
|
128
|
+
return ()=>clearInterval(interval);
|
|
129
|
+
}
|
|
130
|
+
}, [
|
|
131
|
+
refresh,
|
|
132
|
+
refreshIntervalInMs
|
|
133
|
+
]);
|
|
122
134
|
const ctx = (0, _react.useMemo)(()=>{
|
|
123
135
|
const absoluteTimeRange = (0, _core.isRelativeTimeRange)(localTimeRange) ? (0, _core.toAbsoluteTimeRange)(localTimeRange) : localTimeRange;
|
|
124
136
|
return {
|
|
125
137
|
timeRange: localTimeRange,
|
|
126
|
-
setTimeRange: setTimeRange
|
|
138
|
+
setTimeRange: setTimeRange ?? setLocalTimeRange,
|
|
127
139
|
absoluteTimeRange,
|
|
128
140
|
refresh,
|
|
129
141
|
refreshKey: `${absoluteTimeRange.start}:${absoluteTimeRange.end}:${localRefreshInterval}:${refreshCounter}`,
|
|
130
142
|
refreshInterval: localRefreshInterval,
|
|
131
|
-
refreshIntervalInMs:
|
|
132
|
-
setRefreshInterval: setRefreshInterval
|
|
143
|
+
refreshIntervalInMs: refreshIntervalInMs,
|
|
144
|
+
setRefreshInterval: setRefreshInterval ?? setLocalRefreshInterval
|
|
133
145
|
};
|
|
134
146
|
}, [
|
|
135
147
|
localTimeRange,
|
|
136
148
|
setTimeRange,
|
|
137
149
|
refresh,
|
|
138
|
-
refreshCounter,
|
|
139
150
|
localRefreshInterval,
|
|
151
|
+
refreshCounter,
|
|
152
|
+
refreshIntervalInMs,
|
|
140
153
|
setRefreshInterval
|
|
141
154
|
]);
|
|
142
155
|
return /*#__PURE__*/ (0, _jsxruntime.jsx)(TimeRangeContext.Provider, {
|