@perses-dev/dashboards 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/AddGroupButton/AddGroupButton.js +9 -7
- package/dist/cjs/components/AddGroupButton/index.js +10 -8
- package/dist/cjs/components/AddPanelButton/AddPanelButton.js +9 -7
- package/dist/cjs/components/AddPanelButton/index.js +10 -8
- package/dist/cjs/components/Dashboard/Dashboard.js +14 -11
- package/dist/cjs/components/Dashboard/index.js +10 -8
- package/dist/cjs/components/DashboardStickyToolbar/DashboardStickyToolbar.js +18 -16
- package/dist/cjs/components/DashboardStickyToolbar/index.js +10 -8
- package/dist/cjs/components/DashboardToolbar/DashboardToolbar.js +43 -41
- package/dist/cjs/components/DashboardToolbar/index.js +10 -8
- package/dist/cjs/components/DeletePanelDialog/DeletePanelDialog.js +12 -10
- package/dist/cjs/components/DeletePanelDialog/index.js +10 -8
- package/dist/cjs/components/DeletePanelGroupDialog/DeletePanelGroupDialog.js +17 -15
- package/dist/cjs/components/DeletePanelGroupDialog/index.js +10 -8
- package/dist/cjs/components/DiscardChangesConfirmationDialog/DiscardChangesConfirmationDialog.js +5 -3
- package/dist/cjs/components/DiscardChangesConfirmationDialog/index.js +10 -8
- package/dist/cjs/components/DownloadButton/DownloadButton.js +12 -10
- package/dist/cjs/components/DownloadButton/index.js +10 -8
- package/dist/cjs/components/EditButton/EditButton.js +8 -6
- package/dist/cjs/components/EditButton/index.js +10 -8
- package/dist/cjs/components/EditJsonButton/EditJsonButton.js +10 -8
- package/dist/cjs/components/EditJsonButton/index.js +10 -8
- package/dist/cjs/components/EditJsonDialog/EditJsonDialog.js +29 -23
- package/dist/cjs/components/EditJsonDialog/index.js +10 -8
- package/dist/cjs/components/EmptyDashboard/EmptyDashboard.js +18 -16
- package/dist/cjs/components/EmptyDashboard/index.js +10 -8
- package/dist/cjs/components/GridLayout/GridContainer.js +5 -3
- package/dist/cjs/components/GridLayout/GridItemContent.js +33 -12
- package/dist/cjs/components/GridLayout/GridLayout.js +19 -16
- package/dist/cjs/components/GridLayout/GridTitle.js +35 -33
- package/dist/cjs/components/GridLayout/index.js +13 -11
- package/dist/cjs/components/Panel/Panel.js +21 -21
- package/dist/cjs/components/Panel/PanelContent.js +8 -6
- package/dist/cjs/components/Panel/PanelHeader.js +39 -33
- package/dist/cjs/components/Panel/index.js +10 -8
- package/dist/cjs/components/PanelDrawer/PanelDrawer.js +25 -77
- package/dist/cjs/components/PanelDrawer/PanelEditorForm.js +269 -141
- package/dist/cjs/components/PanelDrawer/PanelPreview.js +11 -9
- package/dist/cjs/components/PanelDrawer/index.js +10 -8
- package/dist/cjs/components/PanelDrawer/usePanelEditor.js +3 -1
- package/dist/cjs/components/PanelGroupDialog/PanelGroupDialog.js +18 -16
- package/dist/cjs/components/PanelGroupDialog/PanelGroupEditorForm.js +15 -11
- package/dist/cjs/components/PanelGroupDialog/index.js +10 -8
- package/dist/cjs/components/QuerySummaryTable/QuerySummaryTable.js +46 -44
- package/dist/cjs/components/QuerySummaryTable/index.js +10 -8
- package/dist/cjs/components/SaveChangesConfirmationDialog/SaveChangesConfirmationDialog.js +23 -21
- package/dist/cjs/components/SaveChangesConfirmationDialog/index.js +10 -8
- package/dist/cjs/components/SaveDashboardButton/SaveDashboardButton.js +11 -9
- package/dist/cjs/components/SaveDashboardButton/index.js +10 -8
- package/dist/cjs/components/TimeRangeControls/TimeRangeControls.js +40 -16
- package/dist/cjs/components/TimeRangeControls/index.js +10 -8
- package/dist/cjs/components/ToolbarIconButton/ToolbarIconButton.js +5 -3
- package/dist/cjs/components/ToolbarIconButton/index.js +10 -8
- package/dist/cjs/components/Variables/BuiltinVariableAccordions.js +140 -0
- package/dist/cjs/components/Variables/EditVariablesButton.js +18 -11
- package/dist/cjs/components/Variables/TemplateVariable.js +127 -76
- package/dist/cjs/components/Variables/VariableEditor.js +356 -117
- package/dist/cjs/components/Variables/VariableList.js +45 -21
- package/dist/cjs/components/Variables/index.js +14 -11
- package/dist/cjs/components/index.js +31 -29
- package/dist/cjs/constants/grid-layout-config.js +6 -2
- package/dist/cjs/constants/index.js +11 -9
- package/dist/cjs/constants/user-interface-text.js +6 -2
- package/dist/cjs/context/DashboardProvider/DashboardProvider.js +40 -34
- package/dist/cjs/context/DashboardProvider/common.js +6 -2
- package/dist/cjs/context/DashboardProvider/dashboard-provider-api.js +70 -38
- package/dist/cjs/context/DashboardProvider/delete-panel-group-slice.js +3 -1
- package/dist/cjs/context/DashboardProvider/delete-panel-slice.js +5 -3
- package/dist/cjs/context/DashboardProvider/discard-changes-dialog-slice.js +3 -1
- package/dist/cjs/context/DashboardProvider/duplicate-panel-slice.js +3 -1
- package/dist/cjs/context/DashboardProvider/edit-json-dialog-slice.js +3 -1
- package/dist/cjs/context/DashboardProvider/index.js +12 -10
- package/dist/cjs/context/DashboardProvider/panel-editor-slice.js +13 -11
- package/dist/cjs/context/DashboardProvider/panel-group-editor-slice.js +8 -6
- package/dist/cjs/context/DashboardProvider/panel-group-slice.js +15 -7
- package/dist/cjs/context/DashboardProvider/panel-slice.js +3 -1
- package/dist/cjs/context/DashboardProvider/save-changes-dialog-slice.js +3 -1
- package/dist/cjs/context/DatasourceStoreProvider.js +114 -45
- package/dist/cjs/context/TemplateVariableProvider/TemplateVariableProvider.js +189 -51
- package/dist/cjs/context/TemplateVariableProvider/hydrationUtils.js +65 -13
- package/dist/cjs/context/TemplateVariableProvider/index.js +10 -8
- package/dist/cjs/context/TemplateVariableProvider/query-params.js +17 -7
- package/dist/cjs/context/TemplateVariableProvider/utils.js +49 -9
- package/dist/cjs/context/index.js +13 -11
- package/dist/cjs/context/useDashboard.js +8 -6
- package/dist/cjs/index.js +12 -10
- package/dist/cjs/stories/decorators/WithDashboard.js +6 -4
- package/dist/cjs/stories/decorators/WithDatasourceStore.js +6 -4
- package/dist/cjs/stories/decorators/WithTemplateVariables.js +6 -4
- package/dist/cjs/stories/decorators/constants.js +5 -3
- package/dist/cjs/stories/decorators/index.js +13 -11
- package/dist/cjs/test/dashboard-provider.js +8 -4
- package/dist/cjs/test/datasource-provider.js +16 -12
- package/dist/cjs/test/index.js +13 -11
- package/dist/cjs/test/plugin-registry.js +6 -4
- package/dist/cjs/test/render.js +27 -20
- package/dist/cjs/test/setup-tests.js +2 -2
- package/dist/cjs/test/testDashboard.js +13 -11
- package/dist/cjs/utils/index.js +11 -9
- package/dist/cjs/utils/panelUtils.js +9 -3
- package/dist/cjs/utils/time.js +5 -3
- package/dist/cjs/validation/index.js +30 -0
- package/dist/cjs/validation/panel.js +29 -0
- package/dist/cjs/views/ViewDashboard/DashboardApp.js +24 -15
- package/dist/cjs/views/ViewDashboard/ViewDashboard.js +64 -19
- package/dist/cjs/views/ViewDashboard/index.js +10 -8
- package/dist/cjs/views/index.js +10 -8
- package/dist/components/AddGroupButton/AddGroupButton.js.map +1 -1
- package/dist/components/AddGroupButton/index.js.map +1 -1
- package/dist/components/AddPanelButton/AddPanelButton.js.map +1 -1
- package/dist/components/AddPanelButton/index.js.map +1 -1
- package/dist/components/Dashboard/Dashboard.d.ts +3 -1
- package/dist/components/Dashboard/Dashboard.d.ts.map +1 -1
- package/dist/components/Dashboard/Dashboard.js +3 -2
- package/dist/components/Dashboard/Dashboard.js.map +1 -1
- package/dist/components/Dashboard/index.js.map +1 -1
- package/dist/components/DashboardStickyToolbar/DashboardStickyToolbar.js.map +1 -1
- package/dist/components/DashboardStickyToolbar/index.js.map +1 -1
- package/dist/components/DashboardToolbar/DashboardToolbar.js +1 -1
- package/dist/components/DashboardToolbar/DashboardToolbar.js.map +1 -1
- package/dist/components/DashboardToolbar/index.js.map +1 -1
- package/dist/components/DeletePanelDialog/DeletePanelDialog.js.map +1 -1
- package/dist/components/DeletePanelDialog/index.js.map +1 -1
- package/dist/components/DeletePanelGroupDialog/DeletePanelGroupDialog.js +2 -2
- package/dist/components/DeletePanelGroupDialog/DeletePanelGroupDialog.js.map +1 -1
- package/dist/components/DeletePanelGroupDialog/index.js.map +1 -1
- package/dist/components/DiscardChangesConfirmationDialog/DiscardChangesConfirmationDialog.js.map +1 -1
- package/dist/components/DiscardChangesConfirmationDialog/index.js.map +1 -1
- package/dist/components/DownloadButton/DownloadButton.js.map +1 -1
- package/dist/components/DownloadButton/index.js.map +1 -1
- package/dist/components/EditButton/EditButton.js.map +1 -1
- package/dist/components/EditButton/index.js.map +1 -1
- package/dist/components/EditJsonButton/EditJsonButton.js.map +1 -1
- package/dist/components/EditJsonButton/index.js.map +1 -1
- package/dist/components/EditJsonDialog/EditJsonDialog.d.ts +4 -1
- package/dist/components/EditJsonDialog/EditJsonDialog.d.ts.map +1 -1
- package/dist/components/EditJsonDialog/EditJsonDialog.js +12 -8
- package/dist/components/EditJsonDialog/EditJsonDialog.js.map +1 -1
- package/dist/components/EditJsonDialog/index.js.map +1 -1
- package/dist/components/EmptyDashboard/EmptyDashboard.js.map +1 -1
- package/dist/components/EmptyDashboard/index.js.map +1 -1
- package/dist/components/GridLayout/GridContainer.js.map +1 -1
- package/dist/components/GridLayout/GridItemContent.d.ts +2 -0
- package/dist/components/GridLayout/GridItemContent.d.ts.map +1 -1
- package/dist/components/GridLayout/GridItemContent.js +27 -8
- package/dist/components/GridLayout/GridItemContent.js.map +1 -1
- package/dist/components/GridLayout/GridLayout.d.ts +2 -0
- package/dist/components/GridLayout/GridLayout.d.ts.map +1 -1
- package/dist/components/GridLayout/GridLayout.js +3 -2
- package/dist/components/GridLayout/GridLayout.js.map +1 -1
- package/dist/components/GridLayout/GridTitle.js.map +1 -1
- package/dist/components/GridLayout/index.js.map +1 -1
- package/dist/components/Panel/Panel.d.ts +20 -0
- package/dist/components/Panel/Panel.d.ts.map +1 -1
- package/dist/components/Panel/Panel.js +8 -10
- package/dist/components/Panel/Panel.js.map +1 -1
- package/dist/components/Panel/PanelContent.js.map +1 -1
- package/dist/components/Panel/PanelHeader.d.ts +2 -1
- package/dist/components/Panel/PanelHeader.d.ts.map +1 -1
- package/dist/components/Panel/PanelHeader.js +7 -3
- package/dist/components/Panel/PanelHeader.js.map +1 -1
- package/dist/components/Panel/index.js.map +1 -1
- package/dist/components/PanelDrawer/PanelDrawer.d.ts.map +1 -1
- package/dist/components/PanelDrawer/PanelDrawer.js +22 -76
- package/dist/components/PanelDrawer/PanelDrawer.js.map +1 -1
- package/dist/components/PanelDrawer/PanelEditorForm.d.ts +4 -1
- package/dist/components/PanelDrawer/PanelEditorForm.d.ts.map +1 -1
- package/dist/components/PanelDrawer/PanelEditorForm.js +223 -138
- package/dist/components/PanelDrawer/PanelEditorForm.js.map +1 -1
- package/dist/components/PanelDrawer/PanelPreview.d.ts.map +1 -1
- package/dist/components/PanelDrawer/PanelPreview.js +2 -2
- package/dist/components/PanelDrawer/PanelPreview.js.map +1 -1
- package/dist/components/PanelDrawer/index.js.map +1 -1
- package/dist/components/PanelDrawer/usePanelEditor.js.map +1 -1
- package/dist/components/PanelGroupDialog/PanelGroupDialog.js.map +1 -1
- package/dist/components/PanelGroupDialog/PanelGroupEditorForm.js.map +1 -1
- package/dist/components/PanelGroupDialog/index.js.map +1 -1
- package/dist/components/QuerySummaryTable/QuerySummaryTable.js +4 -4
- package/dist/components/QuerySummaryTable/QuerySummaryTable.js.map +1 -1
- package/dist/components/QuerySummaryTable/index.js.map +1 -1
- package/dist/components/SaveChangesConfirmationDialog/SaveChangesConfirmationDialog.js +4 -4
- package/dist/components/SaveChangesConfirmationDialog/SaveChangesConfirmationDialog.js.map +1 -1
- package/dist/components/SaveChangesConfirmationDialog/index.js.map +1 -1
- package/dist/components/SaveDashboardButton/SaveDashboardButton.js +4 -4
- package/dist/components/SaveDashboardButton/SaveDashboardButton.js.map +1 -1
- package/dist/components/SaveDashboardButton/index.js.map +1 -1
- package/dist/components/TimeRangeControls/TimeRangeControls.d.ts.map +1 -1
- package/dist/components/TimeRangeControls/TimeRangeControls.js +19 -1
- package/dist/components/TimeRangeControls/TimeRangeControls.js.map +1 -1
- package/dist/components/TimeRangeControls/index.js.map +1 -1
- package/dist/components/ToolbarIconButton/ToolbarIconButton.js.map +1 -1
- package/dist/components/ToolbarIconButton/index.js.map +1 -1
- package/dist/components/Variables/BuiltinVariableAccordions.d.ts +8 -0
- package/dist/components/Variables/BuiltinVariableAccordions.d.ts.map +1 -0
- package/dist/components/Variables/BuiltinVariableAccordions.js +127 -0
- package/dist/components/Variables/BuiltinVariableAccordions.js.map +1 -0
- package/dist/components/Variables/EditVariablesButton.d.ts.map +1 -1
- package/dist/components/Variables/EditVariablesButton.js +6 -1
- package/dist/components/Variables/EditVariablesButton.js.map +1 -1
- package/dist/components/Variables/TemplateVariable.d.ts +12 -2
- package/dist/components/Variables/TemplateVariable.d.ts.map +1 -1
- package/dist/components/Variables/TemplateVariable.js +102 -61
- package/dist/components/Variables/TemplateVariable.js.map +1 -1
- package/dist/components/Variables/VariableEditor.d.ts +9 -1
- package/dist/components/Variables/VariableEditor.d.ts.map +1 -1
- package/dist/components/Variables/VariableEditor.js +326 -97
- package/dist/components/Variables/VariableEditor.js.map +1 -1
- package/dist/components/Variables/VariableList.d.ts +5 -0
- package/dist/components/Variables/VariableList.d.ts.map +1 -1
- package/dist/components/Variables/VariableList.js +32 -18
- package/dist/components/Variables/VariableList.js.map +1 -1
- package/dist/components/Variables/index.d.ts +1 -0
- package/dist/components/Variables/index.d.ts.map +1 -1
- package/dist/components/Variables/index.js +1 -0
- package/dist/components/Variables/index.js.map +1 -1
- package/dist/components/index.js.map +1 -1
- package/dist/constants/grid-layout-config.js.map +1 -1
- package/dist/constants/index.js.map +1 -1
- package/dist/constants/user-interface-text.js.map +1 -1
- package/dist/context/DashboardProvider/DashboardProvider.js +5 -5
- package/dist/context/DashboardProvider/DashboardProvider.js.map +1 -1
- package/dist/context/DashboardProvider/common.js.map +1 -1
- package/dist/context/DashboardProvider/dashboard-provider-api.js +2 -2
- package/dist/context/DashboardProvider/dashboard-provider-api.js.map +1 -1
- package/dist/context/DashboardProvider/delete-panel-group-slice.js.map +1 -1
- package/dist/context/DashboardProvider/delete-panel-slice.js +2 -2
- package/dist/context/DashboardProvider/delete-panel-slice.js.map +1 -1
- package/dist/context/DashboardProvider/discard-changes-dialog-slice.js.map +1 -1
- package/dist/context/DashboardProvider/duplicate-panel-slice.js.map +1 -1
- package/dist/context/DashboardProvider/edit-json-dialog-slice.js.map +1 -1
- package/dist/context/DashboardProvider/index.js.map +1 -1
- package/dist/context/DashboardProvider/panel-editor-slice.d.ts +2 -1
- package/dist/context/DashboardProvider/panel-editor-slice.d.ts.map +1 -1
- package/dist/context/DashboardProvider/panel-editor-slice.js +7 -7
- package/dist/context/DashboardProvider/panel-editor-slice.js.map +1 -1
- package/dist/context/DashboardProvider/panel-group-editor-slice.js +2 -2
- package/dist/context/DashboardProvider/panel-group-editor-slice.js.map +1 -1
- package/dist/context/DashboardProvider/panel-group-slice.js +3 -3
- package/dist/context/DashboardProvider/panel-group-slice.js.map +1 -1
- package/dist/context/DashboardProvider/panel-slice.js.map +1 -1
- package/dist/context/DashboardProvider/save-changes-dialog-slice.js.map +1 -1
- package/dist/context/DatasourceStoreProvider.d.ts +14 -10
- package/dist/context/DatasourceStoreProvider.d.ts.map +1 -1
- package/dist/context/DatasourceStoreProvider.js +107 -40
- package/dist/context/DatasourceStoreProvider.js.map +1 -1
- package/dist/context/TemplateVariableProvider/TemplateVariableProvider.d.ts +48 -13
- package/dist/context/TemplateVariableProvider/TemplateVariableProvider.d.ts.map +1 -1
- package/dist/context/TemplateVariableProvider/TemplateVariableProvider.js +165 -41
- package/dist/context/TemplateVariableProvider/TemplateVariableProvider.js.map +1 -1
- package/dist/context/TemplateVariableProvider/hydrationUtils.d.ts +9 -2
- package/dist/context/TemplateVariableProvider/hydrationUtils.d.ts.map +1 -1
- package/dist/context/TemplateVariableProvider/hydrationUtils.js +67 -12
- package/dist/context/TemplateVariableProvider/hydrationUtils.js.map +1 -1
- package/dist/context/TemplateVariableProvider/index.js.map +1 -1
- package/dist/context/TemplateVariableProvider/query-params.js.map +1 -1
- package/dist/context/TemplateVariableProvider/utils.d.ts +27 -2
- package/dist/context/TemplateVariableProvider/utils.d.ts.map +1 -1
- package/dist/context/TemplateVariableProvider/utils.js +48 -6
- package/dist/context/TemplateVariableProvider/utils.js.map +1 -1
- package/dist/context/index.js.map +1 -1
- package/dist/context/useDashboard.js +1 -1
- package/dist/context/useDashboard.js.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/stories/decorators/WithDashboard.js.map +1 -1
- package/dist/stories/decorators/WithDatasourceStore.js.map +1 -1
- package/dist/stories/decorators/WithTemplateVariables.js.map +1 -1
- package/dist/stories/decorators/constants.js +2 -2
- package/dist/stories/decorators/constants.js.map +1 -1
- package/dist/stories/decorators/index.js.map +1 -1
- package/dist/test/dashboard-provider.js.map +1 -1
- package/dist/test/datasource-provider.d.ts.map +1 -1
- package/dist/test/datasource-provider.js +5 -7
- package/dist/test/datasource-provider.js.map +1 -1
- package/dist/test/index.js.map +1 -1
- package/dist/test/plugin-registry.js.map +1 -1
- package/dist/test/render.d.ts.map +1 -1
- package/dist/test/render.js +8 -3
- package/dist/test/render.js.map +1 -1
- package/dist/test/setup-tests.js.map +1 -1
- package/dist/test/testDashboard.js +10 -10
- package/dist/test/testDashboard.js.map +1 -1
- package/dist/utils/index.js.map +1 -1
- package/dist/utils/panelUtils.js.map +1 -1
- package/dist/utils/time.js.map +1 -1
- package/dist/validation/index.d.ts +2 -0
- package/dist/validation/index.d.ts.map +1 -0
- package/dist/validation/index.js +15 -0
- package/dist/validation/index.js.map +1 -0
- package/dist/validation/panel.d.ts +19 -0
- package/dist/validation/panel.d.ts.map +1 -0
- package/dist/validation/panel.js +21 -0
- package/dist/validation/panel.js.map +1 -0
- package/dist/views/ViewDashboard/DashboardApp.d.ts +1 -0
- package/dist/views/ViewDashboard/DashboardApp.d.ts.map +1 -1
- package/dist/views/ViewDashboard/DashboardApp.js +11 -4
- package/dist/views/ViewDashboard/DashboardApp.js.map +1 -1
- package/dist/views/ViewDashboard/ViewDashboard.d.ts +3 -1
- package/dist/views/ViewDashboard/ViewDashboard.d.ts.map +1 -1
- package/dist/views/ViewDashboard/ViewDashboard.js +51 -8
- package/dist/views/ViewDashboard/ViewDashboard.js.map +1 -1
- package/dist/views/ViewDashboard/index.js.map +1 -1
- package/dist/views/index.js.map +1 -1
- package/package.json +8 -7
|
@@ -14,32 +14,56 @@
|
|
|
14
14
|
Object.defineProperty(exports, "__esModule", {
|
|
15
15
|
value: true
|
|
16
16
|
});
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
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
|
+
TemplateVariableList: function() {
|
|
25
|
+
return TemplateVariableList;
|
|
26
|
+
},
|
|
27
|
+
TemplateVariableListItem: function() {
|
|
28
|
+
return TemplateVariableListItem;
|
|
29
|
+
}
|
|
20
30
|
});
|
|
21
|
-
const
|
|
31
|
+
const _jsxruntime = require("react/jsx-runtime");
|
|
22
32
|
const _material = require("@mui/material");
|
|
23
33
|
const _context = require("../../context");
|
|
24
|
-
const
|
|
34
|
+
const _TemplateVariable = require("./TemplateVariable");
|
|
25
35
|
const VARIABLE_INPUT_MIN_WIDTH = '120px';
|
|
26
|
-
const VARIABLE_INPUT_MAX_WIDTH = '
|
|
36
|
+
const VARIABLE_INPUT_MAX_WIDTH = '500px';
|
|
27
37
|
function TemplateVariableList() {
|
|
28
38
|
const variableDefinitions = (0, _context.useTemplateVariableDefinitions)();
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
}, v.spec.name)
|
|
42
|
-
}, v.spec.name);
|
|
43
|
-
})
|
|
39
|
+
const externalVariableDefinitions = (0, _context.useTemplateExternalVariableDefinitions)();
|
|
40
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsxs)(_jsxruntime.Fragment, {
|
|
41
|
+
children: [
|
|
42
|
+
externalVariableDefinitions.slice().reverse() // We reverse to have the most prioritized on top
|
|
43
|
+
.map((def)=>def.definitions.map((v)=>/*#__PURE__*/ (0, _jsxruntime.jsx)(TemplateVariableListItem, {
|
|
44
|
+
spec: v.spec,
|
|
45
|
+
source: def.source
|
|
46
|
+
}, v.spec.name + def.source))),
|
|
47
|
+
variableDefinitions.map((v)=>/*#__PURE__*/ (0, _jsxruntime.jsx)(TemplateVariableListItem, {
|
|
48
|
+
spec: v.spec
|
|
49
|
+
}, v.spec.name))
|
|
50
|
+
]
|
|
44
51
|
});
|
|
45
52
|
}
|
|
53
|
+
function TemplateVariableListItem({ spec , source }) {
|
|
54
|
+
var _ctx_state, _spec_display;
|
|
55
|
+
const ctx = (0, _context.useTemplateVariable)(spec.name, source);
|
|
56
|
+
var _ref, _ref1;
|
|
57
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Box, {
|
|
58
|
+
display: ((_ctx_state = ctx.state) === null || _ctx_state === void 0 ? void 0 : _ctx_state.overridden) || ((_spec_display = spec.display) === null || _spec_display === void 0 ? void 0 : _spec_display.hidden) ? 'none' : undefined,
|
|
59
|
+
minWidth: VARIABLE_INPUT_MIN_WIDTH,
|
|
60
|
+
maxWidth: VARIABLE_INPUT_MAX_WIDTH,
|
|
61
|
+
marginBottom: 1,
|
|
62
|
+
marginRight: 1,
|
|
63
|
+
"data-testid": "template-variable",
|
|
64
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_TemplateVariable.TemplateVariable, {
|
|
65
|
+
name: spec.name,
|
|
66
|
+
source: source
|
|
67
|
+
}, (_ref = spec.name + source) !== null && _ref !== void 0 ? _ref : '')
|
|
68
|
+
}, (_ref1 = spec.name + source) !== null && _ref1 !== void 0 ? _ref1 : '');
|
|
69
|
+
}
|
|
@@ -14,18 +14,21 @@
|
|
|
14
14
|
Object.defineProperty(exports, "__esModule", {
|
|
15
15
|
value: true
|
|
16
16
|
});
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
17
|
+
_export_star(require("./BuiltinVariableAccordions"), exports);
|
|
18
|
+
_export_star(require("./EditVariablesButton"), exports);
|
|
19
|
+
_export_star(require("./TemplateVariable"), exports);
|
|
20
|
+
_export_star(require("./VariableEditor"), exports);
|
|
21
|
+
_export_star(require("./VariableList"), exports);
|
|
22
|
+
function _export_star(from, to) {
|
|
22
23
|
Object.keys(from).forEach(function(k) {
|
|
23
|
-
if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k))
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
24
|
+
if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) {
|
|
25
|
+
Object.defineProperty(to, k, {
|
|
26
|
+
enumerable: true,
|
|
27
|
+
get: function() {
|
|
28
|
+
return from[k];
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
}
|
|
29
32
|
});
|
|
30
33
|
return from;
|
|
31
34
|
}
|
|
@@ -14,36 +14,38 @@
|
|
|
14
14
|
Object.defineProperty(exports, "__esModule", {
|
|
15
15
|
value: true
|
|
16
16
|
});
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
function
|
|
17
|
+
_export_star(require("./AddGroupButton"), exports);
|
|
18
|
+
_export_star(require("./AddPanelButton"), exports);
|
|
19
|
+
_export_star(require("./Dashboard"), exports);
|
|
20
|
+
_export_star(require("./DashboardToolbar"), exports);
|
|
21
|
+
_export_star(require("./DashboardStickyToolbar"), exports);
|
|
22
|
+
_export_star(require("./DeletePanelDialog"), exports);
|
|
23
|
+
_export_star(require("./DeletePanelGroupDialog"), exports);
|
|
24
|
+
_export_star(require("./DiscardChangesConfirmationDialog"), exports);
|
|
25
|
+
_export_star(require("./DownloadButton"), exports);
|
|
26
|
+
_export_star(require("./EditJsonButton"), exports);
|
|
27
|
+
_export_star(require("./EditJsonDialog"), exports);
|
|
28
|
+
_export_star(require("./EmptyDashboard"), exports);
|
|
29
|
+
_export_star(require("./GridLayout"), exports);
|
|
30
|
+
_export_star(require("./Panel"), exports);
|
|
31
|
+
_export_star(require("./PanelDrawer"), exports);
|
|
32
|
+
_export_star(require("./PanelGroupDialog"), exports);
|
|
33
|
+
_export_star(require("./QuerySummaryTable"), exports);
|
|
34
|
+
_export_star(require("./SaveChangesConfirmationDialog"), exports);
|
|
35
|
+
_export_star(require("./SaveDashboardButton"), exports);
|
|
36
|
+
_export_star(require("./TimeRangeControls"), exports);
|
|
37
|
+
_export_star(require("./ToolbarIconButton"), exports);
|
|
38
|
+
_export_star(require("./Variables"), exports);
|
|
39
|
+
function _export_star(from, to) {
|
|
40
40
|
Object.keys(from).forEach(function(k) {
|
|
41
|
-
if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k))
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
41
|
+
if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) {
|
|
42
|
+
Object.defineProperty(to, k, {
|
|
43
|
+
enumerable: true,
|
|
44
|
+
get: function() {
|
|
45
|
+
return from[k];
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
}
|
|
47
49
|
});
|
|
48
50
|
return from;
|
|
49
51
|
}
|
|
@@ -21,8 +21,12 @@ function _export(target, all) {
|
|
|
21
21
|
});
|
|
22
22
|
}
|
|
23
23
|
_export(exports, {
|
|
24
|
-
GRID_LAYOUT_COLS: ()
|
|
25
|
-
|
|
24
|
+
GRID_LAYOUT_COLS: function() {
|
|
25
|
+
return GRID_LAYOUT_COLS;
|
|
26
|
+
},
|
|
27
|
+
GRID_LAYOUT_SMALL_BREAKPOINT: function() {
|
|
28
|
+
return GRID_LAYOUT_SMALL_BREAKPOINT;
|
|
29
|
+
}
|
|
26
30
|
});
|
|
27
31
|
const GRID_LAYOUT_COLS = {
|
|
28
32
|
sm: 24,
|
|
@@ -14,16 +14,18 @@
|
|
|
14
14
|
Object.defineProperty(exports, "__esModule", {
|
|
15
15
|
value: true
|
|
16
16
|
});
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
function
|
|
17
|
+
_export_star(require("./grid-layout-config"), exports);
|
|
18
|
+
_export_star(require("./user-interface-text"), 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,8 +21,12 @@ function _export(target, all) {
|
|
|
21
21
|
});
|
|
22
22
|
}
|
|
23
23
|
_export(exports, {
|
|
24
|
-
TOOLTIP_TEXT: ()
|
|
25
|
-
|
|
24
|
+
TOOLTIP_TEXT: function() {
|
|
25
|
+
return TOOLTIP_TEXT;
|
|
26
|
+
},
|
|
27
|
+
ARIA_LABEL_TEXT: function() {
|
|
28
|
+
return ARIA_LABEL_TEXT;
|
|
29
|
+
}
|
|
26
30
|
});
|
|
27
31
|
const TOOLTIP_TEXT = {
|
|
28
32
|
// Toolbar buttons
|
|
@@ -21,28 +21,34 @@ function _export(target, all) {
|
|
|
21
21
|
});
|
|
22
22
|
}
|
|
23
23
|
_export(exports, {
|
|
24
|
-
DashboardContext: ()
|
|
25
|
-
|
|
26
|
-
|
|
24
|
+
DashboardContext: function() {
|
|
25
|
+
return DashboardContext;
|
|
26
|
+
},
|
|
27
|
+
useDashboardStore: function() {
|
|
28
|
+
return useDashboardStore;
|
|
29
|
+
},
|
|
30
|
+
DashboardProvider: function() {
|
|
31
|
+
return DashboardProvider;
|
|
32
|
+
}
|
|
27
33
|
});
|
|
28
|
-
const
|
|
34
|
+
const _jsxruntime = require("react/jsx-runtime");
|
|
29
35
|
const _zustand = require("zustand");
|
|
30
36
|
const _middleware = require("zustand/middleware");
|
|
31
37
|
const _immer = require("zustand/middleware/immer");
|
|
32
38
|
const _shallow = require("zustand/shallow");
|
|
33
39
|
const _react = require("react");
|
|
34
40
|
const _core = require("@perses-dev/core");
|
|
35
|
-
const
|
|
36
|
-
const
|
|
37
|
-
const
|
|
38
|
-
const
|
|
39
|
-
const
|
|
40
|
-
const
|
|
41
|
-
const
|
|
42
|
-
const
|
|
43
|
-
const
|
|
44
|
-
const
|
|
45
|
-
const
|
|
41
|
+
const _pluginsystem = require("@perses-dev/plugin-system");
|
|
42
|
+
const _panelgroupeditorslice = require("./panel-group-editor-slice");
|
|
43
|
+
const _panelgroupslice = require("./panel-group-slice");
|
|
44
|
+
const _paneleditorslice = require("./panel-editor-slice");
|
|
45
|
+
const _panelslice = require("./panel-slice");
|
|
46
|
+
const _deletepanelgroupslice = require("./delete-panel-group-slice");
|
|
47
|
+
const _deletepanelslice = require("./delete-panel-slice");
|
|
48
|
+
const _discardchangesdialogslice = require("./discard-changes-dialog-slice");
|
|
49
|
+
const _savechangesdialogslice = require("./save-changes-dialog-slice");
|
|
50
|
+
const _duplicatepanelslice = require("./duplicate-panel-slice");
|
|
51
|
+
const _editjsondialogslice = require("./edit-json-dialog-slice");
|
|
46
52
|
const _common = require("./common");
|
|
47
53
|
const DashboardContext = /*#__PURE__*/ (0, _react.createContext)(undefined);
|
|
48
54
|
function useDashboardStore(selector) {
|
|
@@ -57,10 +63,10 @@ function DashboardProvider(props) {
|
|
|
57
63
|
props
|
|
58
64
|
]);
|
|
59
65
|
// load plugin to retrieve initial spec if default panel kind is defined
|
|
60
|
-
const { defaultPluginKinds } = (0,
|
|
61
|
-
var
|
|
62
|
-
const defaultPanelKind = (
|
|
63
|
-
const { data: plugin } = (0,
|
|
66
|
+
const { defaultPluginKinds } = (0, _pluginsystem.usePluginRegistry)();
|
|
67
|
+
var _defaultPluginKinds_Panel;
|
|
68
|
+
const defaultPanelKind = (_defaultPluginKinds_Panel = defaultPluginKinds === null || defaultPluginKinds === void 0 ? void 0 : defaultPluginKinds['Panel']) !== null && _defaultPluginKinds_Panel !== void 0 ? _defaultPluginKinds_Panel : '';
|
|
69
|
+
const { data: plugin } = (0, _pluginsystem.usePlugin)('Panel', defaultPanelKind);
|
|
64
70
|
const [store] = (0, _react.useState)(createDashboardStore(props)); // prevent calling createDashboardStore every time it rerenders
|
|
65
71
|
(0, _react.useEffect)(()=>{
|
|
66
72
|
if (plugin === undefined) return;
|
|
@@ -76,31 +82,31 @@ function DashboardProvider(props) {
|
|
|
76
82
|
store,
|
|
77
83
|
defaultPanelKind
|
|
78
84
|
]);
|
|
79
|
-
return /*#__PURE__*/ (0,
|
|
85
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsx)(DashboardContext.Provider, {
|
|
80
86
|
value: store,
|
|
81
87
|
children: props.children
|
|
82
88
|
});
|
|
83
89
|
}
|
|
84
90
|
function initStore(props) {
|
|
85
|
-
const { initialState: { dashboardResource , isEditMode }
|
|
86
|
-
const { spec: { display , duration , refreshInterval =_core.DEFAULT_REFRESH_INTERVAL } , metadata
|
|
87
|
-
let { spec: { layouts , panels }
|
|
91
|
+
const { initialState: { dashboardResource , isEditMode } } = props;
|
|
92
|
+
const { spec: { display , duration , refreshInterval =_core.DEFAULT_REFRESH_INTERVAL } , metadata } = dashboardResource;
|
|
93
|
+
let { spec: { layouts , panels } } = dashboardResource;
|
|
88
94
|
// Set fallbacks in case the frontend is used with a non-Perses backend
|
|
89
95
|
layouts = layouts !== null && layouts !== void 0 ? layouts : [];
|
|
90
96
|
panels = panels !== null && panels !== void 0 ? panels : {};
|
|
91
97
|
const store = (0, _zustand.createStore)()((0, _immer.immer)((0, _middleware.devtools)((...args)=>{
|
|
92
98
|
const [set] = args;
|
|
93
99
|
return {
|
|
94
|
-
/* Groups */ ...(0,
|
|
95
|
-
...(0,
|
|
96
|
-
...(0,
|
|
97
|
-
/* Panels */ ...(0,
|
|
98
|
-
...(0,
|
|
99
|
-
...(0,
|
|
100
|
-
...(0,
|
|
101
|
-
/* General */ ...(0,
|
|
102
|
-
...(0,
|
|
103
|
-
...(0,
|
|
100
|
+
/* Groups */ ...(0, _panelgroupslice.createPanelGroupSlice)(layouts)(...args),
|
|
101
|
+
...(0, _panelgroupeditorslice.createPanelGroupEditorSlice)(...args),
|
|
102
|
+
...(0, _deletepanelgroupslice.createDeletePanelGroupSlice)(...args),
|
|
103
|
+
/* Panels */ ...(0, _panelslice.createPanelSlice)(panels)(...args),
|
|
104
|
+
...(0, _paneleditorslice.createPanelEditorSlice)()(...args),
|
|
105
|
+
...(0, _deletepanelslice.createDeletePanelSlice)()(...args),
|
|
106
|
+
...(0, _duplicatepanelslice.createDuplicatePanelSlice)()(...args),
|
|
107
|
+
/* General */ ...(0, _discardchangesdialogslice.createDiscardChangesDialogSlice)(...args),
|
|
108
|
+
...(0, _editjsondialogslice.createEditJsonDialogSlice)(...args),
|
|
109
|
+
...(0, _savechangesdialogslice.createSaveChangesDialogSlice)(...args),
|
|
104
110
|
metadata,
|
|
105
111
|
display,
|
|
106
112
|
duration,
|
|
@@ -114,7 +120,7 @@ function initStore(props) {
|
|
|
114
120
|
state.metadata = metadata;
|
|
115
121
|
state.display = display;
|
|
116
122
|
state.panels = panels;
|
|
117
|
-
const { panelGroups , panelGroupOrder } = (0,
|
|
123
|
+
const { panelGroups , panelGroupOrder } = (0, _panelgroupslice.convertLayoutsToPanelGroups)(layouts);
|
|
118
124
|
state.panelGroups = panelGroups;
|
|
119
125
|
state.panelGroupOrder = panelGroupOrder;
|
|
120
126
|
state.duration = duration;
|
|
@@ -21,8 +21,12 @@ function _export(target, all) {
|
|
|
21
21
|
});
|
|
22
22
|
}
|
|
23
23
|
_export(exports, {
|
|
24
|
-
generateId: ()
|
|
25
|
-
|
|
24
|
+
generateId: function() {
|
|
25
|
+
return generateId;
|
|
26
|
+
},
|
|
27
|
+
createPanelDefinition: function() {
|
|
28
|
+
return createPanelDefinition;
|
|
29
|
+
}
|
|
26
30
|
});
|
|
27
31
|
function generateId() {
|
|
28
32
|
if (globalThis.dashboardStoreId === undefined) {
|
|
@@ -21,31 +21,63 @@ function _export(target, all) {
|
|
|
21
21
|
});
|
|
22
22
|
}
|
|
23
23
|
_export(exports, {
|
|
24
|
-
useEditMode: ()
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
24
|
+
useEditMode: function() {
|
|
25
|
+
return useEditMode;
|
|
26
|
+
},
|
|
27
|
+
useDashboardActions: function() {
|
|
28
|
+
return useDashboardActions;
|
|
29
|
+
},
|
|
30
|
+
usePanelGroupIds: function() {
|
|
31
|
+
return usePanelGroupIds;
|
|
32
|
+
},
|
|
33
|
+
useListPanelGroups: function() {
|
|
34
|
+
return useListPanelGroups;
|
|
35
|
+
},
|
|
36
|
+
usePanelGroup: function() {
|
|
37
|
+
return usePanelGroup;
|
|
38
|
+
},
|
|
39
|
+
usePanelGroupActions: function() {
|
|
40
|
+
return usePanelGroupActions;
|
|
41
|
+
},
|
|
42
|
+
usePanelGroupEditor: function() {
|
|
43
|
+
return usePanelGroupEditor;
|
|
44
|
+
},
|
|
45
|
+
useDeletePanelGroupDialog: function() {
|
|
46
|
+
return useDeletePanelGroupDialog;
|
|
47
|
+
},
|
|
48
|
+
usePanel: function() {
|
|
49
|
+
return usePanel;
|
|
50
|
+
},
|
|
51
|
+
usePanelActions: function() {
|
|
52
|
+
return usePanelActions;
|
|
53
|
+
},
|
|
54
|
+
usePanelEditor: function() {
|
|
55
|
+
return usePanelEditor;
|
|
56
|
+
},
|
|
57
|
+
useDeletePanelDialog: function() {
|
|
58
|
+
return useDeletePanelDialog;
|
|
59
|
+
},
|
|
60
|
+
useDashboardDuration: function() {
|
|
61
|
+
return useDashboardDuration;
|
|
62
|
+
},
|
|
63
|
+
useSaveChangesConfirmationDialog: function() {
|
|
64
|
+
return useSaveChangesConfirmationDialog;
|
|
65
|
+
},
|
|
66
|
+
useDiscardChangesConfirmationDialog: function() {
|
|
67
|
+
return useDiscardChangesConfirmationDialog;
|
|
68
|
+
},
|
|
69
|
+
useEditJsonDialog: function() {
|
|
70
|
+
return useEditJsonDialog;
|
|
71
|
+
}
|
|
40
72
|
});
|
|
41
73
|
const _react = require("react");
|
|
42
|
-
const
|
|
74
|
+
const _DashboardProvider = require("./DashboardProvider");
|
|
43
75
|
const selectEditMode = ({ isEditMode , setEditMode })=>({
|
|
44
76
|
isEditMode,
|
|
45
77
|
setEditMode
|
|
46
78
|
});
|
|
47
79
|
function useEditMode() {
|
|
48
|
-
return (0,
|
|
80
|
+
return (0, _DashboardProvider.useDashboardStore)(selectEditMode);
|
|
49
81
|
}
|
|
50
82
|
const selectDashboardActions = ({ setDashboard , openAddPanelGroup , openAddPanel })=>({
|
|
51
83
|
setDashboard,
|
|
@@ -53,7 +85,7 @@ const selectDashboardActions = ({ setDashboard , openAddPanelGroup , openAddPane
|
|
|
53
85
|
openAddPanel
|
|
54
86
|
});
|
|
55
87
|
function useDashboardActions() {
|
|
56
|
-
const { setDashboard , openAddPanelGroup , openAddPanel } = (0,
|
|
88
|
+
const { setDashboard , openAddPanelGroup , openAddPanel } = (0, _DashboardProvider.useDashboardStore)(selectDashboardActions);
|
|
57
89
|
return {
|
|
58
90
|
setDashboard,
|
|
59
91
|
openAddPanelGroup: ()=>openAddPanelGroup(),
|
|
@@ -62,12 +94,12 @@ function useDashboardActions() {
|
|
|
62
94
|
}
|
|
63
95
|
const selectPanelGroupOrder = (state)=>state.panelGroupOrder;
|
|
64
96
|
function usePanelGroupIds() {
|
|
65
|
-
return (0,
|
|
97
|
+
return (0, _DashboardProvider.useDashboardStore)(selectPanelGroupOrder);
|
|
66
98
|
}
|
|
67
99
|
const selectPanelGroups = (state)=>state.panelGroups;
|
|
68
100
|
function useListPanelGroups() {
|
|
69
101
|
const panelGroupIds = usePanelGroupIds();
|
|
70
|
-
const panelGroups = (0,
|
|
102
|
+
const panelGroups = (0, _DashboardProvider.useDashboardStore)(selectPanelGroups);
|
|
71
103
|
return (0, _react.useMemo)(()=>{
|
|
72
104
|
return panelGroupIds.map((id)=>{
|
|
73
105
|
const group = panelGroups[id];
|
|
@@ -82,7 +114,7 @@ function useListPanelGroups() {
|
|
|
82
114
|
]);
|
|
83
115
|
}
|
|
84
116
|
function usePanelGroup(panelGroupId) {
|
|
85
|
-
const panelGroup = (0,
|
|
117
|
+
const panelGroup = (0, _DashboardProvider.useDashboardStore)((0, _react.useCallback)((state)=>state.panelGroups[panelGroupId], [
|
|
86
118
|
panelGroupId
|
|
87
119
|
]));
|
|
88
120
|
if (panelGroup === undefined) {
|
|
@@ -98,7 +130,7 @@ const selectPanelGroupActions = ({ openEditPanelGroup , deletePanelGroup , openA
|
|
|
98
130
|
});
|
|
99
131
|
function usePanelGroupActions(panelGroupId) {
|
|
100
132
|
const { moveUp , moveDown } = useMovePanelGroup(panelGroupId);
|
|
101
|
-
const { openEditPanelGroup , deletePanelGroup , openAddPanel , updatePanelGroupLayouts } = (0,
|
|
133
|
+
const { openEditPanelGroup , deletePanelGroup , openAddPanel , updatePanelGroupLayouts } = (0, _DashboardProvider.useDashboardStore)(selectPanelGroupActions);
|
|
102
134
|
return {
|
|
103
135
|
openEditPanelGroup: ()=>openEditPanelGroup(panelGroupId),
|
|
104
136
|
deletePanelGroup: ()=>deletePanelGroup(panelGroupId),
|
|
@@ -114,11 +146,11 @@ const selectPanelGroupsLength = (state)=>state.panelGroupOrder.length;
|
|
|
114
146
|
* Returns functions for moving a panel group up or down. A function will be undefined if the panel group can't be
|
|
115
147
|
* moved in that direction.
|
|
116
148
|
*/ function useMovePanelGroup(panelGroupId) {
|
|
117
|
-
const currentIndex = (0,
|
|
149
|
+
const currentIndex = (0, _DashboardProvider.useDashboardStore)((0, _react.useCallback)((store)=>store.panelGroupOrder.findIndex((id)=>id === panelGroupId), [
|
|
118
150
|
panelGroupId
|
|
119
151
|
]));
|
|
120
|
-
const panelGroupsLength = (0,
|
|
121
|
-
const swapPanelGroups = (0,
|
|
152
|
+
const panelGroupsLength = (0, _DashboardProvider.useDashboardStore)(selectPanelGroupsLength);
|
|
153
|
+
const swapPanelGroups = (0, _DashboardProvider.useDashboardStore)(selectSwapPanelGroups);
|
|
122
154
|
if (currentIndex < 0) {
|
|
123
155
|
throw new Error(`Could not find panel group with Id ${panelGroupId} in order array`);
|
|
124
156
|
}
|
|
@@ -131,7 +163,7 @@ const selectPanelGroupsLength = (state)=>state.panelGroupOrder.length;
|
|
|
131
163
|
}
|
|
132
164
|
const selectPanelGroupEditor = (state)=>state.panelGroupEditor;
|
|
133
165
|
function usePanelGroupEditor() {
|
|
134
|
-
return (0,
|
|
166
|
+
return (0, _DashboardProvider.useDashboardStore)(selectPanelGroupEditor);
|
|
135
167
|
}
|
|
136
168
|
const selectDeletePanelGroupDialog = ({ deletePanelGroupDialog , openDeletePanelGroupDialog , closeDeletePanelGroupDialog , deletePanelGroup })=>({
|
|
137
169
|
deletePanelGroupDialog,
|
|
@@ -140,7 +172,7 @@ const selectDeletePanelGroupDialog = ({ deletePanelGroupDialog , openDeletePanel
|
|
|
140
172
|
deletePanelGroup
|
|
141
173
|
});
|
|
142
174
|
function useDeletePanelGroupDialog() {
|
|
143
|
-
const { deletePanelGroupDialog , openDeletePanelGroupDialog , closeDeletePanelGroupDialog , deletePanelGroup } = (0,
|
|
175
|
+
const { deletePanelGroupDialog , openDeletePanelGroupDialog , closeDeletePanelGroupDialog , deletePanelGroup } = (0, _DashboardProvider.useDashboardStore)(selectDeletePanelGroupDialog);
|
|
144
176
|
return {
|
|
145
177
|
deletePanelGroupDialog,
|
|
146
178
|
deletePanelGroup,
|
|
@@ -150,9 +182,9 @@ function useDeletePanelGroupDialog() {
|
|
|
150
182
|
}
|
|
151
183
|
function usePanel(panelGroupItemId) {
|
|
152
184
|
const { panelGroupId , panelGroupItemLayoutId: panelGroupLayoutId } = panelGroupItemId;
|
|
153
|
-
const panel = (0,
|
|
154
|
-
var
|
|
155
|
-
const panelKey = (
|
|
185
|
+
const panel = (0, _DashboardProvider.useDashboardStore)((0, _react.useCallback)((store)=>{
|
|
186
|
+
var _store_panelGroups_panelGroupId;
|
|
187
|
+
const panelKey = (_store_panelGroups_panelGroupId = store.panelGroups[panelGroupId]) === null || _store_panelGroups_panelGroupId === void 0 ? void 0 : _store_panelGroups_panelGroupId.itemPanelKeys[panelGroupLayoutId];
|
|
156
188
|
if (panelKey === undefined) return;
|
|
157
189
|
return store.panels[panelKey];
|
|
158
190
|
}, [
|
|
@@ -170,7 +202,7 @@ const selectPanelActions = ({ openEditPanel , openDeletePanelDialog , duplicateP
|
|
|
170
202
|
duplicatePanel
|
|
171
203
|
});
|
|
172
204
|
function usePanelActions(panelGroupItemId) {
|
|
173
|
-
const { openEditPanel , openDeletePanelDialog , duplicatePanel } = (0,
|
|
205
|
+
const { openEditPanel , openDeletePanelDialog , duplicatePanel } = (0, _DashboardProvider.useDashboardStore)(selectPanelActions);
|
|
174
206
|
return {
|
|
175
207
|
openEditPanel: ()=>openEditPanel(panelGroupItemId),
|
|
176
208
|
openDeletePanelDialog: ()=>openDeletePanelDialog(panelGroupItemId),
|
|
@@ -179,7 +211,7 @@ function usePanelActions(panelGroupItemId) {
|
|
|
179
211
|
}
|
|
180
212
|
const selectPanelEditor = (state)=>state.panelEditor;
|
|
181
213
|
function usePanelEditor() {
|
|
182
|
-
return (0,
|
|
214
|
+
return (0, _DashboardProvider.useDashboardStore)(selectPanelEditor);
|
|
183
215
|
}
|
|
184
216
|
const selectDeletePanelDialog = ({ deletePanelDialog , deletePanel , closeDeletePanelDialog })=>({
|
|
185
217
|
deletePanelDialog,
|
|
@@ -188,11 +220,11 @@ const selectDeletePanelDialog = ({ deletePanelDialog , deletePanel , closeDelete
|
|
|
188
220
|
});
|
|
189
221
|
function useDeletePanelDialog() {
|
|
190
222
|
// TODO: Refactor similar to other dialogs/editors so these are on the editor state itself
|
|
191
|
-
return (0,
|
|
223
|
+
return (0, _DashboardProvider.useDashboardStore)(selectDeletePanelDialog);
|
|
192
224
|
}
|
|
193
225
|
const selectDashboardDuration = (state)=>state.duration;
|
|
194
226
|
function useDashboardDuration() {
|
|
195
|
-
return (0,
|
|
227
|
+
return (0, _DashboardProvider.useDashboardStore)(selectDashboardDuration);
|
|
196
228
|
}
|
|
197
229
|
const selectSaveChangesConfirmationDialog = ({ saveChangesConfirmationDialog , openSaveChangesConfirmationDialog , closeSaveChangesConfirmationDialog })=>({
|
|
198
230
|
saveChangesConfirmationDialog,
|
|
@@ -200,7 +232,7 @@ const selectSaveChangesConfirmationDialog = ({ saveChangesConfirmationDialog , o
|
|
|
200
232
|
closeSaveChangesConfirmationDialog
|
|
201
233
|
});
|
|
202
234
|
function useSaveChangesConfirmationDialog() {
|
|
203
|
-
return (0,
|
|
235
|
+
return (0, _DashboardProvider.useDashboardStore)(selectSaveChangesConfirmationDialog);
|
|
204
236
|
}
|
|
205
237
|
const selectDiscardChangesConfirmationDialog = ({ discardChangesConfirmationDialog , openDiscardChangesConfirmationDialog , closeDiscardChangesConfirmationDialog })=>({
|
|
206
238
|
discardChangesConfirmationDialog,
|
|
@@ -208,7 +240,7 @@ const selectDiscardChangesConfirmationDialog = ({ discardChangesConfirmationDial
|
|
|
208
240
|
closeDiscardChangesConfirmationDialog
|
|
209
241
|
});
|
|
210
242
|
function useDiscardChangesConfirmationDialog() {
|
|
211
|
-
return (0,
|
|
243
|
+
return (0, _DashboardProvider.useDashboardStore)(selectDiscardChangesConfirmationDialog);
|
|
212
244
|
}
|
|
213
245
|
const selectEditJsonDialog = ({ editJsonDialog , openEditJsonDialog , closeEditJsonDialog })=>({
|
|
214
246
|
editJsonDialog,
|
|
@@ -216,5 +248,5 @@ const selectEditJsonDialog = ({ editJsonDialog , openEditJsonDialog , closeEditJ
|
|
|
216
248
|
closeEditJsonDialog
|
|
217
249
|
});
|
|
218
250
|
function useEditJsonDialog() {
|
|
219
|
-
return (0,
|
|
251
|
+
return (0, _DashboardProvider.useDashboardStore)(selectEditJsonDialog);
|
|
220
252
|
}
|
|
@@ -16,7 +16,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
16
16
|
});
|
|
17
17
|
Object.defineProperty(exports, "createDeletePanelGroupSlice", {
|
|
18
18
|
enumerable: true,
|
|
19
|
-
get: ()
|
|
19
|
+
get: function() {
|
|
20
|
+
return createDeletePanelGroupSlice;
|
|
21
|
+
}
|
|
20
22
|
});
|
|
21
23
|
const createDeletePanelGroupSlice = (set, get)=>({
|
|
22
24
|
deletePanelGroup (panelGroupId) {
|
|
@@ -16,7 +16,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
16
16
|
});
|
|
17
17
|
Object.defineProperty(exports, "createDeletePanelSlice", {
|
|
18
18
|
enumerable: true,
|
|
19
|
-
get: ()
|
|
19
|
+
get: function() {
|
|
20
|
+
return createDeletePanelSlice;
|
|
21
|
+
}
|
|
20
22
|
});
|
|
21
23
|
function createDeletePanelSlice() {
|
|
22
24
|
// Return the state creator function for Zustand that uses the panels provided as intitial state
|
|
@@ -58,11 +60,11 @@ function createDeletePanelSlice() {
|
|
|
58
60
|
throw new Error(`Could not find panel ${panelKey}`);
|
|
59
61
|
}
|
|
60
62
|
set((state)=>{
|
|
61
|
-
var
|
|
63
|
+
var _panelGroup_title;
|
|
62
64
|
state.deletePanelDialog = {
|
|
63
65
|
panelGroupItemId: panelGroupItemId,
|
|
64
66
|
panelName: panel.spec.display.name,
|
|
65
|
-
panelGroupName: (
|
|
67
|
+
panelGroupName: (_panelGroup_title = panelGroup.title) !== null && _panelGroup_title !== void 0 ? _panelGroup_title : ''
|
|
66
68
|
};
|
|
67
69
|
});
|
|
68
70
|
},
|