@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,43 @@
|
|
|
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, "TimeRangeProviderWithQueryParams", {
|
|
18
|
+
enumerable: true,
|
|
19
|
+
get: function() {
|
|
20
|
+
return TimeRangeProviderWithQueryParams;
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
const _jsxruntime = require("react/jsx-runtime");
|
|
24
|
+
const _react = /*#__PURE__*/ _interop_require_default(require("react"));
|
|
25
|
+
const _TimeRangeProvider = require("./TimeRangeProvider");
|
|
26
|
+
const _queryparams = require("./query-params");
|
|
27
|
+
function _interop_require_default(obj) {
|
|
28
|
+
return obj && obj.__esModule ? obj : {
|
|
29
|
+
default: obj
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
function TimeRangeProviderWithQueryParams(props) {
|
|
33
|
+
const { initialTimeRange, initialRefreshInterval, children } = props;
|
|
34
|
+
const { timeRange, setTimeRange } = (0, _queryparams.useTimeRangeParams)(initialTimeRange);
|
|
35
|
+
const { refreshInterval, setRefreshInterval } = (0, _queryparams.useSetRefreshIntervalParams)(initialRefreshInterval);
|
|
36
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsx)(_TimeRangeProvider.TimeRangeProvider, {
|
|
37
|
+
timeRange: timeRange,
|
|
38
|
+
refreshInterval: refreshInterval,
|
|
39
|
+
setTimeRange: setTimeRange,
|
|
40
|
+
setRefreshInterval: setRefreshInterval,
|
|
41
|
+
children: children
|
|
42
|
+
});
|
|
43
|
+
}
|
|
@@ -14,16 +14,19 @@
|
|
|
14
14
|
Object.defineProperty(exports, "__esModule", {
|
|
15
15
|
value: true
|
|
16
16
|
});
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
17
|
+
_export_star(require("./TimeRangeProvider"), exports);
|
|
18
|
+
_export_star(require("./TimeRangeProviderWithQueryParams"), exports);
|
|
19
|
+
_export_star(require("./query-params"), exports);
|
|
20
|
+
function _export_star(from, to) {
|
|
20
21
|
Object.keys(from).forEach(function(k) {
|
|
21
|
-
if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k))
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
22
|
+
if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) {
|
|
23
|
+
Object.defineProperty(to, k, {
|
|
24
|
+
enumerable: true,
|
|
25
|
+
get: function() {
|
|
26
|
+
return from[k];
|
|
27
|
+
}
|
|
28
|
+
});
|
|
29
|
+
}
|
|
27
30
|
});
|
|
28
31
|
return from;
|
|
29
32
|
}
|
|
@@ -21,19 +21,37 @@ function _export(target, all) {
|
|
|
21
21
|
});
|
|
22
22
|
}
|
|
23
23
|
_export(exports, {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
24
|
+
TimeRangeParam: function() {
|
|
25
|
+
return TimeRangeParam;
|
|
26
|
+
},
|
|
27
|
+
decodeTimeRangeValue: function() {
|
|
28
|
+
return decodeTimeRangeValue;
|
|
29
|
+
},
|
|
30
|
+
encodeTimeRangeValue: function() {
|
|
31
|
+
return encodeTimeRangeValue;
|
|
32
|
+
},
|
|
33
|
+
refreshIntervalQueryConfig: function() {
|
|
34
|
+
return refreshIntervalQueryConfig;
|
|
35
|
+
},
|
|
36
|
+
timeRangeQueryConfig: function() {
|
|
37
|
+
return timeRangeQueryConfig;
|
|
38
|
+
},
|
|
39
|
+
useInitialRefreshInterval: function() {
|
|
40
|
+
return useInitialRefreshInterval;
|
|
41
|
+
},
|
|
42
|
+
useInitialTimeRange: function() {
|
|
43
|
+
return useInitialTimeRange;
|
|
44
|
+
},
|
|
45
|
+
useSetRefreshIntervalParams: function() {
|
|
46
|
+
return useSetRefreshIntervalParams;
|
|
47
|
+
},
|
|
48
|
+
useTimeRangeParams: function() {
|
|
49
|
+
return useTimeRangeParams;
|
|
50
|
+
}
|
|
33
51
|
});
|
|
34
52
|
const _react = require("react");
|
|
35
|
-
const
|
|
36
|
-
const
|
|
53
|
+
const _usequeryparams = require("use-query-params");
|
|
54
|
+
const _datefns = require("date-fns");
|
|
37
55
|
const _core = require("@perses-dev/core");
|
|
38
56
|
/* Interprets an encoded string and returns either the string or null/undefined if not available */ function getEncodedValue(input, allowEmptyString) {
|
|
39
57
|
if (input == null) {
|
|
@@ -61,7 +79,7 @@ function encodeTimeRangeValue(timeOptionValue) {
|
|
|
61
79
|
return timeOptionValue;
|
|
62
80
|
}
|
|
63
81
|
}
|
|
64
|
-
return ((0,
|
|
82
|
+
return ((0, _datefns.getUnixTime)(timeOptionValue) * 1000).toString();
|
|
65
83
|
}
|
|
66
84
|
function decodeTimeRangeValue(input) {
|
|
67
85
|
const paramString = getEncodedValue(input);
|
|
@@ -85,10 +103,10 @@ const refreshIntervalQueryConfig = {
|
|
|
85
103
|
refresh: TimeRangeParam
|
|
86
104
|
};
|
|
87
105
|
function useInitialTimeRange(dashboardDuration) {
|
|
88
|
-
const [query] = (0,
|
|
106
|
+
const [query] = (0, _usequeryparams.useQueryParams)(timeRangeQueryConfig, {
|
|
89
107
|
updateType: 'replaceIn'
|
|
90
108
|
});
|
|
91
|
-
const { start
|
|
109
|
+
const { start, end } = query;
|
|
92
110
|
return (0, _react.useMemo)(()=>{
|
|
93
111
|
let initialTimeRange = {
|
|
94
112
|
pastDuration: dashboardDuration
|
|
@@ -101,7 +119,7 @@ function useInitialTimeRange(dashboardDuration) {
|
|
|
101
119
|
initialTimeRange = {
|
|
102
120
|
pastDuration: startStr
|
|
103
121
|
};
|
|
104
|
-
} else if ((0,
|
|
122
|
+
} else if ((0, _datefns.isDate)(start) && (0, _datefns.isDate)(end)) {
|
|
105
123
|
initialTimeRange = {
|
|
106
124
|
start: start,
|
|
107
125
|
end: end
|
|
@@ -114,19 +132,16 @@ function useInitialTimeRange(dashboardDuration) {
|
|
|
114
132
|
dashboardDuration
|
|
115
133
|
]);
|
|
116
134
|
}
|
|
117
|
-
function
|
|
118
|
-
const [query, setQuery] = (0,
|
|
135
|
+
function useTimeRangeParams(initialTimeRange) {
|
|
136
|
+
const [query, setQuery] = (0, _usequeryparams.useQueryParams)(timeRangeQueryConfig, {
|
|
119
137
|
updateType: 'replaceIn'
|
|
120
138
|
});
|
|
121
139
|
// determine whether initial param had previously been populated to fix back btn
|
|
122
140
|
const [paramsLoaded, setParamsLoaded] = (0, _react.useState)(false);
|
|
123
|
-
|
|
124
|
-
// this occurs when enabledURLParams is set to false on TimeRangeProvider
|
|
125
|
-
const [timeRangeState, setTimeRangeState] = (0, _react.useState)(initialTimeRange);
|
|
126
|
-
const { start } = query;
|
|
141
|
+
const { start } = query;
|
|
127
142
|
(0, _react.useEffect)(()=>{
|
|
128
143
|
// when dashboard loaded with no params, default to dashboard duration
|
|
129
|
-
if (
|
|
144
|
+
if (!paramsLoaded && !start) {
|
|
130
145
|
if ((0, _core.isRelativeTimeRange)(initialTimeRange)) {
|
|
131
146
|
setQuery({
|
|
132
147
|
start: initialTimeRange.pastDuration,
|
|
@@ -137,7 +152,6 @@ function useSetTimeRangeParams(initialTimeRange, enabledURLParams = true) {
|
|
|
137
152
|
}
|
|
138
153
|
}, [
|
|
139
154
|
initialTimeRange,
|
|
140
|
-
enabledURLParams,
|
|
141
155
|
paramsLoaded,
|
|
142
156
|
start,
|
|
143
157
|
setQuery
|
|
@@ -154,22 +168,16 @@ function useSetTimeRangeParams(initialTimeRange, enabledURLParams = true) {
|
|
|
154
168
|
}, [
|
|
155
169
|
setQuery
|
|
156
170
|
]);
|
|
157
|
-
if (!enabledURLParams) {
|
|
158
|
-
return {
|
|
159
|
-
timeRange: timeRangeState,
|
|
160
|
-
setTimeRange: setTimeRangeState
|
|
161
|
-
};
|
|
162
|
-
}
|
|
163
171
|
return {
|
|
164
172
|
timeRange: initialTimeRange,
|
|
165
173
|
setTimeRange: setTimeRange
|
|
166
174
|
};
|
|
167
175
|
}
|
|
168
176
|
function useInitialRefreshInterval(dashboardDuration) {
|
|
169
|
-
const [query] = (0,
|
|
177
|
+
const [query] = (0, _usequeryparams.useQueryParams)(refreshIntervalQueryConfig, {
|
|
170
178
|
updateType: 'replaceIn'
|
|
171
179
|
});
|
|
172
|
-
const { refresh
|
|
180
|
+
const { refresh } = query;
|
|
173
181
|
return (0, _react.useMemo)(()=>{
|
|
174
182
|
let initialTimeRange = dashboardDuration;
|
|
175
183
|
if (!refresh) {
|
|
@@ -185,29 +193,16 @@ function useInitialRefreshInterval(dashboardDuration) {
|
|
|
185
193
|
refresh
|
|
186
194
|
]);
|
|
187
195
|
}
|
|
188
|
-
function
|
|
189
|
-
|
|
190
|
-
if (refreshInterval) {
|
|
191
|
-
const refreshIntervalDuration = (0, _core.parseDurationString)(refreshInterval);
|
|
192
|
-
if (refreshIntervalDuration && refreshIntervalDuration.seconds) {
|
|
193
|
-
refreshIntervalInMs = (refreshIntervalDuration === null || refreshIntervalDuration === void 0 ? void 0 : refreshIntervalDuration.seconds) * 1000;
|
|
194
|
-
}
|
|
195
|
-
}
|
|
196
|
-
return refreshIntervalInMs;
|
|
197
|
-
}
|
|
198
|
-
function useSetRefreshIntervalParams(initialRefreshInterval, enabledURLParams = true) {
|
|
199
|
-
const [query, setQuery] = (0, _useQueryParams.useQueryParams)(refreshIntervalQueryConfig, {
|
|
196
|
+
function useSetRefreshIntervalParams(initialRefreshInterval) {
|
|
197
|
+
const [query, setQuery] = (0, _usequeryparams.useQueryParams)(refreshIntervalQueryConfig, {
|
|
200
198
|
updateType: 'replaceIn'
|
|
201
199
|
});
|
|
202
200
|
// determine whether initial param had previously been populated to fix back btn
|
|
203
201
|
const [paramsLoaded, setParamsLoaded] = (0, _react.useState)(false);
|
|
204
|
-
|
|
205
|
-
// this occurs when enabledURLParams is set to false on TimeRangeProvider
|
|
206
|
-
const [refreshIntervalState, setRefreshIntervalState] = (0, _react.useState)(initialRefreshInterval);
|
|
207
|
-
const { refresh } = query;
|
|
202
|
+
const { refresh } = query;
|
|
208
203
|
(0, _react.useEffect)(()=>{
|
|
209
|
-
// when dashboard loaded with no params, default to dashboard
|
|
210
|
-
if (
|
|
204
|
+
// when dashboard loaded with no params, default to dashboard refresh interval
|
|
205
|
+
if (!paramsLoaded && !refresh) {
|
|
211
206
|
setQuery({
|
|
212
207
|
refresh: initialRefreshInterval
|
|
213
208
|
});
|
|
@@ -215,7 +210,6 @@ function useSetRefreshIntervalParams(initialRefreshInterval, enabledURLParams =
|
|
|
215
210
|
}
|
|
216
211
|
}, [
|
|
217
212
|
initialRefreshInterval,
|
|
218
|
-
enabledURLParams,
|
|
219
213
|
paramsLoaded,
|
|
220
214
|
refresh,
|
|
221
215
|
setQuery
|
|
@@ -225,16 +219,8 @@ function useSetRefreshIntervalParams(initialRefreshInterval, enabledURLParams =
|
|
|
225
219
|
}), [
|
|
226
220
|
setQuery
|
|
227
221
|
]);
|
|
228
|
-
if (!enabledURLParams) {
|
|
229
|
-
return {
|
|
230
|
-
refreshInterval: refreshIntervalState,
|
|
231
|
-
setRefreshInterval: setRefreshIntervalState,
|
|
232
|
-
refreshIntervalInMs: getRefreshIntervalInMs(refreshIntervalState)
|
|
233
|
-
};
|
|
234
|
-
}
|
|
235
222
|
return {
|
|
236
223
|
refreshInterval: initialRefreshInterval,
|
|
237
|
-
setRefreshInterval: setRefreshInterval
|
|
238
|
-
refreshIntervalInMs: getRefreshIntervalInMs(initialRefreshInterval)
|
|
224
|
+
setRefreshInterval: setRefreshInterval
|
|
239
225
|
};
|
|
240
226
|
}
|
|
@@ -0,0 +1,30 @@
|
|
|
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, "getRefreshIntervalInMs", {
|
|
18
|
+
enumerable: true,
|
|
19
|
+
get: function() {
|
|
20
|
+
return getRefreshIntervalInMs;
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
const _core = require("@perses-dev/core");
|
|
24
|
+
const _datefns = require("date-fns");
|
|
25
|
+
function getRefreshIntervalInMs(refreshInterval) {
|
|
26
|
+
if (refreshInterval !== undefined && refreshInterval !== null) {
|
|
27
|
+
return (0, _datefns.milliseconds)((0, _core.parseDurationString)(refreshInterval));
|
|
28
|
+
}
|
|
29
|
+
return 0;
|
|
30
|
+
}
|
|
@@ -0,0 +1,81 @@
|
|
|
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
|
+
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
|
+
BuiltinVariableContext: function() {
|
|
25
|
+
return BuiltinVariableContext;
|
|
26
|
+
},
|
|
27
|
+
useBuiltinVariableContext: function() {
|
|
28
|
+
return useBuiltinVariableContext;
|
|
29
|
+
},
|
|
30
|
+
useBuiltinVariableDefinitions: function() {
|
|
31
|
+
return useBuiltinVariableDefinitions;
|
|
32
|
+
},
|
|
33
|
+
useBuiltinVariableValues: function() {
|
|
34
|
+
return useBuiltinVariableValues;
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
const _react = require("react");
|
|
38
|
+
const BuiltinVariableContext = (0, _react.createContext)(undefined);
|
|
39
|
+
function useBuiltinVariableContext() {
|
|
40
|
+
const ctx = (0, _react.useContext)(BuiltinVariableContext);
|
|
41
|
+
if (ctx === undefined) {
|
|
42
|
+
throw new Error('No BuiltinVariableContext found. Did you forget a Provider?');
|
|
43
|
+
}
|
|
44
|
+
return ctx;
|
|
45
|
+
}
|
|
46
|
+
function useBuiltinVariableValues(names) {
|
|
47
|
+
const { variables } = useBuiltinVariableContext();
|
|
48
|
+
const states = (0, _react.useMemo)(()=>{
|
|
49
|
+
const values = {};
|
|
50
|
+
for (const variable of variables){
|
|
51
|
+
values[variable.spec.name] = {
|
|
52
|
+
loading: false,
|
|
53
|
+
value: variable.spec.value()
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
return values;
|
|
57
|
+
}, [
|
|
58
|
+
variables
|
|
59
|
+
]);
|
|
60
|
+
const values = (0, _react.useMemo)(()=>{
|
|
61
|
+
const values = {};
|
|
62
|
+
names === null || names === void 0 ? void 0 : names.forEach((name)=>{
|
|
63
|
+
const s = states[name];
|
|
64
|
+
if (s) {
|
|
65
|
+
values[name] = s;
|
|
66
|
+
}
|
|
67
|
+
});
|
|
68
|
+
return values;
|
|
69
|
+
}, [
|
|
70
|
+
names,
|
|
71
|
+
states
|
|
72
|
+
]);
|
|
73
|
+
if (names === undefined) {
|
|
74
|
+
return states;
|
|
75
|
+
}
|
|
76
|
+
return values;
|
|
77
|
+
}
|
|
78
|
+
function useBuiltinVariableDefinitions() {
|
|
79
|
+
const { variables } = useBuiltinVariableContext();
|
|
80
|
+
return variables;
|
|
81
|
+
}
|
|
@@ -21,12 +21,23 @@ function _export(target, all) {
|
|
|
21
21
|
});
|
|
22
22
|
}
|
|
23
23
|
_export(exports, {
|
|
24
|
-
DatasourceStoreContext: ()
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
24
|
+
DatasourceStoreContext: function() {
|
|
25
|
+
return DatasourceStoreContext;
|
|
26
|
+
},
|
|
27
|
+
useDatasource: function() {
|
|
28
|
+
return useDatasource;
|
|
29
|
+
},
|
|
30
|
+
useDatasourceClient: function() {
|
|
31
|
+
return useDatasourceClient;
|
|
32
|
+
},
|
|
33
|
+
useDatasourceStore: function() {
|
|
34
|
+
return useDatasourceStore;
|
|
35
|
+
},
|
|
36
|
+
useListDatasourceSelectItems: function() {
|
|
37
|
+
return useListDatasourceSelectItems;
|
|
38
|
+
}
|
|
28
39
|
});
|
|
29
|
-
const
|
|
40
|
+
const _reactquery = require("@tanstack/react-query");
|
|
30
41
|
const _react = require("react");
|
|
31
42
|
const DatasourceStoreContext = (0, _react.createContext)(undefined);
|
|
32
43
|
function useDatasourceStore() {
|
|
@@ -36,17 +47,25 @@ function useDatasourceStore() {
|
|
|
36
47
|
}
|
|
37
48
|
return ctx;
|
|
38
49
|
}
|
|
39
|
-
function
|
|
40
|
-
const {
|
|
41
|
-
return (0,
|
|
42
|
-
'
|
|
43
|
-
datasourcePluginKind
|
|
44
|
-
|
|
50
|
+
function useListDatasourceSelectItems(datasourcePluginKind, project) {
|
|
51
|
+
const { listDatasourceSelectItems } = useDatasourceStore();
|
|
52
|
+
return (0, _reactquery.useQuery)([
|
|
53
|
+
'listDatasourceSelectItems',
|
|
54
|
+
datasourcePluginKind,
|
|
55
|
+
project
|
|
56
|
+
], ()=>listDatasourceSelectItems(datasourcePluginKind));
|
|
45
57
|
}
|
|
46
58
|
function useDatasourceClient(selector) {
|
|
47
59
|
const store = useDatasourceStore();
|
|
48
|
-
return (0,
|
|
60
|
+
return (0, _reactquery.useQuery)([
|
|
49
61
|
'getDatasourceClient',
|
|
50
62
|
selector
|
|
51
63
|
], ()=>store.getDatasourceClient(selector));
|
|
52
64
|
}
|
|
65
|
+
function useDatasource(selector) {
|
|
66
|
+
const store = useDatasourceStore();
|
|
67
|
+
return (0, _reactquery.useQuery)([
|
|
68
|
+
'getDatasource',
|
|
69
|
+
selector
|
|
70
|
+
], ()=>store.getDatasource(selector));
|
|
71
|
+
}
|
|
@@ -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("./builtin-variables"), exports);
|
|
18
|
+
_export_star(require("./datasources"), exports);
|
|
19
|
+
_export_star(require("./plugin-registry"), exports);
|
|
20
|
+
_export_star(require("./template-variables"), exports);
|
|
21
|
+
_export_star(require("./TimeRangeProvider"), exports);
|
|
22
|
+
_export_star(require("./time-series-queries"), exports);
|
|
23
|
+
_export_star(require("./trace-queries"), exports);
|
|
24
|
+
_export_star(require("./DataQueriesProvider"), 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
|
}
|
|
@@ -21,14 +21,27 @@ function _export(target, all) {
|
|
|
21
21
|
});
|
|
22
22
|
}
|
|
23
23
|
_export(exports, {
|
|
24
|
-
PluginRegistryContext: ()
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
24
|
+
PluginRegistryContext: function() {
|
|
25
|
+
return PluginRegistryContext;
|
|
26
|
+
},
|
|
27
|
+
useListPluginMetadata: function() {
|
|
28
|
+
return useListPluginMetadata;
|
|
29
|
+
},
|
|
30
|
+
usePlugin: function() {
|
|
31
|
+
return usePlugin;
|
|
32
|
+
},
|
|
33
|
+
usePluginBuiltinVariableDefinitions: function() {
|
|
34
|
+
return usePluginBuiltinVariableDefinitions;
|
|
35
|
+
},
|
|
36
|
+
usePluginRegistry: function() {
|
|
37
|
+
return usePluginRegistry;
|
|
38
|
+
},
|
|
39
|
+
usePlugins: function() {
|
|
40
|
+
return usePlugins;
|
|
41
|
+
}
|
|
29
42
|
});
|
|
30
43
|
const _react = require("react");
|
|
31
|
-
const
|
|
44
|
+
const _reactquery = require("@tanstack/react-query");
|
|
32
45
|
const PluginRegistryContext = (0, _react.createContext)(undefined);
|
|
33
46
|
function usePluginRegistry() {
|
|
34
47
|
const ctx = (0, _react.useContext)(PluginRegistryContext);
|
|
@@ -38,22 +51,22 @@ function usePluginRegistry() {
|
|
|
38
51
|
return ctx;
|
|
39
52
|
}
|
|
40
53
|
function usePlugin(pluginType, kind, options) {
|
|
41
|
-
var
|
|
54
|
+
var _options_enabled;
|
|
42
55
|
// We never want to ask for a plugin when the kind isn't set yet, so disable those queries automatically
|
|
43
56
|
options = {
|
|
44
57
|
...options,
|
|
45
|
-
enabled: ((
|
|
58
|
+
enabled: ((_options_enabled = options === null || options === void 0 ? void 0 : options.enabled) !== null && _options_enabled !== void 0 ? _options_enabled : true) && kind !== ''
|
|
46
59
|
};
|
|
47
|
-
const { getPlugin
|
|
48
|
-
return (0,
|
|
60
|
+
const { getPlugin } = usePluginRegistry();
|
|
61
|
+
return (0, _reactquery.useQuery)([
|
|
49
62
|
'getPlugin',
|
|
50
63
|
pluginType,
|
|
51
64
|
kind
|
|
52
65
|
], ()=>getPlugin(pluginType, kind), options);
|
|
53
66
|
}
|
|
54
67
|
function usePlugins(pluginType, plugins) {
|
|
55
|
-
const { getPlugin
|
|
56
|
-
return (0,
|
|
68
|
+
const { getPlugin } = usePluginRegistry();
|
|
69
|
+
return (0, _reactquery.useQueries)({
|
|
57
70
|
queries: plugins.map((p)=>{
|
|
58
71
|
return {
|
|
59
72
|
queryKey: [
|
|
@@ -67,9 +80,26 @@ function usePlugins(pluginType, plugins) {
|
|
|
67
80
|
});
|
|
68
81
|
}
|
|
69
82
|
function useListPluginMetadata(pluginType, options) {
|
|
70
|
-
const { listPluginMetadata
|
|
71
|
-
return (0,
|
|
83
|
+
const { listPluginMetadata } = usePluginRegistry();
|
|
84
|
+
return (0, _reactquery.useQuery)([
|
|
72
85
|
'listPluginMetadata',
|
|
73
86
|
pluginType
|
|
74
87
|
], ()=>listPluginMetadata(pluginType), options);
|
|
75
88
|
}
|
|
89
|
+
function usePluginBuiltinVariableDefinitions() {
|
|
90
|
+
const { getPlugin, listPluginMetadata } = usePluginRegistry();
|
|
91
|
+
return (0, _reactquery.useQuery)([
|
|
92
|
+
'usePluginBuiltinVariableDefinitions'
|
|
93
|
+
], async ()=>{
|
|
94
|
+
const datasources = await listPluginMetadata('Datasource');
|
|
95
|
+
const datasourceKinds = new Set(datasources.map((datasource)=>datasource.kind));
|
|
96
|
+
const result = [];
|
|
97
|
+
for (const kind of datasourceKinds){
|
|
98
|
+
const plugin = await getPlugin('Datasource', kind);
|
|
99
|
+
if (plugin.getBuiltinVariableDefinitions) {
|
|
100
|
+
plugin.getBuiltinVariableDefinitions().forEach((definition)=>result.push(definition));
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
return result;
|
|
104
|
+
});
|
|
105
|
+
}
|