@perses-dev/plugin-system 0.0.0-snapshot-panel-extra-content-3-17f9c42 → 0.0.0-snapshot-scatterplot-fix-imports-95e1b59
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 +7 -5
- package/dist/cjs/components/CalculationSelector/index.js +10 -8
- package/dist/cjs/components/DatasourceEditorForm/DatasourceEditorForm.js +350 -0
- package/dist/cjs/components/DatasourceEditorForm/index.js +30 -0
- package/dist/cjs/components/DatasourceSelect.js +137 -25
- package/dist/cjs/components/LegendOptionsEditor/LegendOptionsEditor.js +19 -17
- package/dist/cjs/components/LegendOptionsEditor/index.js +10 -8
- package/dist/cjs/components/OptionsEditorRadios/OptionsEditorRadios.js +25 -30
- package/dist/cjs/components/OptionsEditorRadios/index.js +10 -8
- package/dist/cjs/components/OptionsEditorTabPanel/OptionsEditorTabPanel.js +7 -5
- package/dist/cjs/components/OptionsEditorTabPanel/index.js +10 -8
- package/dist/cjs/components/OptionsEditorTabs/OptionsEditorTabs.js +13 -11
- package/dist/cjs/components/OptionsEditorTabs/index.js +10 -8
- package/dist/cjs/components/PanelSpecEditor/PanelSpecEditor.js +60 -19
- package/dist/cjs/components/PanelSpecEditor/index.js +10 -8
- package/dist/cjs/components/PluginEditor/PluginEditor.js +25 -32
- package/dist/cjs/components/PluginEditor/index.js +11 -9
- package/dist/cjs/components/PluginEditor/plugin-editor-api.js +8 -6
- package/dist/cjs/components/PluginKindSelect/PluginKindSelect.js +25 -14
- package/dist/cjs/components/PluginKindSelect/index.js +10 -8
- package/dist/cjs/components/PluginRegistry/PluginRegistry.js +11 -9
- package/dist/cjs/components/PluginRegistry/index.js +10 -8
- package/dist/cjs/components/PluginRegistry/plugin-indexes.js +7 -3
- package/dist/cjs/components/PluginSpecEditor/PluginSpecEditor.js +9 -7
- package/dist/cjs/components/PluginSpecEditor/index.js +10 -8
- package/dist/cjs/components/ProjectSelect.js +96 -0
- package/dist/cjs/components/TimeRangeControls/TimeRangeControls.js +192 -0
- package/dist/cjs/components/TimeRangeControls/index.js +30 -0
- package/dist/cjs/components/TimeSeriesQueryEditor/TimeSeriesQueryEditor.js +45 -49
- package/dist/cjs/components/TimeSeriesQueryEditor/TimeSeriesQueryInput.js +23 -21
- package/dist/cjs/components/TimeSeriesQueryEditor/index.js +10 -8
- package/dist/cjs/components/TraceQueryEditor/TraceQueryEditor.js +143 -0
- package/dist/cjs/components/TraceQueryEditor/TraceQueryInput.js +96 -0
- package/dist/cjs/components/TraceQueryEditor/index.js +30 -0
- package/dist/cjs/components/Variables/VariableEditorForm/VariableEditorForm.js +445 -230
- package/dist/cjs/components/Variables/VariableEditorForm/VariablePreview.js +38 -32
- package/dist/cjs/components/Variables/VariableEditorForm/index.js +11 -9
- package/dist/cjs/components/Variables/VariableEditorForm/variable-editor-form-model.js +36 -37
- package/dist/cjs/components/Variables/index.js +11 -9
- package/dist/cjs/components/Variables/variable-model.js +24 -17
- package/dist/cjs/components/index.js +24 -19
- package/dist/cjs/constants/index.js +10 -8
- package/dist/cjs/constants/user-interface-text.js +7 -2
- package/dist/cjs/context/ProjectStoreProvider.js +78 -0
- package/dist/cjs/context/index.js +30 -0
- package/dist/cjs/context/query-params.js +49 -0
- package/dist/cjs/index.js +17 -13
- package/dist/cjs/model/index.js +18 -15
- package/dist/cjs/model/legend.js +32 -20
- package/dist/cjs/model/panels.js +2 -2
- package/dist/cjs/model/plugin-base.js +2 -2
- package/dist/cjs/model/plugin-loading.js +3 -1
- package/dist/cjs/model/trace-queries.js +16 -0
- package/dist/cjs/runtime/DataQueriesProvider/DataQueriesProvider.js +67 -35
- package/dist/cjs/runtime/DataQueriesProvider/index.js +11 -9
- package/dist/cjs/runtime/DataQueriesProvider/model.js +81 -0
- package/dist/cjs/runtime/TimeRangeProvider/TimeRangeProvider.js +55 -27
- package/dist/cjs/runtime/TimeRangeProvider/TimeRangeProviderWithQueryParams.js +43 -0
- package/dist/cjs/runtime/TimeRangeProvider/index.js +12 -9
- package/dist/cjs/runtime/TimeRangeProvider/query-params.js +45 -59
- package/dist/cjs/runtime/TimeRangeProvider/refresh-interval.js +30 -0
- package/dist/cjs/runtime/builtin-variables.js +81 -0
- package/dist/cjs/runtime/datasources.js +31 -12
- package/dist/cjs/runtime/index.js +17 -13
- package/dist/cjs/runtime/plugin-registry.js +44 -14
- package/dist/cjs/runtime/template-variables.js +51 -13
- package/dist/cjs/runtime/time-series-queries.js +43 -31
- package/dist/cjs/runtime/trace-queries.js +76 -0
- package/dist/cjs/stories/shared-utils/decorators/WithDataQueries.js +7 -5
- package/dist/cjs/stories/shared-utils/decorators/WithPluginRegistry.js +21 -16
- package/dist/cjs/stories/shared-utils/decorators/WithPluginSystemBuiltinVariables.js +42 -0
- package/dist/cjs/stories/shared-utils/decorators/WithPluginSystemDatasourceStore.js +31 -13
- package/dist/cjs/stories/shared-utils/decorators/WithPluginSystemTemplateVariables.js +6 -4
- package/dist/cjs/stories/shared-utils/decorators/WithTimeRange.js +9 -7
- package/dist/cjs/stories/shared-utils/decorators/index.js +15 -12
- package/dist/cjs/stories/shared-utils/index.js +10 -8
- package/dist/cjs/test/index.js +11 -8
- package/dist/cjs/test/mock-data.js +80 -0
- package/dist/cjs/test/render.js +13 -11
- package/dist/cjs/test/test-plugins/bert/index.js +16 -12
- package/dist/cjs/test/test-plugins/ernie/index.js +15 -11
- package/dist/cjs/test/test-plugins/index.js +14 -10
- package/dist/cjs/test-utils/index.js +10 -8
- package/dist/cjs/test-utils/mock-plugin-registry.js +9 -5
- package/dist/cjs/utils/action.js +43 -0
- package/dist/cjs/utils/index.js +11 -8
- package/dist/cjs/utils/variables.js +26 -8
- package/dist/cjs/validation/datasource.js +30 -0
- package/dist/cjs/validation/duration.js +25 -0
- package/dist/cjs/validation/index.js +34 -0
- package/dist/cjs/validation/resource.js +24 -0
- package/dist/cjs/validation/role.js +86 -0
- package/dist/cjs/validation/rolebinding.js +55 -0
- package/dist/cjs/validation/secret.js +176 -0
- package/dist/cjs/validation/user.js +46 -0
- package/dist/cjs/validation/variable.js +48 -0
- package/dist/components/CalculationSelector/CalculationSelector.d.ts +1 -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/CalculationSelector/index.js.map +1 -1
- package/dist/components/DatasourceEditorForm/DatasourceEditorForm.d.ts +14 -0
- package/dist/components/DatasourceEditorForm/DatasourceEditorForm.d.ts.map +1 -0
- package/dist/components/DatasourceEditorForm/DatasourceEditorForm.js +342 -0
- package/dist/components/DatasourceEditorForm/DatasourceEditorForm.js.map +1 -0
- package/dist/components/DatasourceEditorForm/index.d.ts +2 -0
- package/dist/components/DatasourceEditorForm/index.d.ts.map +1 -0
- package/dist/components/DatasourceEditorForm/index.js +15 -0
- package/dist/components/DatasourceEditorForm/index.js.map +1 -0
- package/dist/components/DatasourceSelect.d.ts +8 -3
- package/dist/components/DatasourceSelect.d.ts.map +1 -1
- package/dist/components/DatasourceSelect.js +120 -23
- package/dist/components/DatasourceSelect.js.map +1 -1
- package/dist/components/LegendOptionsEditor/LegendOptionsEditor.d.ts +1 -2
- package/dist/components/LegendOptionsEditor/LegendOptionsEditor.d.ts.map +1 -1
- package/dist/components/LegendOptionsEditor/LegendOptionsEditor.js +3 -3
- package/dist/components/LegendOptionsEditor/LegendOptionsEditor.js.map +1 -1
- package/dist/components/LegendOptionsEditor/index.js.map +1 -1
- package/dist/components/OptionsEditorRadios/OptionsEditorRadios.d.ts +5 -5
- package/dist/components/OptionsEditorRadios/OptionsEditorRadios.d.ts.map +1 -1
- package/dist/components/OptionsEditorRadios/OptionsEditorRadios.js +18 -25
- package/dist/components/OptionsEditorRadios/OptionsEditorRadios.js.map +1 -1
- package/dist/components/OptionsEditorRadios/index.js.map +1 -1
- package/dist/components/OptionsEditorTabPanel/OptionsEditorTabPanel.d.ts +1 -1
- 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/OptionsEditorTabPanel/index.js.map +1 -1
- package/dist/components/OptionsEditorTabs/OptionsEditorTabs.d.ts +3 -3
- package/dist/components/OptionsEditorTabs/OptionsEditorTabs.d.ts.map +1 -1
- package/dist/components/OptionsEditorTabs/OptionsEditorTabs.js +3 -3
- package/dist/components/OptionsEditorTabs/OptionsEditorTabs.js.map +1 -1
- package/dist/components/OptionsEditorTabs/index.js.map +1 -1
- package/dist/components/PanelSpecEditor/PanelSpecEditor.d.ts +2 -3
- package/dist/components/PanelSpecEditor/PanelSpecEditor.d.ts.map +1 -1
- package/dist/components/PanelSpecEditor/PanelSpecEditor.js +50 -11
- package/dist/components/PanelSpecEditor/PanelSpecEditor.js.map +1 -1
- package/dist/components/PanelSpecEditor/index.js.map +1 -1
- package/dist/components/PluginEditor/PluginEditor.d.ts +1 -2
- package/dist/components/PluginEditor/PluginEditor.d.ts.map +1 -1
- package/dist/components/PluginEditor/PluginEditor.js +17 -26
- package/dist/components/PluginEditor/PluginEditor.js.map +1 -1
- package/dist/components/PluginEditor/index.js.map +1 -1
- package/dist/components/PluginEditor/plugin-editor-api.d.ts +3 -3
- package/dist/components/PluginEditor/plugin-editor-api.d.ts.map +1 -1
- package/dist/components/PluginEditor/plugin-editor-api.js +5 -5
- package/dist/components/PluginEditor/plugin-editor-api.js.map +1 -1
- package/dist/components/PluginKindSelect/PluginKindSelect.d.ts +3 -3
- package/dist/components/PluginKindSelect/PluginKindSelect.d.ts.map +1 -1
- package/dist/components/PluginKindSelect/PluginKindSelect.js +23 -14
- package/dist/components/PluginKindSelect/PluginKindSelect.js.map +1 -1
- package/dist/components/PluginKindSelect/index.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 +3 -3
- package/dist/components/PluginRegistry/PluginRegistry.js.map +1 -1
- package/dist/components/PluginRegistry/index.js.map +1 -1
- package/dist/components/PluginRegistry/plugin-indexes.js +1 -1
- package/dist/components/PluginRegistry/plugin-indexes.js.map +1 -1
- package/dist/components/PluginSpecEditor/PluginSpecEditor.d.ts +2 -2
- 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/PluginSpecEditor/index.js.map +1 -1
- package/dist/components/ProjectSelect.d.ts +14 -0
- package/dist/components/ProjectSelect.d.ts.map +1 -0
- package/dist/components/ProjectSelect.js +91 -0
- package/dist/components/ProjectSelect.js.map +1 -0
- package/dist/components/TimeRangeControls/TimeRangeControls.d.ts +13 -0
- package/dist/components/TimeRangeControls/TimeRangeControls.d.ts.map +1 -0
- package/dist/components/TimeRangeControls/TimeRangeControls.js +168 -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/TimeRangeControls/index.js +15 -0
- package/dist/components/TimeRangeControls/index.js.map +1 -0
- package/dist/components/TimeSeriesQueryEditor/TimeSeriesQueryEditor.d.ts +1 -2
- package/dist/components/TimeSeriesQueryEditor/TimeSeriesQueryEditor.d.ts.map +1 -1
- package/dist/components/TimeSeriesQueryEditor/TimeSeriesQueryEditor.js +38 -44
- package/dist/components/TimeSeriesQueryEditor/TimeSeriesQueryEditor.js.map +1 -1
- package/dist/components/TimeSeriesQueryEditor/TimeSeriesQueryInput.d.ts +1 -2
- package/dist/components/TimeSeriesQueryEditor/TimeSeriesQueryInput.d.ts.map +1 -1
- package/dist/components/TimeSeriesQueryEditor/TimeSeriesQueryInput.js +3 -3
- package/dist/components/TimeSeriesQueryEditor/TimeSeriesQueryInput.js.map +1 -1
- package/dist/components/TimeSeriesQueryEditor/index.js.map +1 -1
- package/dist/components/TraceQueryEditor/TraceQueryEditor.d.ts +8 -0
- package/dist/components/TraceQueryEditor/TraceQueryEditor.d.ts.map +1 -0
- package/dist/components/TraceQueryEditor/TraceQueryEditor.js +130 -0
- package/dist/components/TraceQueryEditor/TraceQueryEditor.js.map +1 -0
- package/dist/components/TraceQueryEditor/TraceQueryInput.d.ts +12 -0
- package/dist/components/TraceQueryEditor/TraceQueryInput.d.ts.map +1 -0
- package/dist/components/TraceQueryEditor/TraceQueryInput.js +83 -0
- package/dist/components/TraceQueryEditor/TraceQueryInput.js.map +1 -0
- package/dist/components/TraceQueryEditor/index.d.ts +2 -0
- package/dist/components/TraceQueryEditor/index.d.ts.map +1 -0
- package/dist/components/TraceQueryEditor/index.js +15 -0
- package/dist/components/TraceQueryEditor/index.js.map +1 -0
- package/dist/components/Variables/VariableEditorForm/VariableEditorForm.d.ts +10 -8
- package/dist/components/Variables/VariableEditorForm/VariableEditorForm.d.ts.map +1 -1
- package/dist/components/Variables/VariableEditorForm/VariableEditorForm.js +395 -184
- package/dist/components/Variables/VariableEditorForm/VariableEditorForm.js.map +1 -1
- package/dist/components/Variables/VariableEditorForm/VariablePreview.d.ts +2 -3
- package/dist/components/Variables/VariableEditorForm/VariablePreview.d.ts.map +1 -1
- package/dist/components/Variables/VariableEditorForm/VariablePreview.js +4 -4
- package/dist/components/Variables/VariableEditorForm/VariablePreview.js.map +1 -1
- package/dist/components/Variables/VariableEditorForm/index.js.map +1 -1
- package/dist/components/Variables/VariableEditorForm/variable-editor-form-model.d.ts +8 -19
- package/dist/components/Variables/VariableEditorForm/variable-editor-form-model.d.ts.map +1 -1
- package/dist/components/Variables/VariableEditorForm/variable-editor-form-model.js +30 -35
- package/dist/components/Variables/VariableEditorForm/variable-editor-form-model.js.map +1 -1
- package/dist/components/Variables/index.js.map +1 -1
- package/dist/components/Variables/variable-model.d.ts.map +1 -1
- package/dist/components/Variables/variable-model.js +9 -10
- package/dist/components/Variables/variable-model.js.map +1 -1
- package/dist/components/index.d.ts +3 -0
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/index.js +3 -0
- package/dist/components/index.js.map +1 -1
- package/dist/constants/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 +16 -0
- package/dist/context/ProjectStoreProvider.d.ts.map +1 -0
- package/dist/context/ProjectStoreProvider.js +56 -0
- package/dist/context/ProjectStoreProvider.js.map +1 -0
- package/dist/context/index.d.ts +2 -0
- package/dist/context/index.d.ts.map +1 -0
- package/dist/context/index.js +15 -0
- package/dist/context/index.js.map +1 -0
- package/dist/context/query-params.d.ts +5 -0
- package/dist/context/query-params.d.ts.map +1 -0
- package/dist/context/query-params.js +41 -0
- package/dist/context/query-params.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/model/datasource.d.ts +2 -1
- package/dist/model/datasource.d.ts.map +1 -1
- package/dist/model/datasource.js +3 -1
- package/dist/model/datasource.js.map +1 -1
- package/dist/model/index.d.ts +1 -0
- package/dist/model/index.d.ts.map +1 -1
- package/dist/model/index.js +1 -0
- package/dist/model/index.js.map +1 -1
- package/dist/model/legend.d.ts +3 -3
- package/dist/model/legend.d.ts.map +1 -1
- package/dist/model/legend.js +14 -14
- package/dist/model/legend.js.map +1 -1
- package/dist/model/panels.d.ts +3 -2
- package/dist/model/panels.d.ts.map +1 -1
- package/dist/model/panels.js.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 +6 -4
- package/dist/model/plugins.d.ts.map +1 -1
- package/dist/model/plugins.js.map +1 -1
- package/dist/model/time-series-queries.d.ts +2 -2
- 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 +19 -0
- package/dist/model/trace-queries.d.ts.map +1 -0
- package/dist/model/trace-queries.js +15 -0
- package/dist/model/trace-queries.js.map +1 -0
- 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/runtime/DataQueriesProvider/DataQueriesProvider.d.ts +6 -6
- package/dist/runtime/DataQueriesProvider/DataQueriesProvider.d.ts.map +1 -1
- package/dist/runtime/DataQueriesProvider/DataQueriesProvider.js +52 -28
- package/dist/runtime/DataQueriesProvider/DataQueriesProvider.js.map +1 -1
- package/dist/runtime/DataQueriesProvider/index.js.map +1 -1
- package/dist/runtime/DataQueriesProvider/model.d.ts +18 -13
- package/dist/runtime/DataQueriesProvider/model.d.ts.map +1 -1
- package/dist/runtime/DataQueriesProvider/model.js +67 -1
- package/dist/runtime/DataQueriesProvider/model.js.map +1 -1
- package/dist/runtime/TimeRangeProvider/TimeRangeProvider.d.ts +9 -4
- package/dist/runtime/TimeRangeProvider/TimeRangeProvider.d.ts.map +1 -1
- package/dist/runtime/TimeRangeProvider/TimeRangeProvider.js +37 -20
- package/dist/runtime/TimeRangeProvider/TimeRangeProvider.js.map +1 -1
- package/dist/runtime/TimeRangeProvider/TimeRangeProviderWithQueryParams.d.ts +9 -0
- package/dist/runtime/TimeRangeProvider/TimeRangeProviderWithQueryParams.d.ts.map +1 -0
- package/dist/runtime/TimeRangeProvider/TimeRangeProviderWithQueryParams.js +30 -0
- package/dist/runtime/TimeRangeProvider/TimeRangeProviderWithQueryParams.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 +1 -0
- package/dist/runtime/TimeRangeProvider/index.js.map +1 -1
- package/dist/runtime/TimeRangeProvider/query-params.d.ts +5 -5
- package/dist/runtime/TimeRangeProvider/query-params.d.ts.map +1 -1
- package/dist/runtime/TimeRangeProvider/query-params.js +13 -45
- package/dist/runtime/TimeRangeProvider/query-params.js.map +1 -1
- package/dist/runtime/TimeRangeProvider/refresh-interval.d.ts +7 -0
- package/dist/runtime/TimeRangeProvider/refresh-interval.d.ts.map +1 -0
- package/dist/runtime/TimeRangeProvider/refresh-interval.js +25 -0
- package/dist/runtime/TimeRangeProvider/refresh-interval.js.map +1 -0
- package/dist/runtime/builtin-variables.d.ts +11 -0
- package/dist/runtime/builtin-variables.d.ts.map +1 -0
- package/dist/runtime/builtin-variables.js +59 -0
- package/dist/runtime/builtin-variables.js.map +1 -0
- package/dist/runtime/datasources.d.ts +42 -7
- package/dist/runtime/datasources.d.ts.map +1 -1
- package/dist/runtime/datasources.js +15 -7
- package/dist/runtime/datasources.js.map +1 -1
- package/dist/runtime/index.d.ts +2 -0
- package/dist/runtime/index.d.ts.map +1 -1
- package/dist/runtime/index.js +2 -0
- package/dist/runtime/index.js.map +1 -1
- package/dist/runtime/plugin-registry.d.ts +5 -3
- package/dist/runtime/plugin-registry.d.ts.map +1 -1
- package/dist/runtime/plugin-registry.js +22 -5
- package/dist/runtime/plugin-registry.js.map +1 -1
- package/dist/runtime/template-variables.d.ts +6 -5
- package/dist/runtime/template-variables.d.ts.map +1 -1
- package/dist/runtime/template-variables.js +36 -9
- package/dist/runtime/template-variables.js.map +1 -1
- package/dist/runtime/time-series-queries.d.ts +3 -3
- package/dist/runtime/time-series-queries.d.ts.map +1 -1
- package/dist/runtime/time-series-queries.js +21 -19
- package/dist/runtime/time-series-queries.js.map +1 -1
- package/dist/runtime/trace-queries.d.ts +14 -0
- package/dist/runtime/trace-queries.d.ts.map +1 -0
- package/dist/runtime/trace-queries.js +61 -0
- package/dist/runtime/trace-queries.js.map +1 -0
- package/dist/stories/shared-utils/decorators/WithDataQueries.d.ts +2 -3
- package/dist/stories/shared-utils/decorators/WithDataQueries.d.ts.map +1 -1
- package/dist/stories/shared-utils/decorators/WithDataQueries.js.map +1 -1
- package/dist/stories/shared-utils/decorators/WithPluginRegistry.d.ts +1 -2
- package/dist/stories/shared-utils/decorators/WithPluginRegistry.d.ts.map +1 -1
- package/dist/stories/shared-utils/decorators/WithPluginRegistry.js +2 -1
- package/dist/stories/shared-utils/decorators/WithPluginRegistry.js.map +1 -1
- package/dist/stories/shared-utils/decorators/WithPluginSystemBuiltinVariables.d.ts +12 -0
- package/dist/stories/shared-utils/decorators/WithPluginSystemBuiltinVariables.d.ts.map +1 -0
- package/dist/stories/shared-utils/decorators/WithPluginSystemBuiltinVariables.js +39 -0
- package/dist/stories/shared-utils/decorators/WithPluginSystemBuiltinVariables.js.map +1 -0
- package/dist/stories/shared-utils/decorators/WithPluginSystemDatasourceStore.d.ts +2 -3
- package/dist/stories/shared-utils/decorators/WithPluginSystemDatasourceStore.d.ts.map +1 -1
- package/dist/stories/shared-utils/decorators/WithPluginSystemDatasourceStore.js +24 -8
- package/dist/stories/shared-utils/decorators/WithPluginSystemDatasourceStore.js.map +1 -1
- package/dist/stories/shared-utils/decorators/WithPluginSystemTemplateVariables.d.ts +2 -3
- package/dist/stories/shared-utils/decorators/WithPluginSystemTemplateVariables.d.ts.map +1 -1
- package/dist/stories/shared-utils/decorators/WithPluginSystemTemplateVariables.js.map +1 -1
- package/dist/stories/shared-utils/decorators/WithTimeRange.d.ts +4 -5
- package/dist/stories/shared-utils/decorators/WithTimeRange.d.ts.map +1 -1
- package/dist/stories/shared-utils/decorators/WithTimeRange.js +2 -2
- package/dist/stories/shared-utils/decorators/WithTimeRange.js.map +1 -1
- package/dist/stories/shared-utils/decorators/index.d.ts +1 -0
- package/dist/stories/shared-utils/decorators/index.d.ts.map +1 -1
- package/dist/stories/shared-utils/decorators/index.js +1 -0
- package/dist/stories/shared-utils/decorators/index.js.map +1 -1
- package/dist/stories/shared-utils/index.js.map +1 -1
- package/dist/test/index.d.ts +1 -0
- package/dist/test/index.d.ts.map +1 -1
- package/dist/test/index.js +1 -0
- package/dist/test/index.js.map +1 -1
- package/dist/test/mock-data.d.ts +4 -0
- package/dist/test/mock-data.d.ts.map +1 -0
- package/dist/test/mock-data.js +64 -0
- package/dist/test/mock-data.js.map +1 -0
- package/dist/test/render.d.ts +1 -1
- package/dist/test/render.d.ts.map +1 -1
- package/dist/test/render.js +2 -2
- package/dist/test/render.js.map +1 -1
- package/dist/test/setup-tests.js.map +1 -1
- package/dist/test/test-plugins/bert/index.js +2 -2
- 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/test-plugins/index.js.map +1 -1
- package/dist/test-utils/index.js.map +1 -1
- package/dist/test-utils/mock-plugin-registry.d.ts +1 -1
- package/dist/test-utils/mock-plugin-registry.d.ts.map +1 -1
- package/dist/test-utils/mock-plugin-registry.js +3 -3
- package/dist/test-utils/mock-plugin-registry.js.map +1 -1
- package/dist/utils/action.d.ts +4 -0
- package/dist/utils/action.d.ts.map +1 -0
- package/dist/utils/action.js +27 -0
- package/dist/utils/action.js.map +1 -0
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +1 -0
- package/dist/utils/index.js.map +1 -1
- package/dist/utils/variables.d.ts.map +1 -1
- package/dist/utils/variables.js +17 -5
- package/dist/utils/variables.js.map +1 -1
- package/dist/validation/datasource.d.ts +19 -0
- package/dist/validation/datasource.d.ts.map +1 -0
- package/dist/validation/datasource.js +22 -0
- package/dist/validation/datasource.js.map +1 -0
- package/dist/validation/duration.d.ts +3 -0
- package/dist/validation/duration.d.ts.map +1 -0
- package/dist/validation/duration.js +17 -0
- package/dist/validation/duration.js.map +1 -0
- package/dist/validation/index.d.ts +6 -0
- package/dist/validation/index.d.ts.map +1 -0
- package/dist/validation/index.js +19 -0
- package/dist/validation/index.js.map +1 -0
- package/dist/validation/resource.d.ts +3 -0
- package/dist/validation/resource.d.ts.map +1 -0
- package/dist/validation/resource.js +16 -0
- package/dist/validation/resource.js.map +1 -0
- package/dist/validation/role.d.ts +228 -0
- package/dist/validation/role.d.ts.map +1 -0
- package/dist/validation/role.js +67 -0
- package/dist/validation/role.js.map +1 -0
- package/dist/validation/rolebinding.d.ts +137 -0
- package/dist/validation/rolebinding.d.ts.map +1 -0
- package/dist/validation/rolebinding.js +47 -0
- package/dist/validation/rolebinding.js.map +1 -0
- package/dist/validation/secret.d.ts +964 -0
- package/dist/validation/secret.d.ts.map +1 -0
- package/dist/validation/secret.js +157 -0
- package/dist/validation/secret.js.map +1 -0
- package/dist/validation/user.d.ts +93 -0
- package/dist/validation/user.d.ts.map +1 -0
- package/dist/validation/user.js +38 -0
- package/dist/validation/user.js.map +1 -0
- package/dist/validation/variable.d.ts +96 -0
- package/dist/validation/variable.d.ts.map +1 -0
- package/dist/validation/variable.js +40 -0
- package/dist/validation/variable.js.map +1 -0
- package/package.json +9 -6
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
// Copyright 2023 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, "useSetProjectParams", {
|
|
18
|
+
enumerable: true,
|
|
19
|
+
get: function() {
|
|
20
|
+
return useSetProjectParams;
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
const _react = require("react");
|
|
24
|
+
const _usequeryparams = require("use-query-params");
|
|
25
|
+
function useSetProjectParams(enabledURLParams = true) {
|
|
26
|
+
const [query, setQuery] = (0, _usequeryparams.useQueryParams)({
|
|
27
|
+
project: ''
|
|
28
|
+
}, {
|
|
29
|
+
updateType: 'replaceIn'
|
|
30
|
+
});
|
|
31
|
+
const [projectState, setProjectState] = (0, _react.useState)('none');
|
|
32
|
+
const setProject = (0, _react.useCallback)((project)=>{
|
|
33
|
+
return setQuery({
|
|
34
|
+
project
|
|
35
|
+
});
|
|
36
|
+
}, [
|
|
37
|
+
setQuery
|
|
38
|
+
]);
|
|
39
|
+
if (enabledURLParams) {
|
|
40
|
+
return {
|
|
41
|
+
project: query.project || 'none',
|
|
42
|
+
setProject
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
return {
|
|
46
|
+
project: projectState,
|
|
47
|
+
setProject: setProjectState
|
|
48
|
+
};
|
|
49
|
+
}
|
package/dist/cjs/index.js
CHANGED
|
@@ -14,20 +14,24 @@
|
|
|
14
14
|
Object.defineProperty(exports, "__esModule", {
|
|
15
15
|
value: true
|
|
16
16
|
});
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
17
|
+
_export_star(require("./components"), exports);
|
|
18
|
+
_export_star(require("./constants"), exports);
|
|
19
|
+
_export_star(require("./model"), exports);
|
|
20
|
+
_export_star(require("./runtime"), exports);
|
|
21
|
+
_export_star(require("./test-utils"), exports);
|
|
22
|
+
_export_star(require("./utils"), exports);
|
|
23
|
+
_export_star(require("./validation"), exports);
|
|
24
|
+
_export_star(require("./context"), exports);
|
|
25
|
+
function _export_star(from, to) {
|
|
24
26
|
Object.keys(from).forEach(function(k) {
|
|
25
|
-
if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k))
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
27
|
+
if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) {
|
|
28
|
+
Object.defineProperty(to, k, {
|
|
29
|
+
enumerable: true,
|
|
30
|
+
get: function() {
|
|
31
|
+
return from[k];
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
}
|
|
31
35
|
});
|
|
32
36
|
return from;
|
|
33
37
|
}
|
package/dist/cjs/model/index.js
CHANGED
|
@@ -14,22 +14,25 @@
|
|
|
14
14
|
Object.defineProperty(exports, "__esModule", {
|
|
15
15
|
value: true
|
|
16
16
|
});
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
17
|
+
_export_star(require("./datasource"), exports);
|
|
18
|
+
_export_star(require("./legend"), exports);
|
|
19
|
+
_export_star(require("./panels"), exports);
|
|
20
|
+
_export_star(require("./plugins"), exports);
|
|
21
|
+
_export_star(require("./plugin-base"), exports);
|
|
22
|
+
_export_star(require("./plugin-loading"), exports);
|
|
23
|
+
_export_star(require("./time-series-queries"), exports);
|
|
24
|
+
_export_star(require("./trace-queries"), exports);
|
|
25
|
+
_export_star(require("./variables"), exports);
|
|
26
|
+
function _export_star(from, to) {
|
|
26
27
|
Object.keys(from).forEach(function(k) {
|
|
27
|
-
if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k))
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
28
|
+
if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) {
|
|
29
|
+
Object.defineProperty(to, k, {
|
|
30
|
+
enumerable: true,
|
|
31
|
+
get: function() {
|
|
32
|
+
return from[k];
|
|
33
|
+
}
|
|
34
|
+
});
|
|
35
|
+
}
|
|
33
36
|
});
|
|
34
37
|
return from;
|
|
35
38
|
}
|
package/dist/cjs/model/legend.js
CHANGED
|
@@ -21,45 +21,57 @@ function _export(target, all) {
|
|
|
21
21
|
});
|
|
22
22
|
}
|
|
23
23
|
_export(exports, {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
24
|
+
LEGEND_MODE_CONFIG: function() {
|
|
25
|
+
return LEGEND_MODE_CONFIG;
|
|
26
|
+
},
|
|
27
|
+
LEGEND_POSITIONS_CONFIG: function() {
|
|
28
|
+
return LEGEND_POSITIONS_CONFIG;
|
|
29
|
+
},
|
|
30
|
+
LEGEND_SIZE_CONFIG: function() {
|
|
31
|
+
return LEGEND_SIZE_CONFIG;
|
|
32
|
+
},
|
|
33
|
+
LEGEND_VALUE_CONFIG: function() {
|
|
34
|
+
return LEGEND_VALUE_CONFIG;
|
|
35
|
+
},
|
|
36
|
+
legendValues: function() {
|
|
37
|
+
return legendValues;
|
|
38
|
+
},
|
|
39
|
+
validateLegendSpec: function() {
|
|
40
|
+
return validateLegendSpec;
|
|
41
|
+
}
|
|
30
42
|
});
|
|
31
43
|
const _core = require("@perses-dev/core");
|
|
32
44
|
const legendValues = [
|
|
33
|
-
'
|
|
34
|
-
'
|
|
35
|
-
'
|
|
36
|
-
'
|
|
37
|
-
'
|
|
38
|
-
'
|
|
39
|
-
'
|
|
40
|
-
'
|
|
45
|
+
'mean',
|
|
46
|
+
'first',
|
|
47
|
+
'first-number',
|
|
48
|
+
'last',
|
|
49
|
+
'last-number',
|
|
50
|
+
'min',
|
|
51
|
+
'max',
|
|
52
|
+
'sum'
|
|
41
53
|
];
|
|
42
54
|
const LEGEND_POSITIONS_CONFIG = {
|
|
43
|
-
|
|
55
|
+
bottom: {
|
|
44
56
|
label: 'Bottom'
|
|
45
57
|
},
|
|
46
|
-
|
|
58
|
+
right: {
|
|
47
59
|
label: 'Right'
|
|
48
60
|
}
|
|
49
61
|
};
|
|
50
62
|
const LEGEND_MODE_CONFIG = {
|
|
51
|
-
|
|
63
|
+
list: {
|
|
52
64
|
label: 'List'
|
|
53
65
|
},
|
|
54
|
-
|
|
66
|
+
table: {
|
|
55
67
|
label: 'Table'
|
|
56
68
|
}
|
|
57
69
|
};
|
|
58
70
|
const LEGEND_SIZE_CONFIG = {
|
|
59
|
-
|
|
71
|
+
small: {
|
|
60
72
|
label: 'Small'
|
|
61
73
|
},
|
|
62
|
-
|
|
74
|
+
medium: {
|
|
63
75
|
label: 'Medium'
|
|
64
76
|
}
|
|
65
77
|
};
|
package/dist/cjs/model/panels.js
CHANGED
|
@@ -14,8 +14,8 @@
|
|
|
14
14
|
Object.defineProperty(exports, "__esModule", {
|
|
15
15
|
value: true
|
|
16
16
|
});
|
|
17
|
-
const _react = /*#__PURE__*/
|
|
18
|
-
function
|
|
17
|
+
const _react = /*#__PURE__*/ _interop_require_default(require("react"));
|
|
18
|
+
function _interop_require_default(obj) {
|
|
19
19
|
return obj && obj.__esModule ? obj : {
|
|
20
20
|
default: obj
|
|
21
21
|
};
|
|
@@ -14,8 +14,8 @@
|
|
|
14
14
|
Object.defineProperty(exports, "__esModule", {
|
|
15
15
|
value: true
|
|
16
16
|
});
|
|
17
|
-
const _react = /*#__PURE__*/
|
|
18
|
-
function
|
|
17
|
+
const _react = /*#__PURE__*/ _interop_require_default(require("react"));
|
|
18
|
+
function _interop_require_default(obj) {
|
|
19
19
|
return obj && obj.__esModule ? obj : {
|
|
20
20
|
default: obj
|
|
21
21
|
};
|
|
@@ -16,7 +16,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
16
16
|
});
|
|
17
17
|
Object.defineProperty(exports, "dynamicImportPluginLoader", {
|
|
18
18
|
enumerable: true,
|
|
19
|
-
get: ()
|
|
19
|
+
get: function() {
|
|
20
|
+
return dynamicImportPluginLoader;
|
|
21
|
+
}
|
|
20
22
|
});
|
|
21
23
|
function dynamicImportPluginLoader(plugins) {
|
|
22
24
|
const importMap = new Map(plugins.map((plugin)=>[
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
// Copyright 2023 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
|
+
});
|
|
@@ -21,18 +21,24 @@ function _export(target, all) {
|
|
|
21
21
|
});
|
|
22
22
|
}
|
|
23
23
|
_export(exports, {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
DataQueriesProvider: ()
|
|
24
|
+
DataQueriesContext: function() {
|
|
25
|
+
return DataQueriesContext;
|
|
26
|
+
},
|
|
27
|
+
DataQueriesProvider: function() {
|
|
28
|
+
return DataQueriesProvider;
|
|
29
|
+
},
|
|
30
|
+
useDataQueries: function() {
|
|
31
|
+
return useDataQueries;
|
|
32
|
+
},
|
|
33
|
+
useDataQueriesContext: function() {
|
|
34
|
+
return useDataQueriesContext;
|
|
35
|
+
}
|
|
28
36
|
});
|
|
29
|
-
const
|
|
37
|
+
const _jsxruntime = require("react/jsx-runtime");
|
|
30
38
|
const _react = require("react");
|
|
31
|
-
const
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
return ctx;
|
|
35
|
-
}
|
|
39
|
+
const _timeseriesqueries = require("../time-series-queries");
|
|
40
|
+
const _tracequeries = require("../trace-queries");
|
|
41
|
+
const _model = require("./model");
|
|
36
42
|
const DataQueriesContext = /*#__PURE__*/ (0, _react.createContext)(undefined);
|
|
37
43
|
function useDataQueriesContext() {
|
|
38
44
|
const ctx = (0, _react.useContext)(DataQueriesContext);
|
|
@@ -41,47 +47,73 @@ function useDataQueriesContext() {
|
|
|
41
47
|
}
|
|
42
48
|
return ctx;
|
|
43
49
|
}
|
|
50
|
+
function useDataQueries(queryType) {
|
|
51
|
+
const ctx = useDataQueriesContext();
|
|
52
|
+
// 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
|
+
});
|
|
57
|
+
// Filter the errors based on the specified query type
|
|
58
|
+
const filteredErrors = ctx.errors.filter((errors, index)=>{
|
|
59
|
+
var _ctx_queryResults_index_definition, _ctx_queryResults_index;
|
|
60
|
+
return ((_ctx_queryResults_index = ctx.queryResults[index]) === null || _ctx_queryResults_index === void 0 ? void 0 : (_ctx_queryResults_index_definition = _ctx_queryResults_index.definition) === null || _ctx_queryResults_index_definition === void 0 ? void 0 : _ctx_queryResults_index_definition.kind) === queryType;
|
|
61
|
+
});
|
|
62
|
+
// Create a new context object with the filtered results and errors
|
|
63
|
+
const filteredCtx = {
|
|
64
|
+
queryResults: filteredQueryResults,
|
|
65
|
+
isFetching: filteredQueryResults.some((result)=>result.isFetching),
|
|
66
|
+
isLoading: filteredQueryResults.some((result)=>result.isLoading),
|
|
67
|
+
refetchAll: ctx.refetchAll,
|
|
68
|
+
errors: filteredErrors
|
|
69
|
+
};
|
|
70
|
+
return filteredCtx;
|
|
71
|
+
}
|
|
44
72
|
function DataQueriesProvider(props) {
|
|
45
|
-
const { definitions
|
|
46
|
-
//
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
73
|
+
const { definitions, options, children, queryOptions } = props;
|
|
74
|
+
// Returns a query kind, for example "TimeSeriesQuery" = getQueryType("PrometheusTimeSeriesQuery")
|
|
75
|
+
const getQueryType = (0, _model.useQueryType)();
|
|
76
|
+
const queryDefinitions = definitions.map((definition)=>{
|
|
77
|
+
const type = getQueryType(definition.kind);
|
|
78
|
+
return {
|
|
79
|
+
kind: type,
|
|
51
80
|
spec: {
|
|
52
81
|
plugin: definition
|
|
53
82
|
}
|
|
54
|
-
}));
|
|
55
|
-
const results = (0, _timeSeriesQueries.useTimeSeriesQueries)(timeSeriesQueries, options);
|
|
56
|
-
const data = results.map(({ data , isFetching , isLoading , refetch , error }, i)=>{
|
|
57
|
-
return {
|
|
58
|
-
definition: definitions[i],
|
|
59
|
-
data,
|
|
60
|
-
isFetching,
|
|
61
|
-
isLoading,
|
|
62
|
-
refetch,
|
|
63
|
-
error
|
|
64
83
|
};
|
|
65
84
|
});
|
|
85
|
+
// Filter definitions for time series query and other future query plugins
|
|
86
|
+
const timeSeriesQueries = queryDefinitions.filter((definition)=>definition.kind === 'TimeSeriesQuery');
|
|
87
|
+
const timeSeriesResults = (0, _timeseriesqueries.useTimeSeriesQueries)(timeSeriesQueries, options, queryOptions);
|
|
88
|
+
const traceQueries = queryDefinitions.filter((definition)=>definition.kind === 'TraceQuery');
|
|
89
|
+
const traceResults = (0, _tracequeries.useTraceQueries)(traceQueries);
|
|
66
90
|
const refetchAll = (0, _react.useCallback)(()=>{
|
|
67
|
-
|
|
91
|
+
timeSeriesResults.forEach((result)=>result.refetch());
|
|
92
|
+
traceResults.forEach((result)=>result.refetch());
|
|
68
93
|
}, [
|
|
69
|
-
|
|
94
|
+
timeSeriesResults,
|
|
95
|
+
traceResults
|
|
70
96
|
]);
|
|
71
97
|
const ctx = (0, _react.useMemo)(()=>{
|
|
98
|
+
const mergedQueryResults = [
|
|
99
|
+
...(0, _model.transformQueryResults)(timeSeriesResults, timeSeriesQueries),
|
|
100
|
+
...(0, _model.transformQueryResults)(traceResults, traceQueries)
|
|
101
|
+
];
|
|
72
102
|
return {
|
|
73
|
-
queryResults:
|
|
74
|
-
isFetching:
|
|
75
|
-
isLoading:
|
|
103
|
+
queryResults: mergedQueryResults,
|
|
104
|
+
isFetching: mergedQueryResults.some((result)=>result.isFetching),
|
|
105
|
+
isLoading: mergedQueryResults.some((result)=>result.isLoading),
|
|
76
106
|
refetchAll,
|
|
77
|
-
errors:
|
|
107
|
+
errors: mergedQueryResults.map((result)=>result.error)
|
|
78
108
|
};
|
|
79
109
|
}, [
|
|
80
|
-
|
|
81
|
-
|
|
110
|
+
timeSeriesQueries,
|
|
111
|
+
timeSeriesResults,
|
|
112
|
+
traceQueries,
|
|
113
|
+
traceResults,
|
|
82
114
|
refetchAll
|
|
83
115
|
]);
|
|
84
|
-
return /*#__PURE__*/ (0,
|
|
116
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsx)(DataQueriesContext.Provider, {
|
|
85
117
|
value: ctx,
|
|
86
118
|
children: children
|
|
87
119
|
});
|
|
@@ -14,16 +14,18 @@
|
|
|
14
14
|
Object.defineProperty(exports, "__esModule", {
|
|
15
15
|
value: true
|
|
16
16
|
});
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
function
|
|
17
|
+
_export_star(require("./DataQueriesProvider"), exports);
|
|
18
|
+
_export_star(require("./model"), exports);
|
|
19
|
+
function _export_star(from, to) {
|
|
20
20
|
Object.keys(from).forEach(function(k) {
|
|
21
|
-
if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k))
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
21
|
+
if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) {
|
|
22
|
+
Object.defineProperty(to, k, {
|
|
23
|
+
enumerable: true,
|
|
24
|
+
get: function() {
|
|
25
|
+
return from[k];
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
}
|
|
27
29
|
});
|
|
28
30
|
return from;
|
|
29
31
|
}
|
|
@@ -14,3 +14,84 @@
|
|
|
14
14
|
Object.defineProperty(exports, "__esModule", {
|
|
15
15
|
value: true
|
|
16
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
|
+
transformQueryResults: function() {
|
|
25
|
+
return transformQueryResults;
|
|
26
|
+
},
|
|
27
|
+
useQueryType: function() {
|
|
28
|
+
return useQueryType;
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
const _react = require("react");
|
|
32
|
+
const _pluginregistry = require("../plugin-registry");
|
|
33
|
+
function transformQueryResults(results, definitions) {
|
|
34
|
+
return results.map(({ data, isFetching, isLoading, refetch, error }, i)=>{
|
|
35
|
+
return {
|
|
36
|
+
definition: definitions[i],
|
|
37
|
+
data,
|
|
38
|
+
isFetching,
|
|
39
|
+
isLoading,
|
|
40
|
+
refetch,
|
|
41
|
+
error
|
|
42
|
+
};
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
function useQueryType() {
|
|
46
|
+
const { data: timeSeriesQueryPlugins, isLoading: isTimeSeriesQueryLoading } = (0, _pluginregistry.useListPluginMetadata)('TimeSeriesQuery');
|
|
47
|
+
const { data: traceQueryPlugins, isLoading: isTraceQueryPluginLoading } = (0, _pluginregistry.useListPluginMetadata)('TraceQuery');
|
|
48
|
+
// For example, `map: {"TimeSeriesQuery":["PrometheusTimeSeriesQuery"],"TraceQuery":["TempoTraceQuery"]}`
|
|
49
|
+
const queryTypeMap = (0, _react.useMemo)(()=>{
|
|
50
|
+
const map = {
|
|
51
|
+
TimeSeriesQuery: [],
|
|
52
|
+
TraceQuery: []
|
|
53
|
+
};
|
|
54
|
+
if (timeSeriesQueryPlugins) {
|
|
55
|
+
timeSeriesQueryPlugins.forEach((plugin)=>{
|
|
56
|
+
var _map_plugin_pluginType;
|
|
57
|
+
(_map_plugin_pluginType = map[plugin.pluginType]) === null || _map_plugin_pluginType === void 0 ? void 0 : _map_plugin_pluginType.push(plugin.kind);
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
if (traceQueryPlugins) {
|
|
61
|
+
traceQueryPlugins.forEach((plugin)=>{
|
|
62
|
+
var _map_plugin_pluginType;
|
|
63
|
+
(_map_plugin_pluginType = map[plugin.pluginType]) === null || _map_plugin_pluginType === void 0 ? void 0 : _map_plugin_pluginType.push(plugin.kind);
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
return map;
|
|
67
|
+
}, [
|
|
68
|
+
timeSeriesQueryPlugins,
|
|
69
|
+
traceQueryPlugins
|
|
70
|
+
]);
|
|
71
|
+
const getQueryType = (0, _react.useCallback)((pluginKind)=>{
|
|
72
|
+
const isLoading = (pluginKind)=>{
|
|
73
|
+
switch(pluginKind){
|
|
74
|
+
case 'PrometheusTimeSeriesQuery':
|
|
75
|
+
return isTimeSeriesQueryLoading;
|
|
76
|
+
case 'TempoTraceQuery':
|
|
77
|
+
return isTraceQueryPluginLoading;
|
|
78
|
+
}
|
|
79
|
+
throw new Error(`Unable to determine the query type: ${pluginKind}`);
|
|
80
|
+
};
|
|
81
|
+
if (isLoading(pluginKind)) {
|
|
82
|
+
return undefined;
|
|
83
|
+
}
|
|
84
|
+
for(const queryType in queryTypeMap){
|
|
85
|
+
var _queryTypeMap_queryType;
|
|
86
|
+
if ((_queryTypeMap_queryType = queryTypeMap[queryType]) === null || _queryTypeMap_queryType === void 0 ? void 0 : _queryTypeMap_queryType.includes(pluginKind)) {
|
|
87
|
+
return queryType;
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
throw new Error(`Unable to determine the query type: ${pluginKind}`);
|
|
91
|
+
}, [
|
|
92
|
+
queryTypeMap,
|
|
93
|
+
isTimeSeriesQueryLoading,
|
|
94
|
+
isTraceQueryPluginLoading
|
|
95
|
+
]);
|
|
96
|
+
return getQueryType;
|
|
97
|
+
}
|
|
@@ -21,15 +21,26 @@ function _export(target, all) {
|
|
|
21
21
|
});
|
|
22
22
|
}
|
|
23
23
|
_export(exports, {
|
|
24
|
-
TimeRangeContext: ()
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
TimeRangeProvider: ()
|
|
24
|
+
TimeRangeContext: function() {
|
|
25
|
+
return TimeRangeContext;
|
|
26
|
+
},
|
|
27
|
+
TimeRangeProvider: function() {
|
|
28
|
+
return TimeRangeProvider;
|
|
29
|
+
},
|
|
30
|
+
useSuggestedStepMs: function() {
|
|
31
|
+
return useSuggestedStepMs;
|
|
32
|
+
},
|
|
33
|
+
useTimeRange: function() {
|
|
34
|
+
return useTimeRange;
|
|
35
|
+
},
|
|
36
|
+
useTimeRangeContext: function() {
|
|
37
|
+
return useTimeRangeContext;
|
|
38
|
+
}
|
|
28
39
|
});
|
|
29
|
-
const
|
|
30
|
-
const _react = /*#__PURE__*/
|
|
40
|
+
const _jsxruntime = require("react/jsx-runtime");
|
|
41
|
+
const _react = /*#__PURE__*/ _interop_require_wildcard(require("react"));
|
|
31
42
|
const _core = require("@perses-dev/core");
|
|
32
|
-
const
|
|
43
|
+
const _refreshinterval = require("./refresh-interval");
|
|
33
44
|
function _getRequireWildcardCache(nodeInterop) {
|
|
34
45
|
if (typeof WeakMap !== "function") return null;
|
|
35
46
|
var cacheBabelInterop = new WeakMap();
|
|
@@ -38,7 +49,7 @@ function _getRequireWildcardCache(nodeInterop) {
|
|
|
38
49
|
return nodeInterop ? cacheNodeInterop : cacheBabelInterop;
|
|
39
50
|
})(nodeInterop);
|
|
40
51
|
}
|
|
41
|
-
function
|
|
52
|
+
function _interop_require_wildcard(obj, nodeInterop) {
|
|
42
53
|
if (!nodeInterop && obj && obj.__esModule) {
|
|
43
54
|
return obj;
|
|
44
55
|
}
|
|
@@ -51,7 +62,9 @@ function _interopRequireWildcard(obj, nodeInterop) {
|
|
|
51
62
|
if (cache && cache.has(obj)) {
|
|
52
63
|
return cache.get(obj);
|
|
53
64
|
}
|
|
54
|
-
var newObj = {
|
|
65
|
+
var newObj = {
|
|
66
|
+
__proto__: null
|
|
67
|
+
};
|
|
55
68
|
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
56
69
|
for(var key in obj){
|
|
57
70
|
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
@@ -80,38 +93,53 @@ function useTimeRangeContext() {
|
|
|
80
93
|
function useTimeRange() {
|
|
81
94
|
return useTimeRangeContext();
|
|
82
95
|
}
|
|
96
|
+
function useSuggestedStepMs(width) {
|
|
97
|
+
const { absoluteTimeRange } = useTimeRange();
|
|
98
|
+
if (width === undefined) return 0;
|
|
99
|
+
return (0, _core.getSuggestedStepMs)(absoluteTimeRange, width);
|
|
100
|
+
}
|
|
83
101
|
function TimeRangeProvider(props) {
|
|
84
|
-
const {
|
|
85
|
-
const
|
|
86
|
-
const
|
|
87
|
-
const [
|
|
102
|
+
const { timeRange, refreshInterval, children, setTimeRange, setRefreshInterval } = props;
|
|
103
|
+
const [localTimeRange, setLocalTimeRange] = (0, _react.useState)(timeRange);
|
|
104
|
+
const [localRefreshInterval, setLocalRefreshInterval] = (0, _react.useState)(refreshInterval);
|
|
105
|
+
const [refreshCounter, setRefreshCounter] = (0, _react.useState)(0);
|
|
106
|
+
(0, _react.useEffect)(()=>{
|
|
107
|
+
setLocalTimeRange(timeRange);
|
|
108
|
+
}, [
|
|
109
|
+
timeRange,
|
|
110
|
+
refreshCounter
|
|
111
|
+
]);
|
|
112
|
+
(0, _react.useEffect)(()=>{
|
|
113
|
+
setLocalRefreshInterval(refreshInterval);
|
|
114
|
+
}, [
|
|
115
|
+
refreshInterval
|
|
116
|
+
]);
|
|
88
117
|
const refresh = (0, _react.useCallback)(()=>{
|
|
89
|
-
|
|
118
|
+
setRefreshCounter((counter)=>counter + 1);
|
|
90
119
|
}, [
|
|
91
|
-
|
|
120
|
+
setRefreshCounter
|
|
92
121
|
]);
|
|
93
122
|
const ctx = (0, _react.useMemo)(()=>{
|
|
94
|
-
const absoluteTimeRange = (0, _core.isRelativeTimeRange)(
|
|
123
|
+
const absoluteTimeRange = (0, _core.isRelativeTimeRange)(localTimeRange) ? (0, _core.toAbsoluteTimeRange)(localTimeRange) : localTimeRange;
|
|
95
124
|
return {
|
|
96
|
-
timeRange,
|
|
97
|
-
setTimeRange,
|
|
125
|
+
timeRange: localTimeRange,
|
|
126
|
+
setTimeRange: setTimeRange !== null && setTimeRange !== void 0 ? setTimeRange : setLocalTimeRange,
|
|
98
127
|
absoluteTimeRange,
|
|
99
128
|
refresh,
|
|
100
|
-
refreshKey: `${absoluteTimeRange.start}:${absoluteTimeRange.end}:${
|
|
101
|
-
refreshInterval,
|
|
102
|
-
refreshIntervalInMs,
|
|
103
|
-
setRefreshInterval
|
|
129
|
+
refreshKey: `${absoluteTimeRange.start}:${absoluteTimeRange.end}:${localRefreshInterval}:${refreshCounter}`,
|
|
130
|
+
refreshInterval: localRefreshInterval,
|
|
131
|
+
refreshIntervalInMs: (0, _refreshinterval.getRefreshIntervalInMs)(localRefreshInterval),
|
|
132
|
+
setRefreshInterval: setRefreshInterval !== null && setRefreshInterval !== void 0 ? setRefreshInterval : setLocalRefreshInterval
|
|
104
133
|
};
|
|
105
134
|
}, [
|
|
106
|
-
|
|
135
|
+
localTimeRange,
|
|
107
136
|
setTimeRange,
|
|
108
137
|
refresh,
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
refreshIntervalInMs,
|
|
138
|
+
refreshCounter,
|
|
139
|
+
localRefreshInterval,
|
|
112
140
|
setRefreshInterval
|
|
113
141
|
]);
|
|
114
|
-
return /*#__PURE__*/ (0,
|
|
142
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsx)(TimeRangeContext.Provider, {
|
|
115
143
|
value: ctx,
|
|
116
144
|
children: children
|
|
117
145
|
});
|