@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
|
@@ -21,11 +21,11 @@ function _export(target, all) {
|
|
|
21
21
|
});
|
|
22
22
|
}
|
|
23
23
|
_export(exports, {
|
|
24
|
-
VariablePreview: function() {
|
|
25
|
-
return VariablePreview;
|
|
26
|
-
},
|
|
27
24
|
VariableListPreview: function() {
|
|
28
25
|
return VariableListPreview;
|
|
26
|
+
},
|
|
27
|
+
VariablePreview: function() {
|
|
28
|
+
return VariablePreview;
|
|
29
29
|
}
|
|
30
30
|
});
|
|
31
31
|
const _jsxruntime = require("react/jsx-runtime");
|
|
@@ -62,7 +62,9 @@ function _interop_require_wildcard(obj, nodeInterop) {
|
|
|
62
62
|
if (cache && cache.has(obj)) {
|
|
63
63
|
return cache.get(obj);
|
|
64
64
|
}
|
|
65
|
-
var newObj = {
|
|
65
|
+
var newObj = {
|
|
66
|
+
__proto__: null
|
|
67
|
+
};
|
|
66
68
|
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
67
69
|
for(var key in obj){
|
|
68
70
|
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
@@ -82,14 +84,14 @@ function _interop_require_wildcard(obj, nodeInterop) {
|
|
|
82
84
|
}
|
|
83
85
|
const DEFAULT_MAX_PREVIEW_VALUES = 50;
|
|
84
86
|
function VariablePreview(props) {
|
|
85
|
-
const { values
|
|
87
|
+
const { values, onRefresh, isLoading, error } = props;
|
|
86
88
|
const [maxValues, setMaxValues] = (0, _react.useState)(DEFAULT_MAX_PREVIEW_VALUES);
|
|
87
|
-
const { infoSnackbar
|
|
89
|
+
const { infoSnackbar } = (0, _components.useSnackbar)();
|
|
88
90
|
const showAll = ()=>{
|
|
89
91
|
setMaxValues(undefined);
|
|
90
92
|
};
|
|
91
93
|
let notShown = 0;
|
|
92
|
-
if (values &&
|
|
94
|
+
if (values && values?.length > 0 && maxValues) {
|
|
93
95
|
notShown = values.length - maxValues;
|
|
94
96
|
}
|
|
95
97
|
return /*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Box, {
|
|
@@ -116,7 +118,7 @@ function VariablePreview(props) {
|
|
|
116
118
|
description: _constants.TOOLTIP_TEXT.copyVariableValues,
|
|
117
119
|
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.IconButton, {
|
|
118
120
|
onClick: async ()=>{
|
|
119
|
-
if (values
|
|
121
|
+
if (values?.length) {
|
|
120
122
|
await navigator.clipboard.writeText(values.map((value)=>value).join(', '));
|
|
121
123
|
infoSnackbar('Preview values copied to clipboard!');
|
|
122
124
|
}
|
|
@@ -141,7 +143,7 @@ function VariablePreview(props) {
|
|
|
141
143
|
severity: "error",
|
|
142
144
|
children: error
|
|
143
145
|
}),
|
|
144
|
-
|
|
146
|
+
values?.length === 0 && /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Alert, {
|
|
145
147
|
severity: "info",
|
|
146
148
|
children: "No results"
|
|
147
149
|
}),
|
|
@@ -153,10 +155,10 @@ function VariablePreview(props) {
|
|
|
153
155
|
},
|
|
154
156
|
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.CircularProgress, {})
|
|
155
157
|
}),
|
|
156
|
-
values
|
|
158
|
+
values?.slice(0, maxValues).map((val, index)=>/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Chip, {
|
|
157
159
|
size: "small",
|
|
158
160
|
label: val
|
|
159
|
-
},
|
|
161
|
+
}, index)),
|
|
160
162
|
notShown > 0 && /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Chip, {
|
|
161
163
|
onClick: showAll,
|
|
162
164
|
variant: "outlined",
|
|
@@ -170,11 +172,11 @@ function VariablePreview(props) {
|
|
|
170
172
|
});
|
|
171
173
|
}
|
|
172
174
|
function VariableListPreview(props) {
|
|
173
|
-
const { definition
|
|
174
|
-
const { data
|
|
175
|
-
const errorMessage = error
|
|
175
|
+
const { definition, onRefresh } = props;
|
|
176
|
+
const { data, isFetching, error } = (0, _variablemodel.useListVariablePluginValues)(definition);
|
|
177
|
+
const errorMessage = error?.message;
|
|
176
178
|
return /*#__PURE__*/ (0, _jsxruntime.jsx)(VariablePreview, {
|
|
177
|
-
values:
|
|
179
|
+
values: data?.map((val)=>val.value) || [],
|
|
178
180
|
onRefresh: onRefresh,
|
|
179
181
|
isLoading: isFetching,
|
|
180
182
|
error: errorMessage
|
|
@@ -29,11 +29,9 @@ _export(exports, {
|
|
|
29
29
|
}
|
|
30
30
|
});
|
|
31
31
|
function getInitialState(initialVariableDefinition) {
|
|
32
|
-
var _initialVariableDefinition_spec_display, _initialVariableDefinition_spec_display1;
|
|
33
|
-
var _initialVariableDefinition_spec_value, _initialVariableDefinition_spec_constant;
|
|
34
32
|
const textVariableFields = {
|
|
35
|
-
value:
|
|
36
|
-
constant:
|
|
33
|
+
value: initialVariableDefinition.spec.value ?? '',
|
|
34
|
+
constant: initialVariableDefinition.spec.constant ?? false
|
|
37
35
|
};
|
|
38
36
|
const listVariableFields = {
|
|
39
37
|
allowMultiple: false,
|
|
@@ -47,27 +45,24 @@ function getInitialState(initialVariableDefinition) {
|
|
|
47
45
|
}
|
|
48
46
|
};
|
|
49
47
|
if (initialVariableDefinition.kind === 'ListVariable') {
|
|
50
|
-
|
|
51
|
-
listVariableFields.
|
|
52
|
-
var _initialVariableDefinition_spec_allowAllValue;
|
|
53
|
-
listVariableFields.allowAllValue = (_initialVariableDefinition_spec_allowAllValue = initialVariableDefinition.spec.allowAllValue) !== null && _initialVariableDefinition_spec_allowAllValue !== void 0 ? _initialVariableDefinition_spec_allowAllValue : false;
|
|
48
|
+
listVariableFields.allowMultiple = initialVariableDefinition.spec.allowMultiple ?? false;
|
|
49
|
+
listVariableFields.allowAllValue = initialVariableDefinition.spec.allowAllValue ?? false;
|
|
54
50
|
listVariableFields.customAllValue = initialVariableDefinition.spec.customAllValue;
|
|
55
51
|
listVariableFields.capturingRegexp = initialVariableDefinition.spec.capturingRegexp;
|
|
56
52
|
listVariableFields.sort = initialVariableDefinition.spec.sort;
|
|
57
53
|
listVariableFields.plugin = initialVariableDefinition.spec.plugin;
|
|
58
54
|
}
|
|
59
|
-
var _initialVariableDefinition_spec_display_name, _initialVariableDefinition_spec_display_description;
|
|
60
55
|
return {
|
|
61
56
|
name: initialVariableDefinition.spec.name,
|
|
62
|
-
title:
|
|
57
|
+
title: initialVariableDefinition.spec.display?.name ?? '',
|
|
63
58
|
kind: initialVariableDefinition.kind,
|
|
64
|
-
description:
|
|
59
|
+
description: initialVariableDefinition.spec.display?.description ?? '',
|
|
65
60
|
listVariableFields,
|
|
66
61
|
textVariableFields
|
|
67
62
|
};
|
|
68
63
|
}
|
|
69
64
|
function getVariableDefinitionFromState(state) {
|
|
70
|
-
const { name
|
|
65
|
+
const { name, title, kind, description } = state;
|
|
71
66
|
const display = {
|
|
72
67
|
name: title,
|
|
73
68
|
description: description
|
|
@@ -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
|
|
@@ -15,23 +15,23 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
15
15
|
value: true
|
|
16
16
|
});
|
|
17
17
|
function _export(target, all) {
|
|
18
|
-
for(var
|
|
18
|
+
for(var name in all)Object.defineProperty(target, name, {
|
|
19
19
|
enumerable: true,
|
|
20
|
-
get: all[
|
|
20
|
+
get: all[name]
|
|
21
21
|
});
|
|
22
22
|
}
|
|
23
23
|
_export(exports, {
|
|
24
|
+
VARIABLE_TYPES: function() {
|
|
25
|
+
return VARIABLE_TYPES;
|
|
26
|
+
},
|
|
24
27
|
filterVariableList: function() {
|
|
25
28
|
return filterVariableList;
|
|
26
29
|
},
|
|
27
|
-
useListVariablePluginValues: function() {
|
|
28
|
-
return useListVariablePluginValues;
|
|
29
|
-
},
|
|
30
30
|
getVariableValuesKey: function() {
|
|
31
31
|
return getVariableValuesKey;
|
|
32
32
|
},
|
|
33
|
-
|
|
34
|
-
return
|
|
33
|
+
useListVariablePluginValues: function() {
|
|
34
|
+
return useListVariablePluginValues;
|
|
35
35
|
}
|
|
36
36
|
});
|
|
37
37
|
const _reactquery = require("@tanstack/react-query");
|
|
@@ -62,10 +62,10 @@ function filterVariableList(data, capturedRegexp) {
|
|
|
62
62
|
return result;
|
|
63
63
|
}
|
|
64
64
|
function useListVariablePluginValues(definition) {
|
|
65
|
-
const { data: variablePlugin
|
|
65
|
+
const { data: variablePlugin } = (0, _runtime.usePlugin)('Variable', definition.spec.plugin.kind);
|
|
66
66
|
const datasourceStore = (0, _runtime.useDatasourceStore)();
|
|
67
|
-
const allVariables = (0, _runtime.
|
|
68
|
-
const { absoluteTimeRange: timeRange
|
|
67
|
+
const allVariables = (0, _runtime.useAllVariableValues)();
|
|
68
|
+
const { absoluteTimeRange: timeRange, refreshKey } = (0, _runtime.useTimeRange)();
|
|
69
69
|
const variablePluginCtx = {
|
|
70
70
|
timeRange,
|
|
71
71
|
datasourceStore,
|
|
@@ -74,39 +74,37 @@ function useListVariablePluginValues(definition) {
|
|
|
74
74
|
const spec = definition.spec.plugin.spec;
|
|
75
75
|
const capturingRegexp = definition.spec.capturingRegexp !== undefined ? new RegExp(definition.spec.capturingRegexp, 'g') : undefined;
|
|
76
76
|
let dependsOnVariables;
|
|
77
|
-
if (variablePlugin
|
|
77
|
+
if (variablePlugin?.dependsOn) {
|
|
78
78
|
const dependencies = variablePlugin.dependsOn(spec, variablePluginCtx);
|
|
79
79
|
dependsOnVariables = dependencies.variables;
|
|
80
80
|
}
|
|
81
|
-
const variables = (0, _runtime.
|
|
81
|
+
const variables = (0, _runtime.useAllVariableValues)(dependsOnVariables);
|
|
82
82
|
let waitToLoad = false;
|
|
83
83
|
if (dependsOnVariables) {
|
|
84
|
-
waitToLoad = dependsOnVariables.some((v)=>
|
|
85
|
-
var _variables_v;
|
|
86
|
-
return (_variables_v = variables[v]) === null || _variables_v === void 0 ? void 0 : _variables_v.loading;
|
|
87
|
-
});
|
|
84
|
+
waitToLoad = dependsOnVariables.some((v)=>variables[v]?.loading);
|
|
88
85
|
}
|
|
89
86
|
const variablesValueKey = getVariableValuesKey(variables);
|
|
90
|
-
return (0, _reactquery.useQuery)(
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
87
|
+
return (0, _reactquery.useQuery)({
|
|
88
|
+
queryKey: [
|
|
89
|
+
definition,
|
|
90
|
+
variablesValueKey,
|
|
91
|
+
timeRange,
|
|
92
|
+
refreshKey
|
|
93
|
+
],
|
|
94
|
+
queryFn: async ()=>{
|
|
95
|
+
const resp = await variablePlugin?.getVariableOptions(spec, {
|
|
96
|
+
datasourceStore,
|
|
97
|
+
variables,
|
|
98
|
+
timeRange
|
|
99
|
+
});
|
|
100
|
+
if (resp === undefined) {
|
|
101
|
+
return [];
|
|
102
|
+
}
|
|
103
|
+
if (!capturingRegexp) {
|
|
104
|
+
return resp.data;
|
|
105
|
+
}
|
|
106
|
+
return filterVariableList(resp.data, capturingRegexp);
|
|
107
|
+
},
|
|
110
108
|
enabled: !!variablePlugin || waitToLoad
|
|
111
109
|
});
|
|
112
110
|
}
|
|
@@ -17,7 +17,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
17
17
|
_export_star(require("./CalculationSelector"), exports);
|
|
18
18
|
_export_star(require("./DatasourceEditorForm"), exports);
|
|
19
19
|
_export_star(require("./DatasourceSelect"), exports);
|
|
20
|
+
_export_star(require("./HTTPSettingsEditor"), exports);
|
|
20
21
|
_export_star(require("./LegendOptionsEditor"), exports);
|
|
22
|
+
_export_star(require("./MultiQueryEditor"), exports);
|
|
21
23
|
_export_star(require("./OptionsEditorRadios"), exports);
|
|
22
24
|
_export_star(require("./OptionsEditorTabs"), exports);
|
|
23
25
|
_export_star(require("./PanelSpecEditor"), exports);
|
|
@@ -25,9 +27,10 @@ _export_star(require("./PluginEditor"), exports);
|
|
|
25
27
|
_export_star(require("./PluginKindSelect"), exports);
|
|
26
28
|
_export_star(require("./PluginRegistry"), exports);
|
|
27
29
|
_export_star(require("./PluginSpecEditor"), exports);
|
|
28
|
-
_export_star(require("./
|
|
30
|
+
_export_star(require("./TimeRangeControls"), exports);
|
|
29
31
|
_export_star(require("./Variables"), exports);
|
|
30
32
|
_export_star(require("./ProjectSelect"), exports);
|
|
33
|
+
_export_star(require("./MetricLabelInput"), exports);
|
|
31
34
|
function _export_star(from, to) {
|
|
32
35
|
Object.keys(from).forEach(function(k) {
|
|
33
36
|
if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) {
|
|
@@ -23,5 +23,8 @@ Object.defineProperty(exports, "TOOLTIP_TEXT", {
|
|
|
23
23
|
const TOOLTIP_TEXT = {
|
|
24
24
|
// Variable editor buttons
|
|
25
25
|
refreshVariableValues: 'Refresh values',
|
|
26
|
-
copyVariableValues: 'Copy values to clipboard'
|
|
26
|
+
copyVariableValues: 'Copy values to clipboard',
|
|
27
|
+
// Time range controls buttons
|
|
28
|
+
refresh: 'Refresh',
|
|
29
|
+
refreshInterval: 'Auto refresh interval'
|
|
27
30
|
};
|
|
@@ -24,14 +24,14 @@ _export(exports, {
|
|
|
24
24
|
ProjectStoreContext: function() {
|
|
25
25
|
return ProjectStoreContext;
|
|
26
26
|
},
|
|
27
|
+
ProjectStoreProvider: function() {
|
|
28
|
+
return ProjectStoreProvider;
|
|
29
|
+
},
|
|
27
30
|
useProjectList: function() {
|
|
28
31
|
return useProjectList;
|
|
29
32
|
},
|
|
30
33
|
useProjectStore: function() {
|
|
31
34
|
return useProjectStore;
|
|
32
|
-
},
|
|
33
|
-
ProjectStoreProvider: function() {
|
|
34
|
-
return ProjectStoreProvider;
|
|
35
35
|
}
|
|
36
36
|
});
|
|
37
37
|
const _jsxruntime = require("react/jsx-runtime");
|
|
@@ -41,10 +41,13 @@ const _core = require("@perses-dev/core");
|
|
|
41
41
|
const _queryparams = require("./query-params");
|
|
42
42
|
const ProjectStoreContext = /*#__PURE__*/ (0, _react.createContext)(undefined);
|
|
43
43
|
function useProjectList() {
|
|
44
|
-
return (0, _reactquery.useQuery)(
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
44
|
+
return (0, _reactquery.useQuery)({
|
|
45
|
+
queryKey: [
|
|
46
|
+
'projects'
|
|
47
|
+
],
|
|
48
|
+
queryFn: ()=>{
|
|
49
|
+
return (0, _core.fetchJson)('/api/v1/projects');
|
|
50
|
+
}
|
|
48
51
|
});
|
|
49
52
|
}
|
|
50
53
|
function useProjectStore() {
|
|
@@ -55,8 +58,8 @@ function useProjectStore() {
|
|
|
55
58
|
return ctx;
|
|
56
59
|
}
|
|
57
60
|
function ProjectStoreProvider(props) {
|
|
58
|
-
const { children
|
|
59
|
-
const { project
|
|
61
|
+
const { children, enabledURLParams } = props;
|
|
62
|
+
const { project, setProject } = (0, _queryparams.useSetProjectParams)(enabledURLParams);
|
|
60
63
|
const contextValue = (0, _react.useMemo)(()=>({
|
|
61
64
|
project: {
|
|
62
65
|
kind: 'Project',
|
|
@@ -0,0 +1,69 @@
|
|
|
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
|
+
ValidationProvider: function() {
|
|
25
|
+
return ValidationProvider;
|
|
26
|
+
},
|
|
27
|
+
ValidationSchemasContext: function() {
|
|
28
|
+
return ValidationSchemasContext;
|
|
29
|
+
},
|
|
30
|
+
useValidationSchemas: function() {
|
|
31
|
+
return useValidationSchemas;
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
const _jsxruntime = require("react/jsx-runtime");
|
|
35
|
+
const _react = require("react");
|
|
36
|
+
const _core = require("@perses-dev/core");
|
|
37
|
+
const ValidationSchemasContext = /*#__PURE__*/ (0, _react.createContext)(undefined);
|
|
38
|
+
function useValidationSchemas() {
|
|
39
|
+
const ctx = (0, _react.useContext)(ValidationSchemasContext);
|
|
40
|
+
if (ctx === undefined) {
|
|
41
|
+
throw new Error('No ValidationSchemasContext found. Did you forget a Provider?');
|
|
42
|
+
}
|
|
43
|
+
return ctx;
|
|
44
|
+
}
|
|
45
|
+
function ValidationProvider({ children }) {
|
|
46
|
+
const [datasourceEditorSchema, setDatasourceEditorSchema] = (0, _react.useState)(_core.datasourceDefinitionSchema);
|
|
47
|
+
const [panelEditorSchema, setPanelEditorSchema] = (0, _react.useState)(_core.panelEditorSchema);
|
|
48
|
+
const [variableEditorSchema, setVariableEditorSchema] = (0, _react.useState)(_core.variableDefinitionSchema);
|
|
49
|
+
function setDatasourceEditorSchemaPlugin(pluginSchema) {
|
|
50
|
+
setDatasourceEditorSchema((0, _core.buildDatasourceDefinitionSchema)(pluginSchema));
|
|
51
|
+
}
|
|
52
|
+
function setPanelEditorSchemaPlugin(pluginSchema) {
|
|
53
|
+
setPanelEditorSchema((0, _core.buildPanelEditorSchema)(pluginSchema));
|
|
54
|
+
}
|
|
55
|
+
function setVariableEditorSchemaPlugin(pluginSchema) {
|
|
56
|
+
setVariableEditorSchema((0, _core.buildVariableDefinitionSchema)(pluginSchema));
|
|
57
|
+
}
|
|
58
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsx)(ValidationSchemasContext.Provider, {
|
|
59
|
+
value: {
|
|
60
|
+
datasourceEditorSchema,
|
|
61
|
+
panelEditorSchema,
|
|
62
|
+
variableEditorSchema,
|
|
63
|
+
setDatasourceEditorSchemaPlugin,
|
|
64
|
+
setPanelEditorSchemaPlugin,
|
|
65
|
+
setVariableEditorSchemaPlugin
|
|
66
|
+
},
|
|
67
|
+
children: children
|
|
68
|
+
});
|
|
69
|
+
}
|
|
@@ -15,6 +15,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
15
15
|
value: true
|
|
16
16
|
});
|
|
17
17
|
_export_star(require("./ProjectStoreProvider"), exports);
|
|
18
|
+
_export_star(require("./ValidationProvider"), exports);
|
|
18
19
|
function _export_star(from, to) {
|
|
19
20
|
Object.keys(from).forEach(function(k) {
|
|
20
21
|
if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) {
|
package/dist/cjs/index.js
CHANGED
|
@@ -20,8 +20,8 @@ _export_star(require("./model"), exports);
|
|
|
20
20
|
_export_star(require("./runtime"), exports);
|
|
21
21
|
_export_star(require("./test-utils"), exports);
|
|
22
22
|
_export_star(require("./utils"), exports);
|
|
23
|
-
_export_star(require("./validation"), exports);
|
|
24
23
|
_export_star(require("./context"), exports);
|
|
24
|
+
_export_star(require("./remote"), exports);
|
|
25
25
|
function _export_star(from, to) {
|
|
26
26
|
Object.keys(from).forEach(function(k) {
|
|
27
27
|
if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) {
|
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11
11
|
// See the License for the specific language governing permissions and
|
|
12
12
|
// limitations under the License.
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
"use strict";
|
|
14
|
+
Object.defineProperty(exports, "__esModule", {
|
|
15
|
+
value: true
|
|
16
|
+
});
|
package/dist/cjs/model/legend.js
CHANGED
|
@@ -21,21 +21,21 @@ function _export(target, all) {
|
|
|
21
21
|
});
|
|
22
22
|
}
|
|
23
23
|
_export(exports, {
|
|
24
|
-
|
|
25
|
-
return
|
|
24
|
+
LEGEND_MODE_CONFIG: function() {
|
|
25
|
+
return LEGEND_MODE_CONFIG;
|
|
26
26
|
},
|
|
27
27
|
LEGEND_POSITIONS_CONFIG: function() {
|
|
28
28
|
return LEGEND_POSITIONS_CONFIG;
|
|
29
29
|
},
|
|
30
|
-
LEGEND_MODE_CONFIG: function() {
|
|
31
|
-
return LEGEND_MODE_CONFIG;
|
|
32
|
-
},
|
|
33
30
|
LEGEND_SIZE_CONFIG: function() {
|
|
34
31
|
return LEGEND_SIZE_CONFIG;
|
|
35
32
|
},
|
|
36
33
|
LEGEND_VALUE_CONFIG: function() {
|
|
37
34
|
return LEGEND_VALUE_CONFIG;
|
|
38
35
|
},
|
|
36
|
+
legendValues: function() {
|
|
37
|
+
return legendValues;
|
|
38
|
+
},
|
|
39
39
|
validateLegendSpec: function() {
|
|
40
40
|
return validateLegendSpec;
|
|
41
41
|
}
|
|
@@ -0,0 +1,16 @@
|
|
|
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
|
+
});
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
/* eslint-disable @typescript-eslint/ban-ts-comment */ // 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, "PluginLoaderComponent", {
|
|
18
|
+
enumerable: true,
|
|
19
|
+
get: function() {
|
|
20
|
+
return PluginLoaderComponent;
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
const _jsxruntime = require("react/jsx-runtime");
|
|
24
|
+
const _react = require("react");
|
|
25
|
+
const _PluginRuntime = require("./PluginRuntime");
|
|
26
|
+
function PluginContainer({ pluginFn, props }) {
|
|
27
|
+
return pluginFn(props);
|
|
28
|
+
}
|
|
29
|
+
function PluginLoaderComponent({ plugin, props, field }) {
|
|
30
|
+
const { loadPlugin } = (0, _PluginRuntime.usePluginRuntime)({
|
|
31
|
+
plugin
|
|
32
|
+
});
|
|
33
|
+
const [pluginModule, setPluginModule] = (0, _react.useState)(null);
|
|
34
|
+
const [error, setError] = (0, _react.useState)(null);
|
|
35
|
+
const name = `${plugin.moduleName}-${plugin.name}`;
|
|
36
|
+
const previousPluginName = (0, _react.useRef)(name);
|
|
37
|
+
(0, _react.useEffect)(()=>{
|
|
38
|
+
previousPluginName.current = name;
|
|
39
|
+
setError(null);
|
|
40
|
+
loadPlugin().then((module)=>{
|
|
41
|
+
setPluginModule(module);
|
|
42
|
+
}).catch((error)=>{
|
|
43
|
+
setPluginModule(null);
|
|
44
|
+
console.error(`PluginLoaderComponent: Error loading plugin ${plugin.name} from module ${plugin.moduleName}:`, error);
|
|
45
|
+
setError(new Error(`PluginLoaderComponent: Error loading plugin ${plugin.name} from module ${plugin.moduleName}`));
|
|
46
|
+
});
|
|
47
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
48
|
+
}, [
|
|
49
|
+
name
|
|
50
|
+
]);
|
|
51
|
+
if (error) {
|
|
52
|
+
throw error;
|
|
53
|
+
}
|
|
54
|
+
if (!pluginModule) {
|
|
55
|
+
return null;
|
|
56
|
+
}
|
|
57
|
+
let pluginFunction = pluginModule[plugin.name];
|
|
58
|
+
if (field && pluginFunction && typeof pluginFunction === 'object' && field in pluginFunction) {
|
|
59
|
+
pluginFunction = pluginFunction[field];
|
|
60
|
+
}
|
|
61
|
+
if (!pluginFunction) {
|
|
62
|
+
throw new Error(`PluginLoaderComponent: Plugin module ${plugin.moduleName} does not have a ${plugin.name} export`);
|
|
63
|
+
}
|
|
64
|
+
if (typeof pluginFunction !== 'function') {
|
|
65
|
+
throw new Error(`PluginLoaderComponent: Plugin ${plugin.name} export is not a function`);
|
|
66
|
+
}
|
|
67
|
+
// make sure to re mount the plugin when changes, to avoid mismatch in hooks ordering when re rendering
|
|
68
|
+
if (previousPluginName.current !== name) {
|
|
69
|
+
return null;
|
|
70
|
+
}
|
|
71
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsx)(PluginContainer, {
|
|
72
|
+
pluginFn: pluginFunction,
|
|
73
|
+
props: props
|
|
74
|
+
}, name);
|
|
75
|
+
}
|