@perses-dev/dashboards 0.0.0-snapshot-scatter-chart-embed-8efdfab → 0.0.0-snapshot-explorer-plugin-c4a7621
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 +9 -2
- package/dist/cjs/components/DashboardStickyToolbar/DashboardStickyToolbar.js +4 -4
- package/dist/cjs/components/DashboardToolbar/DashboardToolbar.js +6 -6
- package/dist/cjs/components/Datasources/DatasourceEditor.js +19 -20
- package/dist/cjs/components/Datasources/EditDatasourcesButton.js +11 -8
- package/dist/cjs/components/DeletePanelDialog/DeletePanelDialog.js +4 -4
- package/dist/cjs/components/DeletePanelGroupDialog/DeletePanelGroupDialog.js +4 -5
- 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 +21 -17
- package/dist/cjs/components/EmptyDashboard/EmptyDashboard.js +5 -5
- package/dist/cjs/components/GridLayout/GridContainer.js +16 -11
- package/dist/cjs/components/GridLayout/GridItemContent.js +24 -10
- package/dist/cjs/components/GridLayout/GridLayout.js +63 -14
- package/dist/cjs/components/GridLayout/GridTitle.js +8 -9
- package/dist/cjs/{validation/panel.js → components/Panel/HeaderIconButton.js} +8 -10
- package/dist/cjs/components/Panel/Panel.js +15 -11
- package/dist/cjs/components/Panel/PanelActions.js +216 -0
- package/dist/cjs/components/Panel/PanelContent.js +6 -6
- package/dist/cjs/components/Panel/PanelHeader.js +36 -103
- package/dist/cjs/components/Panel/PanelLinks.js +136 -0
- package/dist/cjs/components/PanelDrawer/PanelDrawer.js +9 -6
- package/dist/cjs/components/PanelDrawer/PanelEditorForm.js +67 -62
- package/dist/cjs/components/PanelDrawer/PanelPreview.js +9 -6
- package/dist/cjs/components/PanelDrawer/usePanelEditor.js +9 -6
- package/dist/cjs/components/PanelGroupDialog/PanelGroupDialog.js +1 -1
- package/dist/cjs/components/PanelGroupDialog/PanelGroupEditorForm.js +1 -1
- package/dist/cjs/components/QuerySummaryTable/QuerySummaryTable.js +5 -7
- package/dist/cjs/components/SaveChangesConfirmationDialog/SaveChangesConfirmationDialog.js +7 -9
- package/dist/cjs/components/SaveDashboardButton/SaveDashboardButton.js +8 -8
- package/dist/cjs/components/Variables/BuiltinVariableAccordions.js +8 -14
- package/dist/cjs/components/Variables/EditVariablesButton.js +5 -5
- package/dist/cjs/components/Variables/{TemplateVariable.js → Variable.js} +48 -56
- package/dist/cjs/components/Variables/VariableEditor.js +39 -46
- package/dist/cjs/components/Variables/VariableList.js +23 -22
- package/dist/cjs/components/Variables/index.js +2 -2
- package/dist/cjs/components/index.js +0 -2
- package/dist/cjs/constants/styles.js +17 -9
- package/dist/cjs/constants/user-interface-text.js +6 -5
- package/dist/cjs/context/DashboardProvider/DashboardProvider.js +24 -17
- package/dist/cjs/context/DashboardProvider/DashboardProviderWithQueryParams.js +36 -0
- package/dist/cjs/context/DashboardProvider/common.js +5 -5
- package/dist/cjs/context/DashboardProvider/dashboard-provider-api.js +51 -43
- package/dist/cjs/context/DashboardProvider/delete-panel-group-slice.js +1 -1
- package/dist/cjs/context/DashboardProvider/delete-panel-slice.js +4 -5
- package/dist/cjs/context/DashboardProvider/duplicate-panel-slice.js +1 -1
- package/dist/cjs/context/DashboardProvider/panel-editor-slice.js +11 -16
- package/dist/cjs/context/DashboardProvider/panel-group-editor-slice.js +1 -2
- package/dist/cjs/context/DashboardProvider/panel-group-slice.js +13 -8
- package/dist/cjs/context/DashboardProvider/view-panel-slice.js +79 -0
- package/dist/cjs/context/DatasourceStoreProvider.js +32 -31
- package/dist/cjs/context/{TemplateVariableProvider/TemplateVariableProvider.js → VariableProvider/VariableProvider.js} +128 -131
- package/dist/cjs/context/{TemplateVariableProvider → VariableProvider}/hydrationUtils.js +11 -14
- package/dist/cjs/{validation → context/VariableProvider}/index.js +2 -2
- package/dist/cjs/context/{TemplateVariableProvider → VariableProvider}/query-params.js +8 -8
- package/dist/cjs/context/{TemplateVariableProvider → VariableProvider}/utils.js +6 -6
- package/dist/cjs/context/index.js +2 -2
- package/dist/cjs/context/useDashboard.js +24 -9
- package/dist/cjs/stories/decorators/WithDashboard.js +1 -1
- package/dist/cjs/stories/decorators/WithDatasourceStore.js +1 -1
- package/dist/cjs/stories/decorators/{WithTemplateVariables.js → WithVariables.js} +9 -9
- package/dist/cjs/stories/decorators/index.js +2 -2
- package/dist/cjs/test/dashboard-provider.js +3 -3
- package/dist/cjs/test/datasource-provider.js +4 -4
- package/dist/cjs/test/plugin-registry.js +4 -2
- package/dist/cjs/test/render.js +14 -12
- package/dist/cjs/utils/index.js +0 -1
- package/dist/cjs/utils/panelUtils.js +5 -5
- package/dist/cjs/views/ViewDashboard/DashboardApp.js +8 -8
- package/dist/cjs/views/ViewDashboard/ViewDashboard.js +10 -11
- package/dist/components/AddGroupButton/AddGroupButton.d.ts +2 -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 +2 -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 +3 -3
- package/dist/components/Dashboard/Dashboard.d.ts.map +1 -1
- package/dist/components/Dashboard/Dashboard.js +9 -2
- package/dist/components/Dashboard/Dashboard.js.map +1 -1
- package/dist/components/DashboardStickyToolbar/DashboardStickyToolbar.d.ts +2 -2
- package/dist/components/DashboardStickyToolbar/DashboardStickyToolbar.d.ts.map +1 -1
- package/dist/components/DashboardStickyToolbar/DashboardStickyToolbar.js +4 -4
- package/dist/components/DashboardStickyToolbar/DashboardStickyToolbar.js.map +1 -1
- package/dist/components/DashboardToolbar/DashboardToolbar.d.ts +2 -2
- package/dist/components/DashboardToolbar/DashboardToolbar.d.ts.map +1 -1
- package/dist/components/DashboardToolbar/DashboardToolbar.js +5 -5
- package/dist/components/DashboardToolbar/DashboardToolbar.js.map +1 -1
- package/dist/components/Datasources/DatasourceEditor.d.ts +2 -2
- package/dist/components/Datasources/DatasourceEditor.d.ts.map +1 -1
- package/dist/components/Datasources/DatasourceEditor.js +20 -21
- package/dist/components/Datasources/DatasourceEditor.js.map +1 -1
- package/dist/components/Datasources/EditDatasourcesButton.d.ts +2 -2
- package/dist/components/Datasources/EditDatasourcesButton.d.ts.map +1 -1
- package/dist/components/Datasources/EditDatasourcesButton.js +11 -8
- package/dist/components/Datasources/EditDatasourcesButton.js.map +1 -1
- package/dist/components/DeletePanelDialog/DeletePanelDialog.d.ts +2 -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 +2 -2
- package/dist/components/DeletePanelGroupDialog/DeletePanelGroupDialog.d.ts.map +1 -1
- package/dist/components/DeletePanelGroupDialog/DeletePanelGroupDialog.js +4 -5
- package/dist/components/DeletePanelGroupDialog/DeletePanelGroupDialog.js.map +1 -1
- package/dist/components/DiscardChangesConfirmationDialog/DiscardChangesConfirmationDialog.d.ts +2 -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 +2 -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 +2 -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 +2 -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 +2 -2
- package/dist/components/EditJsonDialog/EditJsonDialog.d.ts.map +1 -1
- package/dist/components/EditJsonDialog/EditJsonDialog.js +21 -17
- package/dist/components/EditJsonDialog/EditJsonDialog.js.map +1 -1
- package/dist/components/EmptyDashboard/EmptyDashboard.d.ts +3 -3
- package/dist/components/EmptyDashboard/EmptyDashboard.d.ts.map +1 -1
- package/dist/components/EmptyDashboard/EmptyDashboard.js +5 -5
- package/dist/components/EmptyDashboard/EmptyDashboard.js.map +1 -1
- package/dist/components/GridLayout/GridContainer.d.ts +5 -3
- package/dist/components/GridLayout/GridContainer.d.ts.map +1 -1
- package/dist/components/GridLayout/GridContainer.js +16 -11
- package/dist/components/GridLayout/GridContainer.js.map +1 -1
- package/dist/components/GridLayout/GridItemContent.d.ts +2 -2
- package/dist/components/GridLayout/GridItemContent.d.ts.map +1 -1
- package/dist/components/GridLayout/GridItemContent.js +25 -11
- package/dist/components/GridLayout/GridItemContent.js.map +1 -1
- package/dist/components/GridLayout/GridLayout.d.ts +4 -3
- package/dist/components/GridLayout/GridLayout.d.ts.map +1 -1
- package/dist/components/GridLayout/GridLayout.js +65 -16
- package/dist/components/GridLayout/GridLayout.js.map +1 -1
- package/dist/components/GridLayout/GridTitle.d.ts +3 -3
- package/dist/components/GridLayout/GridTitle.d.ts.map +1 -1
- package/dist/components/GridLayout/GridTitle.js +8 -9
- package/dist/components/GridLayout/GridTitle.js.map +1 -1
- package/dist/components/Panel/HeaderIconButton.d.ts +5 -0
- package/dist/components/Panel/HeaderIconButton.d.ts.map +1 -0
- package/dist/components/{TimeRangeControls/index.js → Panel/HeaderIconButton.js} +7 -3
- package/dist/components/Panel/HeaderIconButton.js.map +1 -0
- package/dist/components/Panel/Panel.d.ts +13 -7
- package/dist/components/Panel/Panel.d.ts.map +1 -1
- package/dist/components/Panel/Panel.js +16 -12
- package/dist/components/Panel/Panel.js.map +1 -1
- package/dist/components/Panel/PanelActions.d.ts +16 -0
- package/dist/components/Panel/PanelActions.d.ts.map +1 -0
- package/dist/components/Panel/PanelActions.js +203 -0
- package/dist/components/Panel/PanelActions.js.map +1 -0
- package/dist/components/Panel/PanelContent.d.ts +2 -2
- package/dist/components/Panel/PanelContent.d.ts.map +1 -1
- package/dist/components/Panel/PanelContent.js +6 -6
- package/dist/components/Panel/PanelContent.js.map +1 -1
- package/dist/components/Panel/PanelHeader.d.ts +9 -9
- package/dist/components/Panel/PanelHeader.d.ts.map +1 -1
- package/dist/components/Panel/PanelHeader.js +39 -106
- package/dist/components/Panel/PanelHeader.js.map +1 -1
- package/dist/components/Panel/PanelLinks.d.ts +6 -0
- package/dist/components/Panel/PanelLinks.d.ts.map +1 -0
- package/dist/components/Panel/PanelLinks.js +123 -0
- package/dist/components/Panel/PanelLinks.js.map +1 -0
- package/dist/components/PanelDrawer/PanelDrawer.d.ts +2 -2
- package/dist/components/PanelDrawer/PanelDrawer.d.ts.map +1 -1
- package/dist/components/PanelDrawer/PanelDrawer.js +10 -7
- package/dist/components/PanelDrawer/PanelDrawer.js.map +1 -1
- package/dist/components/PanelDrawer/PanelEditorForm.d.ts +3 -4
- package/dist/components/PanelDrawer/PanelEditorForm.d.ts.map +1 -1
- package/dist/components/PanelDrawer/PanelEditorForm.js +70 -65
- package/dist/components/PanelDrawer/PanelEditorForm.js.map +1 -1
- package/dist/components/PanelDrawer/PanelPreview.d.ts +3 -3
- package/dist/components/PanelDrawer/PanelPreview.d.ts.map +1 -1
- package/dist/components/PanelDrawer/PanelPreview.js +9 -6
- package/dist/components/PanelDrawer/PanelPreview.js.map +1 -1
- package/dist/components/PanelDrawer/usePanelEditor.d.ts +12 -10
- package/dist/components/PanelDrawer/usePanelEditor.d.ts.map +1 -1
- package/dist/components/PanelDrawer/usePanelEditor.js +9 -6
- package/dist/components/PanelDrawer/usePanelEditor.js.map +1 -1
- package/dist/components/PanelGroupDialog/PanelGroupDialog.d.ts +2 -2
- package/dist/components/PanelGroupDialog/PanelGroupDialog.d.ts.map +1 -1
- package/dist/components/PanelGroupDialog/PanelGroupDialog.js +1 -1
- package/dist/components/PanelGroupDialog/PanelGroupDialog.js.map +1 -1
- package/dist/components/PanelGroupDialog/PanelGroupEditorForm.d.ts +2 -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 +2 -2
- package/dist/components/QuerySummaryTable/QuerySummaryTable.d.ts.map +1 -1
- package/dist/components/QuerySummaryTable/QuerySummaryTable.js +5 -7
- package/dist/components/QuerySummaryTable/QuerySummaryTable.js.map +1 -1
- package/dist/components/SaveChangesConfirmationDialog/SaveChangesConfirmationDialog.d.ts +2 -2
- package/dist/components/SaveChangesConfirmationDialog/SaveChangesConfirmationDialog.d.ts.map +1 -1
- package/dist/components/SaveChangesConfirmationDialog/SaveChangesConfirmationDialog.js +8 -10
- package/dist/components/SaveChangesConfirmationDialog/SaveChangesConfirmationDialog.js.map +1 -1
- package/dist/components/SaveDashboardButton/SaveDashboardButton.d.ts +2 -2
- package/dist/components/SaveDashboardButton/SaveDashboardButton.d.ts.map +1 -1
- package/dist/components/SaveDashboardButton/SaveDashboardButton.js +9 -9
- package/dist/components/SaveDashboardButton/SaveDashboardButton.js.map +1 -1
- package/dist/components/Variables/BuiltinVariableAccordions.d.ts +3 -3
- package/dist/components/Variables/BuiltinVariableAccordions.d.ts.map +1 -1
- package/dist/components/Variables/BuiltinVariableAccordions.js +8 -14
- package/dist/components/Variables/BuiltinVariableAccordions.js.map +1 -1
- package/dist/components/Variables/EditVariablesButton.d.ts +2 -2
- package/dist/components/Variables/EditVariablesButton.d.ts.map +1 -1
- package/dist/components/Variables/EditVariablesButton.js +6 -6
- package/dist/components/Variables/EditVariablesButton.js.map +1 -1
- package/dist/components/Variables/{TemplateVariable.d.ts → Variable.d.ts} +6 -6
- package/dist/components/Variables/Variable.d.ts.map +1 -0
- package/dist/components/Variables/{TemplateVariable.js → Variable.js} +49 -57
- package/dist/components/Variables/Variable.js.map +1 -0
- package/dist/components/Variables/VariableEditor.d.ts +3 -3
- package/dist/components/Variables/VariableEditor.d.ts.map +1 -1
- package/dist/components/Variables/VariableEditor.js +40 -47
- package/dist/components/Variables/VariableEditor.js.map +1 -1
- package/dist/components/Variables/VariableList.d.ts +4 -4
- package/dist/components/Variables/VariableList.d.ts.map +1 -1
- package/dist/components/Variables/VariableList.js +21 -20
- package/dist/components/Variables/VariableList.js.map +1 -1
- package/dist/components/Variables/index.d.ts +1 -1
- package/dist/components/Variables/index.d.ts.map +1 -1
- package/dist/components/Variables/index.js +2 -2
- package/dist/components/Variables/index.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/styles.d.ts +4 -2
- package/dist/constants/styles.d.ts.map +1 -1
- package/dist/constants/styles.js +5 -3
- package/dist/constants/styles.js.map +1 -1
- package/dist/constants/user-interface-text.d.ts +3 -2
- package/dist/constants/user-interface-text.d.ts.map +1 -1
- package/dist/constants/user-interface-text.js +3 -2
- package/dist/constants/user-interface-text.js.map +1 -1
- package/dist/context/DashboardProvider/DashboardProvider.d.ts +11 -6
- package/dist/context/DashboardProvider/DashboardProvider.d.ts.map +1 -1
- package/dist/context/DashboardProvider/DashboardProvider.js +22 -15
- package/dist/context/DashboardProvider/DashboardProvider.js.map +1 -1
- package/dist/context/DashboardProvider/DashboardProviderWithQueryParams.d.ts +4 -0
- package/dist/context/DashboardProvider/DashboardProviderWithQueryParams.d.ts.map +1 -0
- package/dist/context/DashboardProvider/DashboardProviderWithQueryParams.js +28 -0
- package/dist/context/DashboardProvider/DashboardProviderWithQueryParams.js.map +1 -0
- 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 +2 -2
- package/dist/context/DashboardProvider/common.js.map +1 -1
- package/dist/context/DashboardProvider/dashboard-provider-api.d.ts +36 -23
- package/dist/context/DashboardProvider/dashboard-provider-api.d.ts.map +1 -1
- package/dist/context/DashboardProvider/dashboard-provider-api.js +26 -19
- package/dist/context/DashboardProvider/dashboard-provider-api.js.map +1 -1
- package/dist/context/DashboardProvider/delete-panel-group-slice.d.ts +2 -1
- package/dist/context/DashboardProvider/delete-panel-group-slice.d.ts.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 +4 -5
- 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/index.d.ts +1 -2
- package/dist/context/DashboardProvider/index.d.ts.map +1 -1
- package/dist/context/DashboardProvider/index.js.map +1 -1
- package/dist/context/DashboardProvider/panel-editor-slice.d.ts +2 -9
- package/dist/context/DashboardProvider/panel-editor-slice.d.ts.map +1 -1
- package/dist/context/DashboardProvider/panel-editor-slice.js +8 -13
- package/dist/context/DashboardProvider/panel-editor-slice.js.map +1 -1
- package/dist/context/DashboardProvider/panel-group-editor-slice.d.ts +2 -1
- package/dist/context/DashboardProvider/panel-group-editor-slice.d.ts.map +1 -1
- package/dist/context/DashboardProvider/panel-group-editor-slice.js +1 -2
- package/dist/context/DashboardProvider/panel-group-editor-slice.js.map +1 -1
- package/dist/context/DashboardProvider/panel-group-slice.d.ts +3 -3
- package/dist/context/DashboardProvider/panel-group-slice.d.ts.map +1 -1
- package/dist/context/DashboardProvider/panel-group-slice.js +8 -4
- 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/DashboardProvider/view-panel-slice.d.ts +21 -0
- package/dist/context/DashboardProvider/view-panel-slice.d.ts.map +1 -0
- package/dist/context/DashboardProvider/view-panel-slice.js +73 -0
- package/dist/context/DashboardProvider/view-panel-slice.js.map +1 -0
- package/dist/context/DatasourceStoreProvider.d.ts +10 -10
- package/dist/context/DatasourceStoreProvider.d.ts.map +1 -1
- package/dist/context/DatasourceStoreProvider.js +32 -31
- package/dist/context/DatasourceStoreProvider.js.map +1 -1
- package/dist/context/VariableProvider/VariableProvider.d.ts +119 -0
- package/dist/context/VariableProvider/VariableProvider.d.ts.map +1 -0
- package/dist/context/{TemplateVariableProvider/TemplateVariableProvider.js → VariableProvider/VariableProvider.js} +117 -116
- package/dist/context/VariableProvider/VariableProvider.js.map +1 -0
- package/dist/context/{TemplateVariableProvider → VariableProvider}/hydrationUtils.d.ts +1 -1
- package/dist/context/VariableProvider/hydrationUtils.d.ts.map +1 -0
- package/dist/context/{TemplateVariableProvider → VariableProvider}/hydrationUtils.js +9 -12
- package/dist/context/VariableProvider/hydrationUtils.js.map +1 -0
- package/dist/context/VariableProvider/index.d.ts +2 -0
- package/dist/context/VariableProvider/index.d.ts.map +1 -0
- package/dist/{validation → context/VariableProvider}/index.js +2 -2
- package/dist/context/VariableProvider/index.js.map +1 -0
- package/dist/context/{TemplateVariableProvider → VariableProvider}/query-params.d.ts +2 -6
- package/dist/context/VariableProvider/query-params.d.ts.map +1 -0
- package/dist/context/{TemplateVariableProvider → VariableProvider}/query-params.js +1 -1
- package/dist/context/VariableProvider/query-params.js.map +1 -0
- package/dist/context/{TemplateVariableProvider → VariableProvider}/utils.d.ts +1 -1
- package/dist/context/VariableProvider/utils.d.ts.map +1 -0
- package/dist/context/{TemplateVariableProvider → VariableProvider}/utils.js +3 -3
- package/dist/context/VariableProvider/utils.js.map +1 -0
- package/dist/context/index.d.ts +1 -1
- package/dist/context/index.d.ts.map +1 -1
- package/dist/context/index.js +2 -2
- package/dist/context/index.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 +24 -9
- package/dist/context/useDashboard.js.map +1 -1
- package/dist/stories/decorators/WithDashboard.js +1 -1
- package/dist/stories/decorators/WithDashboard.js.map +1 -1
- package/dist/stories/decorators/WithDatasourceStore.js +1 -1
- package/dist/stories/decorators/WithDatasourceStore.js.map +1 -1
- package/dist/stories/decorators/{WithTemplateVariables.js → WithVariables.js} +9 -9
- package/dist/stories/decorators/WithVariables.js.map +1 -0
- package/dist/stories/decorators/index.js +2 -2
- package/dist/stories/decorators/index.js.map +1 -1
- package/dist/test/dashboard-provider.d.ts +1 -1
- package/dist/test/dashboard-provider.d.ts.map +1 -1
- package/dist/test/dashboard-provider.js.map +1 -1
- package/dist/test/datasource-provider.d.ts +2 -2
- package/dist/test/datasource-provider.d.ts.map +1 -1
- package/dist/test/datasource-provider.js.map +1 -1
- package/dist/test/plugin-registry.d.ts.map +1 -1
- package/dist/test/plugin-registry.js +4 -2
- package/dist/test/plugin-registry.js.map +1 -1
- package/dist/test/render.d.ts +2 -2
- package/dist/test/render.d.ts.map +1 -1
- package/dist/test/render.js +10 -8
- 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/views/ViewDashboard/DashboardApp.d.ts +4 -4
- package/dist/views/ViewDashboard/DashboardApp.d.ts.map +1 -1
- package/dist/views/ViewDashboard/DashboardApp.js +8 -8
- package/dist/views/ViewDashboard/DashboardApp.js.map +1 -1
- package/dist/views/ViewDashboard/ViewDashboard.d.ts +4 -4
- package/dist/views/ViewDashboard/ViewDashboard.d.ts.map +1 -1
- package/dist/views/ViewDashboard/ViewDashboard.js +11 -12
- package/dist/views/ViewDashboard/ViewDashboard.js.map +1 -1
- package/package.json +9 -9
- 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/context/TemplateVariableProvider/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.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/components/Variables/TemplateVariable.d.ts.map +0 -1
- package/dist/components/Variables/TemplateVariable.js.map +0 -1
- package/dist/context/TemplateVariableProvider/TemplateVariableProvider.d.ts +0 -77
- package/dist/context/TemplateVariableProvider/TemplateVariableProvider.d.ts.map +0 -1
- package/dist/context/TemplateVariableProvider/TemplateVariableProvider.js.map +0 -1
- package/dist/context/TemplateVariableProvider/hydrationUtils.d.ts.map +0 -1
- package/dist/context/TemplateVariableProvider/hydrationUtils.js.map +0 -1
- package/dist/context/TemplateVariableProvider/index.d.ts +0 -2
- package/dist/context/TemplateVariableProvider/index.d.ts.map +0 -1
- package/dist/context/TemplateVariableProvider/index.js +0 -15
- package/dist/context/TemplateVariableProvider/index.js.map +0 -1
- package/dist/context/TemplateVariableProvider/query-params.d.ts.map +0 -1
- package/dist/context/TemplateVariableProvider/query-params.js.map +0 -1
- package/dist/context/TemplateVariableProvider/utils.d.ts.map +0 -1
- package/dist/context/TemplateVariableProvider/utils.js.map +0 -1
- package/dist/stories/decorators/WithTemplateVariables.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
- package/dist/validation/index.d.ts +0 -2
- package/dist/validation/index.d.ts.map +0 -1
- package/dist/validation/index.js.map +0 -1
- package/dist/validation/panel.d.ts +0 -19
- package/dist/validation/panel.d.ts.map +0 -1
- package/dist/validation/panel.js +0 -21
- package/dist/validation/panel.js.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Copyright
|
|
1
|
+
// Copyright 2024 The Perses Authors
|
|
2
2
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
3
3
|
// you may not use this file except in compliance with the License.
|
|
4
4
|
// You may obtain a copy of the License at
|
|
@@ -22,24 +22,26 @@ Object.defineProperty(exports, "useDashboard", {
|
|
|
22
22
|
});
|
|
23
23
|
const _core = require("@perses-dev/core");
|
|
24
24
|
const _DashboardProvider = require("./DashboardProvider");
|
|
25
|
-
const
|
|
25
|
+
const _VariableProvider = require("./VariableProvider");
|
|
26
26
|
function useDashboard() {
|
|
27
|
-
const { panels
|
|
27
|
+
const { panels, panelGroups, panelGroupOrder, setDashboard: setDashboardResource, kind, metadata, display, duration, refreshInterval, datasources, ttl } = (0, _DashboardProvider.useDashboardStore)(({ panels, panelGroups, panelGroupOrder, setDashboard, kind, metadata, display, duration, refreshInterval, datasources, ttl })=>({
|
|
28
28
|
panels,
|
|
29
29
|
panelGroups,
|
|
30
30
|
panelGroupOrder,
|
|
31
31
|
setDashboard,
|
|
32
|
+
kind,
|
|
32
33
|
metadata,
|
|
33
34
|
display,
|
|
34
35
|
duration,
|
|
35
36
|
refreshInterval,
|
|
36
|
-
datasources
|
|
37
|
+
datasources,
|
|
38
|
+
ttl
|
|
37
39
|
}));
|
|
38
|
-
const { setVariableDefinitions
|
|
39
|
-
const variables = (0,
|
|
40
|
+
const { setVariableDefinitions } = (0, _VariableProvider.useVariableDefinitionActions)();
|
|
41
|
+
const variables = (0, _VariableProvider.useVariableDefinitions)();
|
|
40
42
|
const layouts = convertPanelGroupsToLayouts(panelGroups, panelGroupOrder);
|
|
41
|
-
const dashboard = {
|
|
42
|
-
kind
|
|
43
|
+
const dashboard = kind === 'Dashboard' ? {
|
|
44
|
+
kind,
|
|
43
45
|
metadata,
|
|
44
46
|
spec: {
|
|
45
47
|
display,
|
|
@@ -50,6 +52,19 @@ function useDashboard() {
|
|
|
50
52
|
refreshInterval,
|
|
51
53
|
datasources
|
|
52
54
|
}
|
|
55
|
+
} : {
|
|
56
|
+
kind,
|
|
57
|
+
metadata,
|
|
58
|
+
spec: {
|
|
59
|
+
display,
|
|
60
|
+
panels,
|
|
61
|
+
layouts,
|
|
62
|
+
variables,
|
|
63
|
+
duration,
|
|
64
|
+
refreshInterval,
|
|
65
|
+
datasources,
|
|
66
|
+
ttl
|
|
67
|
+
}
|
|
53
68
|
};
|
|
54
69
|
const setDashboard = (dashboardResource)=>{
|
|
55
70
|
setVariableDefinitions(dashboardResource.spec.variables);
|
|
@@ -67,7 +82,7 @@ function convertPanelGroupsToLayouts(panelGroups, panelGroupOrder) {
|
|
|
67
82
|
if (group === undefined) {
|
|
68
83
|
throw new Error('panel group not found');
|
|
69
84
|
}
|
|
70
|
-
const { title
|
|
85
|
+
const { title, isCollapsed, itemLayouts, itemPanelKeys } = group;
|
|
71
86
|
let display = undefined;
|
|
72
87
|
if (title) {
|
|
73
88
|
display = {
|
|
@@ -30,7 +30,7 @@ function isWithDashboardParameter(parameter) {
|
|
|
30
30
|
const WithDashboard = (Story, context)=>{
|
|
31
31
|
const initParameter = context.parameters.withDashboard;
|
|
32
32
|
const parameter = isWithDashboardParameter(initParameter) ? initParameter : undefined;
|
|
33
|
-
const props = parameter
|
|
33
|
+
const props = parameter?.props;
|
|
34
34
|
return /*#__PURE__*/ (0, _jsxruntime.jsx)(_dashboards.DashboardProvider, {
|
|
35
35
|
initialState: {
|
|
36
36
|
dashboardResource: _constants.EMPTY_DASHBOARD_RESOURCE
|
|
@@ -30,7 +30,7 @@ function isWithDatasourceStoreParameter(parameter) {
|
|
|
30
30
|
const WithDatasourceStore = (Story, context)=>{
|
|
31
31
|
const initParameter = context.parameters.withDatasourceStore;
|
|
32
32
|
const parameter = isWithDatasourceStoreParameter(initParameter) ? initParameter : undefined;
|
|
33
|
-
const props = parameter
|
|
33
|
+
const props = parameter?.props;
|
|
34
34
|
return /*#__PURE__*/ (0, _jsxruntime.jsx)(_dashboards.DatasourceStoreProvider, {
|
|
35
35
|
..._test.defaultDatasourceProps,
|
|
36
36
|
...props,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Copyright
|
|
1
|
+
// Copyright 2024 The Perses Authors
|
|
2
2
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
3
3
|
// you may not use this file except in compliance with the License.
|
|
4
4
|
// You may obtain a copy of the License at
|
|
@@ -14,23 +14,23 @@
|
|
|
14
14
|
Object.defineProperty(exports, "__esModule", {
|
|
15
15
|
value: true
|
|
16
16
|
});
|
|
17
|
-
Object.defineProperty(exports, "
|
|
17
|
+
Object.defineProperty(exports, "WithVariables", {
|
|
18
18
|
enumerable: true,
|
|
19
19
|
get: function() {
|
|
20
|
-
return
|
|
20
|
+
return WithVariables;
|
|
21
21
|
}
|
|
22
22
|
});
|
|
23
23
|
const _jsxruntime = require("react/jsx-runtime");
|
|
24
24
|
const _dashboards = require("@perses-dev/dashboards");
|
|
25
25
|
// Type guard because storybook types parameters as `any`
|
|
26
|
-
function
|
|
26
|
+
function isWithVariableParameter(parameter) {
|
|
27
27
|
return !!parameter && typeof parameter === 'object' && 'props' in parameter;
|
|
28
28
|
}
|
|
29
|
-
const
|
|
30
|
-
const initParameter = context.parameters.
|
|
31
|
-
const parameter =
|
|
32
|
-
const props = parameter
|
|
33
|
-
return /*#__PURE__*/ (0, _jsxruntime.jsx)(_dashboards.
|
|
29
|
+
const WithVariables = (Story, context)=>{
|
|
30
|
+
const initParameter = context.parameters.withVariables;
|
|
31
|
+
const parameter = isWithVariableParameter(initParameter) ? initParameter : undefined;
|
|
32
|
+
const props = parameter?.props;
|
|
33
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsx)(_dashboards.VariableProvider, {
|
|
34
34
|
...props,
|
|
35
35
|
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(Story, {})
|
|
36
36
|
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Copyright
|
|
1
|
+
// Copyright 2024 The Perses Authors
|
|
2
2
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
3
3
|
// you may not use this file except in compliance with the License.
|
|
4
4
|
// You may obtain a copy of the License at
|
|
@@ -17,7 +17,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
17
17
|
_export_star(require("./constants"), exports);
|
|
18
18
|
_export_star(require("./WithDashboard"), exports);
|
|
19
19
|
_export_star(require("./WithDatasourceStore"), exports);
|
|
20
|
-
_export_star(require("./
|
|
20
|
+
_export_star(require("./WithVariables"), exports);
|
|
21
21
|
function _export_star(from, to) {
|
|
22
22
|
Object.keys(from).forEach(function(k) {
|
|
23
23
|
if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) {
|
|
@@ -21,11 +21,11 @@ function _export(target, all) {
|
|
|
21
21
|
});
|
|
22
22
|
}
|
|
23
23
|
_export(exports, {
|
|
24
|
-
getTestDashboard: function() {
|
|
25
|
-
return getTestDashboard;
|
|
26
|
-
},
|
|
27
24
|
createDashboardProviderSpy: function() {
|
|
28
25
|
return createDashboardProviderSpy;
|
|
26
|
+
},
|
|
27
|
+
getTestDashboard: function() {
|
|
28
|
+
return getTestDashboard;
|
|
29
29
|
}
|
|
30
30
|
});
|
|
31
31
|
const _react = require("react");
|
|
@@ -21,14 +21,14 @@ function _export(target, all) {
|
|
|
21
21
|
});
|
|
22
22
|
}
|
|
23
23
|
_export(exports, {
|
|
24
|
-
|
|
25
|
-
return
|
|
24
|
+
defaultDatasourceProps: function() {
|
|
25
|
+
return defaultDatasourceProps;
|
|
26
26
|
},
|
|
27
27
|
prometheusDemo: function() {
|
|
28
28
|
return prometheusDemo;
|
|
29
29
|
},
|
|
30
|
-
|
|
31
|
-
return
|
|
30
|
+
prometheusDemoUrl: function() {
|
|
31
|
+
return prometheusDemoUrl;
|
|
32
32
|
}
|
|
33
33
|
});
|
|
34
34
|
const _dashboardprovider = require("./dashboard-provider");
|
|
@@ -41,8 +41,10 @@ const FakeTimeSeriesPlugin = {
|
|
|
41
41
|
createInitialOptions: ()=>({})
|
|
42
42
|
};
|
|
43
43
|
const MOCK_TIME_SERIES_PANEL = {
|
|
44
|
-
|
|
45
|
-
|
|
44
|
+
kind: 'Panel',
|
|
45
|
+
spec: {
|
|
46
|
+
name: 'TimeSeriesChart'
|
|
47
|
+
},
|
|
46
48
|
plugin: FakeTimeSeriesPlugin
|
|
47
49
|
};
|
|
48
50
|
const MOCK_PLUGINS = [
|
package/dist/cjs/test/render.js
CHANGED
|
@@ -21,27 +21,27 @@ Object.defineProperty(exports, "renderWithContext", {
|
|
|
21
21
|
}
|
|
22
22
|
});
|
|
23
23
|
const _jsxruntime = require("react/jsx-runtime");
|
|
24
|
-
const
|
|
25
|
-
const
|
|
26
|
-
const
|
|
24
|
+
const _components = require("@perses-dev/components");
|
|
25
|
+
const _pluginsystem = require("@perses-dev/plugin-system");
|
|
26
|
+
const _reactquery = require("@tanstack/react-query");
|
|
27
|
+
const _react = require("@testing-library/react");
|
|
27
28
|
const _history = require("history");
|
|
29
|
+
const _react1 = require("react");
|
|
30
|
+
const _reactrouterdom = require("react-router-dom");
|
|
28
31
|
const _usequeryparams = require("use-query-params");
|
|
29
32
|
const _reactrouter6 = require("use-query-params/adapters/react-router-6");
|
|
30
|
-
const _reactquery = require("@tanstack/react-query");
|
|
31
|
-
const _components = require("@perses-dev/components");
|
|
32
|
-
const _pluginsystem = require("@perses-dev/plugin-system");
|
|
33
33
|
const _context = require("../context");
|
|
34
34
|
const _test = require("../test");
|
|
35
35
|
const _pluginregistry = require("./plugin-registry");
|
|
36
36
|
/*
|
|
37
37
|
* Workaround for React router upgrade type errors.
|
|
38
38
|
* More details: https://stackoverflow.com/a/69948457/17575201
|
|
39
|
-
*/ const CustomRouter = ({ history
|
|
40
|
-
const [state, setState] = (0,
|
|
39
|
+
*/ const CustomRouter = ({ history, children })=>{
|
|
40
|
+
const [state, setState] = (0, _react1.useState)({
|
|
41
41
|
action: history.action,
|
|
42
42
|
location: history.location
|
|
43
43
|
});
|
|
44
|
-
(0,
|
|
44
|
+
(0, _react1.useLayoutEffect)(()=>history.listen(setState), [
|
|
45
45
|
history
|
|
46
46
|
]);
|
|
47
47
|
return /*#__PURE__*/ (0, _jsxruntime.jsx)(_reactrouterdom.Router, {
|
|
@@ -61,7 +61,8 @@ function renderWithContext(ui, options, history) {
|
|
|
61
61
|
}
|
|
62
62
|
}
|
|
63
63
|
});
|
|
64
|
-
const customHistory = history
|
|
64
|
+
const customHistory = history ?? (0, _history.createMemoryHistory)();
|
|
65
|
+
const mockRegistry = (0, _pluginsystem.mockPluginRegistry)(..._pluginregistry.MOCK_PLUGINS);
|
|
65
66
|
const BaseRender = ()=>/*#__PURE__*/ (0, _jsxruntime.jsx)(CustomRouter, {
|
|
66
67
|
history: customHistory,
|
|
67
68
|
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_reactquery.QueryClientProvider, {
|
|
@@ -76,7 +77,8 @@ function renderWithContext(ui, options, history) {
|
|
|
76
77
|
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_components.ChartsProvider, {
|
|
77
78
|
chartsTheme: _components.testChartsTheme,
|
|
78
79
|
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_pluginsystem.PluginRegistry, {
|
|
79
|
-
|
|
80
|
+
pluginLoader: mockRegistry.pluginLoader,
|
|
81
|
+
defaultPluginKinds: mockRegistry.defaultPluginKinds,
|
|
80
82
|
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_context.DatasourceStoreProvider, {
|
|
81
83
|
..._test.defaultDatasourceProps,
|
|
82
84
|
children: ui
|
|
@@ -87,5 +89,5 @@ function renderWithContext(ui, options, history) {
|
|
|
87
89
|
})
|
|
88
90
|
})
|
|
89
91
|
});
|
|
90
|
-
return (0,
|
|
92
|
+
return (0, _react.render)(/*#__PURE__*/ (0, _jsxruntime.jsx)(BaseRender, {}), options);
|
|
91
93
|
}
|
package/dist/cjs/utils/index.js
CHANGED
|
@@ -15,7 +15,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
15
15
|
value: true
|
|
16
16
|
});
|
|
17
17
|
_export_star(require("./panelUtils"), exports);
|
|
18
|
-
_export_star(require("./time"), exports);
|
|
19
18
|
function _export_star(from, to) {
|
|
20
19
|
Object.keys(from).forEach(function(k) {
|
|
21
20
|
if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) {
|
|
@@ -21,14 +21,14 @@ function _export(target, all) {
|
|
|
21
21
|
});
|
|
22
22
|
}
|
|
23
23
|
_export(exports, {
|
|
24
|
+
getValidPanelKey: function() {
|
|
25
|
+
return getValidPanelKey;
|
|
26
|
+
},
|
|
24
27
|
getYForNewRow: function() {
|
|
25
28
|
return getYForNewRow;
|
|
26
29
|
},
|
|
27
30
|
insertPanelInLayout: function() {
|
|
28
31
|
return insertPanelInLayout;
|
|
29
|
-
},
|
|
30
|
-
getValidPanelKey: function() {
|
|
31
|
-
return getValidPanelKey;
|
|
32
32
|
}
|
|
33
33
|
});
|
|
34
34
|
const _constants = require("../constants");
|
|
@@ -42,7 +42,7 @@ function getYForNewRow(group) {
|
|
|
42
42
|
}
|
|
43
43
|
return newRowY;
|
|
44
44
|
}
|
|
45
|
-
function getPanelBounds({ x
|
|
45
|
+
function getPanelBounds({ x, y, w, h }) {
|
|
46
46
|
return {
|
|
47
47
|
x1: x,
|
|
48
48
|
x2: x + w,
|
|
@@ -159,7 +159,7 @@ const removeWhiteSpaces = (str)=>{
|
|
|
159
159
|
function getUniquePanelKeys(panels) {
|
|
160
160
|
const uniquePanelKeys = {};
|
|
161
161
|
Object.keys(panels).forEach((panelKey)=>{
|
|
162
|
-
const { name
|
|
162
|
+
const { name, number } = getPanelKeyParts(panelKey);
|
|
163
163
|
if (uniquePanelKeys[name] === undefined) {
|
|
164
164
|
uniquePanelKeys[name] = 0;
|
|
165
165
|
}
|
|
@@ -28,13 +28,13 @@ const _pluginsystem = require("@perses-dev/plugin-system");
|
|
|
28
28
|
const _components1 = require("../../components");
|
|
29
29
|
const _context = require("../../context");
|
|
30
30
|
const DashboardApp = (props)=>{
|
|
31
|
-
const { dashboardResource
|
|
31
|
+
const { dashboardResource, dashboardTitleComponent, emptyDashboardProps, onSave, onDiscard, initialVariableIsSticky, isReadonly, isCreating } = props;
|
|
32
32
|
const chartsTheme = (0, _components.useChartsTheme)();
|
|
33
|
-
const { isEditMode
|
|
34
|
-
const { dashboard
|
|
33
|
+
const { isEditMode, setEditMode } = (0, _context.useEditMode)();
|
|
34
|
+
const { dashboard, setDashboard } = (0, _context.useDashboard)();
|
|
35
35
|
const [originalDashboard, setOriginalDashboard] = (0, _react.useState)(undefined);
|
|
36
|
-
const { setSavedDatasources
|
|
37
|
-
const { openDiscardChangesConfirmationDialog
|
|
36
|
+
const { setSavedDatasources } = (0, _pluginsystem.useDatasourceStore)();
|
|
37
|
+
const { openDiscardChangesConfirmationDialog, closeDiscardChangesConfirmationDialog } = (0, _context.useDiscardChangesConfirmationDialog)();
|
|
38
38
|
const handleDiscardChanges = ()=>{
|
|
39
39
|
// Reset to the original spec and exit edit mode
|
|
40
40
|
if (originalDashboard) {
|
|
@@ -49,8 +49,7 @@ const DashboardApp = (props)=>{
|
|
|
49
49
|
const onEditButtonClick = ()=>{
|
|
50
50
|
setEditMode(true);
|
|
51
51
|
setOriginalDashboard(dashboard);
|
|
52
|
-
|
|
53
|
-
setSavedDatasources((_dashboard_spec_datasources = dashboard.spec.datasources) !== null && _dashboard_spec_datasources !== void 0 ? _dashboard_spec_datasources : {});
|
|
52
|
+
setSavedDatasources(dashboard.spec.datasources ?? {});
|
|
54
53
|
};
|
|
55
54
|
const onCancelButtonClick = ()=>{
|
|
56
55
|
// check if dashboard has been modified
|
|
@@ -87,7 +86,8 @@ const DashboardApp = (props)=>{
|
|
|
87
86
|
}),
|
|
88
87
|
/*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Box, {
|
|
89
88
|
sx: {
|
|
90
|
-
|
|
89
|
+
paddingTop: 2,
|
|
90
|
+
paddingX: 2,
|
|
91
91
|
height: '100%'
|
|
92
92
|
},
|
|
93
93
|
children: [
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Copyright
|
|
1
|
+
// Copyright 2024 The Perses Authors
|
|
2
2
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
3
3
|
// you may not use this file except in compliance with the License.
|
|
4
4
|
// You may obtain a copy of the License at
|
|
@@ -27,17 +27,16 @@ const _components = require("@perses-dev/components");
|
|
|
27
27
|
const _pluginsystem = require("@perses-dev/plugin-system");
|
|
28
28
|
const _react = require("react");
|
|
29
29
|
const _context = require("../../context");
|
|
30
|
+
const _DashboardProviderWithQueryParams = require("../../context/DashboardProvider/DashboardProviderWithQueryParams");
|
|
30
31
|
const _DashboardApp = require("./DashboardApp");
|
|
31
32
|
function ViewDashboard(props) {
|
|
32
|
-
const { dashboardResource
|
|
33
|
-
const { spec
|
|
34
|
-
|
|
35
|
-
const
|
|
36
|
-
var _spec_refreshInterval;
|
|
37
|
-
const dashboardRefreshInterval = (_spec_refreshInterval = spec.refreshInterval) !== null && _spec_refreshInterval !== void 0 ? _spec_refreshInterval : _core.DEFAULT_REFRESH_INTERVAL;
|
|
33
|
+
const { dashboardResource, datasourceApi, externalVariableDefinitions, dashboardTitleComponent, emptyDashboardProps, onSave, onDiscard, initialVariableIsSticky, isReadonly, isEditing, isCreating, sx, ...others } = props;
|
|
34
|
+
const { spec } = dashboardResource;
|
|
35
|
+
const dashboardDuration = spec.duration ?? _core.DEFAULT_DASHBOARD_DURATION;
|
|
36
|
+
const dashboardRefreshInterval = spec.refreshInterval ?? _core.DEFAULT_REFRESH_INTERVAL;
|
|
38
37
|
const initialTimeRange = (0, _pluginsystem.useInitialTimeRange)(dashboardDuration);
|
|
39
38
|
const initialRefreshInterval = (0, _pluginsystem.useInitialRefreshInterval)(dashboardRefreshInterval);
|
|
40
|
-
const { data
|
|
39
|
+
const { data } = (0, _pluginsystem.usePluginBuiltinVariableDefinitions)();
|
|
41
40
|
const builtinVariables = (0, _react.useMemo)(()=>{
|
|
42
41
|
const result = [
|
|
43
42
|
{
|
|
@@ -79,7 +78,7 @@ function ViewDashboard(props) {
|
|
|
79
78
|
return /*#__PURE__*/ (0, _jsxruntime.jsx)(_context.DatasourceStoreProvider, {
|
|
80
79
|
dashboardResource: dashboardResource,
|
|
81
80
|
datasourceApi: datasourceApi,
|
|
82
|
-
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(
|
|
81
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_DashboardProviderWithQueryParams.DashboardProviderWithQueryParams, {
|
|
83
82
|
initialState: {
|
|
84
83
|
dashboardResource,
|
|
85
84
|
isEditMode: !!isEditing
|
|
@@ -87,10 +86,10 @@ function ViewDashboard(props) {
|
|
|
87
86
|
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_pluginsystem.TimeRangeProviderWithQueryParams, {
|
|
88
87
|
initialTimeRange: initialTimeRange,
|
|
89
88
|
initialRefreshInterval: initialRefreshInterval,
|
|
90
|
-
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_context.
|
|
89
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_context.VariableProviderWithQueryParams, {
|
|
91
90
|
initialVariableDefinitions: spec.variables,
|
|
92
91
|
externalVariableDefinitions: externalVariableDefinitions,
|
|
93
|
-
|
|
92
|
+
builtinVariableDefinitions: builtinVariables,
|
|
94
93
|
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Box, {
|
|
95
94
|
sx: (0, _components.combineSx)({
|
|
96
95
|
display: 'flex',
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
export declare const AddGroupButton: () =>
|
|
1
|
+
import { ReactElement } from 'react';
|
|
2
|
+
export declare const AddGroupButton: () => ReactElement;
|
|
3
3
|
//# sourceMappingURL=AddGroupButton.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AddGroupButton.d.ts","sourceRoot":"","sources":["../../../src/components/AddGroupButton/AddGroupButton.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"AddGroupButton.d.ts","sourceRoot":"","sources":["../../../src/components/AddGroupButton/AddGroupButton.tsx"],"names":[],"mappings":"AAgBA,OAAO,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAIrC,eAAO,MAAM,cAAc,QAAO,YAejC,CAAC"}
|
|
@@ -17,7 +17,7 @@ import { InfoTooltip } from '@perses-dev/components';
|
|
|
17
17
|
import { TOOLTIP_TEXT, editButtonStyle } from '../../constants';
|
|
18
18
|
import { useDashboardActions } from '../../context';
|
|
19
19
|
export const AddGroupButton = ()=>{
|
|
20
|
-
const { openAddPanelGroup
|
|
20
|
+
const { openAddPanelGroup } = useDashboardActions();
|
|
21
21
|
return /*#__PURE__*/ _jsx(InfoTooltip, {
|
|
22
22
|
description: TOOLTIP_TEXT.addGroup,
|
|
23
23
|
children: /*#__PURE__*/ _jsx(Button, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/AddGroupButton/AddGroupButton.tsx"],"sourcesContent":["// Copyright 2023 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { Button } from '@mui/material';\nimport AddGroupIcon from 'mdi-material-ui/PlusBoxOutline';\nimport { InfoTooltip } from '@perses-dev/components';\nimport { TOOLTIP_TEXT, editButtonStyle } from '../../constants';\nimport { useDashboardActions } from '../../context';\n\nexport const AddGroupButton = () => {\n const { openAddPanelGroup } = useDashboardActions();\n\n return (\n <InfoTooltip description={TOOLTIP_TEXT.addGroup}>\n <Button\n startIcon={<AddGroupIcon />}\n onClick={openAddPanelGroup}\n aria-label={TOOLTIP_TEXT.addGroup}\n sx={editButtonStyle}\n >\n Panel Group\n </Button>\n </InfoTooltip>\n );\n};\n"],"names":["Button","AddGroupIcon","InfoTooltip","TOOLTIP_TEXT","editButtonStyle","useDashboardActions","AddGroupButton","openAddPanelGroup","description","addGroup","startIcon","onClick","aria-label","sx"],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;;AAEjC,SAASA,MAAM,QAAQ,gBAAgB;AACvC,OAAOC,kBAAkB,iCAAiC;AAC1D,SAASC,WAAW,QAAQ,yBAAyB;
|
|
1
|
+
{"version":3,"sources":["../../../src/components/AddGroupButton/AddGroupButton.tsx"],"sourcesContent":["// Copyright 2023 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { Button } from '@mui/material';\nimport AddGroupIcon from 'mdi-material-ui/PlusBoxOutline';\nimport { InfoTooltip } from '@perses-dev/components';\nimport { ReactElement } from 'react';\nimport { TOOLTIP_TEXT, editButtonStyle } from '../../constants';\nimport { useDashboardActions } from '../../context';\n\nexport const AddGroupButton = (): ReactElement => {\n const { openAddPanelGroup } = useDashboardActions();\n\n return (\n <InfoTooltip description={TOOLTIP_TEXT.addGroup}>\n <Button\n startIcon={<AddGroupIcon />}\n onClick={openAddPanelGroup}\n aria-label={TOOLTIP_TEXT.addGroup}\n sx={editButtonStyle}\n >\n Panel Group\n </Button>\n </InfoTooltip>\n );\n};\n"],"names":["Button","AddGroupIcon","InfoTooltip","TOOLTIP_TEXT","editButtonStyle","useDashboardActions","AddGroupButton","openAddPanelGroup","description","addGroup","startIcon","onClick","aria-label","sx"],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;;AAEjC,SAASA,MAAM,QAAQ,gBAAgB;AACvC,OAAOC,kBAAkB,iCAAiC;AAC1D,SAASC,WAAW,QAAQ,yBAAyB;AAErD,SAASC,YAAY,EAAEC,eAAe,QAAQ,kBAAkB;AAChE,SAASC,mBAAmB,QAAQ,gBAAgB;AAEpD,OAAO,MAAMC,iBAAiB;IAC5B,MAAM,EAAEC,iBAAiB,EAAE,GAAGF;IAE9B,qBACE,KAACH;QAAYM,aAAaL,aAAaM,QAAQ;kBAC7C,cAAA,KAACT;YACCU,yBAAW,KAACT;YACZU,SAASJ;YACTK,cAAYT,aAAaM,QAAQ;YACjCI,IAAIT;sBACL;;;AAKP,EAAE"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { ButtonProps } from '@mui/material';
|
|
2
|
+
import { ReactElement } from 'react';
|
|
3
3
|
export interface AddPanelButtonProps extends Pick<ButtonProps, 'fullWidth'> {
|
|
4
4
|
/**
|
|
5
5
|
* The variant to use to display the button.
|
|
@@ -14,5 +14,5 @@ export interface AddPanelButtonProps extends Pick<ButtonProps, 'fullWidth'> {
|
|
|
14
14
|
*/
|
|
15
15
|
label?: string;
|
|
16
16
|
}
|
|
17
|
-
export declare const AddPanelButton: ({ variant, color, label, fullWidth, }: AddPanelButtonProps) =>
|
|
17
|
+
export declare const AddPanelButton: ({ variant, color, label, fullWidth, }: AddPanelButtonProps) => ReactElement;
|
|
18
18
|
//# sourceMappingURL=AddPanelButton.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AddPanelButton.d.ts","sourceRoot":"","sources":["../../../src/components/AddPanelButton/AddPanelButton.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"AddPanelButton.d.ts","sourceRoot":"","sources":["../../../src/components/AddPanelButton/AddPanelButton.tsx"],"names":[],"mappings":"AAaA,OAAO,EAAU,WAAW,EAAE,MAAM,eAAe,CAAC;AAGpD,OAAO,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAIrC,MAAM,WAAW,mBAAoB,SAAQ,IAAI,CAAC,WAAW,EAAE,WAAW,CAAC;IACzE;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,GAAG,UAAU,CAAC;IAE9B;;OAEG;IACH,KAAK,CAAC,EAAE,SAAS,GAAG,WAAW,CAAC;IAEhC;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,eAAO,MAAM,cAAc,0CAKxB,mBAAmB,KAAG,YAkBxB,CAAC"}
|
|
@@ -16,8 +16,8 @@ import AddPanelIcon from 'mdi-material-ui/ChartBoxPlusOutline';
|
|
|
16
16
|
import { InfoTooltip } from '@perses-dev/components';
|
|
17
17
|
import { TOOLTIP_TEXT, editButtonStyle } from '../../constants';
|
|
18
18
|
import { useDashboardActions } from '../../context';
|
|
19
|
-
export const AddPanelButton = ({ variant ='text'
|
|
20
|
-
const { openAddPanel
|
|
19
|
+
export const AddPanelButton = ({ variant = 'text', color = 'primary', label = 'Panel', fullWidth })=>{
|
|
20
|
+
const { openAddPanel } = useDashboardActions();
|
|
21
21
|
return /*#__PURE__*/ _jsx(InfoTooltip, {
|
|
22
22
|
description: TOOLTIP_TEXT.addPanel,
|
|
23
23
|
children: /*#__PURE__*/ _jsx(Button, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/AddPanelButton/AddPanelButton.tsx"],"sourcesContent":["// Copyright 2023 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { Button, ButtonProps } from '@mui/material';\nimport AddPanelIcon from 'mdi-material-ui/ChartBoxPlusOutline';\nimport { InfoTooltip } from '@perses-dev/components';\nimport { TOOLTIP_TEXT, editButtonStyle } from '../../constants';\nimport { useDashboardActions } from '../../context';\n\nexport interface AddPanelButtonProps extends Pick<ButtonProps, 'fullWidth'> {\n /**\n * The variant to use to display the button.\n */\n variant?: 'text' | 'outlined';\n\n /**\n * The color to use to display the button.\n */\n color?: 'primary' | 'secondary';\n\n /**\n * The label used inside the button.\n */\n label?: string;\n}\n\nexport const AddPanelButton = ({\n variant = 'text',\n color = 'primary',\n label = 'Panel',\n fullWidth,\n}: AddPanelButtonProps) => {\n const { openAddPanel } = useDashboardActions();\n\n return (\n <InfoTooltip description={TOOLTIP_TEXT.addPanel}>\n <Button\n startIcon={<AddPanelIcon />}\n onClick={openAddPanel}\n aria-label={TOOLTIP_TEXT.addPanel}\n variant={variant}\n color={color}\n fullWidth={fullWidth}\n sx={editButtonStyle}\n >\n {label}\n </Button>\n </InfoTooltip>\n );\n};\n"],"names":["Button","AddPanelIcon","InfoTooltip","TOOLTIP_TEXT","editButtonStyle","useDashboardActions","AddPanelButton","variant","color","label","fullWidth","openAddPanel","description","addPanel","startIcon","onClick","aria-label","sx"],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;;AAEjC,SAASA,MAAM,QAAqB,gBAAgB;AACpD,OAAOC,kBAAkB,sCAAsC;AAC/D,SAASC,WAAW,QAAQ,yBAAyB;
|
|
1
|
+
{"version":3,"sources":["../../../src/components/AddPanelButton/AddPanelButton.tsx"],"sourcesContent":["// Copyright 2023 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { Button, ButtonProps } from '@mui/material';\nimport AddPanelIcon from 'mdi-material-ui/ChartBoxPlusOutline';\nimport { InfoTooltip } from '@perses-dev/components';\nimport { ReactElement } from 'react';\nimport { TOOLTIP_TEXT, editButtonStyle } from '../../constants';\nimport { useDashboardActions } from '../../context';\n\nexport interface AddPanelButtonProps extends Pick<ButtonProps, 'fullWidth'> {\n /**\n * The variant to use to display the button.\n */\n variant?: 'text' | 'outlined';\n\n /**\n * The color to use to display the button.\n */\n color?: 'primary' | 'secondary';\n\n /**\n * The label used inside the button.\n */\n label?: string;\n}\n\nexport const AddPanelButton = ({\n variant = 'text',\n color = 'primary',\n label = 'Panel',\n fullWidth,\n}: AddPanelButtonProps): ReactElement => {\n const { openAddPanel } = useDashboardActions();\n\n return (\n <InfoTooltip description={TOOLTIP_TEXT.addPanel}>\n <Button\n startIcon={<AddPanelIcon />}\n onClick={openAddPanel}\n aria-label={TOOLTIP_TEXT.addPanel}\n variant={variant}\n color={color}\n fullWidth={fullWidth}\n sx={editButtonStyle}\n >\n {label}\n </Button>\n </InfoTooltip>\n );\n};\n"],"names":["Button","AddPanelIcon","InfoTooltip","TOOLTIP_TEXT","editButtonStyle","useDashboardActions","AddPanelButton","variant","color","label","fullWidth","openAddPanel","description","addPanel","startIcon","onClick","aria-label","sx"],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;;AAEjC,SAASA,MAAM,QAAqB,gBAAgB;AACpD,OAAOC,kBAAkB,sCAAsC;AAC/D,SAASC,WAAW,QAAQ,yBAAyB;AAErD,SAASC,YAAY,EAAEC,eAAe,QAAQ,kBAAkB;AAChE,SAASC,mBAAmB,QAAQ,gBAAgB;AAmBpD,OAAO,MAAMC,iBAAiB,CAAC,EAC7BC,UAAU,MAAM,EAChBC,QAAQ,SAAS,EACjBC,QAAQ,OAAO,EACfC,SAAS,EACW;IACpB,MAAM,EAAEC,YAAY,EAAE,GAAGN;IAEzB,qBACE,KAACH;QAAYU,aAAaT,aAAaU,QAAQ;kBAC7C,cAAA,KAACb;YACCc,yBAAW,KAACb;YACZc,SAASJ;YACTK,cAAYb,aAAaU,QAAQ;YACjCN,SAASA;YACTC,OAAOA;YACPE,WAAWA;YACXO,IAAIb;sBAEHK;;;AAIT,EAAE"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { BoxProps } from '@mui/material';
|
|
2
|
+
import { ReactElement } from 'react';
|
|
3
3
|
import { EmptyDashboardProps } from '../EmptyDashboard';
|
|
4
4
|
import { PanelOptions } from '../Panel';
|
|
5
|
-
export
|
|
5
|
+
export type DashboardProps = BoxProps & {
|
|
6
6
|
/**
|
|
7
7
|
* Props for `EmptyDashboard` component that will be rendered when the dashboard
|
|
8
8
|
* is empty (i.e. has no panel groups). If not specified, the defaults will
|
|
@@ -14,5 +14,5 @@ export declare type DashboardProps = BoxProps & {
|
|
|
14
14
|
/**
|
|
15
15
|
* Renders a Dashboard for the provided Dashboard spec.
|
|
16
16
|
*/
|
|
17
|
-
export declare function Dashboard({ emptyDashboardProps, panelOptions, ...boxProps }: DashboardProps):
|
|
17
|
+
export declare function Dashboard({ emptyDashboardProps, panelOptions, ...boxProps }: DashboardProps): ReactElement;
|
|
18
18
|
//# sourceMappingURL=Dashboard.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Dashboard.d.ts","sourceRoot":"","sources":["../../../src/components/Dashboard/Dashboard.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Dashboard.d.ts","sourceRoot":"","sources":["../../../src/components/Dashboard/Dashboard.tsx"],"names":[],"mappings":"AAaA,OAAO,EAAO,QAAQ,EAAE,MAAM,eAAe,CAAC;AAE9C,OAAO,EAAE,YAAY,EAAU,MAAM,OAAO,CAAC;AAG7C,OAAO,EAAkB,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AACxE,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AACxC,MAAM,MAAM,cAAc,GAAG,QAAQ,GAAG;IACtC;;;;OAIG;IACH,mBAAmB,CAAC,EAAE,mBAAmB,CAAC;IAC1C,YAAY,CAAC,EAAE,YAAY,CAAC;CAC7B,CAAC;AAGF;;GAEG;AACH,wBAAgB,SAAS,CAAC,EAAE,mBAAmB,EAAE,YAAY,EAAE,GAAG,QAAQ,EAAE,EAAE,cAAc,GAAG,YAAY,CA2B1G"}
|
|
@@ -13,19 +13,25 @@
|
|
|
13
13
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
14
14
|
import { Box } from '@mui/material';
|
|
15
15
|
import { ErrorBoundary, ErrorAlert } from '@perses-dev/components';
|
|
16
|
+
import { useRef } from 'react';
|
|
16
17
|
import { usePanelGroupIds } from '../../context';
|
|
17
18
|
import { GridLayout } from '../GridLayout';
|
|
18
19
|
import { EmptyDashboard } from '../EmptyDashboard';
|
|
20
|
+
const HEADER_HEIGHT = 165; // Approximate height of the header in dashboard view (including the navbar and variables toolbar)
|
|
19
21
|
/**
|
|
20
22
|
* Renders a Dashboard for the provided Dashboard spec.
|
|
21
|
-
*/ export function Dashboard({ emptyDashboardProps
|
|
23
|
+
*/ export function Dashboard({ emptyDashboardProps, panelOptions, ...boxProps }) {
|
|
22
24
|
const panelGroupIds = usePanelGroupIds();
|
|
25
|
+
const boxRef = useRef(null);
|
|
23
26
|
const isEmpty = !panelGroupIds.length;
|
|
27
|
+
const dashboardTopPosition = boxRef.current?.getBoundingClientRect().top ?? HEADER_HEIGHT;
|
|
28
|
+
const panelFullHeight = window.innerHeight - dashboardTopPosition - window.scrollY;
|
|
24
29
|
return /*#__PURE__*/ _jsx(Box, {
|
|
25
30
|
...boxProps,
|
|
26
31
|
sx: {
|
|
27
32
|
height: '100%'
|
|
28
33
|
},
|
|
34
|
+
ref: boxRef,
|
|
29
35
|
children: /*#__PURE__*/ _jsxs(ErrorBoundary, {
|
|
30
36
|
FallbackComponent: ErrorAlert,
|
|
31
37
|
children: [
|
|
@@ -41,7 +47,8 @@ import { EmptyDashboard } from '../EmptyDashboard';
|
|
|
41
47
|
}),
|
|
42
48
|
!isEmpty && panelGroupIds.map((panelGroupId)=>/*#__PURE__*/ _jsx(GridLayout, {
|
|
43
49
|
panelGroupId: panelGroupId,
|
|
44
|
-
panelOptions: panelOptions
|
|
50
|
+
panelOptions: panelOptions,
|
|
51
|
+
panelFullHeight: panelFullHeight
|
|
45
52
|
}, panelGroupId))
|
|
46
53
|
]
|
|
47
54
|
})
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/Dashboard/Dashboard.tsx"],"sourcesContent":["// Copyright 2023 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { Box, BoxProps } from '@mui/material';\nimport { ErrorBoundary, ErrorAlert } from '@perses-dev/components';\nimport { usePanelGroupIds } from '../../context';\nimport { GridLayout } from '../GridLayout';\nimport { EmptyDashboard, EmptyDashboardProps } from '../EmptyDashboard';\nimport { PanelOptions } from '../Panel';\nexport type DashboardProps = BoxProps & {\n /**\n * Props for `EmptyDashboard` component that will be rendered when the dashboard\n * is empty (i.e. has no panel groups). If not specified, the defaults will\n * be used.\n */\n emptyDashboardProps?: EmptyDashboardProps;\n panelOptions?: PanelOptions;\n};\n\n/**\n * Renders a Dashboard for the provided Dashboard spec.\n */\nexport function Dashboard({ emptyDashboardProps, panelOptions, ...boxProps }: DashboardProps) {\n const panelGroupIds = usePanelGroupIds();\n const isEmpty = !panelGroupIds.length;\n\n return (\n <Box {...boxProps} sx={{ height: '100%' }}>\n <ErrorBoundary FallbackComponent={ErrorAlert}>\n {isEmpty && (\n <Box sx={{ height: '100%', display: 'flex', alignItems: 'center' }}>\n <EmptyDashboard {...emptyDashboardProps} />\n </Box>\n )}\n {!isEmpty &&\n panelGroupIds.map((panelGroupId) => (\n <GridLayout
|
|
1
|
+
{"version":3,"sources":["../../../src/components/Dashboard/Dashboard.tsx"],"sourcesContent":["// Copyright 2023 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { Box, BoxProps } from '@mui/material';\nimport { ErrorBoundary, ErrorAlert } from '@perses-dev/components';\nimport { ReactElement, useRef } from 'react';\nimport { usePanelGroupIds } from '../../context';\nimport { GridLayout } from '../GridLayout';\nimport { EmptyDashboard, EmptyDashboardProps } from '../EmptyDashboard';\nimport { PanelOptions } from '../Panel';\nexport type DashboardProps = BoxProps & {\n /**\n * Props for `EmptyDashboard` component that will be rendered when the dashboard\n * is empty (i.e. has no panel groups). If not specified, the defaults will\n * be used.\n */\n emptyDashboardProps?: EmptyDashboardProps;\n panelOptions?: PanelOptions;\n};\nconst HEADER_HEIGHT = 165; // Approximate height of the header in dashboard view (including the navbar and variables toolbar)\n\n/**\n * Renders a Dashboard for the provided Dashboard spec.\n */\nexport function Dashboard({ emptyDashboardProps, panelOptions, ...boxProps }: DashboardProps): ReactElement {\n const panelGroupIds = usePanelGroupIds();\n const boxRef = useRef<HTMLDivElement>(null);\n const isEmpty = !panelGroupIds.length;\n const dashboardTopPosition = boxRef.current?.getBoundingClientRect().top ?? HEADER_HEIGHT;\n const panelFullHeight = window.innerHeight - dashboardTopPosition - window.scrollY;\n\n return (\n <Box {...boxProps} sx={{ height: '100%' }} ref={boxRef}>\n <ErrorBoundary FallbackComponent={ErrorAlert}>\n {isEmpty && (\n <Box sx={{ height: '100%', display: 'flex', alignItems: 'center' }}>\n <EmptyDashboard {...emptyDashboardProps} />\n </Box>\n )}\n {!isEmpty &&\n panelGroupIds.map((panelGroupId) => (\n <GridLayout\n key={panelGroupId}\n panelGroupId={panelGroupId}\n panelOptions={panelOptions}\n panelFullHeight={panelFullHeight}\n />\n ))}\n </ErrorBoundary>\n </Box>\n );\n}\n"],"names":["Box","ErrorBoundary","ErrorAlert","useRef","usePanelGroupIds","GridLayout","EmptyDashboard","HEADER_HEIGHT","Dashboard","emptyDashboardProps","panelOptions","boxProps","panelGroupIds","boxRef","isEmpty","length","dashboardTopPosition","current","getBoundingClientRect","top","panelFullHeight","window","innerHeight","scrollY","sx","height","ref","FallbackComponent","display","alignItems","map","panelGroupId"],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;;AAEjC,SAASA,GAAG,QAAkB,gBAAgB;AAC9C,SAASC,aAAa,EAAEC,UAAU,QAAQ,yBAAyB;AACnE,SAAuBC,MAAM,QAAQ,QAAQ;AAC7C,SAASC,gBAAgB,QAAQ,gBAAgB;AACjD,SAASC,UAAU,QAAQ,gBAAgB;AAC3C,SAASC,cAAc,QAA6B,oBAAoB;AAWxE,MAAMC,gBAAgB,KAAK,kGAAkG;AAE7H;;CAEC,GACD,OAAO,SAASC,UAAU,EAAEC,mBAAmB,EAAEC,YAAY,EAAE,GAAGC,UAA0B;IAC1F,MAAMC,gBAAgBR;IACtB,MAAMS,SAASV,OAAuB;IACtC,MAAMW,UAAU,CAACF,cAAcG,MAAM;IACrC,MAAMC,uBAAuBH,OAAOI,OAAO,EAAEC,wBAAwBC,OAAOZ;IAC5E,MAAMa,kBAAkBC,OAAOC,WAAW,GAAGN,uBAAuBK,OAAOE,OAAO;IAElF,qBACE,KAACvB;QAAK,GAAGW,QAAQ;QAAEa,IAAI;YAAEC,QAAQ;QAAO;QAAGC,KAAKb;kBAC9C,cAAA,MAACZ;YAAc0B,mBAAmBzB;;gBAC/BY,yBACC,KAACd;oBAAIwB,IAAI;wBAAEC,QAAQ;wBAAQG,SAAS;wBAAQC,YAAY;oBAAS;8BAC/D,cAAA,KAACvB;wBAAgB,GAAGG,mBAAmB;;;gBAG1C,CAACK,WACAF,cAAckB,GAAG,CAAC,CAACC,6BACjB,KAAC1B;wBAEC0B,cAAcA;wBACdrB,cAAcA;wBACdU,iBAAiBA;uBAHZW;;;;AASnB"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
|
|
1
|
+
import { ReactElement } from 'react';
|
|
2
2
|
import { SxProps, Theme } from '@mui/material';
|
|
3
3
|
interface DashboardStickyToolbarProps {
|
|
4
4
|
initialVariableIsSticky?: boolean;
|
|
5
5
|
sx?: SxProps<Theme>;
|
|
6
6
|
}
|
|
7
|
-
export declare function DashboardStickyToolbar(props: DashboardStickyToolbarProps):
|
|
7
|
+
export declare function DashboardStickyToolbar(props: DashboardStickyToolbarProps): ReactElement;
|
|
8
8
|
export {};
|
|
9
9
|
//# sourceMappingURL=DashboardStickyToolbar.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DashboardStickyToolbar.d.ts","sourceRoot":"","sources":["../../../src/components/DashboardStickyToolbar/DashboardStickyToolbar.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"DashboardStickyToolbar.d.ts","sourceRoot":"","sources":["../../../src/components/DashboardStickyToolbar/DashboardStickyToolbar.tsx"],"names":[],"mappings":"AAaA,OAAO,EAAE,YAAY,EAAY,MAAM,OAAO,CAAC;AAC/C,OAAO,EAKL,OAAO,EACP,KAAK,EAIN,MAAM,eAAe,CAAC;AAMvB,UAAU,2BAA2B;IACnC,uBAAuB,CAAC,EAAE,OAAO,CAAC;IAClC,EAAE,CAAC,EAAE,OAAO,CAAC,KAAK,CAAC,CAAC;CACrB;AAED,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,2BAA2B,GAAG,YAAY,CAuEvF"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Copyright
|
|
1
|
+
// Copyright 2024 The Perses Authors
|
|
2
2
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
3
3
|
// you may not use this file except in compliance with the License.
|
|
4
4
|
// You may obtain a copy of the License at
|
|
@@ -15,8 +15,8 @@ import { useState } from 'react';
|
|
|
15
15
|
import { AppBar, Box, IconButton, Stack, useMediaQuery, useScrollTrigger, useTheme } from '@mui/material';
|
|
16
16
|
import PinOutline from 'mdi-material-ui/PinOutline';
|
|
17
17
|
import PinOffOutline from 'mdi-material-ui/PinOffOutline';
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
18
|
+
import { TimeRangeControls } from '@perses-dev/plugin-system';
|
|
19
|
+
import { VariableList } from '../Variables';
|
|
20
20
|
export function DashboardStickyToolbar(props) {
|
|
21
21
|
const [isPin, setIsPin] = useState(props.initialVariableIsSticky);
|
|
22
22
|
const scrollTrigger = useScrollTrigger({
|
|
@@ -69,7 +69,7 @@ export function DashboardStickyToolbar(props) {
|
|
|
69
69
|
},
|
|
70
70
|
gap: 1,
|
|
71
71
|
children: [
|
|
72
|
-
/*#__PURE__*/ _jsx(
|
|
72
|
+
/*#__PURE__*/ _jsx(VariableList, {}),
|
|
73
73
|
props.initialVariableIsSticky && /*#__PURE__*/ _jsx(IconButton, {
|
|
74
74
|
style: {
|
|
75
75
|
width: 'fit-content',
|