@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
|
@@ -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, {
|
|
@@ -23,17 +23,23 @@ Object.defineProperty(exports, "Dashboard", {
|
|
|
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 _react = require("react");
|
|
26
27
|
const _context = require("../../context");
|
|
27
28
|
const _GridLayout = require("../GridLayout");
|
|
28
29
|
const _EmptyDashboard = require("../EmptyDashboard");
|
|
29
|
-
|
|
30
|
+
const HEADER_HEIGHT = 165; // Approximate height of the header in dashboard view (including the navbar and variables toolbar)
|
|
31
|
+
function Dashboard({ emptyDashboardProps, panelOptions, ...boxProps }) {
|
|
30
32
|
const panelGroupIds = (0, _context.usePanelGroupIds)();
|
|
33
|
+
const boxRef = (0, _react.useRef)(null);
|
|
31
34
|
const isEmpty = !panelGroupIds.length;
|
|
35
|
+
const dashboardTopPosition = boxRef.current?.getBoundingClientRect().top ?? HEADER_HEIGHT;
|
|
36
|
+
const panelFullHeight = window.innerHeight - dashboardTopPosition - window.scrollY;
|
|
32
37
|
return /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Box, {
|
|
33
38
|
...boxProps,
|
|
34
39
|
sx: {
|
|
35
40
|
height: '100%'
|
|
36
41
|
},
|
|
42
|
+
ref: boxRef,
|
|
37
43
|
children: /*#__PURE__*/ (0, _jsxruntime.jsxs)(_components.ErrorBoundary, {
|
|
38
44
|
FallbackComponent: _components.ErrorAlert,
|
|
39
45
|
children: [
|
|
@@ -49,7 +55,8 @@ function Dashboard({ emptyDashboardProps , panelOptions , ...boxProps }) {
|
|
|
49
55
|
}),
|
|
50
56
|
!isEmpty && panelGroupIds.map((panelGroupId)=>/*#__PURE__*/ (0, _jsxruntime.jsx)(_GridLayout.GridLayout, {
|
|
51
57
|
panelGroupId: panelGroupId,
|
|
52
|
-
panelOptions: panelOptions
|
|
58
|
+
panelOptions: panelOptions,
|
|
59
|
+
panelFullHeight: panelFullHeight
|
|
53
60
|
}, panelGroupId))
|
|
54
61
|
]
|
|
55
62
|
})
|
|
@@ -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
|
|
@@ -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
|
|
@@ -84,7 +84,7 @@ function DashboardStickyToolbar(props) {
|
|
|
84
84
|
},
|
|
85
85
|
gap: 1,
|
|
86
86
|
children: [
|
|
87
|
-
/*#__PURE__*/ (0, _jsxruntime.jsx)(_Variables.
|
|
87
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_Variables.VariableList, {}),
|
|
88
88
|
props.initialVariableIsSticky && /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.IconButton, {
|
|
89
89
|
style: {
|
|
90
90
|
width: 'fit-content',
|
|
@@ -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, {
|
|
@@ -63,7 +63,7 @@ const DashboardToolbar = (props)=>{
|
|
|
63
63
|
ml: "auto",
|
|
64
64
|
children: [
|
|
65
65
|
isReadonly && /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Alert, {
|
|
66
|
-
severity:
|
|
66
|
+
severity: "warning",
|
|
67
67
|
sx: {
|
|
68
68
|
backgroundColor: 'transparent',
|
|
69
69
|
padding: 0
|
|
@@ -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({
|
|
@@ -77,28 +77,29 @@ function DatasourceEditor(props) {
|
|
|
77
77
|
};
|
|
78
78
|
const editDatasource = (name)=>{
|
|
79
79
|
setDatasourceFormAction('update');
|
|
80
|
-
var _datasources_name;
|
|
81
80
|
setDatasourceEdit({
|
|
82
81
|
name: name,
|
|
83
|
-
spec:
|
|
82
|
+
spec: datasources[name] ?? defaultSpec
|
|
84
83
|
});
|
|
85
84
|
};
|
|
86
85
|
return /*#__PURE__*/ (0, _jsxruntime.jsx)(_jsxruntime.Fragment, {
|
|
87
|
-
children: datasourceEdit ? /*#__PURE__*/ (0, _jsxruntime.jsx)(_pluginsystem.
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
86
|
+
children: datasourceEdit ? /*#__PURE__*/ (0, _jsxruntime.jsx)(_pluginsystem.ValidationProvider, {
|
|
87
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_pluginsystem.DatasourceEditorForm, {
|
|
88
|
+
initialDatasourceDefinition: datasourceEdit,
|
|
89
|
+
action: datasourceFormAction,
|
|
90
|
+
isDraft: true,
|
|
91
|
+
onActionChange: setDatasourceFormAction,
|
|
92
|
+
onSave: (def)=>{
|
|
93
|
+
setDatasources((draft)=>{
|
|
94
|
+
delete draft[datasourceEdit.name]; // to tackle the case where datasource name has been changed
|
|
95
|
+
draft[def.name] = def.spec;
|
|
96
|
+
setDatasourceEdit(null);
|
|
97
|
+
});
|
|
98
|
+
},
|
|
99
|
+
onClose: ()=>{
|
|
96
100
|
setDatasourceEdit(null);
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
onClose: ()=>{
|
|
100
|
-
setDatasourceEdit(null);
|
|
101
|
-
}
|
|
101
|
+
}
|
|
102
|
+
})
|
|
102
103
|
}) : /*#__PURE__*/ (0, _jsxruntime.jsxs)(_jsxruntime.Fragment, {
|
|
103
104
|
children: [
|
|
104
105
|
/*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Box, {
|
|
@@ -174,8 +175,6 @@ function DatasourceEditor(props) {
|
|
|
174
175
|
}),
|
|
175
176
|
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.TableBody, {
|
|
176
177
|
children: Object.entries(datasources).map(([name, spec])=>{
|
|
177
|
-
var _spec_display;
|
|
178
|
-
var _spec_display_description;
|
|
179
178
|
return /*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.TableRow, {
|
|
180
179
|
children: [
|
|
181
180
|
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.TableCell, {
|
|
@@ -190,7 +189,7 @@ function DatasourceEditor(props) {
|
|
|
190
189
|
children: spec.plugin.kind
|
|
191
190
|
}),
|
|
192
191
|
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.TableCell, {
|
|
193
|
-
children:
|
|
192
|
+
children: spec.display?.description ?? ''
|
|
194
193
|
}),
|
|
195
194
|
/*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.TableCell, {
|
|
196
195
|
align: "right",
|
|
@@ -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,19 +49,22 @@ 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, _datasources_key_plugin, _savedDatasources_key, _savedDatasources_key_plugin, _datasources_key1, _datasources_key_plugin1, _datasources_key_plugin_spec, _savedDatasources_key1, _savedDatasources_key_plugin1, _savedDatasources_key_plugin_spec;
|
|
53
|
-
var _datasources_key_plugin_spec1;
|
|
54
52
|
// Datasources are allowed to be used if a) they are direct, or b) they are proxied, and their
|
|
55
53
|
// proxy is the same as what we have saved.
|
|
56
|
-
const isDirect = 'directUrl' in (
|
|
57
|
-
|
|
58
|
-
const isSavedProxy = !isDirect && !('directUrl' in ((_savedDatasources_key_plugin_spec1 = (_savedDatasources_key = savedDatasources[key]) === null || _savedDatasources_key === void 0 ? void 0 : (_savedDatasources_key_plugin = _savedDatasources_key.plugin) === null || _savedDatasources_key_plugin === void 0 ? void 0 : _savedDatasources_key_plugin.spec) !== null && _savedDatasources_key_plugin_spec1 !== void 0 ? _savedDatasources_key_plugin_spec1 : {})) && ((_datasources_key1 = datasources[key]) === null || _datasources_key1 === void 0 ? void 0 : (_datasources_key_plugin1 = _datasources_key1.plugin) === null || _datasources_key_plugin1 === void 0 ? void 0 : (_datasources_key_plugin_spec = _datasources_key_plugin1.spec) === null || _datasources_key_plugin_spec === void 0 ? void 0 : _datasources_key_plugin_spec.proxy) === ((_savedDatasources_key1 = savedDatasources[key]) === null || _savedDatasources_key1 === void 0 ? void 0 : (_savedDatasources_key_plugin1 = _savedDatasources_key1.plugin) === null || _savedDatasources_key_plugin1 === void 0 ? void 0 : (_savedDatasources_key_plugin_spec = _savedDatasources_key_plugin1.spec) === null || _savedDatasources_key_plugin_spec === void 0 ? void 0 : _savedDatasources_key_plugin_spec.proxy);
|
|
54
|
+
const isDirect = 'directUrl' in (datasources[key]?.plugin?.spec ?? {});
|
|
55
|
+
const isSavedProxy = !isDirect && !('directUrl' in (savedDatasources[key]?.plugin?.spec ?? {})) && datasources[key]?.plugin?.spec?.proxy === savedDatasources[key]?.plugin?.spec?.proxy;
|
|
59
56
|
return isDirect || isSavedProxy;
|
|
60
57
|
}).reduce((obj, key)=>{
|
|
61
58
|
obj[key] = datasources[key];
|
|
62
59
|
return obj;
|
|
63
60
|
}, {});
|
|
64
|
-
setDashboard({
|
|
61
|
+
setDashboard(dashboard.kind === 'Dashboard' ? {
|
|
62
|
+
...dashboard,
|
|
63
|
+
spec: {
|
|
64
|
+
...dashboard.spec,
|
|
65
|
+
datasources: datasources
|
|
66
|
+
}
|
|
67
|
+
} : {
|
|
65
68
|
...dashboard,
|
|
66
69
|
spec: {
|
|
67
70
|
...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,17 +30,16 @@ function _interop_require_default(obj) {
|
|
|
30
30
|
};
|
|
31
31
|
}
|
|
32
32
|
const DeletePanelGroupDialog = ()=>{
|
|
33
|
-
const { deletePanelGroupDialog
|
|
34
|
-
const panelGroupId = deletePanelGroupDialog
|
|
33
|
+
const { deletePanelGroupDialog, closeDeletePanelGroupDialog, deletePanelGroup } = (0, _context.useDeletePanelGroupDialog)();
|
|
34
|
+
const panelGroupId = deletePanelGroupDialog?.panelGroupId;
|
|
35
35
|
const handleDelete = (e)=>{
|
|
36
36
|
e.preventDefault();
|
|
37
|
-
if (panelGroupId
|
|
37
|
+
if (panelGroupId === undefined) {
|
|
38
38
|
throw new Error('group index is undefined');
|
|
39
39
|
}
|
|
40
40
|
deletePanelGroup(panelGroupId);
|
|
41
41
|
closeDeletePanelGroupDialog();
|
|
42
42
|
};
|
|
43
|
-
var _deletePanelGroupDialog_panelGroupName;
|
|
44
43
|
return /*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Dialog, {
|
|
45
44
|
open: deletePanelGroupDialog !== undefined,
|
|
46
45
|
children: [
|
|
@@ -67,7 +66,7 @@ const DeletePanelGroupDialog = ()=>{
|
|
|
67
66
|
},
|
|
68
67
|
children: [
|
|
69
68
|
"Are you sure you want to delete ",
|
|
70
|
-
|
|
69
|
+
deletePanelGroupDialog?.panelGroupName ?? 'panel group',
|
|
71
70
|
"? This will delete all the panels within the group."
|
|
72
71
|
]
|
|
73
72
|
}),
|
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(),
|
|
@@ -25,13 +25,12 @@ const _react = require("react");
|
|
|
25
25
|
const _material = require("@mui/material");
|
|
26
26
|
const _components = require("@perses-dev/components");
|
|
27
27
|
const _pluginsystem = require("@perses-dev/plugin-system");
|
|
28
|
-
const
|
|
29
|
-
const _useDashboard = require("../../context/useDashboard");
|
|
28
|
+
const _context = require("../../context");
|
|
30
29
|
const EditJsonDialog = (props)=>{
|
|
31
|
-
const { isReadonly
|
|
32
|
-
const { editJsonDialog
|
|
30
|
+
const { isReadonly, disableMetadataEdition } = props;
|
|
31
|
+
const { editJsonDialog, closeEditJsonDialog } = (0, _context.useEditJsonDialog)();
|
|
33
32
|
return /*#__PURE__*/ (0, _jsxruntime.jsxs)(_components.Dialog, {
|
|
34
|
-
open: !!
|
|
33
|
+
open: !!editJsonDialog?.isOpen,
|
|
35
34
|
scroll: "paper",
|
|
36
35
|
fullWidth: true,
|
|
37
36
|
maxWidth: "lg",
|
|
@@ -43,7 +42,7 @@ const EditJsonDialog = (props)=>{
|
|
|
43
42
|
" Dashboard JSON"
|
|
44
43
|
]
|
|
45
44
|
}),
|
|
46
|
-
|
|
45
|
+
editJsonDialog?.isOpen && /*#__PURE__*/ (0, _jsxruntime.jsx)(EditJsonDialogForm, {
|
|
47
46
|
isReadonly: isReadonly,
|
|
48
47
|
disableMetadataEdition: disableMetadataEdition
|
|
49
48
|
})
|
|
@@ -51,11 +50,11 @@ const EditJsonDialog = (props)=>{
|
|
|
51
50
|
});
|
|
52
51
|
};
|
|
53
52
|
const EditJsonDialogForm = (props)=>{
|
|
54
|
-
const { isReadonly
|
|
55
|
-
const { closeEditJsonDialog
|
|
56
|
-
const { setTimeRange
|
|
57
|
-
const { dashboard
|
|
58
|
-
const { setLocalDatasources
|
|
53
|
+
const { isReadonly, disableMetadataEdition } = props;
|
|
54
|
+
const { closeEditJsonDialog } = (0, _context.useEditJsonDialog)();
|
|
55
|
+
const { setTimeRange, setRefreshInterval } = (0, _pluginsystem.useTimeRange)();
|
|
56
|
+
const { dashboard, setDashboard } = (0, _context.useDashboard)();
|
|
57
|
+
const { setLocalDatasources } = (0, _pluginsystem.useDatasourceStore)();
|
|
59
58
|
const [draftDashboard, setDraftDashboard] = (0, _react.useState)(dashboard);
|
|
60
59
|
const handleApply = (e)=>{
|
|
61
60
|
e.preventDefault();
|
|
@@ -63,17 +62,15 @@ const EditJsonDialogForm = (props)=>{
|
|
|
63
62
|
setTimeRange({
|
|
64
63
|
pastDuration: draftDashboard.spec.duration
|
|
65
64
|
});
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
var _draftDashboard_spec_datasources;
|
|
69
|
-
setLocalDatasources((_draftDashboard_spec_datasources = draftDashboard.spec.datasources) !== null && _draftDashboard_spec_datasources !== void 0 ? _draftDashboard_spec_datasources : {});
|
|
65
|
+
setRefreshInterval(draftDashboard.spec.refreshInterval ?? '0s');
|
|
66
|
+
setLocalDatasources(draftDashboard.spec.datasources ?? {});
|
|
70
67
|
closeEditJsonDialog();
|
|
71
68
|
};
|
|
72
69
|
const completeDraftDashboard = (dashboard)=>{
|
|
73
70
|
try {
|
|
74
|
-
const json = JSON.parse(dashboard
|
|
71
|
+
const json = JSON.parse(dashboard ?? '{}');
|
|
75
72
|
setDraftDashboard(json);
|
|
76
|
-
} catch (
|
|
73
|
+
} catch (_) {
|
|
77
74
|
// do nothing
|
|
78
75
|
}
|
|
79
76
|
};
|
|
@@ -92,6 +89,13 @@ const EditJsonDialogForm = (props)=>{
|
|
|
92
89
|
severity: "warning",
|
|
93
90
|
children: "Metadata cannot be modified or saved."
|
|
94
91
|
}),
|
|
92
|
+
draftDashboard.kind === 'EphemeralDashboard' && /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Alert, {
|
|
93
|
+
sx: {
|
|
94
|
+
marginBottom: 1
|
|
95
|
+
},
|
|
96
|
+
severity: "warning",
|
|
97
|
+
children: "Time-to-live cannot be modified or saved from here. Go to the project view to modify it."
|
|
98
|
+
}),
|
|
95
99
|
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.FormControl, {
|
|
96
100
|
fullWidth: true,
|
|
97
101
|
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_components.JSONEditor, {
|
|
@@ -32,13 +32,13 @@ const DEFAULT_DESCRIPTION = {
|
|
|
32
32
|
view: 'This dashboard is currently empty. Get started by clicking the edit button.'
|
|
33
33
|
};
|
|
34
34
|
// Constants from specifics in designs to make the default messaging look good.
|
|
35
|
-
const CONTAINER_WIDTH = '
|
|
35
|
+
const CONTAINER_WIDTH = '500px';
|
|
36
36
|
const PRIMARY_CONTENT_WIDTH = '289px';
|
|
37
37
|
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,
|
|
@@ -105,7 +105,7 @@ const EmptyDashboard = ({ title =DEFAULT_TITLE , image , description , additiona
|
|
|
105
105
|
}),
|
|
106
106
|
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Typography, {
|
|
107
107
|
variant: "body1",
|
|
108
|
-
children: description
|
|
108
|
+
children: description ?? defaultDescription
|
|
109
109
|
}),
|
|
110
110
|
actionsContent && /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Box, {
|
|
111
111
|
sx: {
|
|
@@ -33,24 +33,29 @@ function GridContainer(props) {
|
|
|
33
33
|
isFirstRender
|
|
34
34
|
]);
|
|
35
35
|
return /*#__PURE__*/ (0, _jsxruntime.jsx)(ReactGridLayoutContainer, {
|
|
36
|
-
sx:
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
36
|
+
sx: [
|
|
37
|
+
{
|
|
38
|
+
// This adds spacing between grids (rows) in the overall dashboard
|
|
39
|
+
'& + &': {
|
|
40
|
+
marginTop: 1
|
|
41
|
+
},
|
|
42
|
+
// This disables the animation of grid items when a grid is first rendered
|
|
43
|
+
// (see https://github.com/react-grid-layout/react-grid-layout/issues/103)
|
|
44
|
+
'& .react-grid-item.cssTransforms': {
|
|
45
|
+
transitionProperty: isFirstRender ? 'none' : 'transform'
|
|
46
|
+
}
|
|
40
47
|
},
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
}
|
|
46
|
-
},
|
|
48
|
+
...Array.isArray(props.sx) ? props.sx : [
|
|
49
|
+
props.sx
|
|
50
|
+
]
|
|
51
|
+
],
|
|
47
52
|
"data-testid": "panel-group",
|
|
48
53
|
children: props.children
|
|
49
54
|
});
|
|
50
55
|
}
|
|
51
56
|
/**
|
|
52
57
|
* These are the classes needed by react-grid-layout from their CSS stylesheet.
|
|
53
|
-
*/ const ReactGridLayoutContainer = (0, _material.styled)('section')(({ theme
|
|
58
|
+
*/ const ReactGridLayoutContainer = (0, _material.styled)('section')(({ theme })=>({
|
|
54
59
|
'& .react-grid-layout': {
|
|
55
60
|
position: 'relative',
|
|
56
61
|
transition: 'height 200ms ease'
|
|
@@ -25,19 +25,30 @@ 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
|
|
29
|
-
const
|
|
28
|
+
const _Panel = require("../Panel");
|
|
29
|
+
const _panelgroupslice = require("../../context/DashboardProvider/panel-group-slice");
|
|
30
30
|
function GridItemContent(props) {
|
|
31
|
-
const { panelGroupItemId
|
|
31
|
+
const { panelGroupItemId, width } = props;
|
|
32
32
|
const panelDefinition = (0, _context.usePanel)(panelGroupItemId);
|
|
33
|
-
const { spec: { queries
|
|
34
|
-
const { isEditMode
|
|
35
|
-
const { openEditPanel
|
|
36
|
-
const
|
|
33
|
+
const { spec: { queries } } = panelDefinition;
|
|
34
|
+
const { isEditMode } = (0, _context.useEditMode)();
|
|
35
|
+
const { openEditPanel, openDeletePanelDialog, duplicatePanel, viewPanel } = (0, _context.usePanelActions)(panelGroupItemId);
|
|
36
|
+
const viewPanelGroupItemId = (0, _context.useViewPanel)();
|
|
37
|
+
const { ref, inView } = (0, _reactintersectionobserver.useInView)({
|
|
37
38
|
threshold: 0.2,
|
|
38
39
|
initialInView: false,
|
|
39
40
|
triggerOnce: true
|
|
40
41
|
});
|
|
42
|
+
const readHandlers = {
|
|
43
|
+
isPanelViewed: (0, _panelgroupslice.isPanelGroupItemIdEqual)(viewPanelGroupItemId, panelGroupItemId),
|
|
44
|
+
onViewPanelClick: function() {
|
|
45
|
+
if (viewPanelGroupItemId === undefined) {
|
|
46
|
+
viewPanel(panelGroupItemId);
|
|
47
|
+
} else {
|
|
48
|
+
viewPanel(undefined);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
};
|
|
41
52
|
// Provide actions to the panel when in edit mode
|
|
42
53
|
let editHandlers = undefined;
|
|
43
54
|
if (isEditMode) {
|
|
@@ -48,8 +59,9 @@ function GridItemContent(props) {
|
|
|
48
59
|
};
|
|
49
60
|
}
|
|
50
61
|
// map TimeSeriesQueryDefinition to Definition<UnknownSpec>
|
|
51
|
-
const suggestedStepMs = (0,
|
|
52
|
-
const
|
|
62
|
+
const suggestedStepMs = (0, _pluginsystem.useSuggestedStepMs)(width);
|
|
63
|
+
const { data: plugin } = (0, _pluginsystem.usePlugin)('Panel', panelDefinition.spec.plugin.kind);
|
|
64
|
+
const queryDefinitions = queries ?? [];
|
|
53
65
|
const definitions = queryDefinitions.map((query)=>{
|
|
54
66
|
return {
|
|
55
67
|
kind: query.spec.plugin.kind,
|
|
@@ -65,13 +77,15 @@ function GridItemContent(props) {
|
|
|
65
77
|
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_pluginsystem.DataQueriesProvider, {
|
|
66
78
|
definitions: definitions,
|
|
67
79
|
options: {
|
|
68
|
-
suggestedStepMs
|
|
80
|
+
suggestedStepMs,
|
|
81
|
+
...plugin?.queryOptions
|
|
69
82
|
},
|
|
70
83
|
queryOptions: {
|
|
71
84
|
enabled: inView
|
|
72
85
|
},
|
|
73
86
|
children: inView && /*#__PURE__*/ (0, _jsxruntime.jsx)(_Panel.Panel, {
|
|
74
87
|
definition: panelDefinition,
|
|
88
|
+
readHandlers: readHandlers,
|
|
75
89
|
editHandlers: editHandlers,
|
|
76
90
|
panelOptions: props.panelOptions,
|
|
77
91
|
panelGroupItemId: panelGroupItemId
|