@perses-dev/dashboards 0.0.0-snapshot-panel-extra-content-3-17f9c42 → 0.0.0-snapshot-scatterplot-fix-imports-95e1b59
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/components/AddGroupButton/AddGroupButton.js +11 -8
- package/dist/cjs/components/AddGroupButton/index.js +10 -8
- package/dist/cjs/components/AddPanelButton/AddPanelButton.js +12 -13
- package/dist/cjs/components/AddPanelButton/index.js +10 -8
- package/dist/cjs/components/Dashboard/Dashboard.js +12 -10
- package/dist/cjs/components/Dashboard/index.js +10 -8
- package/dist/cjs/components/DashboardStickyToolbar/DashboardStickyToolbar.js +53 -22
- package/dist/cjs/components/DashboardStickyToolbar/index.js +10 -8
- package/dist/cjs/components/DashboardToolbar/DashboardToolbar.js +82 -103
- package/dist/cjs/components/DashboardToolbar/index.js +10 -8
- package/dist/cjs/components/Datasources/DatasourceEditor.js +236 -0
- package/dist/cjs/components/Datasources/EditDatasourcesButton.js +112 -0
- package/dist/cjs/components/{ToolbarIconButton → Datasources}/index.js +11 -8
- package/dist/cjs/components/DeletePanelDialog/DeletePanelDialog.js +16 -14
- package/dist/cjs/components/DeletePanelDialog/index.js +10 -8
- package/dist/cjs/components/DeletePanelGroupDialog/DeletePanelGroupDialog.js +18 -16
- package/dist/cjs/components/DeletePanelGroupDialog/index.js +10 -8
- package/dist/cjs/components/DiscardChangesConfirmationDialog/DiscardChangesConfirmationDialog.js +6 -4
- package/dist/cjs/components/DiscardChangesConfirmationDialog/index.js +10 -8
- package/dist/cjs/components/DownloadButton/DownloadButton.js +13 -12
- package/dist/cjs/components/DownloadButton/index.js +10 -8
- package/dist/cjs/components/EditButton/EditButton.js +9 -7
- package/dist/cjs/components/EditButton/index.js +10 -8
- package/dist/cjs/components/EditJsonButton/EditJsonButton.js +15 -12
- package/dist/cjs/components/EditJsonButton/index.js +10 -8
- package/dist/cjs/components/EditJsonDialog/EditJsonDialog.js +54 -25
- package/dist/cjs/components/EditJsonDialog/index.js +10 -8
- package/dist/cjs/components/EmptyDashboard/EmptyDashboard.js +21 -19
- package/dist/cjs/components/EmptyDashboard/index.js +10 -8
- package/dist/cjs/components/GridLayout/GridContainer.js +6 -4
- package/dist/cjs/components/GridLayout/GridItemContent.js +37 -19
- package/dist/cjs/components/GridLayout/GridLayout.js +21 -19
- package/dist/cjs/components/GridLayout/GridTitle.js +40 -39
- package/dist/cjs/components/GridLayout/index.js +13 -11
- package/dist/cjs/components/Panel/Panel.js +19 -23
- package/dist/cjs/components/Panel/PanelContent.js +11 -8
- package/dist/cjs/components/Panel/PanelHeader.js +35 -33
- package/dist/cjs/components/Panel/index.js +10 -8
- package/dist/cjs/components/PanelDrawer/PanelDrawer.js +25 -77
- package/dist/cjs/components/PanelDrawer/PanelEditorForm.js +237 -144
- package/dist/cjs/components/PanelDrawer/PanelPreview.js +13 -12
- package/dist/cjs/components/PanelDrawer/index.js +11 -8
- package/dist/cjs/components/PanelDrawer/usePanelEditor.js +5 -3
- package/dist/cjs/components/PanelGroupDialog/PanelGroupDialog.js +18 -16
- package/dist/cjs/components/PanelGroupDialog/PanelGroupEditorForm.js +16 -12
- package/dist/cjs/components/PanelGroupDialog/index.js +10 -8
- package/dist/cjs/components/QuerySummaryTable/QuerySummaryTable.js +48 -46
- package/dist/cjs/components/QuerySummaryTable/index.js +10 -8
- package/dist/cjs/components/SaveChangesConfirmationDialog/SaveChangesConfirmationDialog.js +26 -24
- package/dist/cjs/components/SaveChangesConfirmationDialog/index.js +10 -8
- package/dist/cjs/components/SaveDashboardButton/SaveDashboardButton.js +14 -14
- package/dist/cjs/components/SaveDashboardButton/index.js +10 -8
- package/dist/cjs/components/Variables/BuiltinVariableAccordions.js +141 -0
- package/dist/cjs/components/Variables/EditVariablesButton.js +19 -17
- package/dist/cjs/components/Variables/TemplateVariable.js +261 -107
- package/dist/cjs/components/Variables/VariableEditor.js +282 -207
- package/dist/cjs/components/Variables/VariableList.js +24 -22
- package/dist/cjs/components/Variables/index.js +14 -11
- package/dist/cjs/components/index.js +30 -29
- package/dist/cjs/constants/grid-layout-config.js +6 -2
- package/dist/cjs/constants/index.js +12 -9
- package/dist/cjs/constants/styles.js +42 -0
- package/dist/cjs/constants/user-interface-text.js +8 -3
- package/dist/cjs/context/DashboardProvider/DashboardProvider.js +48 -35
- package/dist/cjs/context/DashboardProvider/common.js +6 -2
- package/dist/cjs/context/DashboardProvider/dashboard-provider-api.js +81 -49
- package/dist/cjs/context/DashboardProvider/delete-panel-group-slice.js +4 -2
- package/dist/cjs/context/DashboardProvider/delete-panel-slice.js +8 -6
- package/dist/cjs/context/DashboardProvider/discard-changes-dialog-slice.js +3 -1
- package/dist/cjs/context/DashboardProvider/duplicate-panel-slice.js +4 -2
- package/dist/cjs/context/DashboardProvider/edit-json-dialog-slice.js +3 -1
- package/dist/cjs/context/DashboardProvider/index.js +12 -10
- package/dist/cjs/context/DashboardProvider/panel-editor-slice.js +17 -17
- package/dist/cjs/context/DashboardProvider/panel-group-editor-slice.js +8 -6
- package/dist/cjs/context/DashboardProvider/panel-group-slice.js +16 -8
- package/dist/cjs/context/DashboardProvider/panel-slice.js +3 -1
- package/dist/cjs/context/DashboardProvider/save-changes-dialog-slice.js +3 -1
- package/dist/cjs/context/DatasourceStoreProvider.js +177 -50
- package/dist/cjs/context/TemplateVariableProvider/TemplateVariableProvider.js +150 -39
- package/dist/cjs/context/TemplateVariableProvider/hydrationUtils.js +12 -10
- package/dist/cjs/context/TemplateVariableProvider/index.js +10 -8
- package/dist/cjs/context/TemplateVariableProvider/query-params.js +17 -7
- package/dist/cjs/context/TemplateVariableProvider/utils.js +15 -7
- package/dist/cjs/context/index.js +13 -11
- package/dist/cjs/context/useDashboard.js +30 -11
- package/dist/cjs/index.js +12 -10
- package/dist/cjs/stories/decorators/WithDashboard.js +6 -4
- package/dist/cjs/stories/decorators/WithDatasourceStore.js +6 -4
- package/dist/cjs/stories/decorators/WithTemplateVariables.js +6 -4
- package/dist/cjs/stories/decorators/constants.js +5 -3
- package/dist/cjs/stories/decorators/index.js +13 -11
- package/dist/cjs/test/dashboard-provider.js +8 -4
- package/dist/cjs/test/datasource-provider.js +16 -12
- package/dist/cjs/test/index.js +13 -11
- package/dist/cjs/test/plugin-registry.js +6 -4
- package/dist/cjs/test/render.js +28 -21
- package/dist/cjs/test/setup-tests.js +2 -2
- package/dist/cjs/test/testDashboard.js +13 -11
- package/dist/cjs/utils/index.js +10 -9
- package/dist/cjs/utils/panelUtils.js +11 -5
- package/dist/cjs/{components/TimeRangeControls → validation}/index.js +10 -8
- package/dist/cjs/{utils/time.js → validation/panel.js} +11 -9
- package/dist/cjs/views/ViewDashboard/DashboardApp.js +32 -18
- package/dist/cjs/views/ViewDashboard/ViewDashboard.js +64 -21
- package/dist/cjs/views/ViewDashboard/index.js +10 -8
- package/dist/cjs/views/index.js +10 -8
- package/dist/components/AddGroupButton/AddGroupButton.d.ts +1 -2
- package/dist/components/AddGroupButton/AddGroupButton.d.ts.map +1 -1
- package/dist/components/AddGroupButton/AddGroupButton.js +3 -2
- package/dist/components/AddGroupButton/AddGroupButton.js.map +1 -1
- package/dist/components/AddGroupButton/index.js.map +1 -1
- package/dist/components/AddPanelButton/AddPanelButton.d.ts +1 -2
- package/dist/components/AddPanelButton/AddPanelButton.d.ts.map +1 -1
- package/dist/components/AddPanelButton/AddPanelButton.js +4 -7
- package/dist/components/AddPanelButton/AddPanelButton.js.map +1 -1
- package/dist/components/AddPanelButton/index.js.map +1 -1
- package/dist/components/Dashboard/Dashboard.d.ts +2 -3
- package/dist/components/Dashboard/Dashboard.d.ts.map +1 -1
- package/dist/components/Dashboard/Dashboard.js +1 -1
- package/dist/components/Dashboard/Dashboard.js.map +1 -1
- package/dist/components/Dashboard/index.js.map +1 -1
- package/dist/components/DashboardStickyToolbar/DashboardStickyToolbar.d.ts +1 -2
- package/dist/components/DashboardStickyToolbar/DashboardStickyToolbar.d.ts.map +1 -1
- package/dist/components/DashboardStickyToolbar/DashboardStickyToolbar.js +38 -9
- package/dist/components/DashboardStickyToolbar/DashboardStickyToolbar.js.map +1 -1
- package/dist/components/DashboardStickyToolbar/index.js.map +1 -1
- package/dist/components/DashboardToolbar/DashboardToolbar.d.ts +1 -1
- package/dist/components/DashboardToolbar/DashboardToolbar.d.ts.map +1 -1
- package/dist/components/DashboardToolbar/DashboardToolbar.js +63 -86
- package/dist/components/DashboardToolbar/DashboardToolbar.js.map +1 -1
- package/dist/components/DashboardToolbar/index.js.map +1 -1
- package/dist/components/Datasources/DatasourceEditor.d.ts +7 -0
- package/dist/components/Datasources/DatasourceEditor.d.ts.map +1 -0
- package/dist/components/Datasources/DatasourceEditor.js +223 -0
- package/dist/components/Datasources/DatasourceEditor.js.map +1 -0
- package/dist/components/Datasources/EditDatasourcesButton.d.ts +2 -0
- package/dist/components/Datasources/EditDatasourcesButton.d.ts.map +1 -0
- package/dist/components/Datasources/EditDatasourcesButton.js +99 -0
- package/dist/components/Datasources/EditDatasourcesButton.js.map +1 -0
- package/dist/components/Datasources/index.d.ts +3 -0
- package/dist/components/Datasources/index.d.ts.map +1 -0
- package/dist/components/{TimeRangeControls → Datasources}/index.js +2 -1
- package/dist/components/Datasources/index.js.map +1 -0
- package/dist/components/DeletePanelDialog/DeletePanelDialog.d.ts +1 -2
- package/dist/components/DeletePanelDialog/DeletePanelDialog.d.ts.map +1 -1
- package/dist/components/DeletePanelDialog/DeletePanelDialog.js +4 -4
- package/dist/components/DeletePanelDialog/DeletePanelDialog.js.map +1 -1
- package/dist/components/DeletePanelDialog/index.js.map +1 -1
- package/dist/components/DeletePanelGroupDialog/DeletePanelGroupDialog.d.ts +1 -2
- package/dist/components/DeletePanelGroupDialog/DeletePanelGroupDialog.d.ts.map +1 -1
- package/dist/components/DeletePanelGroupDialog/DeletePanelGroupDialog.js +3 -3
- package/dist/components/DeletePanelGroupDialog/DeletePanelGroupDialog.js.map +1 -1
- package/dist/components/DeletePanelGroupDialog/index.js.map +1 -1
- package/dist/components/DiscardChangesConfirmationDialog/DiscardChangesConfirmationDialog.d.ts +1 -2
- package/dist/components/DiscardChangesConfirmationDialog/DiscardChangesConfirmationDialog.d.ts.map +1 -1
- package/dist/components/DiscardChangesConfirmationDialog/DiscardChangesConfirmationDialog.js +1 -1
- package/dist/components/DiscardChangesConfirmationDialog/DiscardChangesConfirmationDialog.js.map +1 -1
- package/dist/components/DiscardChangesConfirmationDialog/index.js.map +1 -1
- package/dist/components/DownloadButton/DownloadButton.d.ts +1 -2
- package/dist/components/DownloadButton/DownloadButton.d.ts.map +1 -1
- package/dist/components/DownloadButton/DownloadButton.js +3 -4
- package/dist/components/DownloadButton/DownloadButton.js.map +1 -1
- package/dist/components/DownloadButton/index.js.map +1 -1
- package/dist/components/EditButton/EditButton.d.ts +1 -2
- package/dist/components/EditButton/EditButton.d.ts.map +1 -1
- package/dist/components/EditButton/EditButton.js +1 -1
- package/dist/components/EditButton/EditButton.js.map +1 -1
- package/dist/components/EditButton/index.js.map +1 -1
- package/dist/components/EditJsonButton/EditJsonButton.d.ts +4 -2
- package/dist/components/EditJsonButton/EditJsonButton.d.ts.map +1 -1
- package/dist/components/EditJsonButton/EditJsonButton.js +7 -6
- package/dist/components/EditJsonButton/EditJsonButton.js.map +1 -1
- package/dist/components/EditJsonButton/index.js.map +1 -1
- package/dist/components/EditJsonDialog/EditJsonDialog.d.ts +5 -2
- package/dist/components/EditJsonDialog/EditJsonDialog.d.ts.map +1 -1
- package/dist/components/EditJsonDialog/EditJsonDialog.js +43 -16
- package/dist/components/EditJsonDialog/EditJsonDialog.js.map +1 -1
- package/dist/components/EditJsonDialog/index.js.map +1 -1
- package/dist/components/EmptyDashboard/EmptyDashboard.d.ts +1 -1
- package/dist/components/EmptyDashboard/EmptyDashboard.d.ts.map +1 -1
- package/dist/components/EmptyDashboard/EmptyDashboard.js +3 -3
- package/dist/components/EmptyDashboard/EmptyDashboard.js.map +1 -1
- package/dist/components/EmptyDashboard/index.js.map +1 -1
- package/dist/components/GridLayout/GridContainer.d.ts +1 -1
- package/dist/components/GridLayout/GridContainer.d.ts.map +1 -1
- package/dist/components/GridLayout/GridContainer.js +1 -1
- package/dist/components/GridLayout/GridContainer.js.map +1 -1
- package/dist/components/GridLayout/GridItemContent.d.ts +1 -2
- package/dist/components/GridLayout/GridItemContent.d.ts.map +1 -1
- package/dist/components/GridLayout/GridItemContent.js +31 -15
- package/dist/components/GridLayout/GridItemContent.js.map +1 -1
- package/dist/components/GridLayout/GridLayout.d.ts +1 -2
- package/dist/components/GridLayout/GridLayout.d.ts.map +1 -1
- package/dist/components/GridLayout/GridLayout.js +6 -6
- package/dist/components/GridLayout/GridLayout.js.map +1 -1
- package/dist/components/GridLayout/GridTitle.d.ts +1 -2
- package/dist/components/GridLayout/GridTitle.d.ts.map +1 -1
- package/dist/components/GridLayout/GridTitle.js +5 -6
- package/dist/components/GridLayout/GridTitle.js.map +1 -1
- package/dist/components/GridLayout/index.js.map +1 -1
- package/dist/components/Panel/Panel.d.ts +2 -2
- package/dist/components/Panel/Panel.d.ts.map +1 -1
- package/dist/components/Panel/Panel.js +7 -13
- package/dist/components/Panel/Panel.js.map +1 -1
- package/dist/components/Panel/PanelContent.d.ts +3 -3
- package/dist/components/Panel/PanelContent.d.ts.map +1 -1
- package/dist/components/Panel/PanelContent.js +4 -3
- package/dist/components/Panel/PanelContent.js.map +1 -1
- package/dist/components/Panel/PanelHeader.d.ts +2 -2
- package/dist/components/Panel/PanelHeader.d.ts.map +1 -1
- package/dist/components/Panel/PanelHeader.js +2 -2
- package/dist/components/Panel/PanelHeader.js.map +1 -1
- package/dist/components/Panel/index.js.map +1 -1
- package/dist/components/PanelDrawer/PanelDrawer.d.ts +1 -2
- package/dist/components/PanelDrawer/PanelDrawer.d.ts.map +1 -1
- package/dist/components/PanelDrawer/PanelDrawer.js +22 -76
- package/dist/components/PanelDrawer/PanelDrawer.js.map +1 -1
- package/dist/components/PanelDrawer/PanelEditorForm.d.ts +5 -3
- package/dist/components/PanelDrawer/PanelEditorForm.d.ts.map +1 -1
- package/dist/components/PanelDrawer/PanelEditorForm.js +231 -142
- package/dist/components/PanelDrawer/PanelEditorForm.js.map +1 -1
- package/dist/components/PanelDrawer/PanelPreview.d.ts +1 -2
- package/dist/components/PanelDrawer/PanelPreview.d.ts.map +1 -1
- package/dist/components/PanelDrawer/PanelPreview.js +4 -5
- package/dist/components/PanelDrawer/PanelPreview.js.map +1 -1
- package/dist/components/PanelDrawer/index.d.ts +1 -0
- package/dist/components/PanelDrawer/index.d.ts.map +1 -1
- package/dist/components/PanelDrawer/index.js +1 -0
- package/dist/components/PanelDrawer/index.js.map +1 -1
- package/dist/components/PanelDrawer/usePanelEditor.js +2 -2
- package/dist/components/PanelDrawer/usePanelEditor.js.map +1 -1
- package/dist/components/PanelGroupDialog/PanelGroupDialog.d.ts +1 -2
- package/dist/components/PanelGroupDialog/PanelGroupDialog.d.ts.map +1 -1
- package/dist/components/PanelGroupDialog/PanelGroupDialog.js.map +1 -1
- package/dist/components/PanelGroupDialog/PanelGroupEditorForm.d.ts +1 -2
- package/dist/components/PanelGroupDialog/PanelGroupEditorForm.d.ts.map +1 -1
- package/dist/components/PanelGroupDialog/PanelGroupEditorForm.js +1 -1
- package/dist/components/PanelGroupDialog/PanelGroupEditorForm.js.map +1 -1
- package/dist/components/PanelGroupDialog/index.js.map +1 -1
- package/dist/components/QuerySummaryTable/QuerySummaryTable.d.ts +1 -2
- package/dist/components/QuerySummaryTable/QuerySummaryTable.d.ts.map +1 -1
- package/dist/components/QuerySummaryTable/QuerySummaryTable.js +8 -8
- package/dist/components/QuerySummaryTable/QuerySummaryTable.js.map +1 -1
- package/dist/components/QuerySummaryTable/index.js.map +1 -1
- package/dist/components/SaveChangesConfirmationDialog/SaveChangesConfirmationDialog.d.ts +1 -2
- package/dist/components/SaveChangesConfirmationDialog/SaveChangesConfirmationDialog.d.ts.map +1 -1
- package/dist/components/SaveChangesConfirmationDialog/SaveChangesConfirmationDialog.js +8 -8
- package/dist/components/SaveChangesConfirmationDialog/SaveChangesConfirmationDialog.js.map +1 -1
- package/dist/components/SaveChangesConfirmationDialog/index.js.map +1 -1
- package/dist/components/SaveDashboardButton/SaveDashboardButton.d.ts +1 -2
- package/dist/components/SaveDashboardButton/SaveDashboardButton.d.ts.map +1 -1
- package/dist/components/SaveDashboardButton/SaveDashboardButton.js +8 -10
- package/dist/components/SaveDashboardButton/SaveDashboardButton.js.map +1 -1
- package/dist/components/SaveDashboardButton/index.js.map +1 -1
- package/dist/components/Variables/BuiltinVariableAccordions.d.ts +7 -0
- package/dist/components/Variables/BuiltinVariableAccordions.d.ts.map +1 -0
- package/dist/components/Variables/BuiltinVariableAccordions.js +128 -0
- package/dist/components/Variables/BuiltinVariableAccordions.js.map +1 -0
- package/dist/components/Variables/EditVariablesButton.d.ts +1 -2
- package/dist/components/Variables/EditVariablesButton.d.ts.map +1 -1
- package/dist/components/Variables/EditVariablesButton.js +7 -7
- package/dist/components/Variables/EditVariablesButton.js.map +1 -1
- package/dist/components/Variables/TemplateVariable.d.ts +12 -4
- package/dist/components/Variables/TemplateVariable.d.ts.map +1 -1
- package/dist/components/Variables/TemplateVariable.js +244 -100
- package/dist/components/Variables/TemplateVariable.js.map +1 -1
- package/dist/components/Variables/VariableEditor.d.ts +4 -4
- package/dist/components/Variables/VariableEditor.d.ts.map +1 -1
- package/dist/components/Variables/VariableEditor.js +232 -161
- package/dist/components/Variables/VariableEditor.js.map +1 -1
- package/dist/components/Variables/VariableList.d.ts +2 -3
- package/dist/components/Variables/VariableList.d.ts.map +1 -1
- package/dist/components/Variables/VariableList.js +11 -13
- package/dist/components/Variables/VariableList.js.map +1 -1
- package/dist/components/Variables/index.d.ts +1 -0
- package/dist/components/Variables/index.d.ts.map +1 -1
- package/dist/components/Variables/index.js +1 -0
- package/dist/components/Variables/index.js.map +1 -1
- package/dist/components/index.d.ts +1 -2
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/index.js +1 -2
- package/dist/components/index.js.map +1 -1
- package/dist/constants/grid-layout-config.js.map +1 -1
- package/dist/constants/index.d.ts +1 -0
- package/dist/constants/index.d.ts.map +1 -1
- package/dist/constants/index.js +1 -0
- package/dist/constants/index.js.map +1 -1
- package/dist/constants/styles.d.ts +5 -0
- package/dist/constants/styles.d.ts.map +1 -0
- package/dist/{utils/time.js → constants/styles.js} +10 -10
- package/dist/constants/styles.js.map +1 -0
- package/dist/constants/user-interface-text.d.ts +2 -1
- package/dist/constants/user-interface-text.d.ts.map +1 -1
- package/dist/constants/user-interface-text.js +2 -1
- package/dist/constants/user-interface-text.js.map +1 -1
- package/dist/context/DashboardProvider/DashboardProvider.d.ts +7 -4
- package/dist/context/DashboardProvider/DashboardProvider.d.ts.map +1 -1
- package/dist/context/DashboardProvider/DashboardProvider.js +16 -9
- package/dist/context/DashboardProvider/DashboardProvider.js.map +1 -1
- package/dist/context/DashboardProvider/common.d.ts +3 -3
- package/dist/context/DashboardProvider/common.d.ts.map +1 -1
- package/dist/context/DashboardProvider/common.js.map +1 -1
- package/dist/context/DashboardProvider/dashboard-provider-api.d.ts +1 -1
- package/dist/context/DashboardProvider/dashboard-provider-api.js +17 -17
- package/dist/context/DashboardProvider/dashboard-provider-api.js.map +1 -1
- package/dist/context/DashboardProvider/delete-panel-group-slice.js +1 -1
- package/dist/context/DashboardProvider/delete-panel-group-slice.js.map +1 -1
- package/dist/context/DashboardProvider/delete-panel-slice.js +5 -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.js.map +1 -1
- package/dist/context/DashboardProvider/panel-editor-slice.d.ts +2 -2
- package/dist/context/DashboardProvider/panel-editor-slice.d.ts.map +1 -1
- package/dist/context/DashboardProvider/panel-editor-slice.js +11 -13
- package/dist/context/DashboardProvider/panel-editor-slice.js.map +1 -1
- package/dist/context/DashboardProvider/panel-group-editor-slice.js +2 -2
- package/dist/context/DashboardProvider/panel-group-editor-slice.js.map +1 -1
- package/dist/context/DashboardProvider/panel-group-slice.d.ts +2 -2
- package/dist/context/DashboardProvider/panel-group-slice.d.ts.map +1 -1
- package/dist/context/DashboardProvider/panel-group-slice.js +4 -4
- package/dist/context/DashboardProvider/panel-group-slice.js.map +1 -1
- package/dist/context/DashboardProvider/panel-slice.js.map +1 -1
- package/dist/context/DashboardProvider/save-changes-dialog-slice.js.map +1 -1
- package/dist/context/DatasourceStoreProvider.d.ts +17 -12
- package/dist/context/DatasourceStoreProvider.d.ts.map +1 -1
- package/dist/context/DatasourceStoreProvider.js +172 -47
- package/dist/context/DatasourceStoreProvider.js.map +1 -1
- package/dist/context/TemplateVariableProvider/TemplateVariableProvider.d.ts +15 -8
- package/dist/context/TemplateVariableProvider/TemplateVariableProvider.d.ts.map +1 -1
- package/dist/context/TemplateVariableProvider/TemplateVariableProvider.js +115 -23
- package/dist/context/TemplateVariableProvider/TemplateVariableProvider.js.map +1 -1
- package/dist/context/TemplateVariableProvider/hydrationUtils.d.ts.map +1 -1
- package/dist/context/TemplateVariableProvider/hydrationUtils.js +7 -7
- package/dist/context/TemplateVariableProvider/hydrationUtils.js.map +1 -1
- package/dist/context/TemplateVariableProvider/index.js.map +1 -1
- package/dist/context/TemplateVariableProvider/query-params.js.map +1 -1
- package/dist/context/TemplateVariableProvider/utils.js +3 -3
- package/dist/context/TemplateVariableProvider/utils.js.map +1 -1
- 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 -7
- package/dist/context/useDashboard.js.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/stories/decorators/WithDashboard.js.map +1 -1
- package/dist/stories/decorators/WithDatasourceStore.js.map +1 -1
- package/dist/stories/decorators/WithTemplateVariables.js.map +1 -1
- package/dist/stories/decorators/constants.js +2 -2
- package/dist/stories/decorators/constants.js.map +1 -1
- package/dist/stories/decorators/index.js.map +1 -1
- package/dist/test/dashboard-provider.js.map +1 -1
- package/dist/test/datasource-provider.d.ts.map +1 -1
- package/dist/test/datasource-provider.js +5 -7
- package/dist/test/datasource-provider.js.map +1 -1
- package/dist/test/index.js.map +1 -1
- package/dist/test/plugin-registry.js.map +1 -1
- package/dist/test/render.d.ts.map +1 -1
- package/dist/test/render.js +9 -4
- package/dist/test/render.js.map +1 -1
- package/dist/test/setup-tests.js.map +1 -1
- package/dist/test/testDashboard.js +10 -10
- package/dist/test/testDashboard.js.map +1 -1
- package/dist/utils/index.d.ts +0 -1
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +0 -1
- package/dist/utils/index.js.map +1 -1
- package/dist/utils/panelUtils.d.ts +1 -1
- package/dist/utils/panelUtils.d.ts.map +1 -1
- package/dist/utils/panelUtils.js +2 -2
- package/dist/utils/panelUtils.js.map +1 -1
- package/dist/validation/index.d.ts +2 -0
- package/dist/validation/index.d.ts.map +1 -0
- package/dist/{components/ToolbarIconButton → validation}/index.js +1 -1
- package/dist/validation/index.js.map +1 -0
- package/dist/validation/panel.d.ts +19 -0
- package/dist/validation/panel.d.ts.map +1 -0
- package/dist/validation/panel.js +21 -0
- package/dist/validation/panel.js.map +1 -0
- package/dist/views/ViewDashboard/DashboardApp.d.ts +4 -3
- package/dist/views/ViewDashboard/DashboardApp.d.ts.map +1 -1
- package/dist/views/ViewDashboard/DashboardApp.js +19 -7
- package/dist/views/ViewDashboard/DashboardApp.js.map +1 -1
- package/dist/views/ViewDashboard/ViewDashboard.d.ts +2 -2
- package/dist/views/ViewDashboard/ViewDashboard.d.ts.map +1 -1
- package/dist/views/ViewDashboard/ViewDashboard.js +53 -12
- package/dist/views/ViewDashboard/ViewDashboard.js.map +1 -1
- package/dist/views/ViewDashboard/index.js.map +1 -1
- package/dist/views/index.js.map +1 -1
- package/package.json +8 -7
- package/dist/cjs/components/TimeRangeControls/TimeRangeControls.js +0 -183
- package/dist/cjs/components/ToolbarIconButton/ToolbarIconButton.js +0 -38
- 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 -165
- 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.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.map +0 -1
|
@@ -21,45 +21,47 @@ function _export(target, all) {
|
|
|
21
21
|
});
|
|
22
22
|
}
|
|
23
23
|
_export(exports, {
|
|
24
|
-
TemplateVariableList: ()
|
|
25
|
-
|
|
24
|
+
TemplateVariableList: function() {
|
|
25
|
+
return TemplateVariableList;
|
|
26
|
+
},
|
|
27
|
+
TemplateVariableListItem: function() {
|
|
28
|
+
return TemplateVariableListItem;
|
|
29
|
+
}
|
|
26
30
|
});
|
|
27
|
-
const
|
|
31
|
+
const _jsxruntime = require("react/jsx-runtime");
|
|
28
32
|
const _material = require("@mui/material");
|
|
29
33
|
const _context = require("../../context");
|
|
30
|
-
const
|
|
31
|
-
const
|
|
32
|
-
const VARIABLE_INPUT_MAX_WIDTH = '240px';
|
|
34
|
+
const _constants = require("../../constants");
|
|
35
|
+
const _TemplateVariable = require("./TemplateVariable");
|
|
33
36
|
function TemplateVariableList() {
|
|
34
37
|
const variableDefinitions = (0, _context.useTemplateVariableDefinitions)();
|
|
35
38
|
const externalVariableDefinitions = (0, _context.useTemplateExternalVariableDefinitions)();
|
|
36
|
-
return /*#__PURE__*/ (0,
|
|
39
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsxs)(_jsxruntime.Fragment, {
|
|
37
40
|
children: [
|
|
38
41
|
externalVariableDefinitions.slice().reverse() // We reverse to have the most prioritized on top
|
|
39
|
-
.map((def)=>def.definitions.map((v)=>/*#__PURE__*/ (0,
|
|
42
|
+
.map((def)=>def.definitions.map((v)=>/*#__PURE__*/ (0, _jsxruntime.jsx)(TemplateVariableListItem, {
|
|
40
43
|
spec: v.spec,
|
|
41
44
|
source: def.source
|
|
42
45
|
}, v.spec.name + def.source))),
|
|
43
|
-
variableDefinitions.map((v)=>/*#__PURE__*/ (0,
|
|
46
|
+
variableDefinitions.map((v)=>/*#__PURE__*/ (0, _jsxruntime.jsx)(TemplateVariableListItem, {
|
|
44
47
|
spec: v.spec
|
|
45
48
|
}, v.spec.name))
|
|
46
49
|
]
|
|
47
50
|
});
|
|
48
51
|
}
|
|
49
|
-
function TemplateVariableListItem({ spec
|
|
50
|
-
var
|
|
52
|
+
function TemplateVariableListItem({ spec, source }) {
|
|
53
|
+
var _ctx_state, _spec_display;
|
|
51
54
|
const ctx = (0, _context.useTemplateVariable)(spec.name, source);
|
|
52
|
-
var
|
|
53
|
-
return /*#__PURE__*/ (0,
|
|
54
|
-
display: ((
|
|
55
|
-
minWidth:
|
|
56
|
-
maxWidth:
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
children: /*#__PURE__*/ (0, _jsxRuntime.jsx)(_templateVariable.TemplateVariable, {
|
|
55
|
+
var _ref, _ref1;
|
|
56
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Box, {
|
|
57
|
+
display: ((_ctx_state = ctx.state) === null || _ctx_state === void 0 ? void 0 : _ctx_state.overridden) || ((_spec_display = spec.display) === null || _spec_display === void 0 ? void 0 : _spec_display.hidden) ? 'none' : undefined,
|
|
58
|
+
minWidth: `${_constants.MIN_TEMPLATE_VARIABLE_WIDTH}px`,
|
|
59
|
+
maxWidth: `${_constants.MAX_TEMPLATE_VARIABLE_WIDTH}px`,
|
|
60
|
+
flexShrink: 0,
|
|
61
|
+
"data-testid": 'template-variable-' + spec.name,
|
|
62
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_TemplateVariable.TemplateVariable, {
|
|
61
63
|
name: spec.name,
|
|
62
64
|
source: source
|
|
63
|
-
}, (
|
|
64
|
-
}, (
|
|
65
|
+
}, (_ref = spec.name + source) !== null && _ref !== void 0 ? _ref : '')
|
|
66
|
+
}, (_ref1 = spec.name + source) !== null && _ref1 !== void 0 ? _ref1 : '');
|
|
65
67
|
}
|
|
@@ -14,18 +14,21 @@
|
|
|
14
14
|
Object.defineProperty(exports, "__esModule", {
|
|
15
15
|
value: true
|
|
16
16
|
});
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
17
|
+
_export_star(require("./BuiltinVariableAccordions"), exports);
|
|
18
|
+
_export_star(require("./EditVariablesButton"), exports);
|
|
19
|
+
_export_star(require("./TemplateVariable"), exports);
|
|
20
|
+
_export_star(require("./VariableEditor"), exports);
|
|
21
|
+
_export_star(require("./VariableList"), exports);
|
|
22
|
+
function _export_star(from, to) {
|
|
22
23
|
Object.keys(from).forEach(function(k) {
|
|
23
|
-
if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k))
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
24
|
+
if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) {
|
|
25
|
+
Object.defineProperty(to, k, {
|
|
26
|
+
enumerable: true,
|
|
27
|
+
get: function() {
|
|
28
|
+
return from[k];
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
}
|
|
29
32
|
});
|
|
30
33
|
return from;
|
|
31
34
|
}
|
|
@@ -14,36 +14,37 @@
|
|
|
14
14
|
Object.defineProperty(exports, "__esModule", {
|
|
15
15
|
value: true
|
|
16
16
|
});
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
function _exportStar(from, to) {
|
|
17
|
+
_export_star(require("./AddGroupButton"), exports);
|
|
18
|
+
_export_star(require("./AddPanelButton"), exports);
|
|
19
|
+
_export_star(require("./Dashboard"), exports);
|
|
20
|
+
_export_star(require("./DashboardToolbar"), exports);
|
|
21
|
+
_export_star(require("./DashboardStickyToolbar"), exports);
|
|
22
|
+
_export_star(require("./Datasources"), exports);
|
|
23
|
+
_export_star(require("./DeletePanelDialog"), exports);
|
|
24
|
+
_export_star(require("./DeletePanelGroupDialog"), exports);
|
|
25
|
+
_export_star(require("./DiscardChangesConfirmationDialog"), exports);
|
|
26
|
+
_export_star(require("./DownloadButton"), exports);
|
|
27
|
+
_export_star(require("./EditJsonButton"), exports);
|
|
28
|
+
_export_star(require("./EditJsonDialog"), exports);
|
|
29
|
+
_export_star(require("./EmptyDashboard"), exports);
|
|
30
|
+
_export_star(require("./GridLayout"), exports);
|
|
31
|
+
_export_star(require("./Panel"), exports);
|
|
32
|
+
_export_star(require("./PanelDrawer"), exports);
|
|
33
|
+
_export_star(require("./PanelGroupDialog"), exports);
|
|
34
|
+
_export_star(require("./QuerySummaryTable"), exports);
|
|
35
|
+
_export_star(require("./SaveChangesConfirmationDialog"), exports);
|
|
36
|
+
_export_star(require("./SaveDashboardButton"), exports);
|
|
37
|
+
_export_star(require("./Variables"), exports);
|
|
38
|
+
function _export_star(from, to) {
|
|
40
39
|
Object.keys(from).forEach(function(k) {
|
|
41
|
-
if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k))
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
40
|
+
if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) {
|
|
41
|
+
Object.defineProperty(to, k, {
|
|
42
|
+
enumerable: true,
|
|
43
|
+
get: function() {
|
|
44
|
+
return from[k];
|
|
45
|
+
}
|
|
46
|
+
});
|
|
47
|
+
}
|
|
47
48
|
});
|
|
48
49
|
return from;
|
|
49
50
|
}
|
|
@@ -21,8 +21,12 @@ function _export(target, all) {
|
|
|
21
21
|
});
|
|
22
22
|
}
|
|
23
23
|
_export(exports, {
|
|
24
|
-
GRID_LAYOUT_COLS: ()
|
|
25
|
-
|
|
24
|
+
GRID_LAYOUT_COLS: function() {
|
|
25
|
+
return GRID_LAYOUT_COLS;
|
|
26
|
+
},
|
|
27
|
+
GRID_LAYOUT_SMALL_BREAKPOINT: function() {
|
|
28
|
+
return GRID_LAYOUT_SMALL_BREAKPOINT;
|
|
29
|
+
}
|
|
26
30
|
});
|
|
27
31
|
const GRID_LAYOUT_COLS = {
|
|
28
32
|
sm: 24,
|
|
@@ -14,16 +14,19 @@
|
|
|
14
14
|
Object.defineProperty(exports, "__esModule", {
|
|
15
15
|
value: true
|
|
16
16
|
});
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
17
|
+
_export_star(require("./grid-layout-config"), exports);
|
|
18
|
+
_export_star(require("./styles"), exports);
|
|
19
|
+
_export_star(require("./user-interface-text"), exports);
|
|
20
|
+
function _export_star(from, to) {
|
|
20
21
|
Object.keys(from).forEach(function(k) {
|
|
21
|
-
if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k))
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
22
|
+
if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) {
|
|
23
|
+
Object.defineProperty(to, k, {
|
|
24
|
+
enumerable: true,
|
|
25
|
+
get: function() {
|
|
26
|
+
return from[k];
|
|
27
|
+
}
|
|
28
|
+
});
|
|
29
|
+
}
|
|
27
30
|
});
|
|
28
31
|
return from;
|
|
29
32
|
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
// Copyright 2023 The Perses Authors
|
|
2
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
3
|
+
// you may not use this file except in compliance with the License.
|
|
4
|
+
// You may obtain a copy of the License at
|
|
5
|
+
//
|
|
6
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
|
7
|
+
//
|
|
8
|
+
// Unless required by applicable law or agreed to in writing, software
|
|
9
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
10
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11
|
+
// See the License for the specific language governing permissions and
|
|
12
|
+
// limitations under the License.
|
|
13
|
+
"use strict";
|
|
14
|
+
Object.defineProperty(exports, "__esModule", {
|
|
15
|
+
value: true
|
|
16
|
+
});
|
|
17
|
+
function _export(target, all) {
|
|
18
|
+
for(var name in all)Object.defineProperty(target, name, {
|
|
19
|
+
enumerable: true,
|
|
20
|
+
get: all[name]
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
_export(exports, {
|
|
24
|
+
MAX_TEMPLATE_VARIABLE_WIDTH: function() {
|
|
25
|
+
return MAX_TEMPLATE_VARIABLE_WIDTH;
|
|
26
|
+
},
|
|
27
|
+
MIN_TEMPLATE_VARIABLE_WIDTH: function() {
|
|
28
|
+
return MIN_TEMPLATE_VARIABLE_WIDTH;
|
|
29
|
+
},
|
|
30
|
+
editButtonStyle: function() {
|
|
31
|
+
return editButtonStyle;
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
const editButtonStyle = {
|
|
35
|
+
whiteSpace: 'nowrap',
|
|
36
|
+
minWidth: 'auto',
|
|
37
|
+
'& .MuiButton-startIcon': {
|
|
38
|
+
marginRight: 0.5
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
const MIN_TEMPLATE_VARIABLE_WIDTH = 120;
|
|
42
|
+
const MAX_TEMPLATE_VARIABLE_WIDTH = 500;
|
|
@@ -21,17 +21,22 @@ function _export(target, all) {
|
|
|
21
21
|
});
|
|
22
22
|
}
|
|
23
23
|
_export(exports, {
|
|
24
|
-
|
|
25
|
-
|
|
24
|
+
ARIA_LABEL_TEXT: function() {
|
|
25
|
+
return ARIA_LABEL_TEXT;
|
|
26
|
+
},
|
|
27
|
+
TOOLTIP_TEXT: function() {
|
|
28
|
+
return TOOLTIP_TEXT;
|
|
29
|
+
}
|
|
26
30
|
});
|
|
27
31
|
const TOOLTIP_TEXT = {
|
|
28
32
|
// Toolbar buttons
|
|
29
33
|
addPanel: 'Add panel',
|
|
30
34
|
addGroup: 'Add panel group',
|
|
31
35
|
downloadDashboard: 'Download JSON',
|
|
36
|
+
editDatasources: 'Edit datasources',
|
|
32
37
|
editJson: 'Edit JSON',
|
|
33
38
|
editVariables: 'Edit variables',
|
|
34
|
-
|
|
39
|
+
viewJson: 'View JSON',
|
|
35
40
|
// Group buttons
|
|
36
41
|
addPanelToGroup: 'Add panel to group',
|
|
37
42
|
deleteGroup: 'Delete group',
|
|
@@ -21,28 +21,34 @@ function _export(target, all) {
|
|
|
21
21
|
});
|
|
22
22
|
}
|
|
23
23
|
_export(exports, {
|
|
24
|
-
DashboardContext: ()
|
|
25
|
-
|
|
26
|
-
|
|
24
|
+
DashboardContext: function() {
|
|
25
|
+
return DashboardContext;
|
|
26
|
+
},
|
|
27
|
+
DashboardProvider: function() {
|
|
28
|
+
return DashboardProvider;
|
|
29
|
+
},
|
|
30
|
+
useDashboardStore: function() {
|
|
31
|
+
return useDashboardStore;
|
|
32
|
+
}
|
|
27
33
|
});
|
|
28
|
-
const
|
|
34
|
+
const _jsxruntime = require("react/jsx-runtime");
|
|
29
35
|
const _zustand = require("zustand");
|
|
30
36
|
const _middleware = require("zustand/middleware");
|
|
31
37
|
const _immer = require("zustand/middleware/immer");
|
|
32
38
|
const _shallow = require("zustand/shallow");
|
|
33
39
|
const _react = require("react");
|
|
34
40
|
const _core = require("@perses-dev/core");
|
|
35
|
-
const
|
|
36
|
-
const
|
|
37
|
-
const
|
|
38
|
-
const
|
|
39
|
-
const
|
|
40
|
-
const
|
|
41
|
-
const
|
|
42
|
-
const
|
|
43
|
-
const
|
|
44
|
-
const
|
|
45
|
-
const
|
|
41
|
+
const _pluginsystem = require("@perses-dev/plugin-system");
|
|
42
|
+
const _panelgroupeditorslice = require("./panel-group-editor-slice");
|
|
43
|
+
const _panelgroupslice = require("./panel-group-slice");
|
|
44
|
+
const _paneleditorslice = require("./panel-editor-slice");
|
|
45
|
+
const _panelslice = require("./panel-slice");
|
|
46
|
+
const _deletepanelgroupslice = require("./delete-panel-group-slice");
|
|
47
|
+
const _deletepanelslice = require("./delete-panel-slice");
|
|
48
|
+
const _discardchangesdialogslice = require("./discard-changes-dialog-slice");
|
|
49
|
+
const _savechangesdialogslice = require("./save-changes-dialog-slice");
|
|
50
|
+
const _duplicatepanelslice = require("./duplicate-panel-slice");
|
|
51
|
+
const _editjsondialogslice = require("./edit-json-dialog-slice");
|
|
46
52
|
const _common = require("./common");
|
|
47
53
|
const DashboardContext = /*#__PURE__*/ (0, _react.createContext)(undefined);
|
|
48
54
|
function useDashboardStore(selector) {
|
|
@@ -57,10 +63,10 @@ function DashboardProvider(props) {
|
|
|
57
63
|
props
|
|
58
64
|
]);
|
|
59
65
|
// load plugin to retrieve initial spec if default panel kind is defined
|
|
60
|
-
const { defaultPluginKinds
|
|
61
|
-
var
|
|
62
|
-
const defaultPanelKind = (
|
|
63
|
-
const { data: plugin
|
|
66
|
+
const { defaultPluginKinds } = (0, _pluginsystem.usePluginRegistry)();
|
|
67
|
+
var _defaultPluginKinds_Panel;
|
|
68
|
+
const defaultPanelKind = (_defaultPluginKinds_Panel = defaultPluginKinds === null || defaultPluginKinds === void 0 ? void 0 : defaultPluginKinds['Panel']) !== null && _defaultPluginKinds_Panel !== void 0 ? _defaultPluginKinds_Panel : '';
|
|
69
|
+
const { data: plugin } = (0, _pluginsystem.usePlugin)('Panel', defaultPanelKind);
|
|
64
70
|
const [store] = (0, _react.useState)(createDashboardStore(props)); // prevent calling createDashboardStore every time it rerenders
|
|
65
71
|
(0, _react.useEffect)(()=>{
|
|
66
72
|
if (plugin === undefined) return;
|
|
@@ -76,49 +82,56 @@ function DashboardProvider(props) {
|
|
|
76
82
|
store,
|
|
77
83
|
defaultPanelKind
|
|
78
84
|
]);
|
|
79
|
-
return /*#__PURE__*/ (0,
|
|
85
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsx)(DashboardContext.Provider, {
|
|
80
86
|
value: store,
|
|
81
87
|
children: props.children
|
|
82
88
|
});
|
|
83
89
|
}
|
|
84
90
|
function initStore(props) {
|
|
85
|
-
const { initialState: { dashboardResource
|
|
86
|
-
const { spec: { display
|
|
87
|
-
|
|
91
|
+
const { initialState: { dashboardResource, isEditMode } } = props;
|
|
92
|
+
const { kind, metadata, spec: { display, duration, refreshInterval = _core.DEFAULT_REFRESH_INTERVAL, datasources } } = dashboardResource;
|
|
93
|
+
const ttl = 'ttl' in dashboardResource.spec ? dashboardResource.spec.ttl : undefined;
|
|
94
|
+
let { spec: { layouts, panels } } = dashboardResource;
|
|
88
95
|
// Set fallbacks in case the frontend is used with a non-Perses backend
|
|
89
96
|
layouts = layouts !== null && layouts !== void 0 ? layouts : [];
|
|
90
97
|
panels = panels !== null && panels !== void 0 ? panels : {};
|
|
91
98
|
const store = (0, _zustand.createStore)()((0, _immer.immer)((0, _middleware.devtools)((...args)=>{
|
|
92
99
|
const [set] = args;
|
|
93
100
|
return {
|
|
94
|
-
/* Groups */ ...(0,
|
|
95
|
-
...(0,
|
|
96
|
-
...(0,
|
|
97
|
-
/* Panels */ ...(0,
|
|
98
|
-
...(0,
|
|
99
|
-
...(0,
|
|
100
|
-
...(0,
|
|
101
|
-
/* General */ ...(0,
|
|
102
|
-
...(0,
|
|
103
|
-
...(0,
|
|
101
|
+
/* Groups */ ...(0, _panelgroupslice.createPanelGroupSlice)(layouts)(...args),
|
|
102
|
+
...(0, _panelgroupeditorslice.createPanelGroupEditorSlice)(...args),
|
|
103
|
+
...(0, _deletepanelgroupslice.createDeletePanelGroupSlice)(...args),
|
|
104
|
+
/* Panels */ ...(0, _panelslice.createPanelSlice)(panels)(...args),
|
|
105
|
+
...(0, _paneleditorslice.createPanelEditorSlice)()(...args),
|
|
106
|
+
...(0, _deletepanelslice.createDeletePanelSlice)()(...args),
|
|
107
|
+
...(0, _duplicatepanelslice.createDuplicatePanelSlice)()(...args),
|
|
108
|
+
/* General */ ...(0, _discardchangesdialogslice.createDiscardChangesDialogSlice)(...args),
|
|
109
|
+
...(0, _editjsondialogslice.createEditJsonDialogSlice)(...args),
|
|
110
|
+
...(0, _savechangesdialogslice.createSaveChangesDialogSlice)(...args),
|
|
111
|
+
kind,
|
|
104
112
|
metadata,
|
|
105
113
|
display,
|
|
106
114
|
duration,
|
|
107
115
|
refreshInterval,
|
|
116
|
+
datasources,
|
|
117
|
+
ttl,
|
|
108
118
|
isEditMode: !!isEditMode,
|
|
109
119
|
setEditMode: (isEditMode)=>set({
|
|
110
120
|
isEditMode
|
|
111
121
|
}),
|
|
112
|
-
setDashboard: ({ metadata
|
|
122
|
+
setDashboard: ({ kind, metadata, spec: { display, panels = {}, layouts = [], duration, refreshInterval, datasources = {} } })=>{
|
|
113
123
|
set((state)=>{
|
|
124
|
+
state.kind = kind;
|
|
114
125
|
state.metadata = metadata;
|
|
115
126
|
state.display = display;
|
|
116
127
|
state.panels = panels;
|
|
117
|
-
const { panelGroups
|
|
128
|
+
const { panelGroups, panelGroupOrder } = (0, _panelgroupslice.convertLayoutsToPanelGroups)(layouts);
|
|
118
129
|
state.panelGroups = panelGroups;
|
|
119
130
|
state.panelGroupOrder = panelGroupOrder;
|
|
120
131
|
state.duration = duration;
|
|
121
132
|
state.refreshInterval = refreshInterval !== null && refreshInterval !== void 0 ? refreshInterval : _core.DEFAULT_REFRESH_INTERVAL;
|
|
133
|
+
state.datasources = datasources;
|
|
134
|
+
// TODO: add ttl here to e.g allow edition from JSON view, but probably requires quite some refactoring
|
|
122
135
|
});
|
|
123
136
|
}
|
|
124
137
|
};
|
|
@@ -21,8 +21,12 @@ function _export(target, all) {
|
|
|
21
21
|
});
|
|
22
22
|
}
|
|
23
23
|
_export(exports, {
|
|
24
|
-
|
|
25
|
-
|
|
24
|
+
createPanelDefinition: function() {
|
|
25
|
+
return createPanelDefinition;
|
|
26
|
+
},
|
|
27
|
+
generateId: function() {
|
|
28
|
+
return generateId;
|
|
29
|
+
}
|
|
26
30
|
});
|
|
27
31
|
function generateId() {
|
|
28
32
|
if (globalThis.dashboardStoreId === undefined) {
|