@perses-dev/dashboards 0.0.0-snapshot-scatter-chart-embed-8efdfab → 0.0.0-snapshot-scatterplot-fix-imports-95e1b59
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/components/AddGroupButton/AddGroupButton.js +1 -1
- package/dist/cjs/components/AddPanelButton/AddPanelButton.js +2 -2
- package/dist/cjs/components/Dashboard/Dashboard.js +1 -1
- package/dist/cjs/components/DashboardStickyToolbar/DashboardStickyToolbar.js +2 -2
- package/dist/cjs/components/DashboardToolbar/DashboardToolbar.js +5 -5
- package/dist/cjs/components/Datasources/DatasourceEditor.js +2 -3
- package/dist/cjs/components/Datasources/EditDatasourcesButton.js +10 -4
- package/dist/cjs/components/DeletePanelDialog/DeletePanelDialog.js +4 -4
- package/dist/cjs/components/DeletePanelGroupDialog/DeletePanelGroupDialog.js +1 -1
- package/dist/cjs/components/DiscardChangesConfirmationDialog/DiscardChangesConfirmationDialog.js +1 -1
- package/dist/cjs/components/DownloadButton/DownloadButton.js +3 -4
- package/dist/cjs/components/EditButton/EditButton.js +1 -1
- package/dist/cjs/components/EditJsonButton/EditJsonButton.js +3 -4
- package/dist/cjs/components/EditJsonDialog/EditJsonDialog.js +14 -7
- package/dist/cjs/components/EmptyDashboard/EmptyDashboard.js +3 -3
- package/dist/cjs/components/GridLayout/GridContainer.js +1 -1
- package/dist/cjs/components/GridLayout/GridItemContent.js +6 -7
- package/dist/cjs/components/GridLayout/GridLayout.js +4 -4
- package/dist/cjs/components/GridLayout/GridTitle.js +5 -6
- package/dist/cjs/components/Panel/Panel.js +2 -2
- package/dist/cjs/components/Panel/PanelContent.js +2 -2
- package/dist/cjs/components/Panel/PanelHeader.js +2 -2
- package/dist/cjs/components/PanelDrawer/PanelEditorForm.js +18 -15
- package/dist/cjs/components/PanelDrawer/PanelPreview.js +2 -3
- package/dist/cjs/components/PanelDrawer/usePanelEditor.js +2 -2
- package/dist/cjs/components/PanelGroupDialog/PanelGroupEditorForm.js +1 -1
- package/dist/cjs/components/QuerySummaryTable/QuerySummaryTable.js +2 -2
- package/dist/cjs/components/SaveChangesConfirmationDialog/SaveChangesConfirmationDialog.js +4 -4
- package/dist/cjs/components/SaveDashboardButton/SaveDashboardButton.js +7 -7
- package/dist/cjs/components/Variables/BuiltinVariableAccordions.js +7 -6
- package/dist/cjs/components/Variables/EditVariablesButton.js +2 -2
- package/dist/cjs/components/Variables/TemplateVariable.js +20 -11
- package/dist/cjs/components/Variables/VariableEditor.js +13 -14
- package/dist/cjs/components/Variables/VariableList.js +1 -1
- package/dist/cjs/components/index.js +0 -2
- package/dist/cjs/constants/styles.js +4 -4
- package/dist/cjs/constants/user-interface-text.js +3 -5
- package/dist/cjs/context/DashboardProvider/DashboardProvider.js +15 -10
- package/dist/cjs/context/DashboardProvider/common.js +3 -3
- package/dist/cjs/context/DashboardProvider/dashboard-provider-api.js +40 -40
- package/dist/cjs/context/DashboardProvider/delete-panel-group-slice.js +1 -1
- package/dist/cjs/context/DashboardProvider/delete-panel-slice.js +3 -3
- package/dist/cjs/context/DashboardProvider/duplicate-panel-slice.js +1 -1
- package/dist/cjs/context/DashboardProvider/panel-editor-slice.js +4 -6
- package/dist/cjs/context/DashboardProvider/panel-group-slice.js +6 -6
- package/dist/cjs/context/DatasourceStoreProvider.js +15 -9
- package/dist/cjs/context/TemplateVariableProvider/TemplateVariableProvider.js +81 -77
- package/dist/cjs/context/TemplateVariableProvider/query-params.js +7 -7
- package/dist/cjs/context/TemplateVariableProvider/utils.js +3 -3
- package/dist/cjs/context/useDashboard.js +21 -6
- package/dist/cjs/test/dashboard-provider.js +3 -3
- package/dist/cjs/test/datasource-provider.js +4 -4
- package/dist/cjs/test/render.js +1 -1
- package/dist/cjs/utils/index.js +0 -1
- package/dist/cjs/utils/panelUtils.js +5 -5
- package/dist/cjs/views/ViewDashboard/DashboardApp.js +5 -5
- package/dist/cjs/views/ViewDashboard/ViewDashboard.js +3 -3
- package/dist/components/AddGroupButton/AddGroupButton.d.ts +1 -2
- package/dist/components/AddGroupButton/AddGroupButton.d.ts.map +1 -1
- package/dist/components/AddGroupButton/AddGroupButton.js +1 -1
- package/dist/components/AddGroupButton/AddGroupButton.js.map +1 -1
- package/dist/components/AddPanelButton/AddPanelButton.d.ts +1 -2
- package/dist/components/AddPanelButton/AddPanelButton.d.ts.map +1 -1
- package/dist/components/AddPanelButton/AddPanelButton.js +2 -2
- package/dist/components/AddPanelButton/AddPanelButton.js.map +1 -1
- package/dist/components/Dashboard/Dashboard.d.ts +2 -3
- package/dist/components/Dashboard/Dashboard.d.ts.map +1 -1
- package/dist/components/Dashboard/Dashboard.js +1 -1
- package/dist/components/Dashboard/Dashboard.js.map +1 -1
- package/dist/components/DashboardStickyToolbar/DashboardStickyToolbar.d.ts +1 -2
- package/dist/components/DashboardStickyToolbar/DashboardStickyToolbar.d.ts.map +1 -1
- package/dist/components/DashboardStickyToolbar/DashboardStickyToolbar.js +1 -1
- package/dist/components/DashboardStickyToolbar/DashboardStickyToolbar.js.map +1 -1
- package/dist/components/DashboardToolbar/DashboardToolbar.d.ts +1 -1
- package/dist/components/DashboardToolbar/DashboardToolbar.d.ts.map +1 -1
- package/dist/components/DashboardToolbar/DashboardToolbar.js +4 -4
- package/dist/components/DashboardToolbar/DashboardToolbar.js.map +1 -1
- package/dist/components/Datasources/DatasourceEditor.d.ts +1 -2
- package/dist/components/Datasources/DatasourceEditor.d.ts.map +1 -1
- package/dist/components/Datasources/DatasourceEditor.js +2 -3
- package/dist/components/Datasources/DatasourceEditor.js.map +1 -1
- package/dist/components/Datasources/EditDatasourcesButton.d.ts +1 -2
- package/dist/components/Datasources/EditDatasourcesButton.d.ts.map +1 -1
- package/dist/components/Datasources/EditDatasourcesButton.js +10 -4
- package/dist/components/Datasources/EditDatasourcesButton.js.map +1 -1
- package/dist/components/DeletePanelDialog/DeletePanelDialog.d.ts +1 -2
- package/dist/components/DeletePanelDialog/DeletePanelDialog.d.ts.map +1 -1
- package/dist/components/DeletePanelDialog/DeletePanelDialog.js +4 -4
- package/dist/components/DeletePanelDialog/DeletePanelDialog.js.map +1 -1
- package/dist/components/DeletePanelGroupDialog/DeletePanelGroupDialog.d.ts +1 -2
- package/dist/components/DeletePanelGroupDialog/DeletePanelGroupDialog.d.ts.map +1 -1
- package/dist/components/DeletePanelGroupDialog/DeletePanelGroupDialog.js +1 -1
- package/dist/components/DeletePanelGroupDialog/DeletePanelGroupDialog.js.map +1 -1
- package/dist/components/DiscardChangesConfirmationDialog/DiscardChangesConfirmationDialog.d.ts +1 -2
- package/dist/components/DiscardChangesConfirmationDialog/DiscardChangesConfirmationDialog.d.ts.map +1 -1
- package/dist/components/DiscardChangesConfirmationDialog/DiscardChangesConfirmationDialog.js +1 -1
- package/dist/components/DiscardChangesConfirmationDialog/DiscardChangesConfirmationDialog.js.map +1 -1
- package/dist/components/DownloadButton/DownloadButton.d.ts +1 -2
- package/dist/components/DownloadButton/DownloadButton.d.ts.map +1 -1
- package/dist/components/DownloadButton/DownloadButton.js +3 -4
- package/dist/components/DownloadButton/DownloadButton.js.map +1 -1
- package/dist/components/EditButton/EditButton.d.ts +1 -2
- package/dist/components/EditButton/EditButton.d.ts.map +1 -1
- package/dist/components/EditButton/EditButton.js +1 -1
- package/dist/components/EditButton/EditButton.js.map +1 -1
- package/dist/components/EditJsonButton/EditJsonButton.d.ts +1 -2
- package/dist/components/EditJsonButton/EditJsonButton.d.ts.map +1 -1
- package/dist/components/EditJsonButton/EditJsonButton.js +3 -4
- package/dist/components/EditJsonButton/EditJsonButton.js.map +1 -1
- package/dist/components/EditJsonDialog/EditJsonDialog.d.ts +1 -2
- package/dist/components/EditJsonDialog/EditJsonDialog.d.ts.map +1 -1
- package/dist/components/EditJsonDialog/EditJsonDialog.js +14 -7
- package/dist/components/EditJsonDialog/EditJsonDialog.js.map +1 -1
- package/dist/components/EmptyDashboard/EmptyDashboard.d.ts +1 -1
- package/dist/components/EmptyDashboard/EmptyDashboard.d.ts.map +1 -1
- package/dist/components/EmptyDashboard/EmptyDashboard.js +3 -3
- package/dist/components/EmptyDashboard/EmptyDashboard.js.map +1 -1
- package/dist/components/GridLayout/GridContainer.d.ts +1 -1
- package/dist/components/GridLayout/GridContainer.d.ts.map +1 -1
- package/dist/components/GridLayout/GridContainer.js +1 -1
- package/dist/components/GridLayout/GridContainer.js.map +1 -1
- package/dist/components/GridLayout/GridItemContent.d.ts +1 -2
- package/dist/components/GridLayout/GridItemContent.d.ts.map +1 -1
- package/dist/components/GridLayout/GridItemContent.js +6 -7
- package/dist/components/GridLayout/GridItemContent.js.map +1 -1
- package/dist/components/GridLayout/GridLayout.d.ts +1 -2
- package/dist/components/GridLayout/GridLayout.d.ts.map +1 -1
- package/dist/components/GridLayout/GridLayout.js +4 -4
- package/dist/components/GridLayout/GridLayout.js.map +1 -1
- package/dist/components/GridLayout/GridTitle.d.ts +1 -2
- package/dist/components/GridLayout/GridTitle.d.ts.map +1 -1
- package/dist/components/GridLayout/GridTitle.js +5 -6
- package/dist/components/GridLayout/GridTitle.js.map +1 -1
- package/dist/components/Panel/Panel.d.ts +2 -2
- package/dist/components/Panel/Panel.d.ts.map +1 -1
- package/dist/components/Panel/Panel.js +2 -2
- package/dist/components/Panel/Panel.js.map +1 -1
- package/dist/components/Panel/PanelContent.d.ts +1 -2
- package/dist/components/Panel/PanelContent.d.ts.map +1 -1
- package/dist/components/Panel/PanelContent.js +2 -2
- package/dist/components/Panel/PanelContent.js.map +1 -1
- package/dist/components/Panel/PanelHeader.d.ts +2 -2
- package/dist/components/Panel/PanelHeader.d.ts.map +1 -1
- package/dist/components/Panel/PanelHeader.js +2 -2
- package/dist/components/Panel/PanelHeader.js.map +1 -1
- package/dist/components/PanelDrawer/PanelDrawer.d.ts +1 -2
- package/dist/components/PanelDrawer/PanelDrawer.d.ts.map +1 -1
- package/dist/components/PanelDrawer/PanelDrawer.js.map +1 -1
- package/dist/components/PanelDrawer/PanelEditorForm.d.ts +1 -2
- package/dist/components/PanelDrawer/PanelEditorForm.d.ts.map +1 -1
- package/dist/components/PanelDrawer/PanelEditorForm.js +18 -15
- package/dist/components/PanelDrawer/PanelEditorForm.js.map +1 -1
- package/dist/components/PanelDrawer/PanelPreview.d.ts +1 -2
- package/dist/components/PanelDrawer/PanelPreview.d.ts.map +1 -1
- package/dist/components/PanelDrawer/PanelPreview.js +2 -3
- package/dist/components/PanelDrawer/PanelPreview.js.map +1 -1
- package/dist/components/PanelDrawer/usePanelEditor.js +2 -2
- package/dist/components/PanelDrawer/usePanelEditor.js.map +1 -1
- package/dist/components/PanelGroupDialog/PanelGroupDialog.d.ts +1 -2
- package/dist/components/PanelGroupDialog/PanelGroupDialog.d.ts.map +1 -1
- package/dist/components/PanelGroupDialog/PanelGroupDialog.js.map +1 -1
- package/dist/components/PanelGroupDialog/PanelGroupEditorForm.d.ts +1 -2
- package/dist/components/PanelGroupDialog/PanelGroupEditorForm.d.ts.map +1 -1
- package/dist/components/PanelGroupDialog/PanelGroupEditorForm.js +1 -1
- package/dist/components/PanelGroupDialog/PanelGroupEditorForm.js.map +1 -1
- package/dist/components/QuerySummaryTable/QuerySummaryTable.d.ts +1 -2
- package/dist/components/QuerySummaryTable/QuerySummaryTable.d.ts.map +1 -1
- package/dist/components/QuerySummaryTable/QuerySummaryTable.js +2 -2
- package/dist/components/QuerySummaryTable/QuerySummaryTable.js.map +1 -1
- package/dist/components/SaveChangesConfirmationDialog/SaveChangesConfirmationDialog.d.ts +1 -2
- package/dist/components/SaveChangesConfirmationDialog/SaveChangesConfirmationDialog.d.ts.map +1 -1
- package/dist/components/SaveChangesConfirmationDialog/SaveChangesConfirmationDialog.js +4 -4
- package/dist/components/SaveChangesConfirmationDialog/SaveChangesConfirmationDialog.js.map +1 -1
- package/dist/components/SaveDashboardButton/SaveDashboardButton.d.ts +1 -2
- package/dist/components/SaveDashboardButton/SaveDashboardButton.d.ts.map +1 -1
- package/dist/components/SaveDashboardButton/SaveDashboardButton.js +7 -7
- package/dist/components/SaveDashboardButton/SaveDashboardButton.js.map +1 -1
- package/dist/components/Variables/BuiltinVariableAccordions.d.ts +2 -3
- package/dist/components/Variables/BuiltinVariableAccordions.d.ts.map +1 -1
- package/dist/components/Variables/BuiltinVariableAccordions.js +7 -6
- package/dist/components/Variables/BuiltinVariableAccordions.js.map +1 -1
- package/dist/components/Variables/EditVariablesButton.d.ts +1 -2
- package/dist/components/Variables/EditVariablesButton.d.ts.map +1 -1
- package/dist/components/Variables/EditVariablesButton.js +2 -2
- package/dist/components/Variables/EditVariablesButton.js.map +1 -1
- package/dist/components/Variables/TemplateVariable.d.ts +2 -3
- package/dist/components/Variables/TemplateVariable.d.ts.map +1 -1
- package/dist/components/Variables/TemplateVariable.js +20 -11
- package/dist/components/Variables/TemplateVariable.js.map +1 -1
- package/dist/components/Variables/VariableEditor.d.ts +2 -3
- package/dist/components/Variables/VariableEditor.d.ts.map +1 -1
- package/dist/components/Variables/VariableEditor.js +13 -14
- package/dist/components/Variables/VariableEditor.js.map +1 -1
- package/dist/components/Variables/VariableList.d.ts +2 -3
- package/dist/components/Variables/VariableList.d.ts.map +1 -1
- package/dist/components/Variables/VariableList.js +1 -1
- package/dist/components/Variables/VariableList.js.map +1 -1
- package/dist/components/index.d.ts +0 -2
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/index.js +0 -2
- package/dist/components/index.js.map +1 -1
- package/dist/constants/user-interface-text.d.ts +0 -2
- package/dist/constants/user-interface-text.d.ts.map +1 -1
- package/dist/constants/user-interface-text.js +0 -2
- package/dist/constants/user-interface-text.js.map +1 -1
- package/dist/context/DashboardProvider/DashboardProvider.d.ts +6 -4
- package/dist/context/DashboardProvider/DashboardProvider.d.ts.map +1 -1
- package/dist/context/DashboardProvider/DashboardProvider.js +12 -7
- package/dist/context/DashboardProvider/DashboardProvider.js.map +1 -1
- package/dist/context/DashboardProvider/common.d.ts +3 -3
- package/dist/context/DashboardProvider/common.d.ts.map +1 -1
- package/dist/context/DashboardProvider/common.js.map +1 -1
- package/dist/context/DashboardProvider/dashboard-provider-api.d.ts +1 -1
- package/dist/context/DashboardProvider/dashboard-provider-api.js +15 -15
- package/dist/context/DashboardProvider/dashboard-provider-api.js.map +1 -1
- package/dist/context/DashboardProvider/delete-panel-group-slice.js +1 -1
- package/dist/context/DashboardProvider/delete-panel-group-slice.js.map +1 -1
- package/dist/context/DashboardProvider/delete-panel-slice.js +3 -3
- 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 +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/panel-editor-slice.js +4 -6
- package/dist/context/DashboardProvider/panel-editor-slice.js.map +1 -1
- package/dist/context/DashboardProvider/panel-group-editor-slice.js.map +1 -1
- package/dist/context/DashboardProvider/panel-group-slice.d.ts +2 -2
- package/dist/context/DashboardProvider/panel-group-slice.d.ts.map +1 -1
- package/dist/context/DashboardProvider/panel-group-slice.js +2 -2
- package/dist/context/DashboardProvider/panel-group-slice.js.map +1 -1
- package/dist/context/DashboardProvider/save-changes-dialog-slice.js.map +1 -1
- package/dist/context/DatasourceStoreProvider.d.ts +5 -5
- package/dist/context/DatasourceStoreProvider.d.ts.map +1 -1
- package/dist/context/DatasourceStoreProvider.js +15 -9
- package/dist/context/DatasourceStoreProvider.js.map +1 -1
- package/dist/context/TemplateVariableProvider/TemplateVariableProvider.d.ts +6 -6
- package/dist/context/TemplateVariableProvider/TemplateVariableProvider.d.ts.map +1 -1
- package/dist/context/TemplateVariableProvider/TemplateVariableProvider.js +70 -66
- package/dist/context/TemplateVariableProvider/TemplateVariableProvider.js.map +1 -1
- package/dist/context/TemplateVariableProvider/hydrationUtils.d.ts.map +1 -1
- package/dist/context/TemplateVariableProvider/hydrationUtils.js.map +1 -1
- package/dist/context/TemplateVariableProvider/query-params.js.map +1 -1
- package/dist/context/TemplateVariableProvider/utils.js.map +1 -1
- package/dist/context/useDashboard.d.ts +3 -3
- package/dist/context/useDashboard.d.ts.map +1 -1
- package/dist/context/useDashboard.js +21 -6
- package/dist/context/useDashboard.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/test/dashboard-provider.js.map +1 -1
- package/dist/test/datasource-provider.js.map +1 -1
- package/dist/test/render.js +1 -1
- package/dist/test/render.js.map +1 -1
- package/dist/test/setup-tests.js.map +1 -1
- package/dist/utils/index.d.ts +0 -1
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +0 -1
- package/dist/utils/index.js.map +1 -1
- package/dist/utils/panelUtils.d.ts +1 -1
- package/dist/utils/panelUtils.d.ts.map +1 -1
- package/dist/utils/panelUtils.js +2 -2
- package/dist/utils/panelUtils.js.map +1 -1
- package/dist/validation/panel.d.ts +1 -1
- package/dist/validation/panel.d.ts.map +1 -1
- package/dist/validation/panel.js.map +1 -1
- package/dist/views/ViewDashboard/DashboardApp.d.ts +3 -3
- package/dist/views/ViewDashboard/DashboardApp.d.ts.map +1 -1
- package/dist/views/ViewDashboard/DashboardApp.js +5 -5
- package/dist/views/ViewDashboard/DashboardApp.js.map +1 -1
- package/dist/views/ViewDashboard/ViewDashboard.d.ts +1 -2
- package/dist/views/ViewDashboard/ViewDashboard.d.ts.map +1 -1
- package/dist/views/ViewDashboard/ViewDashboard.js +3 -3
- package/dist/views/ViewDashboard/ViewDashboard.js.map +1 -1
- package/package.json +6 -6
- package/dist/cjs/components/TimeRangeControls/TimeRangeControls.js +0 -210
- package/dist/cjs/components/TimeRangeControls/index.js +0 -30
- package/dist/cjs/components/ToolbarIconButton/ToolbarIconButton.js +0 -40
- package/dist/cjs/components/ToolbarIconButton/index.js +0 -30
- package/dist/cjs/utils/time.js +0 -29
- package/dist/components/TimeRangeControls/TimeRangeControls.d.ts +0 -14
- package/dist/components/TimeRangeControls/TimeRangeControls.d.ts.map +0 -1
- package/dist/components/TimeRangeControls/TimeRangeControls.js +0 -186
- package/dist/components/TimeRangeControls/TimeRangeControls.js.map +0 -1
- package/dist/components/TimeRangeControls/index.d.ts +0 -2
- package/dist/components/TimeRangeControls/index.d.ts.map +0 -1
- package/dist/components/TimeRangeControls/index.js +0 -15
- package/dist/components/TimeRangeControls/index.js.map +0 -1
- package/dist/components/ToolbarIconButton/ToolbarIconButton.d.ts +0 -6
- package/dist/components/ToolbarIconButton/ToolbarIconButton.d.ts.map +0 -1
- package/dist/components/ToolbarIconButton/ToolbarIconButton.js +0 -32
- package/dist/components/ToolbarIconButton/ToolbarIconButton.js.map +0 -1
- package/dist/components/ToolbarIconButton/index.d.ts +0 -2
- package/dist/components/ToolbarIconButton/index.d.ts.map +0 -1
- package/dist/components/ToolbarIconButton/index.js +0 -15
- package/dist/components/ToolbarIconButton/index.js.map +0 -1
- package/dist/utils/time.d.ts +0 -5
- package/dist/utils/time.d.ts.map +0 -1
- package/dist/utils/time.js +0 -23
- package/dist/utils/time.js.map +0 -1
|
@@ -32,7 +32,7 @@ function _interop_require_default(obj) {
|
|
|
32
32
|
};
|
|
33
33
|
}
|
|
34
34
|
const AddGroupButton = ()=>{
|
|
35
|
-
const { openAddPanelGroup
|
|
35
|
+
const { openAddPanelGroup } = (0, _context.useDashboardActions)();
|
|
36
36
|
return /*#__PURE__*/ (0, _jsxruntime.jsx)(_components.InfoTooltip, {
|
|
37
37
|
description: _constants.TOOLTIP_TEXT.addGroup,
|
|
38
38
|
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Button, {
|
|
@@ -31,8 +31,8 @@ function _interop_require_default(obj) {
|
|
|
31
31
|
default: obj
|
|
32
32
|
};
|
|
33
33
|
}
|
|
34
|
-
const AddPanelButton = ({ variant ='text'
|
|
35
|
-
const { openAddPanel
|
|
34
|
+
const AddPanelButton = ({ variant = 'text', color = 'primary', label = 'Panel', fullWidth })=>{
|
|
35
|
+
const { openAddPanel } = (0, _context.useDashboardActions)();
|
|
36
36
|
return /*#__PURE__*/ (0, _jsxruntime.jsx)(_components.InfoTooltip, {
|
|
37
37
|
description: _constants.TOOLTIP_TEXT.addPanel,
|
|
38
38
|
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Button, {
|
|
@@ -26,7 +26,7 @@ const _components = require("@perses-dev/components");
|
|
|
26
26
|
const _context = require("../../context");
|
|
27
27
|
const _GridLayout = require("../GridLayout");
|
|
28
28
|
const _EmptyDashboard = require("../EmptyDashboard");
|
|
29
|
-
function Dashboard({ emptyDashboardProps
|
|
29
|
+
function Dashboard({ emptyDashboardProps, panelOptions, ...boxProps }) {
|
|
30
30
|
const panelGroupIds = (0, _context.usePanelGroupIds)();
|
|
31
31
|
const isEmpty = !panelGroupIds.length;
|
|
32
32
|
return /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Box, {
|
|
@@ -25,8 +25,8 @@ const _react = require("react");
|
|
|
25
25
|
const _material = require("@mui/material");
|
|
26
26
|
const _PinOutline = /*#__PURE__*/ _interop_require_default(require("mdi-material-ui/PinOutline"));
|
|
27
27
|
const _PinOffOutline = /*#__PURE__*/ _interop_require_default(require("mdi-material-ui/PinOffOutline"));
|
|
28
|
+
const _pluginsystem = require("@perses-dev/plugin-system");
|
|
28
29
|
const _Variables = require("../Variables");
|
|
29
|
-
const _TimeRangeControls = require("../TimeRangeControls");
|
|
30
30
|
function _interop_require_default(obj) {
|
|
31
31
|
return obj && obj.__esModule ? obj : {
|
|
32
32
|
default: obj
|
|
@@ -101,7 +101,7 @@ function DashboardStickyToolbar(props) {
|
|
|
101
101
|
ml: isBiggerThanMd ? 1.5 : 'auto',
|
|
102
102
|
direction: "row",
|
|
103
103
|
justifyContent: "end",
|
|
104
|
-
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(
|
|
104
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_pluginsystem.TimeRangeControls, {})
|
|
105
105
|
})
|
|
106
106
|
]
|
|
107
107
|
})
|
|
@@ -23,11 +23,11 @@ Object.defineProperty(exports, "DashboardToolbar", {
|
|
|
23
23
|
const _jsxruntime = require("react/jsx-runtime");
|
|
24
24
|
const _material = require("@mui/material");
|
|
25
25
|
const _components = require("@perses-dev/components");
|
|
26
|
+
const _pluginsystem = require("@perses-dev/plugin-system");
|
|
26
27
|
const _context = require("../../context");
|
|
27
28
|
const _AddPanelButton = require("../AddPanelButton");
|
|
28
29
|
const _AddGroupButton = require("../AddGroupButton");
|
|
29
30
|
const _DownloadButton = require("../DownloadButton");
|
|
30
|
-
const _TimeRangeControls = require("../TimeRangeControls");
|
|
31
31
|
const _Variables = require("../Variables");
|
|
32
32
|
const _Datasources = require("../Datasources");
|
|
33
33
|
const _EditButton = require("../EditButton");
|
|
@@ -35,8 +35,8 @@ const _EditJsonButton = require("../EditJsonButton");
|
|
|
35
35
|
const _SaveDashboardButton = require("../SaveDashboardButton");
|
|
36
36
|
const _DashboardStickyToolbar = require("../DashboardStickyToolbar");
|
|
37
37
|
const DashboardToolbar = (props)=>{
|
|
38
|
-
const { dashboardName
|
|
39
|
-
const { isEditMode
|
|
38
|
+
const { dashboardName, dashboardTitleComponent, initialVariableIsSticky, isReadonly, onEditButtonClick, onCancelButtonClick, onSave } = props;
|
|
39
|
+
const { isEditMode } = (0, _context.useEditMode)();
|
|
40
40
|
const isBiggerThanSm = (0, _material.useMediaQuery)((0, _material.useTheme)().breakpoints.up('sm'));
|
|
41
41
|
const isBiggerThanMd = (0, _material.useMediaQuery)((0, _material.useTheme)().breakpoints.up('md'));
|
|
42
42
|
const dashboardTitle = dashboardTitleComponent ? dashboardTitleComponent : /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Typography, {
|
|
@@ -122,7 +122,7 @@ const DashboardToolbar = (props)=>{
|
|
|
122
122
|
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_DashboardStickyToolbar.DashboardStickyToolbar, {
|
|
123
123
|
initialVariableIsSticky: initialVariableIsSticky,
|
|
124
124
|
sx: {
|
|
125
|
-
backgroundColor: ({ palette
|
|
125
|
+
backgroundColor: ({ palette })=>palette.background.default
|
|
126
126
|
}
|
|
127
127
|
})
|
|
128
128
|
})
|
|
@@ -138,7 +138,7 @@ const DashboardToolbar = (props)=>{
|
|
|
138
138
|
mt: 1,
|
|
139
139
|
ml: 1,
|
|
140
140
|
children: [
|
|
141
|
-
/*#__PURE__*/ (0, _jsxruntime.jsx)(
|
|
141
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_pluginsystem.TimeRangeControls, {}),
|
|
142
142
|
/*#__PURE__*/ (0, _jsxruntime.jsx)(_DownloadButton.DownloadButton, {}),
|
|
143
143
|
/*#__PURE__*/ (0, _jsxruntime.jsx)(_EditJsonButton.EditJsonButton, {
|
|
144
144
|
isReadonly: !isEditMode
|
|
@@ -46,7 +46,7 @@ function DatasourceEditor(props) {
|
|
|
46
46
|
spec: {}
|
|
47
47
|
}
|
|
48
48
|
};
|
|
49
|
-
const { openDiscardChangesConfirmationDialog
|
|
49
|
+
const { openDiscardChangesConfirmationDialog, closeDiscardChangesConfirmationDialog } = (0, _context.useDiscardChangesConfirmationDialog)();
|
|
50
50
|
const handleCancel = ()=>{
|
|
51
51
|
if (JSON.stringify(props.datasources) !== JSON.stringify(datasources)) {
|
|
52
52
|
openDiscardChangesConfirmationDialog({
|
|
@@ -85,8 +85,7 @@ function DatasourceEditor(props) {
|
|
|
85
85
|
};
|
|
86
86
|
return /*#__PURE__*/ (0, _jsxruntime.jsx)(_jsxruntime.Fragment, {
|
|
87
87
|
children: datasourceEdit ? /*#__PURE__*/ (0, _jsxruntime.jsx)(_pluginsystem.DatasourceEditorForm, {
|
|
88
|
-
|
|
89
|
-
initialSpec: datasourceEdit.spec,
|
|
88
|
+
initialDatasourceDefinition: datasourceEdit,
|
|
90
89
|
initialAction: datasourceFormAction,
|
|
91
90
|
isDraft: true,
|
|
92
91
|
onSave: (name, spec)=>{
|
|
@@ -36,10 +36,10 @@ function _interop_require_default(obj) {
|
|
|
36
36
|
}
|
|
37
37
|
function EditDatasourcesButton() {
|
|
38
38
|
const [isDatasourceEditorOpen, setIsDatasourceEditorOpen] = (0, _react.useState)(false);
|
|
39
|
-
const { getLocalDatasources
|
|
39
|
+
const { getLocalDatasources, setLocalDatasources, getSavedDatasources, setSavedDatasources } = (0, _pluginsystem.useDatasourceStore)();
|
|
40
40
|
const localDatasources = getLocalDatasources();
|
|
41
41
|
const savedDatasources = getSavedDatasources();
|
|
42
|
-
const { dashboard
|
|
42
|
+
const { dashboard, setDashboard } = (0, _context.useDashboard)();
|
|
43
43
|
const openDatasourceEditor = ()=>{
|
|
44
44
|
setIsDatasourceEditorOpen(true);
|
|
45
45
|
};
|
|
@@ -49,7 +49,7 @@ function EditDatasourcesButton() {
|
|
|
49
49
|
const handleChangeDatasources = (datasources)=>{
|
|
50
50
|
// Calculates the new list of datasources that are allowed to be used.
|
|
51
51
|
const newSavedDatasources = Object.keys(datasources).filter((key)=>{
|
|
52
|
-
var _datasources_key,
|
|
52
|
+
var _datasources_key_plugin, _datasources_key, _savedDatasources_key_plugin, _savedDatasources_key, _datasources_key_plugin_spec, _datasources_key_plugin1, _datasources_key1, _savedDatasources_key_plugin_spec, _savedDatasources_key_plugin1, _savedDatasources_key1;
|
|
53
53
|
var _datasources_key_plugin_spec1;
|
|
54
54
|
// Datasources are allowed to be used if a) they are direct, or b) they are proxied, and their
|
|
55
55
|
// proxy is the same as what we have saved.
|
|
@@ -61,7 +61,13 @@ function EditDatasourcesButton() {
|
|
|
61
61
|
obj[key] = datasources[key];
|
|
62
62
|
return obj;
|
|
63
63
|
}, {});
|
|
64
|
-
setDashboard({
|
|
64
|
+
setDashboard(dashboard.kind === 'Dashboard' ? {
|
|
65
|
+
...dashboard,
|
|
66
|
+
spec: {
|
|
67
|
+
...dashboard.spec,
|
|
68
|
+
datasources: datasources
|
|
69
|
+
}
|
|
70
|
+
} : {
|
|
65
71
|
...dashboard,
|
|
66
72
|
spec: {
|
|
67
73
|
...dashboard.spec,
|
|
@@ -24,7 +24,7 @@ const _jsxruntime = require("react/jsx-runtime");
|
|
|
24
24
|
const _components = require("@perses-dev/components");
|
|
25
25
|
const _context = require("../../context");
|
|
26
26
|
const DeletePanelDialog = ()=>{
|
|
27
|
-
const { deletePanelDialog
|
|
27
|
+
const { deletePanelDialog, closeDeletePanelDialog } = (0, _context.useDeletePanelDialog)();
|
|
28
28
|
return /*#__PURE__*/ (0, _jsxruntime.jsxs)(_components.Dialog, {
|
|
29
29
|
open: deletePanelDialog !== undefined,
|
|
30
30
|
children: [
|
|
@@ -38,11 +38,11 @@ const DeletePanelDialog = ()=>{
|
|
|
38
38
|
]
|
|
39
39
|
});
|
|
40
40
|
};
|
|
41
|
-
const DeletePanelForm = ({ deletePanelDialog
|
|
42
|
-
const { deletePanel
|
|
41
|
+
const DeletePanelForm = ({ deletePanelDialog })=>{
|
|
42
|
+
const { deletePanel, closeDeletePanelDialog } = (0, _context.useDeletePanelDialog)();
|
|
43
43
|
const handleDelete = (e)=>{
|
|
44
44
|
e.preventDefault();
|
|
45
|
-
const { panelGroupItemId
|
|
45
|
+
const { panelGroupItemId } = deletePanelDialog;
|
|
46
46
|
deletePanel(panelGroupItemId);
|
|
47
47
|
closeDeletePanelDialog();
|
|
48
48
|
};
|
|
@@ -30,7 +30,7 @@ function _interop_require_default(obj) {
|
|
|
30
30
|
};
|
|
31
31
|
}
|
|
32
32
|
const DeletePanelGroupDialog = ()=>{
|
|
33
|
-
const { deletePanelGroupDialog
|
|
33
|
+
const { deletePanelGroupDialog, closeDeletePanelGroupDialog, deletePanelGroup } = (0, _context.useDeletePanelGroupDialog)();
|
|
34
34
|
const panelGroupId = deletePanelGroupDialog === null || deletePanelGroupDialog === void 0 ? void 0 : deletePanelGroupDialog.panelGroupId;
|
|
35
35
|
const handleDelete = (e)=>{
|
|
36
36
|
e.preventDefault();
|
package/dist/cjs/components/DiscardChangesConfirmationDialog/DiscardChangesConfirmationDialog.js
CHANGED
|
@@ -24,7 +24,7 @@ const _jsxruntime = require("react/jsx-runtime");
|
|
|
24
24
|
const _components = require("@perses-dev/components");
|
|
25
25
|
const _context = require("../../context");
|
|
26
26
|
const DashboardDiscardChangesConfirmationDialog = ()=>{
|
|
27
|
-
const { discardChangesConfirmationDialog: dialog
|
|
27
|
+
const { discardChangesConfirmationDialog: dialog } = (0, _context.useDiscardChangesConfirmationDialog)();
|
|
28
28
|
if (dialog === undefined) {
|
|
29
29
|
return null;
|
|
30
30
|
}
|
|
@@ -26,14 +26,13 @@ const _DownloadOutline = /*#__PURE__*/ _interop_require_default(require("mdi-mat
|
|
|
26
26
|
const _components = require("@perses-dev/components");
|
|
27
27
|
const _constants = require("../../constants");
|
|
28
28
|
const _context = require("../../context");
|
|
29
|
-
const _ToolbarIconButton = require("../ToolbarIconButton");
|
|
30
29
|
function _interop_require_default(obj) {
|
|
31
30
|
return obj && obj.__esModule ? obj : {
|
|
32
31
|
default: obj
|
|
33
32
|
};
|
|
34
33
|
}
|
|
35
|
-
function DownloadButton({ heightPx
|
|
36
|
-
const { dashboard
|
|
34
|
+
function DownloadButton({ heightPx }) {
|
|
35
|
+
const { dashboard } = (0, _context.useDashboard)();
|
|
37
36
|
const hiddenLinkRef = (0, _react.useRef)(null);
|
|
38
37
|
const height = heightPx === undefined ? undefined : `${heightPx}px`;
|
|
39
38
|
const onDownloadButtonClick = ()=>{
|
|
@@ -54,7 +53,7 @@ function DownloadButton({ heightPx }) {
|
|
|
54
53
|
children: [
|
|
55
54
|
/*#__PURE__*/ (0, _jsxruntime.jsx)(_components.InfoTooltip, {
|
|
56
55
|
description: _constants.TOOLTIP_TEXT.downloadDashboard,
|
|
57
|
-
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(
|
|
56
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_components.ToolbarIconButton, {
|
|
58
57
|
"aria-label": _constants.TOOLTIP_TEXT.downloadDashboard,
|
|
59
58
|
onClick: onDownloadButtonClick,
|
|
60
59
|
sx: {
|
|
@@ -28,7 +28,7 @@ function _interop_require_default(obj) {
|
|
|
28
28
|
default: obj
|
|
29
29
|
};
|
|
30
30
|
}
|
|
31
|
-
const EditButton = ({ label ='Edit'
|
|
31
|
+
const EditButton = ({ label = 'Edit', onClick })=>{
|
|
32
32
|
return /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Button, {
|
|
33
33
|
onClick: onClick,
|
|
34
34
|
startIcon: /*#__PURE__*/ (0, _jsxruntime.jsx)(_PencilOutline.default, {}),
|
|
@@ -24,7 +24,6 @@ const _jsxruntime = require("react/jsx-runtime");
|
|
|
24
24
|
const _CodeBraces = /*#__PURE__*/ _interop_require_default(require("mdi-material-ui/CodeBraces"));
|
|
25
25
|
const _components = require("@perses-dev/components");
|
|
26
26
|
const _constants = require("../../constants");
|
|
27
|
-
const _ToolbarIconButton = require("../ToolbarIconButton");
|
|
28
27
|
const _context = require("../../context");
|
|
29
28
|
function _interop_require_default(obj) {
|
|
30
29
|
return obj && obj.__esModule ? obj : {
|
|
@@ -32,12 +31,12 @@ function _interop_require_default(obj) {
|
|
|
32
31
|
};
|
|
33
32
|
}
|
|
34
33
|
const EditJsonButton = (props)=>{
|
|
35
|
-
const { isReadonly
|
|
36
|
-
const { openEditJsonDialog
|
|
34
|
+
const { isReadonly } = props;
|
|
35
|
+
const { openEditJsonDialog } = (0, _context.useEditJsonDialog)();
|
|
37
36
|
const info = isReadonly ? _constants.TOOLTIP_TEXT.viewJson : _constants.TOOLTIP_TEXT.editJson;
|
|
38
37
|
return /*#__PURE__*/ (0, _jsxruntime.jsx)(_components.InfoTooltip, {
|
|
39
38
|
description: info,
|
|
40
|
-
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(
|
|
39
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_components.ToolbarIconButton, {
|
|
41
40
|
"aria-label": info,
|
|
42
41
|
variant: "outlined",
|
|
43
42
|
onClick: ()=>openEditJsonDialog(),
|
|
@@ -28,8 +28,8 @@ const _pluginsystem = require("@perses-dev/plugin-system");
|
|
|
28
28
|
const _DashboardProvider = require("../../context/DashboardProvider");
|
|
29
29
|
const _useDashboard = require("../../context/useDashboard");
|
|
30
30
|
const EditJsonDialog = (props)=>{
|
|
31
|
-
const { isReadonly
|
|
32
|
-
const { editJsonDialog
|
|
31
|
+
const { isReadonly, disableMetadataEdition } = props;
|
|
32
|
+
const { editJsonDialog, closeEditJsonDialog } = (0, _DashboardProvider.useEditJsonDialog)();
|
|
33
33
|
return /*#__PURE__*/ (0, _jsxruntime.jsxs)(_components.Dialog, {
|
|
34
34
|
open: !!(editJsonDialog === null || editJsonDialog === void 0 ? void 0 : editJsonDialog.isOpen),
|
|
35
35
|
scroll: "paper",
|
|
@@ -51,11 +51,11 @@ const EditJsonDialog = (props)=>{
|
|
|
51
51
|
});
|
|
52
52
|
};
|
|
53
53
|
const EditJsonDialogForm = (props)=>{
|
|
54
|
-
const { isReadonly
|
|
55
|
-
const { closeEditJsonDialog
|
|
56
|
-
const { setTimeRange
|
|
57
|
-
const { dashboard
|
|
58
|
-
const { setLocalDatasources
|
|
54
|
+
const { isReadonly, disableMetadataEdition } = props;
|
|
55
|
+
const { closeEditJsonDialog } = (0, _DashboardProvider.useEditJsonDialog)();
|
|
56
|
+
const { setTimeRange, setRefreshInterval } = (0, _pluginsystem.useTimeRange)();
|
|
57
|
+
const { dashboard, setDashboard } = (0, _useDashboard.useDashboard)();
|
|
58
|
+
const { setLocalDatasources } = (0, _pluginsystem.useDatasourceStore)();
|
|
59
59
|
const [draftDashboard, setDraftDashboard] = (0, _react.useState)(dashboard);
|
|
60
60
|
const handleApply = (e)=>{
|
|
61
61
|
e.preventDefault();
|
|
@@ -92,6 +92,13 @@ const EditJsonDialogForm = (props)=>{
|
|
|
92
92
|
severity: "warning",
|
|
93
93
|
children: "Metadata cannot be modified or saved."
|
|
94
94
|
}),
|
|
95
|
+
draftDashboard.kind === 'EphemeralDashboard' && /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Alert, {
|
|
96
|
+
sx: {
|
|
97
|
+
marginBottom: 1
|
|
98
|
+
},
|
|
99
|
+
severity: "warning",
|
|
100
|
+
children: "Time-to-live cannot be modified or saved from here. Go to the project view to modify it."
|
|
101
|
+
}),
|
|
95
102
|
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.FormControl, {
|
|
96
103
|
fullWidth: true,
|
|
97
104
|
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_components.JSONEditor, {
|
|
@@ -38,7 +38,7 @@ const COMMON_BUTTON_PROPS = {
|
|
|
38
38
|
variant: 'outlined',
|
|
39
39
|
color: 'secondary'
|
|
40
40
|
};
|
|
41
|
-
const EmptyDashboardActions = ({ actions
|
|
41
|
+
const EmptyDashboardActions = ({ actions, isEditMode, onEditButtonClick })=>{
|
|
42
42
|
if (actions && typeof actions !== 'boolean') {
|
|
43
43
|
// Custom actions
|
|
44
44
|
return actions;
|
|
@@ -76,8 +76,8 @@ const EmptyDashboardActions = ({ actions , isEditMode , onEditButtonClick })=>{
|
|
|
76
76
|
}
|
|
77
77
|
return null;
|
|
78
78
|
};
|
|
79
|
-
const EmptyDashboard = ({ title =DEFAULT_TITLE
|
|
80
|
-
const { isEditMode
|
|
79
|
+
const EmptyDashboard = ({ title = DEFAULT_TITLE, image, description, additionalText, actions, onEditButtonClick })=>{
|
|
80
|
+
const { isEditMode } = (0, _context.useEditMode)();
|
|
81
81
|
const defaultDescription = isEditMode ? DEFAULT_DESCRIPTION.edit : DEFAULT_DESCRIPTION.view;
|
|
82
82
|
const actionsContent = /*#__PURE__*/ (0, _jsxruntime.jsx)(EmptyDashboardActions, {
|
|
83
83
|
actions: actions,
|
|
@@ -50,7 +50,7 @@ function GridContainer(props) {
|
|
|
50
50
|
}
|
|
51
51
|
/**
|
|
52
52
|
* These are the classes needed by react-grid-layout from their CSS stylesheet.
|
|
53
|
-
*/ const ReactGridLayoutContainer = (0, _material.styled)('section')(({ theme
|
|
53
|
+
*/ const ReactGridLayoutContainer = (0, _material.styled)('section')(({ theme })=>({
|
|
54
54
|
'& .react-grid-layout': {
|
|
55
55
|
position: 'relative',
|
|
56
56
|
transition: 'height 200ms ease'
|
|
@@ -25,15 +25,14 @@ const _material = require("@mui/material");
|
|
|
25
25
|
const _reactintersectionobserver = require("react-intersection-observer");
|
|
26
26
|
const _pluginsystem = require("@perses-dev/plugin-system");
|
|
27
27
|
const _context = require("../../context");
|
|
28
|
-
const _utils = require("../../utils");
|
|
29
28
|
const _Panel = require("../Panel/Panel");
|
|
30
29
|
function GridItemContent(props) {
|
|
31
|
-
const { panelGroupItemId
|
|
30
|
+
const { panelGroupItemId, width } = props;
|
|
32
31
|
const panelDefinition = (0, _context.usePanel)(panelGroupItemId);
|
|
33
|
-
const { spec: { queries
|
|
34
|
-
const { isEditMode
|
|
35
|
-
const { openEditPanel
|
|
36
|
-
const { ref
|
|
32
|
+
const { spec: { queries } } = panelDefinition;
|
|
33
|
+
const { isEditMode } = (0, _context.useEditMode)();
|
|
34
|
+
const { openEditPanel, openDeletePanelDialog, duplicatePanel } = (0, _context.usePanelActions)(panelGroupItemId);
|
|
35
|
+
const { ref, inView } = (0, _reactintersectionobserver.useInView)({
|
|
37
36
|
threshold: 0.2,
|
|
38
37
|
initialInView: false,
|
|
39
38
|
triggerOnce: true
|
|
@@ -48,7 +47,7 @@ function GridItemContent(props) {
|
|
|
48
47
|
};
|
|
49
48
|
}
|
|
50
49
|
// map TimeSeriesQueryDefinition to Definition<UnknownSpec>
|
|
51
|
-
const suggestedStepMs = (0,
|
|
50
|
+
const suggestedStepMs = (0, _pluginsystem.useSuggestedStepMs)(width);
|
|
52
51
|
const queryDefinitions = queries !== null && queries !== void 0 ? queries : [];
|
|
53
52
|
const definitions = queryDefinitions.map((query)=>{
|
|
54
53
|
return {
|
|
@@ -33,13 +33,13 @@ const _GridContainer = require("./GridContainer");
|
|
|
33
33
|
const DEFAULT_MARGIN = 10;
|
|
34
34
|
const ResponsiveGridLayout = (0, _reactgridlayout.WidthProvider)(_reactgridlayout.Responsive);
|
|
35
35
|
function GridLayout(props) {
|
|
36
|
-
const { panelGroupId
|
|
36
|
+
const { panelGroupId/*...others */ } = props;
|
|
37
37
|
const theme = (0, _material.useTheme)();
|
|
38
38
|
const groupDefinition = (0, _context.usePanelGroup)(panelGroupId);
|
|
39
|
-
const { updatePanelGroupLayouts
|
|
39
|
+
const { updatePanelGroupLayouts } = (0, _context.usePanelGroupActions)(panelGroupId);
|
|
40
40
|
var _ref;
|
|
41
41
|
const [isOpen, setIsOpen] = (0, _react.useState)((_ref = !groupDefinition.isCollapsed) !== null && _ref !== void 0 ? _ref : true);
|
|
42
|
-
const { isEditMode
|
|
42
|
+
const { isEditMode } = (0, _context.useEditMode)();
|
|
43
43
|
const [gridColWidth, setGridColWidth] = (0, _react.useState)(0);
|
|
44
44
|
const handleLayoutChange = (currentLayout, allLayouts)=>{
|
|
45
45
|
// Using the value from `allLayouts` instead of `currentLayout` because of
|
|
@@ -103,7 +103,7 @@ function GridLayout(props) {
|
|
|
103
103
|
},
|
|
104
104
|
onLayoutChange: handleLayoutChange,
|
|
105
105
|
onWidthChange: handleWidthChange,
|
|
106
|
-
children: groupDefinition.itemLayouts.map(({ i
|
|
106
|
+
children: groupDefinition.itemLayouts.map(({ i, w })=>/*#__PURE__*/ (0, _jsxruntime.jsx)("div", {
|
|
107
107
|
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_components.ErrorBoundary, {
|
|
108
108
|
FallbackComponent: _components.ErrorAlert,
|
|
109
109
|
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_GridItemContent.GridItemContent, {
|
|
@@ -39,11 +39,11 @@ function _interop_require_default(obj) {
|
|
|
39
39
|
};
|
|
40
40
|
}
|
|
41
41
|
function GridTitle(props) {
|
|
42
|
-
const { panelGroupId
|
|
42
|
+
const { panelGroupId, title: rawTitle, collapse } = props;
|
|
43
43
|
const title = (0, _pluginsystem.useReplaceVariablesInString)(rawTitle);
|
|
44
|
-
const { openAddPanel
|
|
45
|
-
const { openDeletePanelGroupDialog
|
|
46
|
-
const { isEditMode
|
|
44
|
+
const { openAddPanel, openEditPanelGroup, moveUp, moveDown } = (0, _context.usePanelGroupActions)(panelGroupId);
|
|
45
|
+
const { openDeletePanelGroupDialog } = (0, _context.useDeletePanelGroupDialog)();
|
|
46
|
+
const { isEditMode } = (0, _context.useEditMode)();
|
|
47
47
|
const text = /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Typography, {
|
|
48
48
|
variant: "h2",
|
|
49
49
|
children: title
|
|
@@ -54,9 +54,8 @@ function GridTitle(props) {
|
|
|
54
54
|
display: 'flex',
|
|
55
55
|
justifyContent: 'start',
|
|
56
56
|
alignItems: 'center',
|
|
57
|
-
padding: (theme)=>theme.spacing(1),
|
|
58
57
|
cursor: collapse ? 'pointer' : 'auto',
|
|
59
|
-
backgroundColor: ({ palette
|
|
58
|
+
backgroundColor: ({ palette })=>palette.background.paper
|
|
60
59
|
},
|
|
61
60
|
"data-testid": "panel-group-header",
|
|
62
61
|
children: collapse ? /*#__PURE__*/ (0, _jsxruntime.jsxs)(_jsxruntime.Fragment, {
|
|
@@ -34,12 +34,12 @@ function _interop_require_default(obj) {
|
|
|
34
34
|
}
|
|
35
35
|
const Panel = /*#__PURE__*/ (0, _react.memo)(function Panel(props) {
|
|
36
36
|
var _panelOptions_extra;
|
|
37
|
-
const { definition
|
|
37
|
+
const { definition, editHandlers, onMouseEnter, onMouseLeave, sx, panelOptions, panelGroupItemId, ...others } = props;
|
|
38
38
|
// Make sure we have an ID we can use for aria attributes
|
|
39
39
|
const generatedPanelId = (0, _components.useId)('Panel');
|
|
40
40
|
const headerId = `${generatedPanelId}-header`;
|
|
41
41
|
const [contentElement, setContentElement] = (0, _react.useState)(null);
|
|
42
|
-
const { width
|
|
42
|
+
const { width, height } = (0, _useresizeobserver.default)({
|
|
43
43
|
ref: contentElement
|
|
44
44
|
});
|
|
45
45
|
const contentDimensions = (0, _react.useMemo)(()=>{
|
|
@@ -24,8 +24,8 @@ const _jsxruntime = require("react/jsx-runtime");
|
|
|
24
24
|
const _pluginsystem = require("@perses-dev/plugin-system");
|
|
25
25
|
const _material = require("@mui/material");
|
|
26
26
|
function PanelContent(props) {
|
|
27
|
-
const { panelPluginKind
|
|
28
|
-
const { data: plugin
|
|
27
|
+
const { panelPluginKind, contentDimensions, definition, ...others } = props;
|
|
28
|
+
const { data: plugin, isLoading } = (0, _pluginsystem.usePlugin)('Panel', panelPluginKind, {
|
|
29
29
|
useErrorBoundary: true
|
|
30
30
|
});
|
|
31
31
|
const PanelComponent = plugin === null || plugin === void 0 ? void 0 : plugin.PanelComponent;
|
|
@@ -35,7 +35,7 @@ function _interop_require_default(obj) {
|
|
|
35
35
|
default: obj
|
|
36
36
|
};
|
|
37
37
|
}
|
|
38
|
-
function PanelHeader({ id
|
|
38
|
+
function PanelHeader({ id, title: rawTitle, description: rawDescription, editHandlers, sx, extra, ...rest }) {
|
|
39
39
|
const titleElementId = `${id}-title`;
|
|
40
40
|
const descriptionTooltipId = `${id}-description`;
|
|
41
41
|
const title = (0, _pluginsystem.useReplaceVariablesInString)(rawTitle);
|
|
@@ -169,7 +169,7 @@ function PanelHeader({ id , title: rawTitle , description: rawDescription , edit
|
|
|
169
169
|
...rest
|
|
170
170
|
});
|
|
171
171
|
}
|
|
172
|
-
const HeaderIconButton = (0, _material.styled)(_material.IconButton)(({ theme
|
|
172
|
+
const HeaderIconButton = (0, _material.styled)(_material.IconButton)(({ theme })=>({
|
|
173
173
|
borderRadius: theme.shape.borderRadius,
|
|
174
174
|
padding: '4px'
|
|
175
175
|
}));
|
|
@@ -40,11 +40,11 @@ const _validation = require("../../validation");
|
|
|
40
40
|
const _PanelPreview = require("./PanelPreview");
|
|
41
41
|
const _usePanelEditor = require("./usePanelEditor");
|
|
42
42
|
function PanelEditorForm(props) {
|
|
43
|
-
const { initialValues: { panelDefinition: initialPanelDef
|
|
43
|
+
const { initialValues: { panelDefinition: initialPanelDef, groupId: initialGroupId }, initialAction, onSave, onClose } = props;
|
|
44
44
|
const panelGroups = (0, _context.useListPanelGroups)();
|
|
45
45
|
const [groupId, setGroupId] = (0, _react.useState)(initialGroupId);
|
|
46
|
-
const { panelDefinition
|
|
47
|
-
const { plugin
|
|
46
|
+
const { panelDefinition, setName, setDescription, setQueries, setPlugin, setPanelDefinition } = (0, _usePanelEditor.usePanelEditor)(initialPanelDef);
|
|
47
|
+
const { plugin } = panelDefinition.spec;
|
|
48
48
|
const [isDiscardDialogOpened, setDiscardDialogOpened] = (0, _react.useState)(false);
|
|
49
49
|
// Use common plugin editor logic even though we've split the inputs up in this form
|
|
50
50
|
const pluginEditor = (0, _pluginsystem.usePluginEditor)({
|
|
@@ -98,14 +98,13 @@ function PanelEditorForm(props) {
|
|
|
98
98
|
}
|
|
99
99
|
const handlePanelDefinitionChange = (nextPanelDefStr)=>{
|
|
100
100
|
const nextPanelDef = JSON.parse(nextPanelDefStr);
|
|
101
|
-
const { kind: pluginKind
|
|
101
|
+
const { kind: pluginKind, spec: pluginSpec } = nextPanelDef.spec.plugin;
|
|
102
102
|
// if panel plugin kind and spec are modified, then need to save current spec
|
|
103
103
|
if (panelDefinition.spec.plugin.kind !== pluginKind && JSON.stringify(panelDefinition.spec.plugin.spec) !== JSON.stringify(pluginSpec)) {
|
|
104
104
|
pluginEditor.rememberCurrentSpecState();
|
|
105
105
|
}
|
|
106
106
|
setPanelDefinition(nextPanelDef);
|
|
107
107
|
};
|
|
108
|
-
var _panelGroup_title, _pluginEditor_error_message;
|
|
109
108
|
return /*#__PURE__*/ (0, _jsxruntime.jsxs)(_reacthookform.FormProvider, {
|
|
110
109
|
...form,
|
|
111
110
|
children: [
|
|
@@ -161,9 +160,9 @@ function PanelEditorForm(props) {
|
|
|
161
160
|
xs: 8,
|
|
162
161
|
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_reacthookform.Controller, {
|
|
163
162
|
name: "name",
|
|
164
|
-
render: ({ field
|
|
163
|
+
render: ({ field, fieldState })=>{
|
|
165
164
|
var _fieldState_error;
|
|
166
|
-
/*#__PURE__*/
|
|
165
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.TextField, {
|
|
167
166
|
...field,
|
|
168
167
|
required: true,
|
|
169
168
|
fullWidth: true,
|
|
@@ -183,9 +182,9 @@ function PanelEditorForm(props) {
|
|
|
183
182
|
xs: 4,
|
|
184
183
|
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_reacthookform.Controller, {
|
|
185
184
|
name: "groupId",
|
|
186
|
-
render: ({ field
|
|
185
|
+
render: ({ field, fieldState })=>{
|
|
187
186
|
var _fieldState_error;
|
|
188
|
-
/*#__PURE__*/
|
|
187
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.TextField, {
|
|
189
188
|
select: true,
|
|
190
189
|
...field,
|
|
191
190
|
required: true,
|
|
@@ -197,10 +196,13 @@ function PanelEditorForm(props) {
|
|
|
197
196
|
field.onChange(event);
|
|
198
197
|
setGroupId(+event.target.value);
|
|
199
198
|
},
|
|
200
|
-
children: panelGroups.map((panelGroup, index)=>/*#__PURE__*/
|
|
199
|
+
children: panelGroups.map((panelGroup, index)=>/*#__PURE__*/ {
|
|
200
|
+
var _panelGroup_title;
|
|
201
|
+
return (0, _jsxruntime.jsx)(_material.MenuItem, {
|
|
201
202
|
value: panelGroup.id,
|
|
202
203
|
children: (_panelGroup_title = panelGroup.title) !== null && _panelGroup_title !== void 0 ? _panelGroup_title : `Group ${index + 1}`
|
|
203
|
-
}, panelGroup.id)
|
|
204
|
+
}, panelGroup.id);
|
|
205
|
+
})
|
|
204
206
|
});
|
|
205
207
|
}
|
|
206
208
|
})
|
|
@@ -210,9 +212,9 @@ function PanelEditorForm(props) {
|
|
|
210
212
|
xs: 8,
|
|
211
213
|
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_reacthookform.Controller, {
|
|
212
214
|
name: "description",
|
|
213
|
-
render: ({ field
|
|
215
|
+
render: ({ field, fieldState })=>{
|
|
214
216
|
var _fieldState_error;
|
|
215
|
-
/*#__PURE__*/
|
|
217
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.TextField, {
|
|
216
218
|
...field,
|
|
217
219
|
fullWidth: true,
|
|
218
220
|
label: "Description",
|
|
@@ -231,9 +233,10 @@ function PanelEditorForm(props) {
|
|
|
231
233
|
xs: 4,
|
|
232
234
|
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_reacthookform.Controller, {
|
|
233
235
|
name: "type",
|
|
234
|
-
render: ({ field
|
|
236
|
+
render: ({ field, fieldState })=>/*#__PURE__*/ {
|
|
235
237
|
var _pluginEditor_error, _fieldState_error;
|
|
236
|
-
|
|
238
|
+
var _pluginEditor_error_message;
|
|
239
|
+
return (0, _jsxruntime.jsx)(_pluginsystem.PluginKindSelect, {
|
|
237
240
|
...field,
|
|
238
241
|
pluginType: "Panel",
|
|
239
242
|
required: true,
|
|
@@ -25,16 +25,15 @@ const _react = require("react");
|
|
|
25
25
|
const _material = require("@mui/material");
|
|
26
26
|
const _pluginsystem = require("@perses-dev/plugin-system");
|
|
27
27
|
const _Panel = require("../Panel");
|
|
28
|
-
const _utils = require("../../utils");
|
|
29
28
|
const PANEL_PREVIEW_HEIGHT = 300;
|
|
30
29
|
const PANEL_PREVIEW_DEFAULT_WIDTH = 840;
|
|
31
|
-
function PanelPreview({ panelDefinition
|
|
30
|
+
function PanelPreview({ panelDefinition }) {
|
|
32
31
|
const boxRef = (0, _react.useRef)(null);
|
|
33
32
|
let width = PANEL_PREVIEW_DEFAULT_WIDTH;
|
|
34
33
|
if (boxRef.current !== null) {
|
|
35
34
|
width = boxRef.current.getBoundingClientRect().width;
|
|
36
35
|
}
|
|
37
|
-
const suggestedStepMs = (0,
|
|
36
|
+
const suggestedStepMs = (0, _pluginsystem.useSuggestedStepMs)(width);
|
|
38
37
|
if (panelDefinition.spec.plugin.kind === '') {
|
|
39
38
|
return null;
|
|
40
39
|
}
|
|
@@ -22,7 +22,7 @@ Object.defineProperty(exports, "usePanelEditor", {
|
|
|
22
22
|
});
|
|
23
23
|
const _react = require("react");
|
|
24
24
|
const usePanelEditor = (panelDefinition)=>{
|
|
25
|
-
const { display
|
|
25
|
+
const { display, plugin: pluginDefinition, queries: initialQueries } = panelDefinition.spec;
|
|
26
26
|
const [name, setName] = (0, _react.useState)(display.name);
|
|
27
27
|
const [description, setDescription] = (0, _react.useState)(display.description);
|
|
28
28
|
const [plugin, setPlugin] = (0, _react.useState)(pluginDefinition);
|
|
@@ -47,7 +47,7 @@ const usePanelEditor = (panelDefinition)=>{
|
|
|
47
47
|
]);
|
|
48
48
|
// reset panel definition
|
|
49
49
|
const setPanelDefinition = (0, _react.useCallback)((panelDefinition)=>{
|
|
50
|
-
const { display
|
|
50
|
+
const { display, plugin, queries } = panelDefinition.spec;
|
|
51
51
|
setName(display.name);
|
|
52
52
|
setDescription(display.description);
|
|
53
53
|
setPlugin(plugin);
|
|
@@ -32,7 +32,7 @@ const _jsxruntime = require("react/jsx-runtime");
|
|
|
32
32
|
const _react = require("react");
|
|
33
33
|
const _material = require("@mui/material");
|
|
34
34
|
function PanelGroupEditorForm(props) {
|
|
35
|
-
const { initialValues
|
|
35
|
+
const { initialValues, onSubmit } = props;
|
|
36
36
|
const [title, setTitle] = (0, _react.useState)(initialValues.title);
|
|
37
37
|
const [isCollapsed, setIsCollapsed] = (0, _react.useState)(initialValues.isCollapsed);
|
|
38
38
|
const handleCollapsedChange = (e)=>{
|
|
@@ -26,11 +26,11 @@ const _reactquery = require("@tanstack/react-query");
|
|
|
26
26
|
const _pluginsystem = require("@perses-dev/plugin-system");
|
|
27
27
|
const TABLE_MAX_WIDTH = 1000;
|
|
28
28
|
function QuerySummaryTable(props) {
|
|
29
|
-
const { showTotalQueries =true
|
|
29
|
+
const { showTotalQueries = true } = props;
|
|
30
30
|
const datasourceClient = (0, _pluginsystem.useDatasourceClient)({
|
|
31
31
|
kind: 'PrometheusDatasource'
|
|
32
32
|
});
|
|
33
|
-
const { absoluteTimeRange
|
|
33
|
+
const { absoluteTimeRange } = (0, _pluginsystem.useTimeRange)();
|
|
34
34
|
// for displaying a summary of recent query results
|
|
35
35
|
const queryClient = (0, _reactquery.useQueryClient)();
|
|
36
36
|
const queries = queryClient.getQueryCache().findAll();
|