@perses-dev/dashboards 0.0.0-snapshot-scatterplot-fix-imports-95e1b59 → 0.0.0-snapshot-histogram-types-78c5104
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/Dashboard/Dashboard.js +8 -1
- package/dist/cjs/components/DashboardStickyToolbar/DashboardStickyToolbar.js +2 -2
- package/dist/cjs/components/DashboardToolbar/DashboardToolbar.js +4 -4
- package/dist/cjs/components/Datasources/DatasourceEditor.js +18 -18
- package/dist/cjs/components/Datasources/EditDatasourcesButton.js +2 -5
- package/dist/cjs/components/DeletePanelDialog/DeletePanelDialog.js +2 -0
- package/dist/cjs/components/DeletePanelGroupDialog/DeletePanelGroupDialog.js +5 -4
- package/dist/cjs/components/DownloadButton/DownloadButton.js +135 -29
- package/dist/cjs/components/EditJsonDialog/EditJsonDialog.js +10 -13
- package/dist/cjs/components/EmptyDashboard/EmptyDashboard.js +2 -2
- package/dist/cjs/components/GridLayout/GridContainer.js +15 -10
- package/dist/cjs/components/GridLayout/GridItemContent.js +20 -4
- package/dist/cjs/components/GridLayout/GridLayout.js +57 -12
- package/dist/cjs/components/GridLayout/GridTitle.js +3 -3
- package/dist/cjs/{validation/panel.js → components/Panel/HeaderIconButton.js} +8 -10
- package/dist/cjs/components/Panel/Panel.js +19 -11
- package/dist/cjs/components/Panel/PanelActions.js +365 -0
- package/dist/cjs/components/Panel/PanelContent.js +59 -13
- package/dist/cjs/components/Panel/PanelHeader.js +14 -117
- package/dist/cjs/components/Panel/PanelLinks.js +136 -0
- package/dist/cjs/components/Panel/PanelPluginLoader.js +56 -0
- package/dist/cjs/components/Panel/index.js +1 -0
- package/dist/cjs/components/PanelDrawer/PanelDrawer.js +9 -6
- package/dist/cjs/components/PanelDrawer/PanelEditorForm.js +81 -67
- package/dist/cjs/components/PanelDrawer/PanelPreview.js +7 -3
- package/dist/cjs/components/PanelDrawer/usePanelEditor.js +9 -6
- package/dist/cjs/components/PanelGroupDialog/PanelGroupDialog.js +1 -1
- package/dist/cjs/components/QuerySummaryTable/QuerySummaryTable.js +3 -5
- package/dist/cjs/components/SaveChangesConfirmationDialog/SaveChangesConfirmationDialog.js +4 -6
- package/dist/cjs/components/SaveDashboardButton/SaveDashboardButton.js +2 -2
- package/dist/cjs/components/Variables/BuiltinVariableAccordions.js +7 -14
- package/dist/cjs/components/Variables/EditVariablesButton.js +4 -4
- package/dist/cjs/components/Variables/{TemplateVariable.js → Variable.js} +52 -60
- package/dist/cjs/components/Variables/VariableEditor.js +34 -40
- package/dist/cjs/components/Variables/VariableList.js +23 -22
- package/dist/cjs/components/Variables/index.js +2 -2
- package/dist/cjs/constants/styles.js +19 -7
- package/dist/cjs/constants/user-interface-text.js +3 -1
- package/dist/cjs/context/DashboardProvider/DashboardProvider.js +10 -8
- package/dist/cjs/context/DashboardProvider/DashboardProviderWithQueryParams.js +36 -0
- package/dist/cjs/context/DashboardProvider/common.js +2 -2
- package/dist/cjs/context/DashboardProvider/dashboard-provider-api.js +25 -6
- package/dist/cjs/context/DashboardProvider/delete-panel-slice.js +1 -2
- package/dist/cjs/context/DashboardProvider/panel-editor-slice.js +7 -10
- package/dist/cjs/context/DashboardProvider/panel-group-editor-slice.js +1 -2
- package/dist/cjs/context/DashboardProvider/panel-group-slice.js +8 -3
- package/dist/cjs/context/DashboardProvider/view-panel-slice.js +79 -0
- package/dist/cjs/context/DatasourceStoreProvider.js +18 -23
- package/dist/cjs/context/{TemplateVariableProvider/TemplateVariableProvider.js → VariableProvider/VariableProvider.js} +76 -87
- 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 +1 -1
- package/dist/cjs/context/{TemplateVariableProvider → VariableProvider}/utils.js +3 -3
- package/dist/cjs/context/index.js +2 -2
- package/dist/cjs/context/useDashboard.js +4 -4
- package/dist/cjs/test/datasource-provider.js +1 -1
- package/dist/cjs/test/plugin-registry.js +8 -3
- package/dist/cjs/test/render.js +13 -11
- package/dist/cjs/views/ViewDashboard/DashboardApp.js +6 -4
- package/dist/cjs/views/ViewDashboard/ViewDashboard.js +10 -9
- package/dist/components/AddGroupButton/AddGroupButton.d.ts +2 -1
- package/dist/components/AddGroupButton/AddGroupButton.d.ts.map +1 -1
- package/dist/components/AddGroupButton/AddGroupButton.js.map +1 -1
- package/dist/components/AddPanelButton/AddPanelButton.d.ts +2 -1
- package/dist/components/AddPanelButton/AddPanelButton.d.ts.map +1 -1
- package/dist/components/AddPanelButton/AddPanelButton.js.map +1 -1
- package/dist/components/Dashboard/Dashboard.d.ts +2 -1
- package/dist/components/Dashboard/Dashboard.d.ts.map +1 -1
- package/dist/components/Dashboard/Dashboard.js +8 -1
- package/dist/components/Dashboard/Dashboard.js.map +1 -1
- package/dist/components/DashboardStickyToolbar/DashboardStickyToolbar.d.ts +2 -1
- package/dist/components/DashboardStickyToolbar/DashboardStickyToolbar.d.ts.map +1 -1
- package/dist/components/DashboardStickyToolbar/DashboardStickyToolbar.js +3 -3
- package/dist/components/DashboardStickyToolbar/DashboardStickyToolbar.js.map +1 -1
- package/dist/components/DashboardToolbar/DashboardToolbar.d.ts +4 -2
- package/dist/components/DashboardToolbar/DashboardToolbar.d.ts.map +1 -1
- package/dist/components/DashboardToolbar/DashboardToolbar.js +4 -4
- package/dist/components/DashboardToolbar/DashboardToolbar.js.map +1 -1
- package/dist/components/Datasources/DatasourceEditor.d.ts +2 -1
- package/dist/components/Datasources/DatasourceEditor.d.ts.map +1 -1
- package/dist/components/Datasources/DatasourceEditor.js +19 -19
- package/dist/components/Datasources/DatasourceEditor.js.map +1 -1
- package/dist/components/Datasources/EditDatasourcesButton.d.ts +2 -1
- package/dist/components/Datasources/EditDatasourcesButton.d.ts.map +1 -1
- package/dist/components/Datasources/EditDatasourcesButton.js +2 -5
- package/dist/components/Datasources/EditDatasourcesButton.js.map +1 -1
- package/dist/components/DeletePanelDialog/DeletePanelDialog.d.ts +2 -1
- package/dist/components/DeletePanelDialog/DeletePanelDialog.d.ts.map +1 -1
- package/dist/components/DeletePanelDialog/DeletePanelDialog.js +3 -1
- package/dist/components/DeletePanelDialog/DeletePanelDialog.js.map +1 -1
- package/dist/components/DeletePanelGroupDialog/DeletePanelGroupDialog.d.ts +2 -1
- package/dist/components/DeletePanelGroupDialog/DeletePanelGroupDialog.d.ts.map +1 -1
- package/dist/components/DeletePanelGroupDialog/DeletePanelGroupDialog.js +6 -5
- package/dist/components/DeletePanelGroupDialog/DeletePanelGroupDialog.js.map +1 -1
- package/dist/components/DiscardChangesConfirmationDialog/DiscardChangesConfirmationDialog.d.ts +2 -1
- package/dist/components/DiscardChangesConfirmationDialog/DiscardChangesConfirmationDialog.d.ts.map +1 -1
- package/dist/components/DiscardChangesConfirmationDialog/DiscardChangesConfirmationDialog.js.map +1 -1
- package/dist/components/DownloadButton/DownloadButton.d.ts +2 -5
- package/dist/components/DownloadButton/DownloadButton.d.ts.map +1 -1
- package/dist/components/DownloadButton/DownloadButton.js +94 -29
- package/dist/components/DownloadButton/DownloadButton.js.map +1 -1
- package/dist/components/EditButton/EditButton.d.ts +2 -1
- package/dist/components/EditButton/EditButton.d.ts.map +1 -1
- package/dist/components/EditButton/EditButton.js.map +1 -1
- package/dist/components/EditJsonButton/EditJsonButton.d.ts +2 -1
- package/dist/components/EditJsonButton/EditJsonButton.d.ts.map +1 -1
- package/dist/components/EditJsonButton/EditJsonButton.js.map +1 -1
- package/dist/components/EditJsonDialog/EditJsonDialog.d.ts +2 -1
- package/dist/components/EditJsonDialog/EditJsonDialog.d.ts.map +1 -1
- package/dist/components/EditJsonDialog/EditJsonDialog.js +7 -10
- 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 +2 -2
- 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 +15 -10
- package/dist/components/GridLayout/GridContainer.js.map +1 -1
- package/dist/components/GridLayout/GridItemContent.d.ts +2 -1
- package/dist/components/GridLayout/GridItemContent.d.ts.map +1 -1
- package/dist/components/GridLayout/GridItemContent.js +22 -6
- package/dist/components/GridLayout/GridItemContent.js.map +1 -1
- package/dist/components/GridLayout/GridLayout.d.ts +4 -2
- package/dist/components/GridLayout/GridLayout.d.ts.map +1 -1
- package/dist/components/GridLayout/GridLayout.js +59 -14
- package/dist/components/GridLayout/GridLayout.js.map +1 -1
- package/dist/components/GridLayout/GridTitle.d.ts +3 -2
- package/dist/components/GridLayout/GridTitle.d.ts.map +1 -1
- package/dist/components/GridLayout/GridTitle.js +3 -3
- 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/{stories/decorators/index.js → components/Panel/HeaderIconButton.js} +7 -6
- package/dist/components/Panel/HeaderIconButton.js.map +1 -0
- package/dist/components/Panel/Panel.d.ts +16 -5
- package/dist/components/Panel/Panel.d.ts.map +1 -1
- package/dist/components/Panel/Panel.js +25 -12
- package/dist/components/Panel/Panel.js.map +1 -1
- package/dist/components/Panel/PanelActions.d.ts +22 -0
- package/dist/components/Panel/PanelActions.d.ts.map +1 -0
- package/dist/components/Panel/PanelActions.js +352 -0
- package/dist/components/Panel/PanelActions.js.map +1 -0
- package/dist/components/Panel/PanelContent.d.ts +7 -5
- package/dist/components/Panel/PanelContent.d.ts.map +1 -1
- package/dist/components/Panel/PanelContent.js +61 -15
- package/dist/components/Panel/PanelContent.js.map +1 -1
- package/dist/components/Panel/PanelHeader.d.ts +10 -8
- package/dist/components/Panel/PanelHeader.d.ts.map +1 -1
- package/dist/components/Panel/PanelHeader.js +18 -116
- 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/Panel/PanelPluginLoader.d.ts +13 -0
- package/dist/components/Panel/PanelPluginLoader.d.ts.map +1 -0
- package/dist/components/Panel/PanelPluginLoader.js +51 -0
- package/dist/components/Panel/PanelPluginLoader.js.map +1 -0
- package/dist/components/Panel/index.d.ts +1 -0
- package/dist/components/Panel/index.d.ts.map +1 -1
- package/dist/components/Panel/index.js +1 -0
- package/dist/components/Panel/index.js.map +1 -1
- package/dist/components/PanelDrawer/PanelDrawer.d.ts +2 -1
- 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 -3
- package/dist/components/PanelDrawer/PanelEditorForm.d.ts.map +1 -1
- package/dist/components/PanelDrawer/PanelEditorForm.js +84 -70
- package/dist/components/PanelDrawer/PanelEditorForm.js.map +1 -1
- package/dist/components/PanelDrawer/PanelPreview.d.ts +3 -2
- package/dist/components/PanelDrawer/PanelPreview.d.ts.map +1 -1
- package/dist/components/PanelDrawer/PanelPreview.js +8 -4
- 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 -1
- 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 -1
- package/dist/components/PanelGroupDialog/PanelGroupEditorForm.d.ts.map +1 -1
- package/dist/components/PanelGroupDialog/PanelGroupEditorForm.js.map +1 -1
- package/dist/components/QuerySummaryTable/QuerySummaryTable.d.ts +2 -1
- package/dist/components/QuerySummaryTable/QuerySummaryTable.d.ts.map +1 -1
- package/dist/components/QuerySummaryTable/QuerySummaryTable.js +3 -5
- package/dist/components/QuerySummaryTable/QuerySummaryTable.js.map +1 -1
- package/dist/components/SaveChangesConfirmationDialog/SaveChangesConfirmationDialog.d.ts +2 -1
- package/dist/components/SaveChangesConfirmationDialog/SaveChangesConfirmationDialog.d.ts.map +1 -1
- package/dist/components/SaveChangesConfirmationDialog/SaveChangesConfirmationDialog.js +5 -7
- package/dist/components/SaveChangesConfirmationDialog/SaveChangesConfirmationDialog.js.map +1 -1
- package/dist/components/SaveDashboardButton/SaveDashboardButton.d.ts +2 -1
- package/dist/components/SaveDashboardButton/SaveDashboardButton.d.ts.map +1 -1
- package/dist/components/SaveDashboardButton/SaveDashboardButton.js +3 -3
- package/dist/components/SaveDashboardButton/SaveDashboardButton.js.map +1 -1
- package/dist/components/Variables/BuiltinVariableAccordions.d.ts +2 -1
- package/dist/components/Variables/BuiltinVariableAccordions.d.ts.map +1 -1
- package/dist/components/Variables/BuiltinVariableAccordions.js +7 -14
- package/dist/components/Variables/BuiltinVariableAccordions.js.map +1 -1
- package/dist/components/Variables/EditVariablesButton.d.ts +2 -1
- package/dist/components/Variables/EditVariablesButton.d.ts.map +1 -1
- package/dist/components/Variables/EditVariablesButton.js +5 -5
- package/dist/components/Variables/EditVariablesButton.js.map +1 -1
- package/dist/components/Variables/{TemplateVariable.d.ts → Variable.d.ts} +6 -5
- package/dist/components/Variables/Variable.d.ts.map +1 -0
- package/dist/components/Variables/{TemplateVariable.js → Variable.js} +53 -61
- package/dist/components/Variables/Variable.js.map +1 -0
- package/dist/components/Variables/VariableEditor.d.ts +3 -2
- package/dist/components/Variables/VariableEditor.d.ts.map +1 -1
- package/dist/components/Variables/VariableEditor.js +35 -41
- package/dist/components/Variables/VariableEditor.js.map +1 -1
- package/dist/components/Variables/VariableList.d.ts +4 -3
- 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/constants/styles.d.ts +5 -2
- package/dist/constants/styles.d.ts.map +1 -1
- package/dist/constants/styles.js +6 -3
- package/dist/constants/styles.js.map +1 -1
- package/dist/constants/user-interface-text.d.ts +3 -1
- package/dist/constants/user-interface-text.d.ts.map +1 -1
- package/dist/constants/user-interface-text.js +3 -1
- package/dist/constants/user-interface-text.js.map +1 -1
- package/dist/context/DashboardProvider/DashboardProvider.d.ts +6 -3
- package/dist/context/DashboardProvider/DashboardProvider.d.ts.map +1 -1
- package/dist/context/DashboardProvider/DashboardProvider.js +11 -9
- 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.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 +45 -23
- package/dist/context/DashboardProvider/dashboard-provider-api.d.ts.map +1 -1
- package/dist/context/DashboardProvider/dashboard-provider-api.js +23 -6
- 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.map +1 -1
- package/dist/context/DashboardProvider/delete-panel-slice.js +1 -2
- package/dist/context/DashboardProvider/delete-panel-slice.js.map +1 -1
- package/dist/context/DashboardProvider/discard-changes-dialog-slice.js.map +1 -1
- package/dist/context/DashboardProvider/duplicate-panel-slice.js.map +1 -1
- package/dist/context/DashboardProvider/edit-json-dialog-slice.js.map +1 -1
- package/dist/context/DashboardProvider/index.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 +4 -7
- 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 +7 -3
- 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 +7 -7
- package/dist/context/DatasourceStoreProvider.d.ts.map +1 -1
- package/dist/context/DatasourceStoreProvider.js +18 -23
- 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} +62 -64
- 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.map +1 -1
- package/dist/context/useDashboard.js +4 -4
- package/dist/context/useDashboard.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 +3 -3
- package/dist/test/datasource-provider.d.ts.map +1 -1
- package/dist/test/datasource-provider.js +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 +8 -3
- 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 +9 -7
- package/dist/test/render.js.map +1 -1
- package/dist/utils/panelUtils.d.ts.map +1 -1
- package/dist/utils/panelUtils.js.map +1 -1
- package/dist/views/ViewDashboard/DashboardApp.d.ts +4 -2
- package/dist/views/ViewDashboard/DashboardApp.d.ts.map +1 -1
- package/dist/views/ViewDashboard/DashboardApp.js +6 -4
- package/dist/views/ViewDashboard/DashboardApp.js.map +1 -1
- package/dist/views/ViewDashboard/ViewDashboard.d.ts +4 -3
- package/dist/views/ViewDashboard/ViewDashboard.d.ts.map +1 -1
- package/dist/views/ViewDashboard/ViewDashboard.js +11 -10
- package/dist/views/ViewDashboard/ViewDashboard.js.map +1 -1
- package/package.json +12 -12
- package/dist/cjs/context/TemplateVariableProvider/index.js +0 -30
- package/dist/cjs/stories/decorators/WithDashboard.js +0 -41
- package/dist/cjs/stories/decorators/WithDatasourceStore.js +0 -39
- package/dist/cjs/stories/decorators/WithTemplateVariables.js +0 -37
- package/dist/cjs/stories/decorators/constants.js +0 -39
- package/dist/cjs/stories/decorators/index.js +0 -33
- 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/WithDashboard.js +0 -33
- package/dist/stories/decorators/WithDashboard.js.map +0 -1
- package/dist/stories/decorators/WithDatasourceStore.js +0 -31
- package/dist/stories/decorators/WithDatasourceStore.js.map +0 -1
- package/dist/stories/decorators/WithTemplateVariables.js +0 -29
- package/dist/stories/decorators/WithTemplateVariables.js.map +0 -1
- package/dist/stories/decorators/constants.js +0 -31
- package/dist/stories/decorators/constants.js.map +0 -1
- package/dist/stories/decorators/index.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
|
@@ -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");
|
|
30
|
+
const HEADER_HEIGHT = 165; // Approximate height of the header in dashboard view (including the navbar and variables toolbar)
|
|
29
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
|
|
@@ -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',
|
|
@@ -35,7 +35,7 @@ const _EditJsonButton = require("../EditJsonButton");
|
|
|
35
35
|
const _SaveDashboardButton = require("../SaveDashboardButton");
|
|
36
36
|
const _DashboardStickyToolbar = require("../DashboardStickyToolbar");
|
|
37
37
|
const DashboardToolbar = (props)=>{
|
|
38
|
-
const { dashboardName, dashboardTitleComponent, initialVariableIsSticky, isReadonly, onEditButtonClick, onCancelButtonClick, onSave } = props;
|
|
38
|
+
const { dashboardName, dashboardTitleComponent, initialVariableIsSticky, isReadonly, isVariableEnabled, isDatasourceEnabled, onEditButtonClick, onCancelButtonClick, onSave } = props;
|
|
39
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'));
|
|
@@ -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
|
|
@@ -76,8 +76,8 @@ const DashboardToolbar = (props)=>{
|
|
|
76
76
|
ml: 1,
|
|
77
77
|
whiteSpace: "nowrap",
|
|
78
78
|
children: [
|
|
79
|
-
/*#__PURE__*/ (0, _jsxruntime.jsx)(_Variables.EditVariablesButton, {}),
|
|
80
|
-
/*#__PURE__*/ (0, _jsxruntime.jsx)(_Datasources.EditDatasourcesButton, {}),
|
|
79
|
+
isVariableEnabled && /*#__PURE__*/ (0, _jsxruntime.jsx)(_Variables.EditVariablesButton, {}),
|
|
80
|
+
isDatasourceEnabled && /*#__PURE__*/ (0, _jsxruntime.jsx)(_Datasources.EditDatasourcesButton, {}),
|
|
81
81
|
/*#__PURE__*/ (0, _jsxruntime.jsx)(_AddPanelButton.AddPanelButton, {}),
|
|
82
82
|
/*#__PURE__*/ (0, _jsxruntime.jsx)(_AddGroupButton.AddGroupButton, {})
|
|
83
83
|
]
|
|
@@ -77,27 +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
|
-
draft
|
|
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: ()=>{
|
|
95
100
|
setDatasourceEdit(null);
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
onClose: ()=>{
|
|
99
|
-
setDatasourceEdit(null);
|
|
100
|
-
}
|
|
101
|
+
}
|
|
102
|
+
})
|
|
101
103
|
}) : /*#__PURE__*/ (0, _jsxruntime.jsxs)(_jsxruntime.Fragment, {
|
|
102
104
|
children: [
|
|
103
105
|
/*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Box, {
|
|
@@ -173,8 +175,6 @@ function DatasourceEditor(props) {
|
|
|
173
175
|
}),
|
|
174
176
|
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.TableBody, {
|
|
175
177
|
children: Object.entries(datasources).map(([name, spec])=>{
|
|
176
|
-
var _spec_display;
|
|
177
|
-
var _spec_display_description;
|
|
178
178
|
return /*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.TableRow, {
|
|
179
179
|
children: [
|
|
180
180
|
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.TableCell, {
|
|
@@ -189,7 +189,7 @@ function DatasourceEditor(props) {
|
|
|
189
189
|
children: spec.plugin.kind
|
|
190
190
|
}),
|
|
191
191
|
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.TableCell, {
|
|
192
|
-
children:
|
|
192
|
+
children: spec.display?.description ?? ''
|
|
193
193
|
}),
|
|
194
194
|
/*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.TableCell, {
|
|
195
195
|
align: "right",
|
|
@@ -49,13 +49,10 @@ 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_plugin, _datasources_key, _savedDatasources_key_plugin, _savedDatasources_key, _datasources_key_plugin_spec, _datasources_key_plugin1, _datasources_key1, _savedDatasources_key_plugin_spec, _savedDatasources_key_plugin1, _savedDatasources_key1;
|
|
53
|
-
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];
|
|
@@ -40,11 +40,13 @@ const DeletePanelDialog = ()=>{
|
|
|
40
40
|
};
|
|
41
41
|
const DeletePanelForm = ({ deletePanelDialog })=>{
|
|
42
42
|
const { deletePanel, closeDeletePanelDialog } = (0, _context.useDeletePanelDialog)();
|
|
43
|
+
const { setViewPanel } = (0, _context.useViewPanel)();
|
|
43
44
|
const handleDelete = (e)=>{
|
|
44
45
|
e.preventDefault();
|
|
45
46
|
const { panelGroupItemId } = deletePanelDialog;
|
|
46
47
|
deletePanel(panelGroupItemId);
|
|
47
48
|
closeDeletePanelDialog();
|
|
49
|
+
setViewPanel(undefined);
|
|
48
50
|
};
|
|
49
51
|
return /*#__PURE__*/ (0, _jsxruntime.jsxs)("form", {
|
|
50
52
|
onSubmit: handleDelete,
|
|
@@ -31,16 +31,17 @@ function _interop_require_default(obj) {
|
|
|
31
31
|
}
|
|
32
32
|
const DeletePanelGroupDialog = ()=>{
|
|
33
33
|
const { deletePanelGroupDialog, closeDeletePanelGroupDialog, deletePanelGroup } = (0, _context.useDeletePanelGroupDialog)();
|
|
34
|
-
const
|
|
34
|
+
const { setViewPanel } = (0, _context.useViewPanel)();
|
|
35
|
+
const panelGroupId = deletePanelGroupDialog?.panelGroupId;
|
|
35
36
|
const handleDelete = (e)=>{
|
|
36
37
|
e.preventDefault();
|
|
37
|
-
if (panelGroupId
|
|
38
|
+
if (panelGroupId === undefined) {
|
|
38
39
|
throw new Error('group index is undefined');
|
|
39
40
|
}
|
|
40
41
|
deletePanelGroup(panelGroupId);
|
|
41
42
|
closeDeletePanelGroupDialog();
|
|
43
|
+
setViewPanel(undefined);
|
|
42
44
|
};
|
|
43
|
-
var _deletePanelGroupDialog_panelGroupName;
|
|
44
45
|
return /*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Dialog, {
|
|
45
46
|
open: deletePanelGroupDialog !== undefined,
|
|
46
47
|
children: [
|
|
@@ -67,7 +68,7 @@ const DeletePanelGroupDialog = ()=>{
|
|
|
67
68
|
},
|
|
68
69
|
children: [
|
|
69
70
|
"Are you sure you want to delete ",
|
|
70
|
-
|
|
71
|
+
deletePanelGroupDialog?.panelGroupName ?? 'panel group',
|
|
71
72
|
"? This will delete all the panels within the group."
|
|
72
73
|
]
|
|
73
74
|
}),
|
|
@@ -21,53 +21,159 @@ Object.defineProperty(exports, "DownloadButton", {
|
|
|
21
21
|
}
|
|
22
22
|
});
|
|
23
23
|
const _jsxruntime = require("react/jsx-runtime");
|
|
24
|
-
const
|
|
25
|
-
const _DownloadOutline = /*#__PURE__*/ _interop_require_default(require("mdi-material-ui/DownloadOutline"));
|
|
24
|
+
const _material = require("@mui/material");
|
|
26
25
|
const _components = require("@perses-dev/components");
|
|
27
|
-
const
|
|
26
|
+
const _DownloadOutline = /*#__PURE__*/ _interop_require_default(require("mdi-material-ui/DownloadOutline"));
|
|
27
|
+
const _react = /*#__PURE__*/ _interop_require_wildcard(require("react"));
|
|
28
|
+
const _yaml = require("yaml");
|
|
28
29
|
const _context = require("../../context");
|
|
29
30
|
function _interop_require_default(obj) {
|
|
30
31
|
return obj && obj.__esModule ? obj : {
|
|
31
32
|
default: obj
|
|
32
33
|
};
|
|
33
34
|
}
|
|
34
|
-
function
|
|
35
|
+
function _getRequireWildcardCache(nodeInterop) {
|
|
36
|
+
if (typeof WeakMap !== "function") return null;
|
|
37
|
+
var cacheBabelInterop = new WeakMap();
|
|
38
|
+
var cacheNodeInterop = new WeakMap();
|
|
39
|
+
return (_getRequireWildcardCache = function(nodeInterop) {
|
|
40
|
+
return nodeInterop ? cacheNodeInterop : cacheBabelInterop;
|
|
41
|
+
})(nodeInterop);
|
|
42
|
+
}
|
|
43
|
+
function _interop_require_wildcard(obj, nodeInterop) {
|
|
44
|
+
if (!nodeInterop && obj && obj.__esModule) {
|
|
45
|
+
return obj;
|
|
46
|
+
}
|
|
47
|
+
if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
|
|
48
|
+
return {
|
|
49
|
+
default: obj
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
var cache = _getRequireWildcardCache(nodeInterop);
|
|
53
|
+
if (cache && cache.has(obj)) {
|
|
54
|
+
return cache.get(obj);
|
|
55
|
+
}
|
|
56
|
+
var newObj = {
|
|
57
|
+
__proto__: null
|
|
58
|
+
};
|
|
59
|
+
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
60
|
+
for(var key in obj){
|
|
61
|
+
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
62
|
+
var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
|
|
63
|
+
if (desc && (desc.get || desc.set)) {
|
|
64
|
+
Object.defineProperty(newObj, key, desc);
|
|
65
|
+
} else {
|
|
66
|
+
newObj[key] = obj[key];
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
newObj.default = obj;
|
|
71
|
+
if (cache) {
|
|
72
|
+
cache.set(obj, newObj);
|
|
73
|
+
}
|
|
74
|
+
return newObj;
|
|
75
|
+
}
|
|
76
|
+
function DownloadButton() {
|
|
35
77
|
const { dashboard } = (0, _context.useDashboard)();
|
|
36
78
|
const hiddenLinkRef = (0, _react.useRef)(null);
|
|
37
|
-
const
|
|
38
|
-
const
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
const hiddenLinkUrl = URL.createObjectURL(new Blob([
|
|
42
|
-
JSON.stringify(dashboard)
|
|
43
|
-
], {
|
|
44
|
-
type: 'application/json'
|
|
45
|
-
}));
|
|
46
|
-
// Simulate click
|
|
47
|
-
hiddenLinkRef.current.href = hiddenLinkUrl;
|
|
48
|
-
hiddenLinkRef.current.click();
|
|
49
|
-
// Remove blob URL (for memory management)
|
|
50
|
-
URL.revokeObjectURL(hiddenLinkUrl);
|
|
79
|
+
const [anchorEl, setAnchorEl] = _react.default.useState(null);
|
|
80
|
+
const open = Boolean(anchorEl);
|
|
81
|
+
const handleClick = (event)=>{
|
|
82
|
+
setAnchorEl(event.currentTarget);
|
|
51
83
|
};
|
|
84
|
+
const handleItemClick = (format, shape)=>()=>{
|
|
85
|
+
setAnchorEl(null);
|
|
86
|
+
let type, content = '';
|
|
87
|
+
switch(format){
|
|
88
|
+
case 'json':
|
|
89
|
+
type = 'application/json';
|
|
90
|
+
content = JSON.stringify(dashboard, null, 2);
|
|
91
|
+
break;
|
|
92
|
+
case 'yaml':
|
|
93
|
+
{
|
|
94
|
+
type = 'application/yaml';
|
|
95
|
+
if (shape === 'cr') {
|
|
96
|
+
const name = dashboard.metadata.name.toLowerCase().replace(/[^a-z0-9-]/g, '-');
|
|
97
|
+
content = (0, _yaml.stringify)({
|
|
98
|
+
apiVersion: 'perses.dev/v1alpha1',
|
|
99
|
+
kind: 'PersesDashboard',
|
|
100
|
+
metadata: {
|
|
101
|
+
labels: {
|
|
102
|
+
'app.kubernetes.io/name': 'perses-dashboard',
|
|
103
|
+
'app.kubernetes.io/instance': name,
|
|
104
|
+
'app.kubernetes.io/part-of': 'perses-operator'
|
|
105
|
+
},
|
|
106
|
+
name
|
|
107
|
+
},
|
|
108
|
+
namespace: dashboard.metadata.project,
|
|
109
|
+
spec: dashboard.spec
|
|
110
|
+
});
|
|
111
|
+
} else {
|
|
112
|
+
content = (0, _yaml.stringify)(dashboard);
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
break;
|
|
116
|
+
}
|
|
117
|
+
if (!hiddenLinkRef || !hiddenLinkRef.current) return;
|
|
118
|
+
// Create blob URL
|
|
119
|
+
const hiddenLinkUrl = URL.createObjectURL(new Blob([
|
|
120
|
+
content
|
|
121
|
+
], {
|
|
122
|
+
type
|
|
123
|
+
}));
|
|
124
|
+
// Simulate click
|
|
125
|
+
hiddenLinkRef.current.download = `${dashboard.metadata.name}${shape === 'cr' ? '-cr' : ''}.${format}`;
|
|
126
|
+
hiddenLinkRef.current.href = hiddenLinkUrl;
|
|
127
|
+
hiddenLinkRef.current.click();
|
|
128
|
+
// Remove blob URL (for memory management)
|
|
129
|
+
URL.revokeObjectURL(hiddenLinkUrl);
|
|
130
|
+
};
|
|
52
131
|
return /*#__PURE__*/ (0, _jsxruntime.jsxs)(_jsxruntime.Fragment, {
|
|
53
132
|
children: [
|
|
54
|
-
/*#__PURE__*/ (0, _jsxruntime.jsx)(_components.
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
133
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_components.ToolbarIconButton, {
|
|
134
|
+
id: "download-dashboard-button",
|
|
135
|
+
"aria-controls": open ? 'basic-menu' : undefined,
|
|
136
|
+
"aria-haspopup": "true",
|
|
137
|
+
"aria-expanded": open ? 'true' : undefined,
|
|
138
|
+
onClick: handleClick,
|
|
139
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_DownloadOutline.default, {})
|
|
140
|
+
}),
|
|
141
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Menu, {
|
|
142
|
+
id: "download-dashboard-formats",
|
|
143
|
+
anchorEl: anchorEl,
|
|
144
|
+
open: open,
|
|
145
|
+
hideBackdrop: true,
|
|
146
|
+
onClose: ()=>setAnchorEl(null),
|
|
147
|
+
MenuListProps: {
|
|
148
|
+
'aria-labelledby': 'download-dashboard-button'
|
|
149
|
+
},
|
|
150
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)("div", {
|
|
151
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.ClickAwayListener, {
|
|
152
|
+
onClickAway: ()=>setAnchorEl(null),
|
|
153
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.MenuList, {
|
|
154
|
+
children: [
|
|
155
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.MenuItem, {
|
|
156
|
+
onClick: handleItemClick('json'),
|
|
157
|
+
children: "JSON"
|
|
158
|
+
}),
|
|
159
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.MenuItem, {
|
|
160
|
+
onClick: handleItemClick('yaml'),
|
|
161
|
+
children: "YAML"
|
|
162
|
+
}),
|
|
163
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.MenuItem, {
|
|
164
|
+
onClick: handleItemClick('yaml', 'cr'),
|
|
165
|
+
children: "YAML (CR)"
|
|
166
|
+
})
|
|
167
|
+
]
|
|
168
|
+
})
|
|
169
|
+
})
|
|
63
170
|
})
|
|
64
171
|
}),
|
|
65
172
|
/*#__PURE__*/ (0, _jsxruntime.jsx)("a", {
|
|
66
173
|
ref: hiddenLinkRef,
|
|
67
174
|
style: {
|
|
68
175
|
display: 'none'
|
|
69
|
-
}
|
|
70
|
-
download: `${dashboard.metadata.name}.json`
|
|
176
|
+
}
|
|
71
177
|
})
|
|
72
178
|
]
|
|
73
179
|
});
|
|
@@ -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
30
|
const { isReadonly, disableMetadataEdition } = props;
|
|
32
|
-
const { editJsonDialog, closeEditJsonDialog } = (0,
|
|
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
|
})
|
|
@@ -52,9 +51,9 @@ const EditJsonDialog = (props)=>{
|
|
|
52
51
|
};
|
|
53
52
|
const EditJsonDialogForm = (props)=>{
|
|
54
53
|
const { isReadonly, disableMetadataEdition } = props;
|
|
55
|
-
const { closeEditJsonDialog } = (0,
|
|
54
|
+
const { closeEditJsonDialog } = (0, _context.useEditJsonDialog)();
|
|
56
55
|
const { setTimeRange, setRefreshInterval } = (0, _pluginsystem.useTimeRange)();
|
|
57
|
-
const { dashboard, setDashboard } = (0,
|
|
56
|
+
const { dashboard, setDashboard } = (0, _context.useDashboard)();
|
|
58
57
|
const { setLocalDatasources } = (0, _pluginsystem.useDatasourceStore)();
|
|
59
58
|
const [draftDashboard, setDraftDashboard] = (0, _react.useState)(dashboard);
|
|
60
59
|
const handleApply = (e)=>{
|
|
@@ -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
|
};
|
|
@@ -32,7 +32,7 @@ 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',
|
|
@@ -105,7 +105,7 @@ const EmptyDashboard = ({ title = DEFAULT_TITLE, image, description, additionalT
|
|
|
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,17 +33,22 @@ 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
|
});
|
|
@@ -25,18 +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 _Panel = require("../Panel
|
|
28
|
+
const _Panel = require("../Panel");
|
|
29
|
+
const _panelgroupslice = require("../../context/DashboardProvider/panel-group-slice");
|
|
29
30
|
function GridItemContent(props) {
|
|
30
31
|
const { panelGroupItemId, width } = props;
|
|
31
32
|
const panelDefinition = (0, _context.usePanel)(panelGroupItemId);
|
|
32
33
|
const { spec: { queries } } = panelDefinition;
|
|
33
34
|
const { isEditMode } = (0, _context.useEditMode)();
|
|
34
|
-
const { openEditPanel, openDeletePanelDialog, duplicatePanel } = (0, _context.usePanelActions)(panelGroupItemId);
|
|
35
|
+
const { openEditPanel, openDeletePanelDialog, duplicatePanel, viewPanel } = (0, _context.usePanelActions)(panelGroupItemId);
|
|
36
|
+
const viewPanelGroupItemId = (0, _context.useViewPanelGroup)();
|
|
35
37
|
const { ref, inView } = (0, _reactintersectionobserver.useInView)({
|
|
36
38
|
threshold: 0.2,
|
|
37
39
|
initialInView: false,
|
|
38
40
|
triggerOnce: true
|
|
39
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
|
+
};
|
|
40
52
|
// Provide actions to the panel when in edit mode
|
|
41
53
|
let editHandlers = undefined;
|
|
42
54
|
if (isEditMode) {
|
|
@@ -48,13 +60,15 @@ function GridItemContent(props) {
|
|
|
48
60
|
}
|
|
49
61
|
// map TimeSeriesQueryDefinition to Definition<UnknownSpec>
|
|
50
62
|
const suggestedStepMs = (0, _pluginsystem.useSuggestedStepMs)(width);
|
|
51
|
-
const
|
|
63
|
+
const { data: plugin } = (0, _pluginsystem.usePlugin)('Panel', panelDefinition.spec.plugin.kind);
|
|
64
|
+
const queryDefinitions = queries ?? [];
|
|
52
65
|
const definitions = queryDefinitions.map((query)=>{
|
|
53
66
|
return {
|
|
54
67
|
kind: query.spec.plugin.kind,
|
|
55
68
|
spec: query.spec.plugin.spec
|
|
56
69
|
};
|
|
57
70
|
});
|
|
71
|
+
const pluginQueryOptions = typeof plugin?.queryOptions === 'function' ? plugin?.queryOptions(panelDefinition.spec.plugin.spec) : plugin?.queryOptions;
|
|
58
72
|
return /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Box, {
|
|
59
73
|
ref: ref,
|
|
60
74
|
sx: {
|
|
@@ -64,13 +78,15 @@ function GridItemContent(props) {
|
|
|
64
78
|
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_pluginsystem.DataQueriesProvider, {
|
|
65
79
|
definitions: definitions,
|
|
66
80
|
options: {
|
|
67
|
-
suggestedStepMs
|
|
81
|
+
suggestedStepMs,
|
|
82
|
+
...pluginQueryOptions
|
|
68
83
|
},
|
|
69
84
|
queryOptions: {
|
|
70
85
|
enabled: inView
|
|
71
86
|
},
|
|
72
87
|
children: inView && /*#__PURE__*/ (0, _jsxruntime.jsx)(_Panel.Panel, {
|
|
73
88
|
definition: panelDefinition,
|
|
89
|
+
readHandlers: readHandlers,
|
|
74
90
|
editHandlers: editHandlers,
|
|
75
91
|
panelOptions: props.panelOptions,
|
|
76
92
|
panelGroupItemId: panelGroupItemId
|