@perses-dev/plugin-system 0.38.0 → 0.40.0
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 +6 -4
- package/dist/cjs/components/CalculationSelector/index.js +10 -8
- package/dist/cjs/components/DatasourceEditorForm/DatasourceEditorForm.js +380 -0
- package/dist/cjs/components/DatasourceEditorForm/index.js +30 -0
- package/dist/cjs/components/DatasourceSelect.js +119 -21
- package/dist/cjs/components/LegendOptionsEditor/LegendOptionsEditor.js +18 -16
- package/dist/cjs/components/LegendOptionsEditor/index.js +10 -8
- package/dist/cjs/components/OptionsEditorRadios/OptionsEditorRadios.js +69 -0
- package/dist/cjs/components/OptionsEditorRadios/index.js +30 -0
- package/dist/cjs/components/{OptionsEditorTabs/TabPanel.js → OptionsEditorTabPanel/OptionsEditorTabPanel.js} +8 -6
- package/dist/cjs/components/OptionsEditorTabPanel/index.js +30 -0
- package/dist/cjs/components/OptionsEditorTabs/OptionsEditorTabs.js +10 -8
- package/dist/cjs/components/OptionsEditorTabs/index.js +10 -8
- package/dist/cjs/components/PanelSpecEditor/PanelSpecEditor.js +13 -11
- package/dist/cjs/components/PanelSpecEditor/index.js +10 -8
- package/dist/cjs/components/PluginEditor/PluginEditor.js +24 -31
- package/dist/cjs/components/PluginEditor/index.js +11 -9
- package/dist/cjs/components/PluginEditor/plugin-editor-api.js +5 -3
- package/dist/cjs/components/PluginKindSelect/PluginKindSelect.js +23 -12
- 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 +6 -2
- package/dist/cjs/components/PluginSpecEditor/PluginSpecEditor.js +6 -4
- package/dist/cjs/components/PluginSpecEditor/index.js +10 -8
- package/dist/cjs/components/TimeSeriesQueryEditor/TimeSeriesQueryEditor.js +15 -13
- package/dist/cjs/components/TimeSeriesQueryEditor/TimeSeriesQueryInput.js +21 -19
- package/dist/cjs/components/TimeSeriesQueryEditor/index.js +10 -8
- package/dist/cjs/components/Variables/VariableEditorForm/VariableEditorForm.js +256 -166
- package/dist/cjs/components/Variables/VariableEditorForm/VariablePreview.js +32 -28
- package/dist/cjs/components/Variables/VariableEditorForm/index.js +11 -9
- package/dist/cjs/components/Variables/VariableEditorForm/variable-editor-form-model.js +28 -32
- package/dist/cjs/components/Variables/index.js +11 -9
- package/dist/cjs/components/Variables/variable-model.js +17 -9
- package/dist/cjs/components/index.js +22 -18
- package/dist/cjs/constants/index.js +10 -8
- package/dist/cjs/constants/user-interface-text.js +3 -1
- package/dist/cjs/index.js +16 -13
- package/dist/cjs/model/index.js +17 -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/runtime/DataQueriesProvider/DataQueriesProvider.js +55 -35
- package/dist/cjs/runtime/DataQueriesProvider/index.js +11 -9
- package/dist/cjs/runtime/DataQueriesProvider/model.js +61 -0
- package/dist/cjs/runtime/TimeRangeProvider/TimeRangeProvider.js +19 -11
- package/dist/cjs/runtime/TimeRangeProvider/index.js +11 -9
- package/dist/cjs/runtime/TimeRangeProvider/query-params.js +36 -18
- package/dist/cjs/runtime/builtin-variables.js +81 -0
- package/dist/cjs/runtime/datasources.js +29 -11
- package/dist/cjs/runtime/index.js +16 -13
- package/dist/cjs/runtime/plugin-registry.js +41 -11
- package/dist/cjs/runtime/template-variables.js +96 -4
- package/dist/cjs/runtime/time-series-queries.js +39 -27
- package/dist/cjs/stories/shared-utils/decorators/WithDataQueries.js +7 -5
- package/dist/cjs/stories/shared-utils/decorators/WithPluginRegistry.js +16 -14
- package/dist/cjs/stories/shared-utils/decorators/WithPluginSystemBuiltinVariables.js +42 -0
- package/dist/cjs/stories/shared-utils/decorators/WithPluginSystemDatasourceStore.js +19 -13
- package/dist/cjs/stories/shared-utils/decorators/WithPluginSystemTemplateVariables.js +6 -4
- package/dist/cjs/stories/shared-utils/decorators/WithTimeRange.js +7 -5
- 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 +57 -0
- package/dist/cjs/test/render.js +13 -11
- package/dist/cjs/test/test-plugins/bert/index.js +14 -10
- package/dist/cjs/test/test-plugins/ernie/index.js +13 -9
- package/dist/cjs/test/test-plugins/index.js +11 -9
- package/dist/cjs/test-utils/index.js +10 -8
- package/dist/cjs/test-utils/mock-plugin-registry.js +8 -4
- 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/index.js +32 -0
- package/dist/cjs/validation/resource.js +24 -0
- package/dist/cjs/validation/variable.js +29 -0
- 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 +15 -0
- package/dist/components/DatasourceEditorForm/DatasourceEditorForm.d.ts.map +1 -0
- package/dist/components/DatasourceEditorForm/DatasourceEditorForm.js +333 -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 +5 -0
- package/dist/components/DatasourceSelect.d.ts.map +1 -1
- package/dist/components/DatasourceSelect.js +102 -19
- package/dist/components/DatasourceSelect.js.map +1 -1
- package/dist/components/LegendOptionsEditor/LegendOptionsEditor.js +2 -2
- 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 +16 -0
- package/dist/components/OptionsEditorRadios/OptionsEditorRadios.d.ts.map +1 -0
- package/dist/components/OptionsEditorRadios/OptionsEditorRadios.js +61 -0
- package/dist/components/OptionsEditorRadios/OptionsEditorRadios.js.map +1 -0
- package/dist/components/OptionsEditorRadios/index.d.ts +2 -0
- package/dist/components/OptionsEditorRadios/index.d.ts.map +1 -0
- package/dist/components/OptionsEditorRadios/index.js +15 -0
- package/dist/components/OptionsEditorRadios/index.js.map +1 -0
- package/dist/components/OptionsEditorTabPanel/OptionsEditorTabPanel.d.ts +9 -0
- package/dist/components/OptionsEditorTabPanel/OptionsEditorTabPanel.d.ts.map +1 -0
- package/dist/components/{OptionsEditorTabs/TabPanel.js → OptionsEditorTabPanel/OptionsEditorTabPanel.js} +2 -2
- package/dist/components/OptionsEditorTabPanel/OptionsEditorTabPanel.js.map +1 -0
- package/dist/components/OptionsEditorTabPanel/index.d.ts +2 -0
- package/dist/components/OptionsEditorTabPanel/index.d.ts.map +1 -0
- package/dist/components/OptionsEditorTabPanel/index.js +15 -0
- package/dist/components/OptionsEditorTabPanel/index.js.map +1 -0
- package/dist/components/OptionsEditorTabs/OptionsEditorTabs.js +2 -2
- package/dist/components/OptionsEditorTabs/OptionsEditorTabs.js.map +1 -1
- package/dist/components/OptionsEditorTabs/index.js.map +1 -1
- package/dist/components/PanelSpecEditor/PanelSpecEditor.js +2 -2
- package/dist/components/PanelSpecEditor/PanelSpecEditor.js.map +1 -1
- package/dist/components/PanelSpecEditor/index.js.map +1 -1
- package/dist/components/PluginEditor/PluginEditor.js +15 -24
- 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 +1 -1
- package/dist/components/PluginEditor/plugin-editor-api.js +2 -2
- 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 +21 -12
- package/dist/components/PluginKindSelect/PluginKindSelect.js.map +1 -1
- package/dist/components/PluginKindSelect/index.js.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.map +1 -1
- package/dist/components/PluginSpecEditor/PluginSpecEditor.js.map +1 -1
- package/dist/components/PluginSpecEditor/index.js.map +1 -1
- package/dist/components/TimeSeriesQueryEditor/TimeSeriesQueryEditor.js +4 -4
- package/dist/components/TimeSeriesQueryEditor/TimeSeriesQueryEditor.js.map +1 -1
- package/dist/components/TimeSeriesQueryEditor/TimeSeriesQueryInput.js +1 -1
- package/dist/components/TimeSeriesQueryEditor/TimeSeriesQueryInput.js.map +1 -1
- package/dist/components/TimeSeriesQueryEditor/index.js.map +1 -1
- package/dist/components/Variables/VariableEditorForm/VariableEditorForm.d.ts +10 -7
- package/dist/components/Variables/VariableEditorForm/VariableEditorForm.d.ts.map +1 -1
- package/dist/components/Variables/VariableEditorForm/VariableEditorForm.js +200 -112
- package/dist/components/Variables/VariableEditorForm/VariableEditorForm.js.map +1 -1
- 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 +5 -4
- package/dist/components/Variables/VariableEditorForm/variable-editor-form-model.d.ts.map +1 -1
- package/dist/components/Variables/VariableEditorForm/variable-editor-form-model.js +22 -30
- 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.js +3 -3
- package/dist/components/Variables/variable-model.js.map +1 -1
- package/dist/components/index.d.ts +2 -0
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/index.js +2 -0
- package/dist/components/index.js.map +1 -1
- package/dist/constants/index.js.map +1 -1
- package/dist/constants/user-interface-text.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -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.map +1 -1
- package/dist/model/index.js.map +1 -1
- package/dist/model/legend.d.ts +1 -1
- 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.js.map +1 -1
- package/dist/model/plugin-base.js.map +1 -1
- package/dist/model/plugin-loading.js.map +1 -1
- package/dist/runtime/DataQueriesProvider/DataQueriesProvider.d.ts +5 -5
- package/dist/runtime/DataQueriesProvider/DataQueriesProvider.d.ts.map +1 -1
- package/dist/runtime/DataQueriesProvider/DataQueriesProvider.js +40 -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 +17 -12
- package/dist/runtime/DataQueriesProvider/model.d.ts.map +1 -1
- package/dist/runtime/DataQueriesProvider/model.js +47 -1
- package/dist/runtime/DataQueriesProvider/model.js.map +1 -1
- package/dist/runtime/TimeRangeProvider/TimeRangeProvider.js.map +1 -1
- package/dist/runtime/TimeRangeProvider/index.js.map +1 -1
- package/dist/runtime/TimeRangeProvider/query-params.js +1 -1
- package/dist/runtime/TimeRangeProvider/query-params.js.map +1 -1
- 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 +14 -6
- package/dist/runtime/datasources.d.ts.map +1 -1
- package/dist/runtime/datasources.js +13 -6
- package/dist/runtime/datasources.js.map +1 -1
- package/dist/runtime/index.d.ts +1 -0
- package/dist/runtime/index.d.ts.map +1 -1
- package/dist/runtime/index.js +1 -0
- package/dist/runtime/index.js.map +1 -1
- package/dist/runtime/plugin-registry.d.ts +2 -0
- package/dist/runtime/plugin-registry.d.ts.map +1 -1
- package/dist/runtime/plugin-registry.js +19 -2
- package/dist/runtime/plugin-registry.js.map +1 -1
- package/dist/runtime/template-variables.d.ts +62 -2
- package/dist/runtime/template-variables.d.ts.map +1 -1
- package/dist/runtime/template-variables.js +83 -1
- 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 +14 -12
- package/dist/runtime/time-series-queries.js.map +1 -1
- package/dist/stories/shared-utils/decorators/WithDataQueries.js.map +1 -1
- package/dist/stories/shared-utils/decorators/WithPluginRegistry.js.map +1 -1
- package/dist/stories/shared-utils/decorators/WithPluginSystemBuiltinVariables.d.ts +13 -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.map +1 -1
- package/dist/stories/shared-utils/decorators/WithPluginSystemDatasourceStore.js +11 -7
- package/dist/stories/shared-utils/decorators/WithPluginSystemDatasourceStore.js.map +1 -1
- package/dist/stories/shared-utils/decorators/WithPluginSystemTemplateVariables.js.map +1 -1
- 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 +3 -0
- package/dist/test/mock-data.d.ts.map +1 -0
- package/dist/test/mock-data.js +49 -0
- package/dist/test/mock-data.js.map +1 -0
- 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.map +1 -1
- 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.js +2 -2
- 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/index.d.ts +4 -0
- package/dist/validation/index.d.ts.map +1 -0
- package/dist/validation/index.js +17 -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/variable.d.ts +19 -0
- package/dist/validation/variable.d.ts.map +1 -0
- package/dist/validation/variable.js +21 -0
- package/dist/validation/variable.js.map +1 -0
- package/package.json +8 -6
- package/dist/components/OptionsEditorTabs/TabPanel.d.ts +0 -9
- package/dist/components/OptionsEditorTabs/TabPanel.d.ts.map +0 -1
- package/dist/components/OptionsEditorTabs/TabPanel.js.map +0 -1
|
@@ -21,18 +21,23 @@ function _export(target, all) {
|
|
|
21
21
|
});
|
|
22
22
|
}
|
|
23
23
|
_export(exports, {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
24
|
+
DataQueriesContext: function() {
|
|
25
|
+
return DataQueriesContext;
|
|
26
|
+
},
|
|
27
|
+
useDataQueriesContext: function() {
|
|
28
|
+
return useDataQueriesContext;
|
|
29
|
+
},
|
|
30
|
+
useDataQueries: function() {
|
|
31
|
+
return useDataQueries;
|
|
32
|
+
},
|
|
33
|
+
DataQueriesProvider: function() {
|
|
34
|
+
return DataQueriesProvider;
|
|
35
|
+
}
|
|
28
36
|
});
|
|
29
|
-
const
|
|
37
|
+
const _jsxruntime = require("react/jsx-runtime");
|
|
30
38
|
const _react = require("react");
|
|
31
|
-
const
|
|
32
|
-
|
|
33
|
-
const ctx = useDataQueriesContext();
|
|
34
|
-
return ctx;
|
|
35
|
-
}
|
|
39
|
+
const _timeseriesqueries = require("../time-series-queries");
|
|
40
|
+
const _model = require("./model");
|
|
36
41
|
const DataQueriesContext = /*#__PURE__*/ (0, _react.createContext)(undefined);
|
|
37
42
|
function useDataQueriesContext() {
|
|
38
43
|
const ctx = (0, _react.useContext)(DataQueriesContext);
|
|
@@ -41,47 +46,62 @@ function useDataQueriesContext() {
|
|
|
41
46
|
}
|
|
42
47
|
return ctx;
|
|
43
48
|
}
|
|
49
|
+
function useDataQueries(queryType) {
|
|
50
|
+
const ctx = useDataQueriesContext();
|
|
51
|
+
// Filter the query results based on the specified query type
|
|
52
|
+
const filteredQueryResults = ctx.queryResults.filter((queryResult)=>queryResult.definition.kind === queryType);
|
|
53
|
+
// Filter the errors based on the specified query type
|
|
54
|
+
const filteredErrors = ctx.errors.filter((errors, index)=>{
|
|
55
|
+
var _ctx_queryResults_index;
|
|
56
|
+
return ((_ctx_queryResults_index = ctx.queryResults[index]) === null || _ctx_queryResults_index === void 0 ? void 0 : _ctx_queryResults_index.definition.kind) === queryType;
|
|
57
|
+
});
|
|
58
|
+
// Create a new context object with the filtered results and errors
|
|
59
|
+
const filteredCtx = {
|
|
60
|
+
queryResults: filteredQueryResults,
|
|
61
|
+
isFetching: filteredQueryResults.some((result)=>result.isFetching),
|
|
62
|
+
isLoading: filteredQueryResults.some((result)=>result.isLoading),
|
|
63
|
+
refetchAll: ctx.refetchAll,
|
|
64
|
+
errors: filteredErrors
|
|
65
|
+
};
|
|
66
|
+
return filteredCtx;
|
|
67
|
+
}
|
|
44
68
|
function DataQueriesProvider(props) {
|
|
45
|
-
const { definitions , options , children } = props;
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
kind:
|
|
69
|
+
const { definitions , options , children , queryOptions } = props;
|
|
70
|
+
const getQueryType = (0, _model.useQueryType)();
|
|
71
|
+
const queryDefinitions = definitions.map((definition)=>{
|
|
72
|
+
const type = getQueryType(definition.kind);
|
|
73
|
+
return {
|
|
74
|
+
kind: type,
|
|
51
75
|
spec: {
|
|
52
76
|
plugin: definition
|
|
53
77
|
}
|
|
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
78
|
};
|
|
65
79
|
});
|
|
80
|
+
// Filter definitions for time series query and other future query plugins
|
|
81
|
+
const timeSeriesQueries = queryDefinitions.filter((definition)=>definition.kind === 'TimeSeriesQuery');
|
|
82
|
+
const timeSeriesResults = (0, _timeseriesqueries.useTimeSeriesQueries)(timeSeriesQueries, options, queryOptions);
|
|
66
83
|
const refetchAll = (0, _react.useCallback)(()=>{
|
|
67
|
-
|
|
84
|
+
timeSeriesResults.forEach((result)=>result.refetch());
|
|
68
85
|
}, [
|
|
69
|
-
|
|
86
|
+
timeSeriesResults
|
|
70
87
|
]);
|
|
71
88
|
const ctx = (0, _react.useMemo)(()=>{
|
|
89
|
+
const mergedQueryResults = [
|
|
90
|
+
...(0, _model.transformQueryResults)(timeSeriesResults, timeSeriesQueries)
|
|
91
|
+
];
|
|
72
92
|
return {
|
|
73
|
-
queryResults:
|
|
74
|
-
isFetching:
|
|
75
|
-
isLoading:
|
|
93
|
+
queryResults: mergedQueryResults,
|
|
94
|
+
isFetching: mergedQueryResults.some((result)=>result.isFetching),
|
|
95
|
+
isLoading: mergedQueryResults.some((result)=>result.isLoading),
|
|
76
96
|
refetchAll,
|
|
77
|
-
errors:
|
|
97
|
+
errors: mergedQueryResults.map((result)=>result.error)
|
|
78
98
|
};
|
|
79
99
|
}, [
|
|
80
|
-
|
|
81
|
-
|
|
100
|
+
timeSeriesQueries,
|
|
101
|
+
timeSeriesResults,
|
|
82
102
|
refetchAll
|
|
83
103
|
]);
|
|
84
|
-
return /*#__PURE__*/ (0,
|
|
104
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsx)(DataQueriesContext.Provider, {
|
|
85
105
|
value: ctx,
|
|
86
106
|
children: children
|
|
87
107
|
});
|
|
@@ -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,64 @@
|
|
|
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 } = (0, _pluginregistry.useListPluginMetadata)('TimeSeriesQuery');
|
|
47
|
+
const queryTypeMap = (0, _react.useMemo)(()=>{
|
|
48
|
+
const map = {
|
|
49
|
+
TimeSeriesQuery: []
|
|
50
|
+
};
|
|
51
|
+
if (timeSeriesQueryPlugins) {
|
|
52
|
+
timeSeriesQueryPlugins.forEach((plugin)=>{
|
|
53
|
+
var _map_TimeSeriesQuery;
|
|
54
|
+
(_map_TimeSeriesQuery = map['TimeSeriesQuery']) === null || _map_TimeSeriesQuery === void 0 ? void 0 : _map_TimeSeriesQuery.push(plugin.kind);
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
return map;
|
|
58
|
+
}, [
|
|
59
|
+
timeSeriesQueryPlugins
|
|
60
|
+
]);
|
|
61
|
+
const getQueryType = (0, _react.useCallback)((pluginKind)=>{
|
|
62
|
+
if (isLoading) {
|
|
63
|
+
return undefined;
|
|
64
|
+
}
|
|
65
|
+
for(const queryType in queryTypeMap){
|
|
66
|
+
var _queryTypeMap_queryType;
|
|
67
|
+
if ((_queryTypeMap_queryType = queryTypeMap[queryType]) === null || _queryTypeMap_queryType === void 0 ? void 0 : _queryTypeMap_queryType.includes(pluginKind)) {
|
|
68
|
+
return queryType;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
throw new Error(`Unable to determine the query type: ${pluginKind}`);
|
|
72
|
+
}, [
|
|
73
|
+
queryTypeMap,
|
|
74
|
+
isLoading
|
|
75
|
+
]);
|
|
76
|
+
return getQueryType;
|
|
77
|
+
}
|
|
@@ -21,15 +21,23 @@ function _export(target, all) {
|
|
|
21
21
|
});
|
|
22
22
|
}
|
|
23
23
|
_export(exports, {
|
|
24
|
-
TimeRangeContext: ()
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
24
|
+
TimeRangeContext: function() {
|
|
25
|
+
return TimeRangeContext;
|
|
26
|
+
},
|
|
27
|
+
useTimeRangeContext: function() {
|
|
28
|
+
return useTimeRangeContext;
|
|
29
|
+
},
|
|
30
|
+
useTimeRange: function() {
|
|
31
|
+
return useTimeRange;
|
|
32
|
+
},
|
|
33
|
+
TimeRangeProvider: function() {
|
|
34
|
+
return TimeRangeProvider;
|
|
35
|
+
}
|
|
28
36
|
});
|
|
29
|
-
const
|
|
30
|
-
const _react = /*#__PURE__*/
|
|
37
|
+
const _jsxruntime = require("react/jsx-runtime");
|
|
38
|
+
const _react = /*#__PURE__*/ _interop_require_wildcard(require("react"));
|
|
31
39
|
const _core = require("@perses-dev/core");
|
|
32
|
-
const
|
|
40
|
+
const _queryparams = require("./query-params");
|
|
33
41
|
function _getRequireWildcardCache(nodeInterop) {
|
|
34
42
|
if (typeof WeakMap !== "function") return null;
|
|
35
43
|
var cacheBabelInterop = new WeakMap();
|
|
@@ -38,7 +46,7 @@ function _getRequireWildcardCache(nodeInterop) {
|
|
|
38
46
|
return nodeInterop ? cacheNodeInterop : cacheBabelInterop;
|
|
39
47
|
})(nodeInterop);
|
|
40
48
|
}
|
|
41
|
-
function
|
|
49
|
+
function _interop_require_wildcard(obj, nodeInterop) {
|
|
42
50
|
if (!nodeInterop && obj && obj.__esModule) {
|
|
43
51
|
return obj;
|
|
44
52
|
}
|
|
@@ -82,8 +90,8 @@ function useTimeRange() {
|
|
|
82
90
|
}
|
|
83
91
|
function TimeRangeProvider(props) {
|
|
84
92
|
const { initialTimeRange , initialRefreshInterval , enabledURLParams , children } = props;
|
|
85
|
-
const { timeRange , setTimeRange } = (0,
|
|
86
|
-
const { refreshInterval , setRefreshInterval , refreshIntervalInMs } = (0,
|
|
93
|
+
const { timeRange , setTimeRange } = (0, _queryparams.useSetTimeRangeParams)(initialTimeRange, enabledURLParams);
|
|
94
|
+
const { refreshInterval , setRefreshInterval , refreshIntervalInMs } = (0, _queryparams.useSetRefreshIntervalParams)(initialRefreshInterval, enabledURLParams);
|
|
87
95
|
const [refreshKey, setRefreshKey] = (0, _react.useState)(0);
|
|
88
96
|
const refresh = (0, _react.useCallback)(()=>{
|
|
89
97
|
setRefreshKey(refreshKey + 1);
|
|
@@ -111,7 +119,7 @@ function TimeRangeProvider(props) {
|
|
|
111
119
|
refreshIntervalInMs,
|
|
112
120
|
setRefreshInterval
|
|
113
121
|
]);
|
|
114
|
-
return /*#__PURE__*/ (0,
|
|
122
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsx)(TimeRangeContext.Provider, {
|
|
115
123
|
value: ctx,
|
|
116
124
|
children: children
|
|
117
125
|
});
|
|
@@ -14,16 +14,18 @@
|
|
|
14
14
|
Object.defineProperty(exports, "__esModule", {
|
|
15
15
|
value: true
|
|
16
16
|
});
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
function
|
|
17
|
+
_export_star(require("./TimeRangeProvider"), exports);
|
|
18
|
+
_export_star(require("./query-params"), 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
|
}
|
|
@@ -21,19 +21,37 @@ function _export(target, all) {
|
|
|
21
21
|
});
|
|
22
22
|
}
|
|
23
23
|
_export(exports, {
|
|
24
|
-
encodeTimeRangeValue: ()
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
24
|
+
encodeTimeRangeValue: function() {
|
|
25
|
+
return encodeTimeRangeValue;
|
|
26
|
+
},
|
|
27
|
+
decodeTimeRangeValue: function() {
|
|
28
|
+
return decodeTimeRangeValue;
|
|
29
|
+
},
|
|
30
|
+
TimeRangeParam: function() {
|
|
31
|
+
return TimeRangeParam;
|
|
32
|
+
},
|
|
33
|
+
timeRangeQueryConfig: function() {
|
|
34
|
+
return timeRangeQueryConfig;
|
|
35
|
+
},
|
|
36
|
+
refreshIntervalQueryConfig: function() {
|
|
37
|
+
return refreshIntervalQueryConfig;
|
|
38
|
+
},
|
|
39
|
+
useInitialTimeRange: function() {
|
|
40
|
+
return useInitialTimeRange;
|
|
41
|
+
},
|
|
42
|
+
useSetTimeRangeParams: function() {
|
|
43
|
+
return useSetTimeRangeParams;
|
|
44
|
+
},
|
|
45
|
+
useInitialRefreshInterval: function() {
|
|
46
|
+
return useInitialRefreshInterval;
|
|
47
|
+
},
|
|
48
|
+
useSetRefreshIntervalParams: function() {
|
|
49
|
+
return useSetRefreshIntervalParams;
|
|
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,7 +103,7 @@ 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
109
|
const { start , end } = query;
|
|
@@ -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
|
|
@@ -115,7 +133,7 @@ function useInitialTimeRange(dashboardDuration) {
|
|
|
115
133
|
]);
|
|
116
134
|
}
|
|
117
135
|
function useSetTimeRangeParams(initialTimeRange, enabledURLParams = true) {
|
|
118
|
-
const [query, setQuery] = (0,
|
|
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
|
|
@@ -166,7 +184,7 @@ function useSetTimeRangeParams(initialTimeRange, enabledURLParams = true) {
|
|
|
166
184
|
};
|
|
167
185
|
}
|
|
168
186
|
function useInitialRefreshInterval(dashboardDuration) {
|
|
169
|
-
const [query] = (0,
|
|
187
|
+
const [query] = (0, _usequeryparams.useQueryParams)(refreshIntervalQueryConfig, {
|
|
170
188
|
updateType: 'replaceIn'
|
|
171
189
|
});
|
|
172
190
|
const { refresh } = query;
|
|
@@ -196,7 +214,7 @@ function getRefreshIntervalInMs(refreshInterval) {
|
|
|
196
214
|
return refreshIntervalInMs;
|
|
197
215
|
}
|
|
198
216
|
function useSetRefreshIntervalParams(initialRefreshInterval, enabledURLParams = true) {
|
|
199
|
-
const [query, setQuery] = (0,
|
|
217
|
+
const [query, setQuery] = (0, _usequeryparams.useQueryParams)(refreshIntervalQueryConfig, {
|
|
200
218
|
updateType: 'replaceIn'
|
|
201
219
|
});
|
|
202
220
|
// determine whether initial param had previously been populated to fix back btn
|
|
@@ -206,7 +224,7 @@ function useSetRefreshIntervalParams(initialRefreshInterval, enabledURLParams =
|
|
|
206
224
|
const [refreshIntervalState, setRefreshIntervalState] = (0, _react.useState)(initialRefreshInterval);
|
|
207
225
|
const { refresh } = query;
|
|
208
226
|
(0, _react.useEffect)(()=>{
|
|
209
|
-
// when dashboard loaded with no params, default to dashboard
|
|
227
|
+
// when dashboard loaded with no params, default to dashboard refresh interval
|
|
210
228
|
if (enabledURLParams && !paramsLoaded && !refresh) {
|
|
211
229
|
setQuery({
|
|
212
230
|
refresh: initialRefreshInterval
|
|
@@ -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
|
+
useBuiltinVariableValues: function() {
|
|
31
|
+
return useBuiltinVariableValues;
|
|
32
|
+
},
|
|
33
|
+
useBuiltinVariableDefinitions: function() {
|
|
34
|
+
return useBuiltinVariableDefinitions;
|
|
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
|
+
useDatasourceStore: function() {
|
|
28
|
+
return useDatasourceStore;
|
|
29
|
+
},
|
|
30
|
+
useListDatasourceSelectItems: function() {
|
|
31
|
+
return useListDatasourceSelectItems;
|
|
32
|
+
},
|
|
33
|
+
useDatasourceClient: function() {
|
|
34
|
+
return useDatasourceClient;
|
|
35
|
+
},
|
|
36
|
+
useDatasource: function() {
|
|
37
|
+
return useDatasource;
|
|
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,24 @@ function useDatasourceStore() {
|
|
|
36
47
|
}
|
|
37
48
|
return ctx;
|
|
38
49
|
}
|
|
39
|
-
function
|
|
40
|
-
const {
|
|
41
|
-
return (0,
|
|
42
|
-
'
|
|
50
|
+
function useListDatasourceSelectItems(datasourcePluginKind) {
|
|
51
|
+
const { listDatasourceSelectItems } = useDatasourceStore();
|
|
52
|
+
return (0, _reactquery.useQuery)([
|
|
53
|
+
'listDatasourceSelectItems',
|
|
43
54
|
datasourcePluginKind
|
|
44
|
-
], ()=>
|
|
55
|
+
], ()=>listDatasourceSelectItems(datasourcePluginKind));
|
|
45
56
|
}
|
|
46
57
|
function useDatasourceClient(selector) {
|
|
47
58
|
const store = useDatasourceStore();
|
|
48
|
-
return (0,
|
|
59
|
+
return (0, _reactquery.useQuery)([
|
|
49
60
|
'getDatasourceClient',
|
|
50
61
|
selector
|
|
51
62
|
], ()=>store.getDatasourceClient(selector));
|
|
52
63
|
}
|
|
64
|
+
function useDatasource(selector) {
|
|
65
|
+
const store = useDatasourceStore();
|
|
66
|
+
return (0, _reactquery.useQuery)([
|
|
67
|
+
'getDatasource',
|
|
68
|
+
selector
|
|
69
|
+
], ()=>store.getDatasource(selector));
|
|
70
|
+
}
|
|
@@ -14,20 +14,23 @@
|
|
|
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("./DataQueriesProvider"), exports);
|
|
24
|
+
function _export_star(from, to) {
|
|
24
25
|
Object.keys(from).forEach(function(k) {
|
|
25
|
-
if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k))
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
26
|
+
if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) {
|
|
27
|
+
Object.defineProperty(to, k, {
|
|
28
|
+
enumerable: true,
|
|
29
|
+
get: function() {
|
|
30
|
+
return from[k];
|
|
31
|
+
}
|
|
32
|
+
});
|
|
33
|
+
}
|
|
31
34
|
});
|
|
32
35
|
return from;
|
|
33
36
|
}
|