@perses-dev/plugin-system 0.0.0-snapshot-scatter-chart-embed-8efdfab → 0.0.0-snapshot-explorer-plugin-c4a7621
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/components/CalculationSelector/CalculationSelector.js +1 -1
- package/dist/cjs/components/DatasourceEditorForm/DatasourceEditorForm.js +83 -163
- package/dist/cjs/components/DatasourceSelect.js +12 -15
- package/dist/cjs/components/HTTPSettingsEditor/HTTPSettingsEditor.js +528 -0
- package/dist/cjs/components/{TimeSeriesQueryEditor → HTTPSettingsEditor}/index.js +2 -2
- package/dist/cjs/components/LegendOptionsEditor/LegendOptionsEditor.js +8 -7
- package/dist/cjs/components/MetricLabelInput/MetricLabelInput.js +41 -0
- package/dist/cjs/{validation/resource.js → components/MetricLabelInput/index.js} +15 -9
- package/dist/cjs/components/{TraceQueryEditor/TraceQueryEditor.js → MultiQueryEditor/MultiQueryEditor.js} +39 -40
- package/dist/cjs/components/{TimeSeriesQueryEditor/TimeSeriesQueryInput.js → MultiQueryEditor/QueryEditorContainer.js} +23 -11
- package/dist/cjs/components/MultiQueryEditor/index.js +30 -0
- package/dist/cjs/components/OptionsEditorRadios/OptionsEditorRadios.js +3 -3
- package/dist/cjs/components/OptionsEditorTabPanel/OptionsEditorTabPanel.js +1 -1
- package/dist/cjs/components/OptionsEditorTabs/OptionsEditorTabs.js +3 -3
- package/dist/cjs/components/PanelSpecEditor/PanelSpecEditor.js +54 -62
- package/dist/cjs/components/PluginEditor/PluginEditor.js +16 -13
- package/dist/cjs/components/PluginEditor/plugin-editor-api.js +44 -33
- package/dist/cjs/components/PluginKindSelect/PluginKindSelect.js +55 -7
- package/dist/cjs/components/PluginRegistry/PluginRegistry.js +9 -10
- package/dist/cjs/components/PluginRegistry/plugin-indexes.js +20 -17
- package/dist/cjs/components/PluginSpecEditor/PluginSpecEditor.js +3 -3
- package/dist/cjs/components/ProjectSelect.js +7 -7
- package/dist/cjs/components/TimeRangeControls/TimeRangeControls.js +131 -0
- package/dist/cjs/components/{TraceQueryEditor → TimeRangeControls}/index.js +1 -1
- package/dist/cjs/components/Variables/VariableEditorForm/VariableEditorForm.js +394 -439
- package/dist/cjs/components/Variables/VariableEditorForm/VariablePreview.js +17 -15
- package/dist/cjs/components/Variables/VariableEditorForm/variable-editor-form-model.js +7 -12
- package/dist/cjs/components/Variables/variable-model.js +35 -37
- package/dist/cjs/components/index.js +4 -1
- package/dist/cjs/constants/user-interface-text.js +4 -1
- package/dist/cjs/context/ProjectStoreProvider.js +12 -9
- package/dist/cjs/context/ValidationProvider.js +69 -0
- package/dist/cjs/context/index.js +1 -0
- package/dist/cjs/index.js +1 -1
- package/dist/{components/TimeSeriesQueryEditor/index.js → cjs/model/explore.js} +4 -3
- package/dist/cjs/model/legend.js +5 -5
- package/dist/cjs/remote/PersesPlugin.types.js +16 -0
- package/dist/cjs/remote/PluginLoaderComponent.js +75 -0
- package/dist/cjs/remote/PluginRuntime.js +267 -0
- package/dist/cjs/{validation → remote}/index.js +2 -4
- package/dist/cjs/remote/remotePluginLoader.js +61 -0
- package/dist/cjs/runtime/DataQueriesProvider/DataQueriesProvider.js +23 -14
- package/dist/cjs/runtime/DataQueriesProvider/model.js +10 -9
- package/dist/cjs/runtime/QueryCountProvider.js +83 -0
- package/dist/cjs/runtime/TimeRangeProvider/TimeRangeProvider.js +37 -13
- package/dist/cjs/runtime/TimeRangeProvider/TimeRangeProviderWithQueryParams.js +3 -3
- package/dist/cjs/runtime/TimeRangeProvider/TimeRangeSettingsProvider.js +100 -0
- package/dist/cjs/runtime/TimeRangeProvider/index.js +2 -1
- package/dist/cjs/runtime/TimeRangeProvider/query-params.js +20 -23
- package/dist/cjs/runtime/UsageMetricsProvider.js +99 -0
- package/dist/cjs/runtime/builtin-variables.js +7 -7
- package/dist/cjs/runtime/datasources.js +30 -21
- package/dist/cjs/runtime/index.js +4 -2
- package/dist/cjs/runtime/plugin-registry.js +48 -36
- package/dist/cjs/runtime/time-series-queries.js +35 -40
- package/dist/cjs/runtime/trace-queries.js +9 -6
- package/dist/cjs/runtime/{template-variables.js → variables.js} +38 -48
- package/dist/cjs/stories/shared-utils/decorators/WithDataQueries.js +1 -1
- package/dist/cjs/stories/shared-utils/decorators/WithPluginRegistry.js +1 -65
- package/dist/cjs/stories/shared-utils/decorators/WithPluginSystemBuiltinVariables.js +1 -1
- package/dist/cjs/stories/shared-utils/decorators/WithPluginSystemDatasourceStore.js +5 -5
- package/dist/cjs/stories/shared-utils/decorators/{WithPluginSystemTemplateVariables.js → WithPluginSystemVariables.js} +9 -9
- package/dist/cjs/stories/shared-utils/decorators/WithTimeRange.js +1 -1
- package/dist/cjs/stories/shared-utils/decorators/index.js +2 -2
- package/dist/cjs/test/mock-data.js +25 -4
- package/dist/cjs/test/render.js +2 -11
- package/dist/cjs/test/test-plugins/bert/index.js +21 -20
- package/dist/cjs/test/test-plugins/ernie/index.js +2 -2
- package/dist/cjs/test/test-plugins/index.js +3 -1
- package/dist/cjs/test-utils/mock-plugin-registry.js +13 -13
- package/dist/cjs/utils/action.js +3 -3
- package/dist/cjs/utils/variables.js +24 -24
- package/dist/components/CalculationSelector/CalculationSelector.d.ts +2 -2
- package/dist/components/CalculationSelector/CalculationSelector.d.ts.map +1 -1
- package/dist/components/CalculationSelector/CalculationSelector.js +1 -1
- package/dist/components/CalculationSelector/CalculationSelector.js.map +1 -1
- package/dist/components/DatasourceEditorForm/DatasourceEditorForm.d.ts +7 -7
- package/dist/components/DatasourceEditorForm/DatasourceEditorForm.d.ts.map +1 -1
- package/dist/components/DatasourceEditorForm/DatasourceEditorForm.js +86 -166
- package/dist/components/DatasourceEditorForm/DatasourceEditorForm.js.map +1 -1
- package/dist/components/DatasourceSelect.d.ts +4 -4
- package/dist/components/DatasourceSelect.d.ts.map +1 -1
- package/dist/components/DatasourceSelect.js +9 -12
- package/dist/components/DatasourceSelect.js.map +1 -1
- package/dist/components/HTTPSettingsEditor/HTTPSettingsEditor.d.ts +11 -0
- package/dist/components/HTTPSettingsEditor/HTTPSettingsEditor.d.ts.map +1 -0
- package/dist/components/HTTPSettingsEditor/HTTPSettingsEditor.js +474 -0
- package/dist/components/HTTPSettingsEditor/HTTPSettingsEditor.js.map +1 -0
- package/dist/components/HTTPSettingsEditor/index.d.ts +2 -0
- package/dist/components/HTTPSettingsEditor/index.d.ts.map +1 -0
- package/dist/components/HTTPSettingsEditor/index.js +15 -0
- package/dist/components/HTTPSettingsEditor/index.js.map +1 -0
- package/dist/components/LegendOptionsEditor/LegendOptionsEditor.d.ts +3 -2
- package/dist/components/LegendOptionsEditor/LegendOptionsEditor.d.ts.map +1 -1
- package/dist/components/LegendOptionsEditor/LegendOptionsEditor.js +10 -9
- package/dist/components/LegendOptionsEditor/LegendOptionsEditor.js.map +1 -1
- package/dist/components/MetricLabelInput/MetricLabelInput.d.ts +7 -0
- package/dist/components/MetricLabelInput/MetricLabelInput.d.ts.map +1 -0
- package/dist/components/MetricLabelInput/MetricLabelInput.js +33 -0
- package/dist/components/MetricLabelInput/MetricLabelInput.js.map +1 -0
- package/dist/components/MetricLabelInput/index.d.ts +2 -0
- package/dist/components/MetricLabelInput/index.d.ts.map +1 -0
- package/dist/components/MetricLabelInput/index.js +15 -0
- package/dist/components/MetricLabelInput/index.js.map +1 -0
- package/dist/components/MultiQueryEditor/MultiQueryEditor.d.ts +17 -0
- package/dist/components/MultiQueryEditor/MultiQueryEditor.d.ts.map +1 -0
- package/dist/components/{TimeSeriesQueryEditor/TimeSeriesQueryEditor.js → MultiQueryEditor/MultiQueryEditor.js} +42 -39
- package/dist/components/MultiQueryEditor/MultiQueryEditor.js.map +1 -0
- package/dist/components/MultiQueryEditor/QueryEditorContainer.d.ts +29 -0
- package/dist/components/MultiQueryEditor/QueryEditorContainer.d.ts.map +1 -0
- package/dist/components/{TimeSeriesQueryEditor/TimeSeriesQueryInput.js → MultiQueryEditor/QueryEditorContainer.js} +33 -10
- package/dist/components/MultiQueryEditor/QueryEditorContainer.js.map +1 -0
- package/dist/components/MultiQueryEditor/index.d.ts +2 -0
- package/dist/components/MultiQueryEditor/index.d.ts.map +1 -0
- package/dist/components/MultiQueryEditor/index.js +15 -0
- package/dist/components/{TraceQueryEditor → MultiQueryEditor}/index.js.map +1 -1
- package/dist/components/OptionsEditorRadios/OptionsEditorRadios.d.ts +4 -4
- package/dist/components/OptionsEditorRadios/OptionsEditorRadios.d.ts.map +1 -1
- package/dist/components/OptionsEditorRadios/OptionsEditorRadios.js +3 -3
- package/dist/components/OptionsEditorRadios/OptionsEditorRadios.js.map +1 -1
- package/dist/components/OptionsEditorTabPanel/OptionsEditorTabPanel.d.ts +2 -2
- package/dist/components/OptionsEditorTabPanel/OptionsEditorTabPanel.d.ts.map +1 -1
- package/dist/components/OptionsEditorTabPanel/OptionsEditorTabPanel.js +1 -1
- package/dist/components/OptionsEditorTabPanel/OptionsEditorTabPanel.js.map +1 -1
- package/dist/components/OptionsEditorTabs/OptionsEditorTabs.d.ts +5 -5
- package/dist/components/OptionsEditorTabs/OptionsEditorTabs.d.ts.map +1 -1
- package/dist/components/OptionsEditorTabs/OptionsEditorTabs.js +3 -3
- package/dist/components/OptionsEditorTabs/OptionsEditorTabs.js.map +1 -1
- package/dist/components/PanelSpecEditor/PanelSpecEditor.d.ts +5 -3
- package/dist/components/PanelSpecEditor/PanelSpecEditor.d.ts.map +1 -1
- package/dist/components/PanelSpecEditor/PanelSpecEditor.js +56 -64
- package/dist/components/PanelSpecEditor/PanelSpecEditor.js.map +1 -1
- package/dist/components/PluginEditor/PluginEditor.d.ts +2 -2
- package/dist/components/PluginEditor/PluginEditor.d.ts.map +1 -1
- package/dist/components/PluginEditor/PluginEditor.js +16 -13
- package/dist/components/PluginEditor/PluginEditor.js.map +1 -1
- package/dist/components/PluginEditor/plugin-editor-api.d.ts +16 -10
- package/dist/components/PluginEditor/plugin-editor-api.d.ts.map +1 -1
- package/dist/components/PluginEditor/plugin-editor-api.js +44 -33
- package/dist/components/PluginEditor/plugin-editor-api.js.map +1 -1
- package/dist/components/PluginKindSelect/PluginKindSelect.d.ts +11 -5
- package/dist/components/PluginKindSelect/PluginKindSelect.d.ts.map +1 -1
- package/dist/components/PluginKindSelect/PluginKindSelect.js +61 -10
- package/dist/components/PluginKindSelect/PluginKindSelect.js.map +1 -1
- package/dist/components/PluginRegistry/PluginRegistry.d.ts +4 -4
- package/dist/components/PluginRegistry/PluginRegistry.d.ts.map +1 -1
- package/dist/components/PluginRegistry/PluginRegistry.js +9 -10
- package/dist/components/PluginRegistry/PluginRegistry.js.map +1 -1
- package/dist/components/PluginRegistry/plugin-indexes.d.ts +4 -4
- package/dist/components/PluginRegistry/plugin-indexes.d.ts.map +1 -1
- package/dist/components/PluginRegistry/plugin-indexes.js +17 -14
- package/dist/components/PluginRegistry/plugin-indexes.js.map +1 -1
- package/dist/components/PluginSpecEditor/PluginSpecEditor.d.ts +5 -5
- package/dist/components/PluginSpecEditor/PluginSpecEditor.d.ts.map +1 -1
- package/dist/components/PluginSpecEditor/PluginSpecEditor.js +3 -3
- package/dist/components/PluginSpecEditor/PluginSpecEditor.js.map +1 -1
- package/dist/components/ProjectSelect.d.ts +3 -3
- package/dist/components/ProjectSelect.d.ts.map +1 -1
- package/dist/components/ProjectSelect.js +7 -7
- package/dist/components/ProjectSelect.js.map +1 -1
- package/dist/components/TimeRangeControls/TimeRangeControls.d.ts +14 -0
- package/dist/components/TimeRangeControls/TimeRangeControls.d.ts.map +1 -0
- package/dist/components/TimeRangeControls/TimeRangeControls.js +110 -0
- package/dist/components/TimeRangeControls/TimeRangeControls.js.map +1 -0
- package/dist/components/TimeRangeControls/index.d.ts +2 -0
- package/dist/components/TimeRangeControls/index.d.ts.map +1 -0
- package/dist/components/{TraceQueryEditor → TimeRangeControls}/index.js +1 -1
- package/dist/components/TimeRangeControls/index.js.map +1 -0
- package/dist/components/Variables/VariableEditorForm/VariableEditorForm.d.ts +4 -3
- package/dist/components/Variables/VariableEditorForm/VariableEditorForm.d.ts.map +1 -1
- package/dist/components/Variables/VariableEditorForm/VariableEditorForm.js +395 -442
- package/dist/components/Variables/VariableEditorForm/VariableEditorForm.js.map +1 -1
- package/dist/components/Variables/VariableEditorForm/VariablePreview.d.ts +3 -3
- package/dist/components/Variables/VariableEditorForm/VariablePreview.d.ts.map +1 -1
- package/dist/components/Variables/VariableEditorForm/VariablePreview.js +11 -11
- package/dist/components/Variables/VariableEditorForm/VariablePreview.js.map +1 -1
- package/dist/components/Variables/VariableEditorForm/variable-editor-form-model.d.ts +3 -3
- package/dist/components/Variables/VariableEditorForm/variable-editor-form-model.d.ts.map +1 -1
- package/dist/components/Variables/VariableEditorForm/variable-editor-form-model.js +7 -12
- package/dist/components/Variables/VariableEditorForm/variable-editor-form-model.js.map +1 -1
- package/dist/components/Variables/variable-model.d.ts +2 -1
- package/dist/components/Variables/variable-model.d.ts.map +1 -1
- package/dist/components/Variables/variable-model.js +29 -31
- package/dist/components/Variables/variable-model.js.map +1 -1
- package/dist/components/index.d.ts +4 -1
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/index.js +4 -1
- package/dist/components/index.js.map +1 -1
- package/dist/constants/user-interface-text.d.ts +2 -0
- package/dist/constants/user-interface-text.d.ts.map +1 -1
- package/dist/constants/user-interface-text.js +4 -1
- package/dist/constants/user-interface-text.js.map +1 -1
- package/dist/context/ProjectStoreProvider.d.ts +4 -4
- package/dist/context/ProjectStoreProvider.d.ts.map +1 -1
- package/dist/context/ProjectStoreProvider.js +9 -6
- package/dist/context/ProjectStoreProvider.js.map +1 -1
- package/dist/context/ValidationProvider.d.ts +19 -0
- package/dist/context/ValidationProvider.d.ts.map +1 -0
- package/dist/context/ValidationProvider.js +52 -0
- package/dist/context/ValidationProvider.js.map +1 -0
- package/dist/context/index.d.ts +1 -0
- package/dist/context/index.d.ts.map +1 -1
- package/dist/context/index.js +1 -0
- package/dist/context/index.js.map +1 -1
- package/dist/context/query-params.d.ts.map +1 -1
- package/dist/context/query-params.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/model/datasource.js +3 -1
- package/dist/model/datasource.js.map +1 -1
- package/dist/model/explore.d.ts +13 -0
- package/dist/model/explore.d.ts.map +1 -0
- package/dist/{validation/resource.js → model/explore.js} +4 -3
- package/dist/model/explore.js.map +1 -0
- package/dist/model/legend.d.ts +2 -2
- package/dist/model/legend.d.ts.map +1 -1
- package/dist/model/legend.js.map +1 -1
- package/dist/model/panels.d.ts +17 -5
- package/dist/model/panels.d.ts.map +1 -1
- package/dist/model/panels.js.map +1 -1
- package/dist/model/plugin-base.d.ts +0 -1
- package/dist/model/plugin-base.d.ts.map +1 -1
- package/dist/model/plugin-base.js.map +1 -1
- package/dist/model/plugin-loading.js.map +1 -1
- package/dist/model/plugins.d.ts +35 -21
- package/dist/model/plugins.d.ts.map +1 -1
- package/dist/model/plugins.js.map +1 -1
- package/dist/model/time-series-queries.d.ts +4 -3
- package/dist/model/time-series-queries.d.ts.map +1 -1
- package/dist/model/time-series-queries.js.map +1 -1
- package/dist/model/trace-queries.d.ts +1 -1
- package/dist/model/trace-queries.d.ts.map +1 -1
- package/dist/model/trace-queries.js.map +1 -1
- package/dist/model/variables.d.ts +2 -2
- package/dist/model/variables.d.ts.map +1 -1
- package/dist/model/variables.js +3 -1
- package/dist/model/variables.js.map +1 -1
- package/dist/remote/PersesPlugin.types.d.ts +7 -0
- package/dist/remote/PersesPlugin.types.d.ts.map +1 -0
- package/dist/remote/PersesPlugin.types.js +15 -0
- package/dist/remote/PersesPlugin.types.js.map +1 -0
- package/dist/remote/PluginLoaderComponent.d.ts +10 -0
- package/dist/remote/PluginLoaderComponent.d.ts.map +1 -0
- package/dist/remote/PluginLoaderComponent.js +67 -0
- package/dist/remote/PluginLoaderComponent.js.map +1 -0
- package/dist/remote/PluginRuntime.d.ts +11 -0
- package/dist/remote/PluginRuntime.d.ts.map +1 -0
- package/dist/remote/PluginRuntime.js +202 -0
- package/dist/remote/PluginRuntime.js.map +1 -0
- package/dist/remote/index.d.ts +3 -0
- package/dist/remote/index.d.ts.map +1 -0
- package/dist/{validation → remote}/index.js +2 -4
- package/dist/remote/index.js.map +1 -0
- package/dist/remote/remotePluginLoader.d.ts +3 -0
- package/dist/remote/remotePluginLoader.d.ts.map +1 -0
- package/dist/remote/remotePluginLoader.js +53 -0
- package/dist/remote/remotePluginLoader.js.map +1 -0
- package/dist/runtime/DataQueriesProvider/DataQueriesProvider.d.ts +2 -2
- package/dist/runtime/DataQueriesProvider/DataQueriesProvider.d.ts.map +1 -1
- package/dist/runtime/DataQueriesProvider/DataQueriesProvider.js +19 -10
- package/dist/runtime/DataQueriesProvider/DataQueriesProvider.js.map +1 -1
- package/dist/runtime/DataQueriesProvider/model.d.ts +6 -7
- package/dist/runtime/DataQueriesProvider/model.d.ts.map +1 -1
- package/dist/runtime/DataQueriesProvider/model.js +10 -9
- package/dist/runtime/DataQueriesProvider/model.js.map +1 -1
- package/dist/runtime/QueryCountProvider.d.ts +9 -0
- package/dist/runtime/QueryCountProvider.d.ts.map +1 -0
- package/dist/{validation/datasource.js → runtime/QueryCountProvider.js} +14 -10
- package/dist/runtime/QueryCountProvider.js.map +1 -0
- package/dist/runtime/TimeRangeProvider/TimeRangeProvider.d.ts +6 -2
- package/dist/runtime/TimeRangeProvider/TimeRangeProvider.d.ts.map +1 -1
- package/dist/runtime/TimeRangeProvider/TimeRangeProvider.js +30 -9
- package/dist/runtime/TimeRangeProvider/TimeRangeProvider.js.map +1 -1
- package/dist/runtime/TimeRangeProvider/TimeRangeProviderWithQueryParams.d.ts +2 -2
- package/dist/runtime/TimeRangeProvider/TimeRangeProviderWithQueryParams.d.ts.map +1 -1
- package/dist/runtime/TimeRangeProvider/TimeRangeProviderWithQueryParams.js +3 -3
- package/dist/runtime/TimeRangeProvider/TimeRangeProviderWithQueryParams.js.map +1 -1
- package/dist/runtime/TimeRangeProvider/TimeRangeSettingsProvider.d.ts +32 -0
- package/dist/runtime/TimeRangeProvider/TimeRangeSettingsProvider.d.ts.map +1 -0
- package/dist/runtime/TimeRangeProvider/TimeRangeSettingsProvider.js +82 -0
- package/dist/runtime/TimeRangeProvider/TimeRangeSettingsProvider.js.map +1 -0
- package/dist/runtime/TimeRangeProvider/index.d.ts +1 -0
- package/dist/runtime/TimeRangeProvider/index.d.ts.map +1 -1
- package/dist/runtime/TimeRangeProvider/index.js +2 -1
- package/dist/runtime/TimeRangeProvider/index.js.map +1 -1
- package/dist/runtime/TimeRangeProvider/query-params.d.ts +1 -1
- package/dist/runtime/TimeRangeProvider/query-params.d.ts.map +1 -1
- package/dist/runtime/TimeRangeProvider/query-params.js +8 -11
- package/dist/runtime/TimeRangeProvider/query-params.js.map +1 -1
- package/dist/runtime/TimeRangeProvider/refresh-interval.d.ts.map +1 -1
- package/dist/runtime/TimeRangeProvider/refresh-interval.js.map +1 -1
- package/dist/runtime/UsageMetricsProvider.d.ts +25 -0
- package/dist/runtime/UsageMetricsProvider.d.ts.map +1 -0
- package/dist/runtime/UsageMetricsProvider.js +77 -0
- package/dist/runtime/UsageMetricsProvider.js.map +1 -0
- package/dist/runtime/builtin-variables.d.ts +2 -2
- package/dist/runtime/builtin-variables.d.ts.map +1 -1
- package/dist/runtime/builtin-variables.js +4 -4
- package/dist/runtime/builtin-variables.js.map +1 -1
- package/dist/runtime/datasources.d.ts +5 -4
- package/dist/runtime/datasources.d.ts.map +1 -1
- package/dist/runtime/datasources.js +24 -15
- package/dist/runtime/datasources.js.map +1 -1
- package/dist/runtime/index.d.ts +3 -1
- package/dist/runtime/index.d.ts.map +1 -1
- package/dist/runtime/index.js +4 -2
- package/dist/runtime/index.js.map +1 -1
- package/dist/runtime/plugin-registry.d.ts +11 -11
- package/dist/runtime/plugin-registry.d.ts.map +1 -1
- package/dist/runtime/plugin-registry.js +40 -28
- package/dist/runtime/plugin-registry.js.map +1 -1
- package/dist/runtime/time-series-queries.d.ts +5 -4
- package/dist/runtime/time-series-queries.d.ts.map +1 -1
- package/dist/runtime/time-series-queries.js +28 -33
- package/dist/runtime/time-series-queries.js.map +1 -1
- package/dist/runtime/trace-queries.d.ts +5 -4
- package/dist/runtime/trace-queries.d.ts.map +1 -1
- package/dist/runtime/trace-queries.js +10 -7
- package/dist/runtime/trace-queries.js.map +1 -1
- package/dist/runtime/{template-variables.d.ts → variables.d.ts} +7 -7
- package/dist/runtime/variables.d.ts.map +1 -0
- package/dist/runtime/{template-variables.js → variables.js} +35 -44
- package/dist/runtime/variables.js.map +1 -0
- package/dist/stories/shared-utils/decorators/WithDataQueries.d.ts +3 -3
- package/dist/stories/shared-utils/decorators/WithDataQueries.d.ts.map +1 -1
- package/dist/stories/shared-utils/decorators/WithDataQueries.js +1 -1
- package/dist/stories/shared-utils/decorators/WithDataQueries.js.map +1 -1
- package/dist/stories/shared-utils/decorators/WithPluginRegistry.d.ts +2 -2
- package/dist/stories/shared-utils/decorators/WithPluginRegistry.d.ts.map +1 -1
- package/dist/stories/shared-utils/decorators/WithPluginRegistry.js +2 -22
- package/dist/stories/shared-utils/decorators/WithPluginRegistry.js.map +1 -1
- package/dist/stories/shared-utils/decorators/WithPluginSystemBuiltinVariables.d.ts +3 -3
- package/dist/stories/shared-utils/decorators/WithPluginSystemBuiltinVariables.d.ts.map +1 -1
- package/dist/stories/shared-utils/decorators/WithPluginSystemBuiltinVariables.js +1 -1
- package/dist/stories/shared-utils/decorators/WithPluginSystemBuiltinVariables.js.map +1 -1
- package/dist/stories/shared-utils/decorators/WithPluginSystemDatasourceStore.d.ts +3 -3
- package/dist/stories/shared-utils/decorators/WithPluginSystemDatasourceStore.d.ts.map +1 -1
- package/dist/stories/shared-utils/decorators/WithPluginSystemDatasourceStore.js +5 -5
- package/dist/stories/shared-utils/decorators/WithPluginSystemDatasourceStore.js.map +1 -1
- package/dist/stories/shared-utils/decorators/WithPluginSystemVariables.d.ts +13 -0
- package/dist/stories/shared-utils/decorators/WithPluginSystemVariables.d.ts.map +1 -0
- package/dist/stories/shared-utils/decorators/{WithPluginSystemTemplateVariables.js → WithPluginSystemVariables.js} +10 -10
- package/dist/stories/shared-utils/decorators/WithPluginSystemVariables.js.map +1 -0
- package/dist/stories/shared-utils/decorators/WithTimeRange.d.ts +3 -3
- package/dist/stories/shared-utils/decorators/WithTimeRange.d.ts.map +1 -1
- package/dist/stories/shared-utils/decorators/WithTimeRange.js +1 -1
- package/dist/stories/shared-utils/decorators/WithTimeRange.js.map +1 -1
- package/dist/stories/shared-utils/decorators/index.d.ts +1 -1
- package/dist/stories/shared-utils/decorators/index.d.ts.map +1 -1
- package/dist/stories/shared-utils/decorators/index.js +2 -2
- package/dist/stories/shared-utils/decorators/index.js.map +1 -1
- package/dist/test/mock-data.d.ts.map +1 -1
- package/dist/test/mock-data.js +25 -4
- package/dist/test/mock-data.js.map +1 -1
- package/dist/test/render.d.ts +4 -4
- package/dist/test/render.d.ts.map +1 -1
- package/dist/test/render.js +2 -11
- package/dist/test/render.js.map +1 -1
- package/dist/test/setup-tests.js.map +1 -1
- package/dist/test/test-plugins/bert/index.d.ts.map +1 -1
- package/dist/test/test-plugins/bert/index.js +21 -20
- package/dist/test/test-plugins/bert/index.js.map +1 -1
- package/dist/test/test-plugins/ernie/index.js +2 -2
- package/dist/test/test-plugins/ernie/index.js.map +1 -1
- package/dist/test-utils/mock-plugin-registry.d.ts +6 -4
- package/dist/test-utils/mock-plugin-registry.d.ts.map +1 -1
- package/dist/test-utils/mock-plugin-registry.js +10 -10
- package/dist/test-utils/mock-plugin-registry.js.map +1 -1
- package/dist/utils/variables.d.ts +4 -4
- package/dist/utils/variables.d.ts.map +1 -1
- package/dist/utils/variables.js +19 -19
- package/dist/utils/variables.js.map +1 -1
- package/package.json +7 -6
- package/dist/cjs/components/TimeSeriesQueryEditor/TimeSeriesQueryEditor.js +0 -146
- package/dist/cjs/components/TraceQueryEditor/TraceQueryInput.js +0 -96
- package/dist/cjs/validation/datasource.js +0 -30
- package/dist/cjs/validation/role.js +0 -85
- package/dist/cjs/validation/rolebinding.js +0 -55
- package/dist/cjs/validation/secret.js +0 -176
- package/dist/cjs/validation/variable.js +0 -48
- package/dist/components/TimeSeriesQueryEditor/TimeSeriesQueryEditor.d.ts +0 -8
- package/dist/components/TimeSeriesQueryEditor/TimeSeriesQueryEditor.d.ts.map +0 -1
- package/dist/components/TimeSeriesQueryEditor/TimeSeriesQueryEditor.js.map +0 -1
- package/dist/components/TimeSeriesQueryEditor/TimeSeriesQueryInput.d.ts +0 -13
- package/dist/components/TimeSeriesQueryEditor/TimeSeriesQueryInput.d.ts.map +0 -1
- package/dist/components/TimeSeriesQueryEditor/TimeSeriesQueryInput.js.map +0 -1
- package/dist/components/TimeSeriesQueryEditor/index.d.ts +0 -2
- package/dist/components/TimeSeriesQueryEditor/index.d.ts.map +0 -1
- package/dist/components/TimeSeriesQueryEditor/index.js.map +0 -1
- package/dist/components/TraceQueryEditor/TraceQueryEditor.d.ts +0 -9
- package/dist/components/TraceQueryEditor/TraceQueryEditor.d.ts.map +0 -1
- package/dist/components/TraceQueryEditor/TraceQueryEditor.js +0 -130
- package/dist/components/TraceQueryEditor/TraceQueryEditor.js.map +0 -1
- package/dist/components/TraceQueryEditor/TraceQueryInput.d.ts +0 -13
- package/dist/components/TraceQueryEditor/TraceQueryInput.d.ts.map +0 -1
- package/dist/components/TraceQueryEditor/TraceQueryInput.js +0 -83
- package/dist/components/TraceQueryEditor/TraceQueryInput.js.map +0 -1
- package/dist/components/TraceQueryEditor/index.d.ts +0 -2
- package/dist/components/TraceQueryEditor/index.d.ts.map +0 -1
- package/dist/runtime/template-variables.d.ts.map +0 -1
- package/dist/runtime/template-variables.js.map +0 -1
- package/dist/stories/shared-utils/decorators/WithPluginSystemTemplateVariables.d.ts +0 -13
- package/dist/stories/shared-utils/decorators/WithPluginSystemTemplateVariables.d.ts.map +0 -1
- package/dist/stories/shared-utils/decorators/WithPluginSystemTemplateVariables.js.map +0 -1
- package/dist/validation/datasource.d.ts +0 -19
- package/dist/validation/datasource.d.ts.map +0 -1
- package/dist/validation/datasource.js.map +0 -1
- package/dist/validation/index.d.ts +0 -5
- package/dist/validation/index.d.ts.map +0 -1
- package/dist/validation/index.js.map +0 -1
- package/dist/validation/resource.d.ts +0 -3
- package/dist/validation/resource.d.ts.map +0 -1
- package/dist/validation/resource.js.map +0 -1
- package/dist/validation/role.d.ts +0 -228
- package/dist/validation/role.d.ts.map +0 -1
- package/dist/validation/role.js +0 -66
- package/dist/validation/role.js.map +0 -1
- package/dist/validation/rolebinding.d.ts +0 -137
- package/dist/validation/rolebinding.d.ts.map +0 -1
- package/dist/validation/rolebinding.js +0 -47
- package/dist/validation/rolebinding.js.map +0 -1
- package/dist/validation/secret.d.ts +0 -964
- package/dist/validation/secret.d.ts.map +0 -1
- package/dist/validation/secret.js +0 -157
- package/dist/validation/secret.js.map +0 -1
- package/dist/validation/variable.d.ts +0 -96
- package/dist/validation/variable.d.ts.map +0 -1
- package/dist/validation/variable.js +0 -40
- package/dist/validation/variable.js.map +0 -1
|
@@ -0,0 +1,267 @@
|
|
|
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
|
+
pluginRuntime: function() {
|
|
28
|
+
return pluginRuntime;
|
|
29
|
+
},
|
|
30
|
+
usePluginRuntime: function() {
|
|
31
|
+
return usePluginRuntime;
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
const _runtime = require("@module-federation/enhanced/runtime");
|
|
35
|
+
const _reactquery = /*#__PURE__*/ _interop_require_wildcard(require("@tanstack/react-query"));
|
|
36
|
+
const _react = /*#__PURE__*/ _interop_require_default(require("react"));
|
|
37
|
+
const _reactdom = /*#__PURE__*/ _interop_require_default(require("react-dom"));
|
|
38
|
+
const _reactrouterdom = /*#__PURE__*/ _interop_require_wildcard(require("react-router-dom"));
|
|
39
|
+
const _reacthookform = /*#__PURE__*/ _interop_require_wildcard(require("react-hook-form"));
|
|
40
|
+
function _interop_require_default(obj) {
|
|
41
|
+
return obj && obj.__esModule ? obj : {
|
|
42
|
+
default: obj
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
function _getRequireWildcardCache(nodeInterop) {
|
|
46
|
+
if (typeof WeakMap !== "function") return null;
|
|
47
|
+
var cacheBabelInterop = new WeakMap();
|
|
48
|
+
var cacheNodeInterop = new WeakMap();
|
|
49
|
+
return (_getRequireWildcardCache = function(nodeInterop) {
|
|
50
|
+
return nodeInterop ? cacheNodeInterop : cacheBabelInterop;
|
|
51
|
+
})(nodeInterop);
|
|
52
|
+
}
|
|
53
|
+
function _interop_require_wildcard(obj, nodeInterop) {
|
|
54
|
+
if (!nodeInterop && obj && obj.__esModule) {
|
|
55
|
+
return obj;
|
|
56
|
+
}
|
|
57
|
+
if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
|
|
58
|
+
return {
|
|
59
|
+
default: obj
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
var cache = _getRequireWildcardCache(nodeInterop);
|
|
63
|
+
if (cache && cache.has(obj)) {
|
|
64
|
+
return cache.get(obj);
|
|
65
|
+
}
|
|
66
|
+
var newObj = {
|
|
67
|
+
__proto__: null
|
|
68
|
+
};
|
|
69
|
+
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
70
|
+
for(var key in obj){
|
|
71
|
+
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
72
|
+
var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
|
|
73
|
+
if (desc && (desc.get || desc.set)) {
|
|
74
|
+
Object.defineProperty(newObj, key, desc);
|
|
75
|
+
} else {
|
|
76
|
+
newObj[key] = obj[key];
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
newObj.default = obj;
|
|
81
|
+
if (cache) {
|
|
82
|
+
cache.set(obj, newObj);
|
|
83
|
+
}
|
|
84
|
+
return newObj;
|
|
85
|
+
}
|
|
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: '4.36.1',
|
|
116
|
+
lib: ()=>_reactquery,
|
|
117
|
+
shareConfig: {
|
|
118
|
+
singleton: true,
|
|
119
|
+
requiredVersion: '^4.36.1'
|
|
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.50.0',
|
|
140
|
+
lib: ()=>require('@perses-dev/components'),
|
|
141
|
+
shareConfig: {
|
|
142
|
+
singleton: true,
|
|
143
|
+
requiredVersion: '^0.50.0'
|
|
144
|
+
}
|
|
145
|
+
},
|
|
146
|
+
'@perses-dev/plugin-system': {
|
|
147
|
+
version: '0.50.0',
|
|
148
|
+
lib: ()=>require('@perses-dev/plugin-system'),
|
|
149
|
+
shareConfig: {
|
|
150
|
+
singleton: true,
|
|
151
|
+
requiredVersion: '^0.50.0'
|
|
152
|
+
}
|
|
153
|
+
},
|
|
154
|
+
'@perses-dev/explore': {
|
|
155
|
+
version: '0.50.0',
|
|
156
|
+
lib: ()=>require('@perses-dev/explore'),
|
|
157
|
+
shareConfig: {
|
|
158
|
+
singleton: true,
|
|
159
|
+
requiredVersion: '^0.50.0'
|
|
160
|
+
}
|
|
161
|
+
},
|
|
162
|
+
'@perses-dev/dashboards': {
|
|
163
|
+
version: '0.50.0',
|
|
164
|
+
lib: ()=>require('@perses-dev/dashboards'),
|
|
165
|
+
shareConfig: {
|
|
166
|
+
singleton: true,
|
|
167
|
+
requiredVersion: '^0.50.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: '2.29.3',
|
|
173
|
+
lib: ()=>require('date-fns'),
|
|
174
|
+
shareConfig: {
|
|
175
|
+
singleton: true,
|
|
176
|
+
requiredVersion: '^2.29.3'
|
|
177
|
+
}
|
|
178
|
+
},
|
|
179
|
+
'date-fns-tz': {
|
|
180
|
+
version: '1.3.8',
|
|
181
|
+
lib: ()=>require('date-fns-tz'),
|
|
182
|
+
shareConfig: {
|
|
183
|
+
singleton: true,
|
|
184
|
+
requiredVersion: '^1.3.8'
|
|
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: '9.0.15',
|
|
237
|
+
lib: ()=>require('immer'),
|
|
238
|
+
shareConfig: {
|
|
239
|
+
singleton: true,
|
|
240
|
+
requiredVersion: '^9.0.15'
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
});
|
|
245
|
+
const registerRemote = (name, baseURL)=>{
|
|
246
|
+
const existingRemote = pluginRuntime.options.remotes.find((remote)=>remote.name === name);
|
|
247
|
+
if (!existingRemote) {
|
|
248
|
+
const remoteEntryURL = baseURL ? `${baseURL}/${name}/mf-manifest.json` : `/plugins/${name}/mf-manifest.json`;
|
|
249
|
+
pluginRuntime.registerRemotes([
|
|
250
|
+
{
|
|
251
|
+
name,
|
|
252
|
+
entry: remoteEntryURL,
|
|
253
|
+
alias: name
|
|
254
|
+
}
|
|
255
|
+
]);
|
|
256
|
+
}
|
|
257
|
+
};
|
|
258
|
+
const loadPlugin = async (moduleName, pluginName, baseURL)=>{
|
|
259
|
+
registerRemote(moduleName, baseURL);
|
|
260
|
+
return (0, _runtime.loadRemote)(`${moduleName}/${pluginName}`);
|
|
261
|
+
};
|
|
262
|
+
function usePluginRuntime({ plugin }) {
|
|
263
|
+
return {
|
|
264
|
+
pluginRuntime,
|
|
265
|
+
loadPlugin: ()=>loadPlugin(plugin.moduleName, plugin.name, plugin.baseURL)
|
|
266
|
+
};
|
|
267
|
+
}
|
|
@@ -14,10 +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("./secret"), exports);
|
|
20
|
-
_export_star(require("./variable"), exports);
|
|
17
|
+
_export_star(require("./PluginLoaderComponent"), exports);
|
|
18
|
+
_export_star(require("./remotePluginLoader"), exports);
|
|
21
19
|
function _export_star(from, to) {
|
|
22
20
|
Object.keys(from).forEach(function(k) {
|
|
23
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
|
+
};
|
|
@@ -24,20 +24,21 @@ _export(exports, {
|
|
|
24
24
|
DataQueriesContext: function() {
|
|
25
25
|
return DataQueriesContext;
|
|
26
26
|
},
|
|
27
|
-
|
|
28
|
-
return
|
|
27
|
+
DataQueriesProvider: function() {
|
|
28
|
+
return DataQueriesProvider;
|
|
29
29
|
},
|
|
30
30
|
useDataQueries: function() {
|
|
31
31
|
return useDataQueries;
|
|
32
32
|
},
|
|
33
|
-
|
|
34
|
-
return
|
|
33
|
+
useDataQueriesContext: function() {
|
|
34
|
+
return useDataQueriesContext;
|
|
35
35
|
}
|
|
36
36
|
});
|
|
37
37
|
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, _ctx_queryResults_index_definition;
|
|
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,
|
|
@@ -70,7 +65,7 @@ function useDataQueries(queryType) {
|
|
|
70
65
|
return filteredCtx;
|
|
71
66
|
}
|
|
72
67
|
function DataQueriesProvider(props) {
|
|
73
|
-
const { definitions
|
|
68
|
+
const { definitions, options, children, queryOptions } = props;
|
|
74
69
|
// Returns a query kind, for example "TimeSeriesQuery" = getQueryType("PrometheusTimeSeriesQuery")
|
|
75
70
|
const getQueryType = (0, _model.useQueryType)();
|
|
76
71
|
const queryDefinitions = definitions.map((definition)=>{
|
|
@@ -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,
|
|
@@ -31,7 +31,7 @@ _export(exports, {
|
|
|
31
31
|
const _react = require("react");
|
|
32
32
|
const _pluginregistry = require("../plugin-registry");
|
|
33
33
|
function transformQueryResults(results, definitions) {
|
|
34
|
-
return results.map(({ data
|
|
34
|
+
return results.map(({ data, isFetching, isLoading, refetch, error }, i)=>{
|
|
35
35
|
return {
|
|
36
36
|
definition: definitions[i],
|
|
37
37
|
data,
|
|
@@ -43,8 +43,12 @@ function transformQueryResults(results, definitions) {
|
|
|
43
43
|
});
|
|
44
44
|
}
|
|
45
45
|
function useQueryType() {
|
|
46
|
-
const { data: timeSeriesQueryPlugins
|
|
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;
|
|
@@ -82,8 +84,7 @@ function useQueryType() {
|
|
|
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
|
}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
// Copyright 2024 The Perses Authors
|
|
2
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
3
|
+
// you may not use this file except in compliance with the License.
|
|
4
|
+
// You may obtain a copy of the License at
|
|
5
|
+
//
|
|
6
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
|
7
|
+
//
|
|
8
|
+
// Unless required by applicable law or agreed to in writing, software
|
|
9
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
10
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11
|
+
// See the License for the specific language governing permissions and
|
|
12
|
+
// limitations under the License.
|
|
13
|
+
"use strict";
|
|
14
|
+
Object.defineProperty(exports, "__esModule", {
|
|
15
|
+
value: true
|
|
16
|
+
});
|
|
17
|
+
function _export(target, all) {
|
|
18
|
+
for(var name in all)Object.defineProperty(target, name, {
|
|
19
|
+
enumerable: true,
|
|
20
|
+
get: all[name]
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
_export(exports, {
|
|
24
|
+
QueryCountProvider: function() {
|
|
25
|
+
return QueryCountProvider;
|
|
26
|
+
},
|
|
27
|
+
useQueryCountContext: function() {
|
|
28
|
+
return useQueryCountContext;
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
const _jsxruntime = require("react/jsx-runtime");
|
|
32
|
+
const _react = /*#__PURE__*/ _interop_require_wildcard(require("react"));
|
|
33
|
+
function _getRequireWildcardCache(nodeInterop) {
|
|
34
|
+
if (typeof WeakMap !== "function") return null;
|
|
35
|
+
var cacheBabelInterop = new WeakMap();
|
|
36
|
+
var cacheNodeInterop = new WeakMap();
|
|
37
|
+
return (_getRequireWildcardCache = function(nodeInterop) {
|
|
38
|
+
return nodeInterop ? cacheNodeInterop : cacheBabelInterop;
|
|
39
|
+
})(nodeInterop);
|
|
40
|
+
}
|
|
41
|
+
function _interop_require_wildcard(obj, nodeInterop) {
|
|
42
|
+
if (!nodeInterop && obj && obj.__esModule) {
|
|
43
|
+
return obj;
|
|
44
|
+
}
|
|
45
|
+
if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
|
|
46
|
+
return {
|
|
47
|
+
default: obj
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
var cache = _getRequireWildcardCache(nodeInterop);
|
|
51
|
+
if (cache && cache.has(obj)) {
|
|
52
|
+
return cache.get(obj);
|
|
53
|
+
}
|
|
54
|
+
var newObj = {
|
|
55
|
+
__proto__: null
|
|
56
|
+
};
|
|
57
|
+
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
58
|
+
for(var key in obj){
|
|
59
|
+
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
60
|
+
var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
|
|
61
|
+
if (desc && (desc.get || desc.set)) {
|
|
62
|
+
Object.defineProperty(newObj, key, desc);
|
|
63
|
+
} else {
|
|
64
|
+
newObj[key] = obj[key];
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
newObj.default = obj;
|
|
69
|
+
if (cache) {
|
|
70
|
+
cache.set(obj, newObj);
|
|
71
|
+
}
|
|
72
|
+
return newObj;
|
|
73
|
+
}
|
|
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
|
|
79
|
+
});
|
|
80
|
+
};
|
|
81
|
+
const useQueryCountContext = ()=>{
|
|
82
|
+
return (0, _react.useContext)(QueryCountContext);
|
|
83
|
+
};
|
|
@@ -24,14 +24,17 @@ _export(exports, {
|
|
|
24
24
|
TimeRangeContext: function() {
|
|
25
25
|
return TimeRangeContext;
|
|
26
26
|
},
|
|
27
|
-
|
|
28
|
-
return
|
|
27
|
+
TimeRangeProvider: function() {
|
|
28
|
+
return TimeRangeProvider;
|
|
29
|
+
},
|
|
30
|
+
useSuggestedStepMs: function() {
|
|
31
|
+
return useSuggestedStepMs;
|
|
29
32
|
},
|
|
30
33
|
useTimeRange: function() {
|
|
31
34
|
return useTimeRange;
|
|
32
35
|
},
|
|
33
|
-
|
|
34
|
-
return
|
|
36
|
+
useTimeRangeContext: function() {
|
|
37
|
+
return useTimeRangeContext;
|
|
35
38
|
}
|
|
36
39
|
});
|
|
37
40
|
const _jsxruntime = require("react/jsx-runtime");
|
|
@@ -59,7 +62,9 @@ function _interop_require_wildcard(obj, nodeInterop) {
|
|
|
59
62
|
if (cache && cache.has(obj)) {
|
|
60
63
|
return cache.get(obj);
|
|
61
64
|
}
|
|
62
|
-
var newObj = {
|
|
65
|
+
var newObj = {
|
|
66
|
+
__proto__: null
|
|
67
|
+
};
|
|
63
68
|
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
64
69
|
for(var key in obj){
|
|
65
70
|
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
@@ -88,18 +93,24 @@ function useTimeRangeContext() {
|
|
|
88
93
|
function useTimeRange() {
|
|
89
94
|
return useTimeRangeContext();
|
|
90
95
|
}
|
|
96
|
+
function useSuggestedStepMs(width) {
|
|
97
|
+
const { absoluteTimeRange } = useTimeRange();
|
|
98
|
+
if (width === undefined) return 0;
|
|
99
|
+
return (0, _core.getSuggestedStepMs)(absoluteTimeRange, width);
|
|
100
|
+
}
|
|
91
101
|
function TimeRangeProvider(props) {
|
|
92
|
-
const { timeRange
|
|
102
|
+
const { timeRange, refreshInterval, children, setTimeRange, setRefreshInterval } = props;
|
|
93
103
|
const [localTimeRange, setLocalTimeRange] = (0, _react.useState)(timeRange);
|
|
94
|
-
const [localRefreshInterval,
|
|
104
|
+
const [localRefreshInterval, setLocalRefreshInterval] = (0, _react.useState)(refreshInterval);
|
|
95
105
|
const [refreshCounter, setRefreshCounter] = (0, _react.useState)(0);
|
|
96
106
|
(0, _react.useEffect)(()=>{
|
|
97
107
|
setLocalTimeRange(timeRange);
|
|
98
108
|
}, [
|
|
99
|
-
timeRange
|
|
109
|
+
timeRange,
|
|
110
|
+
refreshCounter
|
|
100
111
|
]);
|
|
101
112
|
(0, _react.useEffect)(()=>{
|
|
102
|
-
|
|
113
|
+
setLocalRefreshInterval(refreshInterval);
|
|
103
114
|
}, [
|
|
104
115
|
refreshInterval
|
|
105
116
|
]);
|
|
@@ -108,24 +119,37 @@ function TimeRangeProvider(props) {
|
|
|
108
119
|
}, [
|
|
109
120
|
setRefreshCounter
|
|
110
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
|
+
]);
|
|
111
134
|
const ctx = (0, _react.useMemo)(()=>{
|
|
112
135
|
const absoluteTimeRange = (0, _core.isRelativeTimeRange)(localTimeRange) ? (0, _core.toAbsoluteTimeRange)(localTimeRange) : localTimeRange;
|
|
113
136
|
return {
|
|
114
137
|
timeRange: localTimeRange,
|
|
115
|
-
setTimeRange: setTimeRange
|
|
138
|
+
setTimeRange: setTimeRange ?? setLocalTimeRange,
|
|
116
139
|
absoluteTimeRange,
|
|
117
140
|
refresh,
|
|
118
141
|
refreshKey: `${absoluteTimeRange.start}:${absoluteTimeRange.end}:${localRefreshInterval}:${refreshCounter}`,
|
|
119
142
|
refreshInterval: localRefreshInterval,
|
|
120
|
-
refreshIntervalInMs:
|
|
121
|
-
setRefreshInterval: setRefreshInterval
|
|
143
|
+
refreshIntervalInMs: refreshIntervalInMs,
|
|
144
|
+
setRefreshInterval: setRefreshInterval ?? setLocalRefreshInterval
|
|
122
145
|
};
|
|
123
146
|
}, [
|
|
124
147
|
localTimeRange,
|
|
125
148
|
setTimeRange,
|
|
126
149
|
refresh,
|
|
127
|
-
refreshCounter,
|
|
128
150
|
localRefreshInterval,
|
|
151
|
+
refreshCounter,
|
|
152
|
+
refreshIntervalInMs,
|
|
129
153
|
setRefreshInterval
|
|
130
154
|
]);
|
|
131
155
|
return /*#__PURE__*/ (0, _jsxruntime.jsx)(TimeRangeContext.Provider, {
|
|
@@ -30,9 +30,9 @@ function _interop_require_default(obj) {
|
|
|
30
30
|
};
|
|
31
31
|
}
|
|
32
32
|
function TimeRangeProviderWithQueryParams(props) {
|
|
33
|
-
const { initialTimeRange
|
|
34
|
-
const { timeRange
|
|
35
|
-
const { refreshInterval
|
|
33
|
+
const { initialTimeRange, initialRefreshInterval, children } = props;
|
|
34
|
+
const { timeRange, setTimeRange } = (0, _queryparams.useTimeRangeParams)(initialTimeRange);
|
|
35
|
+
const { refreshInterval, setRefreshInterval } = (0, _queryparams.useSetRefreshIntervalParams)(initialRefreshInterval);
|
|
36
36
|
return /*#__PURE__*/ (0, _jsxruntime.jsx)(_TimeRangeProvider.TimeRangeProvider, {
|
|
37
37
|
timeRange: timeRange,
|
|
38
38
|
refreshInterval: refreshInterval,
|