@perses-dev/plugin-system 0.39.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 +23 -28
- package/dist/cjs/components/OptionsEditorRadios/index.js +10 -8
- package/dist/cjs/components/OptionsEditorTabPanel/OptionsEditorTabPanel.js +6 -4
- package/dist/cjs/components/OptionsEditorTabPanel/index.js +10 -8
- 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 -19
- 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 +19 -11
- package/dist/cjs/runtime/DataQueriesProvider/index.js +11 -9
- package/dist/cjs/runtime/DataQueriesProvider/model.js +12 -8
- 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 +42 -12
- 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 -9
- package/dist/cjs/test/mock-data.js +3 -1
- 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 +2 -2
- package/dist/components/OptionsEditorRadios/OptionsEditorRadios.d.ts.map +1 -1
- package/dist/components/OptionsEditorRadios/OptionsEditorRadios.js +16 -23
- package/dist/components/OptionsEditorRadios/OptionsEditorRadios.js.map +1 -1
- package/dist/components/OptionsEditorRadios/index.js.map +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.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 +1 -0
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/index.js +1 -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.js +4 -4
- 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 +3 -2
- package/dist/runtime/DataQueriesProvider/model.d.ts.map +1 -1
- package/dist/runtime/DataQueriesProvider/model.js +4 -4
- 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 +2 -1
- package/dist/runtime/template-variables.d.ts.map +1 -1
- package/dist/runtime/template-variables.js +27 -8
- 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.js.map +1 -1
- package/dist/test/mock-data.js.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.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
|
@@ -14,15 +14,17 @@
|
|
|
14
14
|
Object.defineProperty(exports, "__esModule", {
|
|
15
15
|
value: true
|
|
16
16
|
});
|
|
17
|
-
|
|
18
|
-
function
|
|
17
|
+
_export_star(require("./PluginKindSelect"), exports);
|
|
18
|
+
function _export_star(from, to) {
|
|
19
19
|
Object.keys(from).forEach(function(k) {
|
|
20
|
-
if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k))
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
20
|
+
if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) {
|
|
21
|
+
Object.defineProperty(to, k, {
|
|
22
|
+
enumerable: true,
|
|
23
|
+
get: function() {
|
|
24
|
+
return from[k];
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
}
|
|
26
28
|
});
|
|
27
29
|
return from;
|
|
28
30
|
}
|
|
@@ -16,16 +16,18 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
16
16
|
});
|
|
17
17
|
Object.defineProperty(exports, "PluginRegistry", {
|
|
18
18
|
enumerable: true,
|
|
19
|
-
get: ()
|
|
19
|
+
get: function() {
|
|
20
|
+
return PluginRegistry;
|
|
21
|
+
}
|
|
20
22
|
});
|
|
21
|
-
const
|
|
23
|
+
const _jsxruntime = require("react/jsx-runtime");
|
|
22
24
|
const _core = require("@perses-dev/core");
|
|
23
25
|
const _react = require("react");
|
|
24
26
|
const _runtime = require("../../runtime");
|
|
25
|
-
const
|
|
27
|
+
const _pluginindexes = require("./plugin-indexes");
|
|
26
28
|
function PluginRegistry(props) {
|
|
27
|
-
const { pluginLoader: { getInstalledPlugins , importPluginModule } , children , defaultPluginKinds
|
|
28
|
-
const getPluginIndexes = (0,
|
|
29
|
+
const { pluginLoader: { getInstalledPlugins , importPluginModule } , children , defaultPluginKinds } = props;
|
|
30
|
+
const getPluginIndexes = (0, _pluginindexes.usePluginIndexes)(getInstalledPlugins);
|
|
29
31
|
// De-dupe calls to import plugin modules
|
|
30
32
|
const importCache = (0, _react.useRef)(new Map());
|
|
31
33
|
// Do useEvent here since this accesses the importPluginModule prop and we want a stable reference to it for the
|
|
@@ -44,7 +46,7 @@ function PluginRegistry(props) {
|
|
|
44
46
|
// Get the indexes of the installed plugins
|
|
45
47
|
const pluginIndexes = await getPluginIndexes();
|
|
46
48
|
// Figure out what module the plugin is in by looking in the index
|
|
47
|
-
const typeAndKindKey = (0,
|
|
49
|
+
const typeAndKindKey = (0, _pluginindexes.getTypeAndKindKey)(pluginType, kind);
|
|
48
50
|
const resource = pluginIndexes.pluginResourcesByTypeAndKind.get(typeAndKindKey);
|
|
49
51
|
if (resource === undefined) {
|
|
50
52
|
throw new Error(`A ${pluginType} plugin for kind '${kind}' is not installed`);
|
|
@@ -63,8 +65,8 @@ function PluginRegistry(props) {
|
|
|
63
65
|
]);
|
|
64
66
|
const listPluginMetadata = (0, _react.useCallback)(async (pluginType)=>{
|
|
65
67
|
const pluginIndexes = await getPluginIndexes();
|
|
66
|
-
var
|
|
67
|
-
return (
|
|
68
|
+
var _pluginIndexes_pluginMetadataByType_get;
|
|
69
|
+
return (_pluginIndexes_pluginMetadataByType_get = pluginIndexes.pluginMetadataByType.get(pluginType)) !== null && _pluginIndexes_pluginMetadataByType_get !== void 0 ? _pluginIndexes_pluginMetadataByType_get : [];
|
|
68
70
|
}, [
|
|
69
71
|
getPluginIndexes
|
|
70
72
|
]);
|
|
@@ -78,7 +80,7 @@ function PluginRegistry(props) {
|
|
|
78
80
|
listPluginMetadata,
|
|
79
81
|
defaultPluginKinds
|
|
80
82
|
]);
|
|
81
|
-
return /*#__PURE__*/ (0,
|
|
83
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsx)(_runtime.PluginRegistryContext.Provider, {
|
|
82
84
|
value: context,
|
|
83
85
|
children: children
|
|
84
86
|
});
|
|
@@ -14,15 +14,17 @@
|
|
|
14
14
|
Object.defineProperty(exports, "__esModule", {
|
|
15
15
|
value: true
|
|
16
16
|
});
|
|
17
|
-
|
|
18
|
-
function
|
|
17
|
+
_export_star(require("./PluginRegistry"), exports);
|
|
18
|
+
function _export_star(from, to) {
|
|
19
19
|
Object.keys(from).forEach(function(k) {
|
|
20
|
-
if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k))
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
20
|
+
if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) {
|
|
21
|
+
Object.defineProperty(to, k, {
|
|
22
|
+
enumerable: true,
|
|
23
|
+
get: function() {
|
|
24
|
+
return from[k];
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
}
|
|
26
28
|
});
|
|
27
29
|
return from;
|
|
28
30
|
}
|
|
@@ -21,8 +21,12 @@ function _export(target, all) {
|
|
|
21
21
|
});
|
|
22
22
|
}
|
|
23
23
|
_export(exports, {
|
|
24
|
-
usePluginIndexes: ()
|
|
25
|
-
|
|
24
|
+
usePluginIndexes: function() {
|
|
25
|
+
return usePluginIndexes;
|
|
26
|
+
},
|
|
27
|
+
getTypeAndKindKey: function() {
|
|
28
|
+
return getTypeAndKindKey;
|
|
29
|
+
}
|
|
26
30
|
});
|
|
27
31
|
const _core = require("@perses-dev/core");
|
|
28
32
|
const _react = require("react");
|
|
@@ -16,16 +16,18 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
16
16
|
});
|
|
17
17
|
Object.defineProperty(exports, "PluginSpecEditor", {
|
|
18
18
|
enumerable: true,
|
|
19
|
-
get: ()
|
|
19
|
+
get: function() {
|
|
20
|
+
return PluginSpecEditor;
|
|
21
|
+
}
|
|
20
22
|
});
|
|
21
|
-
const
|
|
23
|
+
const _jsxruntime = require("react/jsx-runtime");
|
|
22
24
|
const _components = require("@perses-dev/components");
|
|
23
25
|
const _runtime = require("../../runtime");
|
|
24
26
|
function PluginSpecEditor(props) {
|
|
25
27
|
const { pluginType , pluginKind , ...others } = props;
|
|
26
28
|
const { data: plugin , isLoading , error } = (0, _runtime.usePlugin)(pluginType, pluginKind);
|
|
27
29
|
if (error) {
|
|
28
|
-
return /*#__PURE__*/ (0,
|
|
30
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsx)(_components.ErrorAlert, {
|
|
29
31
|
error: error
|
|
30
32
|
});
|
|
31
33
|
}
|
|
@@ -41,7 +43,7 @@ function PluginSpecEditor(props) {
|
|
|
41
43
|
}
|
|
42
44
|
const { OptionsEditorComponent } = plugin;
|
|
43
45
|
if (OptionsEditorComponent !== undefined) {
|
|
44
|
-
return /*#__PURE__*/ (0,
|
|
46
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsx)(OptionsEditorComponent, {
|
|
45
47
|
...others
|
|
46
48
|
});
|
|
47
49
|
}
|
|
@@ -14,15 +14,17 @@
|
|
|
14
14
|
Object.defineProperty(exports, "__esModule", {
|
|
15
15
|
value: true
|
|
16
16
|
});
|
|
17
|
-
|
|
18
|
-
function
|
|
17
|
+
_export_star(require("./PluginSpecEditor"), exports);
|
|
18
|
+
function _export_star(from, to) {
|
|
19
19
|
Object.keys(from).forEach(function(k) {
|
|
20
|
-
if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k))
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
20
|
+
if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) {
|
|
21
|
+
Object.defineProperty(to, k, {
|
|
22
|
+
enumerable: true,
|
|
23
|
+
get: function() {
|
|
24
|
+
return from[k];
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
}
|
|
26
28
|
});
|
|
27
29
|
return from;
|
|
28
30
|
}
|
|
@@ -16,16 +16,18 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
16
16
|
});
|
|
17
17
|
Object.defineProperty(exports, "TimeSeriesQueryEditor", {
|
|
18
18
|
enumerable: true,
|
|
19
|
-
get: ()
|
|
19
|
+
get: function() {
|
|
20
|
+
return TimeSeriesQueryEditor;
|
|
21
|
+
}
|
|
20
22
|
});
|
|
21
|
-
const
|
|
23
|
+
const _jsxruntime = require("react/jsx-runtime");
|
|
22
24
|
const _react = require("react");
|
|
23
25
|
const _immer = require("immer");
|
|
24
26
|
const _material = require("@mui/material");
|
|
25
|
-
const
|
|
27
|
+
const _Plus = /*#__PURE__*/ _interop_require_default(require("mdi-material-ui/Plus"));
|
|
26
28
|
const _runtime = require("../../runtime");
|
|
27
|
-
const
|
|
28
|
-
function
|
|
29
|
+
const _TimeSeriesQueryInput = require("./TimeSeriesQueryInput");
|
|
30
|
+
function _interop_require_default(obj) {
|
|
29
31
|
return obj && obj.__esModule ? obj : {
|
|
30
32
|
default: obj
|
|
31
33
|
};
|
|
@@ -34,8 +36,8 @@ const DEFAULT_QUERY_PLUGIN_TYPE = 'TimeSeriesQuery';
|
|
|
34
36
|
function TimeSeriesQueryEditor({ queries =[] , onChange }) {
|
|
35
37
|
const hasMoreThanOneQuery = queries.length > 1;
|
|
36
38
|
const { defaultPluginKinds } = (0, _runtime.usePluginRegistry)();
|
|
37
|
-
var
|
|
38
|
-
const defaultTimeSeriesQueryKind = (
|
|
39
|
+
var _defaultPluginKinds_DEFAULT_QUERY_PLUGIN_TYPE;
|
|
40
|
+
const defaultTimeSeriesQueryKind = (_defaultPluginKinds_DEFAULT_QUERY_PLUGIN_TYPE = defaultPluginKinds === null || defaultPluginKinds === void 0 ? void 0 : defaultPluginKinds[DEFAULT_QUERY_PLUGIN_TYPE]) !== null && _defaultPluginKinds_DEFAULT_QUERY_PLUGIN_TYPE !== void 0 ? _defaultPluginKinds_DEFAULT_QUERY_PLUGIN_TYPE : '';
|
|
39
41
|
const { data: defaultQueryPlugin } = (0, _runtime.usePlugin)(DEFAULT_QUERY_PLUGIN_TYPE, defaultTimeSeriesQueryKind, {
|
|
40
42
|
useErrorBoundary: true,
|
|
41
43
|
enabled: true
|
|
@@ -102,14 +104,14 @@ function TimeSeriesQueryEditor({ queries =[] , onChange }) {
|
|
|
102
104
|
];
|
|
103
105
|
});
|
|
104
106
|
};
|
|
105
|
-
var
|
|
107
|
+
var _defaultPluginKinds_TimeSeriesQuery;
|
|
106
108
|
// show one query input if queries is empty
|
|
107
109
|
const queryDefinitions = queries.length ? queries : [
|
|
108
110
|
{
|
|
109
111
|
kind: 'TimeSeriesQuery',
|
|
110
112
|
spec: {
|
|
111
113
|
plugin: {
|
|
112
|
-
kind: (
|
|
114
|
+
kind: (_defaultPluginKinds_TimeSeriesQuery = defaultPluginKinds === null || defaultPluginKinds === void 0 ? void 0 : defaultPluginKinds['TimeSeriesQuery']) !== null && _defaultPluginKinds_TimeSeriesQuery !== void 0 ? _defaultPluginKinds_TimeSeriesQuery : '',
|
|
113
115
|
spec: {
|
|
114
116
|
query: ''
|
|
115
117
|
}
|
|
@@ -117,19 +119,19 @@ function TimeSeriesQueryEditor({ queries =[] , onChange }) {
|
|
|
117
119
|
}
|
|
118
120
|
}
|
|
119
121
|
];
|
|
120
|
-
return /*#__PURE__*/ (0,
|
|
122
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Stack, {
|
|
121
123
|
spacing: 1,
|
|
122
124
|
children: [
|
|
123
|
-
/*#__PURE__*/ (0,
|
|
125
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Button, {
|
|
124
126
|
variant: "contained",
|
|
125
|
-
startIcon: /*#__PURE__*/ (0,
|
|
127
|
+
startIcon: /*#__PURE__*/ (0, _jsxruntime.jsx)(_Plus.default, {}),
|
|
126
128
|
sx: {
|
|
127
129
|
marginLeft: 'auto'
|
|
128
130
|
},
|
|
129
131
|
onClick: handleQueryAdd,
|
|
130
132
|
children: "Add Query"
|
|
131
133
|
}),
|
|
132
|
-
queryDefinitions.map((query, i)=>/*#__PURE__*/ (0,
|
|
134
|
+
queryDefinitions.map((query, i)=>/*#__PURE__*/ (0, _jsxruntime.jsx)(_TimeSeriesQueryInput.TimeSeriesQueryInput, {
|
|
133
135
|
index: i,
|
|
134
136
|
query: query,
|
|
135
137
|
isCollapsed: !!queriesCollapsed[i],
|
|
@@ -16,36 +16,38 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
16
16
|
});
|
|
17
17
|
Object.defineProperty(exports, "TimeSeriesQueryInput", {
|
|
18
18
|
enumerable: true,
|
|
19
|
-
get: ()
|
|
19
|
+
get: function() {
|
|
20
|
+
return TimeSeriesQueryInput;
|
|
21
|
+
}
|
|
20
22
|
});
|
|
21
|
-
const
|
|
22
|
-
const _immer = /*#__PURE__*/
|
|
23
|
+
const _jsxruntime = require("react/jsx-runtime");
|
|
24
|
+
const _immer = /*#__PURE__*/ _interop_require_default(require("immer"));
|
|
23
25
|
const _material = require("@mui/material");
|
|
24
|
-
const
|
|
25
|
-
const
|
|
26
|
-
const
|
|
27
|
-
const
|
|
28
|
-
function
|
|
26
|
+
const _DeleteOutline = /*#__PURE__*/ _interop_require_default(require("mdi-material-ui/DeleteOutline"));
|
|
27
|
+
const _ChevronDown = /*#__PURE__*/ _interop_require_default(require("mdi-material-ui/ChevronDown"));
|
|
28
|
+
const _ChevronRight = /*#__PURE__*/ _interop_require_default(require("mdi-material-ui/ChevronRight"));
|
|
29
|
+
const _PluginEditor = require("../PluginEditor");
|
|
30
|
+
function _interop_require_default(obj) {
|
|
29
31
|
return obj && obj.__esModule ? obj : {
|
|
30
32
|
default: obj
|
|
31
33
|
};
|
|
32
34
|
}
|
|
33
35
|
const TimeSeriesQueryInput = ({ index , query , isCollapsed , onDelete , onChange , onCollapseExpand })=>{
|
|
34
|
-
return /*#__PURE__*/ (0,
|
|
36
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Stack, {
|
|
35
37
|
spacing: 1,
|
|
36
38
|
children: [
|
|
37
|
-
/*#__PURE__*/ (0,
|
|
39
|
+
/*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Stack, {
|
|
38
40
|
direction: "row",
|
|
39
41
|
alignItems: "center",
|
|
40
42
|
borderBottom: 1,
|
|
41
43
|
borderColor: (theme)=>theme.palette.divider,
|
|
42
44
|
children: [
|
|
43
|
-
/*#__PURE__*/ (0,
|
|
45
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.IconButton, {
|
|
44
46
|
size: "small",
|
|
45
47
|
onClick: ()=>onCollapseExpand(index),
|
|
46
|
-
children: isCollapsed ? /*#__PURE__*/ (0,
|
|
48
|
+
children: isCollapsed ? /*#__PURE__*/ (0, _jsxruntime.jsx)(_ChevronRight.default, {}) : /*#__PURE__*/ (0, _jsxruntime.jsx)(_ChevronDown.default, {})
|
|
47
49
|
}),
|
|
48
|
-
/*#__PURE__*/ (0,
|
|
50
|
+
/*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Typography, {
|
|
49
51
|
variant: "overline",
|
|
50
52
|
component: "h4",
|
|
51
53
|
children: [
|
|
@@ -53,7 +55,7 @@ const TimeSeriesQueryInput = ({ index , query , isCollapsed , onDelete , onChang
|
|
|
53
55
|
index + 1
|
|
54
56
|
]
|
|
55
57
|
}),
|
|
56
|
-
/*#__PURE__*/ (0,
|
|
58
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.IconButton, {
|
|
57
59
|
size: "small",
|
|
58
60
|
// Use `visibility` to ensure that the row has the same height when delete button is visible or not visible
|
|
59
61
|
sx: {
|
|
@@ -61,11 +63,11 @@ const TimeSeriesQueryInput = ({ index , query , isCollapsed , onDelete , onChang
|
|
|
61
63
|
visibility: `${onDelete ? 'visible' : 'hidden'}`
|
|
62
64
|
},
|
|
63
65
|
onClick: ()=>onDelete && onDelete(index),
|
|
64
|
-
children: /*#__PURE__*/ (0,
|
|
66
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_DeleteOutline.default, {})
|
|
65
67
|
})
|
|
66
68
|
]
|
|
67
69
|
}),
|
|
68
|
-
!isCollapsed && /*#__PURE__*/ (0,
|
|
70
|
+
!isCollapsed && /*#__PURE__*/ (0, _jsxruntime.jsx)(QueryEditor, {
|
|
69
71
|
value: query,
|
|
70
72
|
onChange: (next)=>onChange(index, next)
|
|
71
73
|
})
|
|
@@ -76,15 +78,15 @@ const TimeSeriesQueryInput = ({ index , query , isCollapsed , onDelete , onChang
|
|
|
76
78
|
* Displays an editor for TimeSeriesQueryDefinition objects.
|
|
77
79
|
*/ function QueryEditor(props) {
|
|
78
80
|
const { value , onChange , ...others } = props;
|
|
79
|
-
const { spec: { plugin }
|
|
81
|
+
const { spec: { plugin } } = value;
|
|
80
82
|
const handlePluginChange = (next)=>{
|
|
81
83
|
onChange((0, _immer.default)(value, (draft)=>{
|
|
82
84
|
draft.spec.plugin = next;
|
|
83
85
|
}));
|
|
84
86
|
};
|
|
85
|
-
return /*#__PURE__*/ (0,
|
|
87
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Box, {
|
|
86
88
|
...others,
|
|
87
|
-
children: /*#__PURE__*/ (0,
|
|
89
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_PluginEditor.PluginEditor, {
|
|
88
90
|
pluginType: "TimeSeriesQuery",
|
|
89
91
|
pluginKindLabel: "Query Type",
|
|
90
92
|
value: plugin,
|
|
@@ -14,15 +14,17 @@
|
|
|
14
14
|
Object.defineProperty(exports, "__esModule", {
|
|
15
15
|
value: true
|
|
16
16
|
});
|
|
17
|
-
|
|
18
|
-
function
|
|
17
|
+
_export_star(require("./TimeSeriesQueryEditor"), exports);
|
|
18
|
+
function _export_star(from, to) {
|
|
19
19
|
Object.keys(from).forEach(function(k) {
|
|
20
|
-
if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k))
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
20
|
+
if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) {
|
|
21
|
+
Object.defineProperty(to, k, {
|
|
22
|
+
enumerable: true,
|
|
23
|
+
get: function() {
|
|
24
|
+
return from[k];
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
}
|
|
26
28
|
});
|
|
27
29
|
return from;
|
|
28
30
|
}
|