@perses-dev/dashboards 0.0.0-snapshot-scatter-chart-embed-8efdfab → 0.0.0-snapshot-explorer-plugin-c4a7621
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/components/AddGroupButton/AddGroupButton.js +1 -1
- package/dist/cjs/components/AddPanelButton/AddPanelButton.js +2 -2
- package/dist/cjs/components/Dashboard/Dashboard.js +9 -2
- package/dist/cjs/components/DashboardStickyToolbar/DashboardStickyToolbar.js +4 -4
- package/dist/cjs/components/DashboardToolbar/DashboardToolbar.js +6 -6
- package/dist/cjs/components/Datasources/DatasourceEditor.js +19 -20
- package/dist/cjs/components/Datasources/EditDatasourcesButton.js +11 -8
- package/dist/cjs/components/DeletePanelDialog/DeletePanelDialog.js +4 -4
- package/dist/cjs/components/DeletePanelGroupDialog/DeletePanelGroupDialog.js +4 -5
- package/dist/cjs/components/DiscardChangesConfirmationDialog/DiscardChangesConfirmationDialog.js +1 -1
- package/dist/cjs/components/DownloadButton/DownloadButton.js +3 -4
- package/dist/cjs/components/EditButton/EditButton.js +1 -1
- package/dist/cjs/components/EditJsonButton/EditJsonButton.js +3 -4
- package/dist/cjs/components/EditJsonDialog/EditJsonDialog.js +21 -17
- package/dist/cjs/components/EmptyDashboard/EmptyDashboard.js +5 -5
- package/dist/cjs/components/GridLayout/GridContainer.js +16 -11
- package/dist/cjs/components/GridLayout/GridItemContent.js +24 -10
- package/dist/cjs/components/GridLayout/GridLayout.js +63 -14
- package/dist/cjs/components/GridLayout/GridTitle.js +8 -9
- package/dist/cjs/{validation/panel.js → components/Panel/HeaderIconButton.js} +8 -10
- package/dist/cjs/components/Panel/Panel.js +15 -11
- package/dist/cjs/components/Panel/PanelActions.js +216 -0
- package/dist/cjs/components/Panel/PanelContent.js +6 -6
- package/dist/cjs/components/Panel/PanelHeader.js +36 -103
- package/dist/cjs/components/Panel/PanelLinks.js +136 -0
- package/dist/cjs/components/PanelDrawer/PanelDrawer.js +9 -6
- package/dist/cjs/components/PanelDrawer/PanelEditorForm.js +67 -62
- package/dist/cjs/components/PanelDrawer/PanelPreview.js +9 -6
- package/dist/cjs/components/PanelDrawer/usePanelEditor.js +9 -6
- package/dist/cjs/components/PanelGroupDialog/PanelGroupDialog.js +1 -1
- package/dist/cjs/components/PanelGroupDialog/PanelGroupEditorForm.js +1 -1
- package/dist/cjs/components/QuerySummaryTable/QuerySummaryTable.js +5 -7
- package/dist/cjs/components/SaveChangesConfirmationDialog/SaveChangesConfirmationDialog.js +7 -9
- package/dist/cjs/components/SaveDashboardButton/SaveDashboardButton.js +8 -8
- package/dist/cjs/components/Variables/BuiltinVariableAccordions.js +8 -14
- package/dist/cjs/components/Variables/EditVariablesButton.js +5 -5
- package/dist/cjs/components/Variables/{TemplateVariable.js → Variable.js} +48 -56
- package/dist/cjs/components/Variables/VariableEditor.js +39 -46
- package/dist/cjs/components/Variables/VariableList.js +23 -22
- package/dist/cjs/components/Variables/index.js +2 -2
- package/dist/cjs/components/index.js +0 -2
- package/dist/cjs/constants/styles.js +17 -9
- package/dist/cjs/constants/user-interface-text.js +6 -5
- package/dist/cjs/context/DashboardProvider/DashboardProvider.js +24 -17
- package/dist/cjs/context/DashboardProvider/DashboardProviderWithQueryParams.js +36 -0
- package/dist/cjs/context/DashboardProvider/common.js +5 -5
- package/dist/cjs/context/DashboardProvider/dashboard-provider-api.js +51 -43
- package/dist/cjs/context/DashboardProvider/delete-panel-group-slice.js +1 -1
- package/dist/cjs/context/DashboardProvider/delete-panel-slice.js +4 -5
- package/dist/cjs/context/DashboardProvider/duplicate-panel-slice.js +1 -1
- package/dist/cjs/context/DashboardProvider/panel-editor-slice.js +11 -16
- package/dist/cjs/context/DashboardProvider/panel-group-editor-slice.js +1 -2
- package/dist/cjs/context/DashboardProvider/panel-group-slice.js +13 -8
- package/dist/cjs/context/DashboardProvider/view-panel-slice.js +79 -0
- package/dist/cjs/context/DatasourceStoreProvider.js +32 -31
- package/dist/cjs/context/{TemplateVariableProvider/TemplateVariableProvider.js → VariableProvider/VariableProvider.js} +128 -131
- package/dist/cjs/context/{TemplateVariableProvider → VariableProvider}/hydrationUtils.js +11 -14
- package/dist/cjs/{validation → context/VariableProvider}/index.js +2 -2
- package/dist/cjs/context/{TemplateVariableProvider → VariableProvider}/query-params.js +8 -8
- package/dist/cjs/context/{TemplateVariableProvider → VariableProvider}/utils.js +6 -6
- package/dist/cjs/context/index.js +2 -2
- package/dist/cjs/context/useDashboard.js +24 -9
- package/dist/cjs/stories/decorators/WithDashboard.js +1 -1
- package/dist/cjs/stories/decorators/WithDatasourceStore.js +1 -1
- package/dist/cjs/stories/decorators/{WithTemplateVariables.js → WithVariables.js} +9 -9
- package/dist/cjs/stories/decorators/index.js +2 -2
- package/dist/cjs/test/dashboard-provider.js +3 -3
- package/dist/cjs/test/datasource-provider.js +4 -4
- package/dist/cjs/test/plugin-registry.js +4 -2
- package/dist/cjs/test/render.js +14 -12
- package/dist/cjs/utils/index.js +0 -1
- package/dist/cjs/utils/panelUtils.js +5 -5
- package/dist/cjs/views/ViewDashboard/DashboardApp.js +8 -8
- package/dist/cjs/views/ViewDashboard/ViewDashboard.js +10 -11
- package/dist/components/AddGroupButton/AddGroupButton.d.ts +2 -2
- package/dist/components/AddGroupButton/AddGroupButton.d.ts.map +1 -1
- package/dist/components/AddGroupButton/AddGroupButton.js +1 -1
- package/dist/components/AddGroupButton/AddGroupButton.js.map +1 -1
- package/dist/components/AddPanelButton/AddPanelButton.d.ts +2 -2
- package/dist/components/AddPanelButton/AddPanelButton.d.ts.map +1 -1
- package/dist/components/AddPanelButton/AddPanelButton.js +2 -2
- package/dist/components/AddPanelButton/AddPanelButton.js.map +1 -1
- package/dist/components/Dashboard/Dashboard.d.ts +3 -3
- package/dist/components/Dashboard/Dashboard.d.ts.map +1 -1
- package/dist/components/Dashboard/Dashboard.js +9 -2
- package/dist/components/Dashboard/Dashboard.js.map +1 -1
- package/dist/components/DashboardStickyToolbar/DashboardStickyToolbar.d.ts +2 -2
- package/dist/components/DashboardStickyToolbar/DashboardStickyToolbar.d.ts.map +1 -1
- package/dist/components/DashboardStickyToolbar/DashboardStickyToolbar.js +4 -4
- package/dist/components/DashboardStickyToolbar/DashboardStickyToolbar.js.map +1 -1
- package/dist/components/DashboardToolbar/DashboardToolbar.d.ts +2 -2
- package/dist/components/DashboardToolbar/DashboardToolbar.d.ts.map +1 -1
- package/dist/components/DashboardToolbar/DashboardToolbar.js +5 -5
- package/dist/components/DashboardToolbar/DashboardToolbar.js.map +1 -1
- package/dist/components/Datasources/DatasourceEditor.d.ts +2 -2
- package/dist/components/Datasources/DatasourceEditor.d.ts.map +1 -1
- package/dist/components/Datasources/DatasourceEditor.js +20 -21
- package/dist/components/Datasources/DatasourceEditor.js.map +1 -1
- package/dist/components/Datasources/EditDatasourcesButton.d.ts +2 -2
- package/dist/components/Datasources/EditDatasourcesButton.d.ts.map +1 -1
- package/dist/components/Datasources/EditDatasourcesButton.js +11 -8
- package/dist/components/Datasources/EditDatasourcesButton.js.map +1 -1
- package/dist/components/DeletePanelDialog/DeletePanelDialog.d.ts +2 -2
- package/dist/components/DeletePanelDialog/DeletePanelDialog.d.ts.map +1 -1
- package/dist/components/DeletePanelDialog/DeletePanelDialog.js +4 -4
- package/dist/components/DeletePanelDialog/DeletePanelDialog.js.map +1 -1
- package/dist/components/DeletePanelGroupDialog/DeletePanelGroupDialog.d.ts +2 -2
- package/dist/components/DeletePanelGroupDialog/DeletePanelGroupDialog.d.ts.map +1 -1
- package/dist/components/DeletePanelGroupDialog/DeletePanelGroupDialog.js +4 -5
- package/dist/components/DeletePanelGroupDialog/DeletePanelGroupDialog.js.map +1 -1
- package/dist/components/DiscardChangesConfirmationDialog/DiscardChangesConfirmationDialog.d.ts +2 -2
- package/dist/components/DiscardChangesConfirmationDialog/DiscardChangesConfirmationDialog.d.ts.map +1 -1
- package/dist/components/DiscardChangesConfirmationDialog/DiscardChangesConfirmationDialog.js +1 -1
- package/dist/components/DiscardChangesConfirmationDialog/DiscardChangesConfirmationDialog.js.map +1 -1
- package/dist/components/DownloadButton/DownloadButton.d.ts +2 -2
- package/dist/components/DownloadButton/DownloadButton.d.ts.map +1 -1
- package/dist/components/DownloadButton/DownloadButton.js +3 -4
- package/dist/components/DownloadButton/DownloadButton.js.map +1 -1
- package/dist/components/EditButton/EditButton.d.ts +2 -2
- package/dist/components/EditButton/EditButton.d.ts.map +1 -1
- package/dist/components/EditButton/EditButton.js +1 -1
- package/dist/components/EditButton/EditButton.js.map +1 -1
- package/dist/components/EditJsonButton/EditJsonButton.d.ts +2 -2
- package/dist/components/EditJsonButton/EditJsonButton.d.ts.map +1 -1
- package/dist/components/EditJsonButton/EditJsonButton.js +3 -4
- package/dist/components/EditJsonButton/EditJsonButton.js.map +1 -1
- package/dist/components/EditJsonDialog/EditJsonDialog.d.ts +2 -2
- package/dist/components/EditJsonDialog/EditJsonDialog.d.ts.map +1 -1
- package/dist/components/EditJsonDialog/EditJsonDialog.js +21 -17
- package/dist/components/EditJsonDialog/EditJsonDialog.js.map +1 -1
- package/dist/components/EmptyDashboard/EmptyDashboard.d.ts +3 -3
- package/dist/components/EmptyDashboard/EmptyDashboard.d.ts.map +1 -1
- package/dist/components/EmptyDashboard/EmptyDashboard.js +5 -5
- package/dist/components/EmptyDashboard/EmptyDashboard.js.map +1 -1
- package/dist/components/GridLayout/GridContainer.d.ts +5 -3
- package/dist/components/GridLayout/GridContainer.d.ts.map +1 -1
- package/dist/components/GridLayout/GridContainer.js +16 -11
- package/dist/components/GridLayout/GridContainer.js.map +1 -1
- package/dist/components/GridLayout/GridItemContent.d.ts +2 -2
- package/dist/components/GridLayout/GridItemContent.d.ts.map +1 -1
- package/dist/components/GridLayout/GridItemContent.js +25 -11
- package/dist/components/GridLayout/GridItemContent.js.map +1 -1
- package/dist/components/GridLayout/GridLayout.d.ts +4 -3
- package/dist/components/GridLayout/GridLayout.d.ts.map +1 -1
- package/dist/components/GridLayout/GridLayout.js +65 -16
- package/dist/components/GridLayout/GridLayout.js.map +1 -1
- package/dist/components/GridLayout/GridTitle.d.ts +3 -3
- package/dist/components/GridLayout/GridTitle.d.ts.map +1 -1
- package/dist/components/GridLayout/GridTitle.js +8 -9
- package/dist/components/GridLayout/GridTitle.js.map +1 -1
- package/dist/components/Panel/HeaderIconButton.d.ts +5 -0
- package/dist/components/Panel/HeaderIconButton.d.ts.map +1 -0
- package/dist/components/{TimeRangeControls/index.js → Panel/HeaderIconButton.js} +7 -3
- package/dist/components/Panel/HeaderIconButton.js.map +1 -0
- package/dist/components/Panel/Panel.d.ts +13 -7
- package/dist/components/Panel/Panel.d.ts.map +1 -1
- package/dist/components/Panel/Panel.js +16 -12
- package/dist/components/Panel/Panel.js.map +1 -1
- package/dist/components/Panel/PanelActions.d.ts +16 -0
- package/dist/components/Panel/PanelActions.d.ts.map +1 -0
- package/dist/components/Panel/PanelActions.js +203 -0
- package/dist/components/Panel/PanelActions.js.map +1 -0
- package/dist/components/Panel/PanelContent.d.ts +2 -2
- package/dist/components/Panel/PanelContent.d.ts.map +1 -1
- package/dist/components/Panel/PanelContent.js +6 -6
- package/dist/components/Panel/PanelContent.js.map +1 -1
- package/dist/components/Panel/PanelHeader.d.ts +9 -9
- package/dist/components/Panel/PanelHeader.d.ts.map +1 -1
- package/dist/components/Panel/PanelHeader.js +39 -106
- package/dist/components/Panel/PanelHeader.js.map +1 -1
- package/dist/components/Panel/PanelLinks.d.ts +6 -0
- package/dist/components/Panel/PanelLinks.d.ts.map +1 -0
- package/dist/components/Panel/PanelLinks.js +123 -0
- package/dist/components/Panel/PanelLinks.js.map +1 -0
- package/dist/components/PanelDrawer/PanelDrawer.d.ts +2 -2
- package/dist/components/PanelDrawer/PanelDrawer.d.ts.map +1 -1
- package/dist/components/PanelDrawer/PanelDrawer.js +10 -7
- package/dist/components/PanelDrawer/PanelDrawer.js.map +1 -1
- package/dist/components/PanelDrawer/PanelEditorForm.d.ts +3 -4
- package/dist/components/PanelDrawer/PanelEditorForm.d.ts.map +1 -1
- package/dist/components/PanelDrawer/PanelEditorForm.js +70 -65
- package/dist/components/PanelDrawer/PanelEditorForm.js.map +1 -1
- package/dist/components/PanelDrawer/PanelPreview.d.ts +3 -3
- package/dist/components/PanelDrawer/PanelPreview.d.ts.map +1 -1
- package/dist/components/PanelDrawer/PanelPreview.js +9 -6
- package/dist/components/PanelDrawer/PanelPreview.js.map +1 -1
- package/dist/components/PanelDrawer/usePanelEditor.d.ts +12 -10
- package/dist/components/PanelDrawer/usePanelEditor.d.ts.map +1 -1
- package/dist/components/PanelDrawer/usePanelEditor.js +9 -6
- package/dist/components/PanelDrawer/usePanelEditor.js.map +1 -1
- package/dist/components/PanelGroupDialog/PanelGroupDialog.d.ts +2 -2
- package/dist/components/PanelGroupDialog/PanelGroupDialog.d.ts.map +1 -1
- package/dist/components/PanelGroupDialog/PanelGroupDialog.js +1 -1
- package/dist/components/PanelGroupDialog/PanelGroupDialog.js.map +1 -1
- package/dist/components/PanelGroupDialog/PanelGroupEditorForm.d.ts +2 -2
- package/dist/components/PanelGroupDialog/PanelGroupEditorForm.d.ts.map +1 -1
- package/dist/components/PanelGroupDialog/PanelGroupEditorForm.js +1 -1
- package/dist/components/PanelGroupDialog/PanelGroupEditorForm.js.map +1 -1
- package/dist/components/QuerySummaryTable/QuerySummaryTable.d.ts +2 -2
- package/dist/components/QuerySummaryTable/QuerySummaryTable.d.ts.map +1 -1
- package/dist/components/QuerySummaryTable/QuerySummaryTable.js +5 -7
- package/dist/components/QuerySummaryTable/QuerySummaryTable.js.map +1 -1
- package/dist/components/SaveChangesConfirmationDialog/SaveChangesConfirmationDialog.d.ts +2 -2
- package/dist/components/SaveChangesConfirmationDialog/SaveChangesConfirmationDialog.d.ts.map +1 -1
- package/dist/components/SaveChangesConfirmationDialog/SaveChangesConfirmationDialog.js +8 -10
- package/dist/components/SaveChangesConfirmationDialog/SaveChangesConfirmationDialog.js.map +1 -1
- package/dist/components/SaveDashboardButton/SaveDashboardButton.d.ts +2 -2
- package/dist/components/SaveDashboardButton/SaveDashboardButton.d.ts.map +1 -1
- package/dist/components/SaveDashboardButton/SaveDashboardButton.js +9 -9
- package/dist/components/SaveDashboardButton/SaveDashboardButton.js.map +1 -1
- package/dist/components/Variables/BuiltinVariableAccordions.d.ts +3 -3
- package/dist/components/Variables/BuiltinVariableAccordions.d.ts.map +1 -1
- package/dist/components/Variables/BuiltinVariableAccordions.js +8 -14
- package/dist/components/Variables/BuiltinVariableAccordions.js.map +1 -1
- package/dist/components/Variables/EditVariablesButton.d.ts +2 -2
- package/dist/components/Variables/EditVariablesButton.d.ts.map +1 -1
- package/dist/components/Variables/EditVariablesButton.js +6 -6
- package/dist/components/Variables/EditVariablesButton.js.map +1 -1
- package/dist/components/Variables/{TemplateVariable.d.ts → Variable.d.ts} +6 -6
- package/dist/components/Variables/Variable.d.ts.map +1 -0
- package/dist/components/Variables/{TemplateVariable.js → Variable.js} +49 -57
- package/dist/components/Variables/Variable.js.map +1 -0
- package/dist/components/Variables/VariableEditor.d.ts +3 -3
- package/dist/components/Variables/VariableEditor.d.ts.map +1 -1
- package/dist/components/Variables/VariableEditor.js +40 -47
- package/dist/components/Variables/VariableEditor.js.map +1 -1
- package/dist/components/Variables/VariableList.d.ts +4 -4
- package/dist/components/Variables/VariableList.d.ts.map +1 -1
- package/dist/components/Variables/VariableList.js +21 -20
- package/dist/components/Variables/VariableList.js.map +1 -1
- package/dist/components/Variables/index.d.ts +1 -1
- package/dist/components/Variables/index.d.ts.map +1 -1
- package/dist/components/Variables/index.js +2 -2
- package/dist/components/Variables/index.js.map +1 -1
- package/dist/components/index.d.ts +0 -2
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/index.js +0 -2
- package/dist/components/index.js.map +1 -1
- package/dist/constants/styles.d.ts +4 -2
- package/dist/constants/styles.d.ts.map +1 -1
- package/dist/constants/styles.js +5 -3
- package/dist/constants/styles.js.map +1 -1
- package/dist/constants/user-interface-text.d.ts +3 -2
- package/dist/constants/user-interface-text.d.ts.map +1 -1
- package/dist/constants/user-interface-text.js +3 -2
- package/dist/constants/user-interface-text.js.map +1 -1
- package/dist/context/DashboardProvider/DashboardProvider.d.ts +11 -6
- package/dist/context/DashboardProvider/DashboardProvider.d.ts.map +1 -1
- package/dist/context/DashboardProvider/DashboardProvider.js +22 -15
- package/dist/context/DashboardProvider/DashboardProvider.js.map +1 -1
- package/dist/context/DashboardProvider/DashboardProviderWithQueryParams.d.ts +4 -0
- package/dist/context/DashboardProvider/DashboardProviderWithQueryParams.d.ts.map +1 -0
- package/dist/context/DashboardProvider/DashboardProviderWithQueryParams.js +28 -0
- package/dist/context/DashboardProvider/DashboardProviderWithQueryParams.js.map +1 -0
- package/dist/context/DashboardProvider/common.d.ts +3 -3
- package/dist/context/DashboardProvider/common.d.ts.map +1 -1
- package/dist/context/DashboardProvider/common.js +2 -2
- package/dist/context/DashboardProvider/common.js.map +1 -1
- package/dist/context/DashboardProvider/dashboard-provider-api.d.ts +36 -23
- package/dist/context/DashboardProvider/dashboard-provider-api.d.ts.map +1 -1
- package/dist/context/DashboardProvider/dashboard-provider-api.js +26 -19
- package/dist/context/DashboardProvider/dashboard-provider-api.js.map +1 -1
- package/dist/context/DashboardProvider/delete-panel-group-slice.d.ts +2 -1
- package/dist/context/DashboardProvider/delete-panel-group-slice.d.ts.map +1 -1
- package/dist/context/DashboardProvider/delete-panel-group-slice.js +1 -1
- package/dist/context/DashboardProvider/delete-panel-group-slice.js.map +1 -1
- package/dist/context/DashboardProvider/delete-panel-slice.js +4 -5
- package/dist/context/DashboardProvider/delete-panel-slice.js.map +1 -1
- package/dist/context/DashboardProvider/discard-changes-dialog-slice.js.map +1 -1
- package/dist/context/DashboardProvider/duplicate-panel-slice.js +1 -1
- package/dist/context/DashboardProvider/duplicate-panel-slice.js.map +1 -1
- package/dist/context/DashboardProvider/edit-json-dialog-slice.js.map +1 -1
- package/dist/context/DashboardProvider/index.d.ts +1 -2
- package/dist/context/DashboardProvider/index.d.ts.map +1 -1
- package/dist/context/DashboardProvider/index.js.map +1 -1
- package/dist/context/DashboardProvider/panel-editor-slice.d.ts +2 -9
- package/dist/context/DashboardProvider/panel-editor-slice.d.ts.map +1 -1
- package/dist/context/DashboardProvider/panel-editor-slice.js +8 -13
- package/dist/context/DashboardProvider/panel-editor-slice.js.map +1 -1
- package/dist/context/DashboardProvider/panel-group-editor-slice.d.ts +2 -1
- package/dist/context/DashboardProvider/panel-group-editor-slice.d.ts.map +1 -1
- package/dist/context/DashboardProvider/panel-group-editor-slice.js +1 -2
- package/dist/context/DashboardProvider/panel-group-editor-slice.js.map +1 -1
- package/dist/context/DashboardProvider/panel-group-slice.d.ts +3 -3
- package/dist/context/DashboardProvider/panel-group-slice.d.ts.map +1 -1
- package/dist/context/DashboardProvider/panel-group-slice.js +8 -4
- package/dist/context/DashboardProvider/panel-group-slice.js.map +1 -1
- package/dist/context/DashboardProvider/save-changes-dialog-slice.js.map +1 -1
- package/dist/context/DashboardProvider/view-panel-slice.d.ts +21 -0
- package/dist/context/DashboardProvider/view-panel-slice.d.ts.map +1 -0
- package/dist/context/DashboardProvider/view-panel-slice.js +73 -0
- package/dist/context/DashboardProvider/view-panel-slice.js.map +1 -0
- package/dist/context/DatasourceStoreProvider.d.ts +10 -10
- package/dist/context/DatasourceStoreProvider.d.ts.map +1 -1
- package/dist/context/DatasourceStoreProvider.js +32 -31
- package/dist/context/DatasourceStoreProvider.js.map +1 -1
- package/dist/context/VariableProvider/VariableProvider.d.ts +119 -0
- package/dist/context/VariableProvider/VariableProvider.d.ts.map +1 -0
- package/dist/context/{TemplateVariableProvider/TemplateVariableProvider.js → VariableProvider/VariableProvider.js} +117 -116
- package/dist/context/VariableProvider/VariableProvider.js.map +1 -0
- package/dist/context/{TemplateVariableProvider → VariableProvider}/hydrationUtils.d.ts +1 -1
- package/dist/context/VariableProvider/hydrationUtils.d.ts.map +1 -0
- package/dist/context/{TemplateVariableProvider → VariableProvider}/hydrationUtils.js +9 -12
- package/dist/context/VariableProvider/hydrationUtils.js.map +1 -0
- package/dist/context/VariableProvider/index.d.ts +2 -0
- package/dist/context/VariableProvider/index.d.ts.map +1 -0
- package/dist/{validation → context/VariableProvider}/index.js +2 -2
- package/dist/context/VariableProvider/index.js.map +1 -0
- package/dist/context/{TemplateVariableProvider → VariableProvider}/query-params.d.ts +2 -6
- package/dist/context/VariableProvider/query-params.d.ts.map +1 -0
- package/dist/context/{TemplateVariableProvider → VariableProvider}/query-params.js +1 -1
- package/dist/context/VariableProvider/query-params.js.map +1 -0
- package/dist/context/{TemplateVariableProvider → VariableProvider}/utils.d.ts +1 -1
- package/dist/context/VariableProvider/utils.d.ts.map +1 -0
- package/dist/context/{TemplateVariableProvider → VariableProvider}/utils.js +3 -3
- package/dist/context/VariableProvider/utils.js.map +1 -0
- package/dist/context/index.d.ts +1 -1
- package/dist/context/index.d.ts.map +1 -1
- package/dist/context/index.js +2 -2
- package/dist/context/index.js.map +1 -1
- package/dist/context/useDashboard.d.ts +3 -3
- package/dist/context/useDashboard.d.ts.map +1 -1
- package/dist/context/useDashboard.js +24 -9
- package/dist/context/useDashboard.js.map +1 -1
- package/dist/stories/decorators/WithDashboard.js +1 -1
- package/dist/stories/decorators/WithDashboard.js.map +1 -1
- package/dist/stories/decorators/WithDatasourceStore.js +1 -1
- package/dist/stories/decorators/WithDatasourceStore.js.map +1 -1
- package/dist/stories/decorators/{WithTemplateVariables.js → WithVariables.js} +9 -9
- package/dist/stories/decorators/WithVariables.js.map +1 -0
- package/dist/stories/decorators/index.js +2 -2
- package/dist/stories/decorators/index.js.map +1 -1
- package/dist/test/dashboard-provider.d.ts +1 -1
- package/dist/test/dashboard-provider.d.ts.map +1 -1
- package/dist/test/dashboard-provider.js.map +1 -1
- package/dist/test/datasource-provider.d.ts +2 -2
- package/dist/test/datasource-provider.d.ts.map +1 -1
- package/dist/test/datasource-provider.js.map +1 -1
- package/dist/test/plugin-registry.d.ts.map +1 -1
- package/dist/test/plugin-registry.js +4 -2
- package/dist/test/plugin-registry.js.map +1 -1
- package/dist/test/render.d.ts +2 -2
- package/dist/test/render.d.ts.map +1 -1
- package/dist/test/render.js +10 -8
- package/dist/test/render.js.map +1 -1
- package/dist/test/setup-tests.js.map +1 -1
- package/dist/utils/index.d.ts +0 -1
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +0 -1
- package/dist/utils/index.js.map +1 -1
- package/dist/utils/panelUtils.d.ts +1 -1
- package/dist/utils/panelUtils.d.ts.map +1 -1
- package/dist/utils/panelUtils.js +2 -2
- package/dist/utils/panelUtils.js.map +1 -1
- package/dist/views/ViewDashboard/DashboardApp.d.ts +4 -4
- package/dist/views/ViewDashboard/DashboardApp.d.ts.map +1 -1
- package/dist/views/ViewDashboard/DashboardApp.js +8 -8
- package/dist/views/ViewDashboard/DashboardApp.js.map +1 -1
- package/dist/views/ViewDashboard/ViewDashboard.d.ts +4 -4
- package/dist/views/ViewDashboard/ViewDashboard.d.ts.map +1 -1
- package/dist/views/ViewDashboard/ViewDashboard.js +11 -12
- package/dist/views/ViewDashboard/ViewDashboard.js.map +1 -1
- package/package.json +9 -9
- package/dist/cjs/components/TimeRangeControls/TimeRangeControls.js +0 -210
- package/dist/cjs/components/TimeRangeControls/index.js +0 -30
- package/dist/cjs/components/ToolbarIconButton/ToolbarIconButton.js +0 -40
- package/dist/cjs/components/ToolbarIconButton/index.js +0 -30
- package/dist/cjs/context/TemplateVariableProvider/index.js +0 -30
- package/dist/cjs/utils/time.js +0 -29
- package/dist/components/TimeRangeControls/TimeRangeControls.d.ts +0 -14
- package/dist/components/TimeRangeControls/TimeRangeControls.d.ts.map +0 -1
- package/dist/components/TimeRangeControls/TimeRangeControls.js +0 -186
- package/dist/components/TimeRangeControls/TimeRangeControls.js.map +0 -1
- package/dist/components/TimeRangeControls/index.d.ts +0 -2
- package/dist/components/TimeRangeControls/index.d.ts.map +0 -1
- package/dist/components/TimeRangeControls/index.js.map +0 -1
- package/dist/components/ToolbarIconButton/ToolbarIconButton.d.ts +0 -6
- package/dist/components/ToolbarIconButton/ToolbarIconButton.d.ts.map +0 -1
- package/dist/components/ToolbarIconButton/ToolbarIconButton.js +0 -32
- package/dist/components/ToolbarIconButton/ToolbarIconButton.js.map +0 -1
- package/dist/components/ToolbarIconButton/index.d.ts +0 -2
- package/dist/components/ToolbarIconButton/index.d.ts.map +0 -1
- package/dist/components/ToolbarIconButton/index.js +0 -15
- package/dist/components/ToolbarIconButton/index.js.map +0 -1
- package/dist/components/Variables/TemplateVariable.d.ts.map +0 -1
- package/dist/components/Variables/TemplateVariable.js.map +0 -1
- package/dist/context/TemplateVariableProvider/TemplateVariableProvider.d.ts +0 -77
- package/dist/context/TemplateVariableProvider/TemplateVariableProvider.d.ts.map +0 -1
- package/dist/context/TemplateVariableProvider/TemplateVariableProvider.js.map +0 -1
- package/dist/context/TemplateVariableProvider/hydrationUtils.d.ts.map +0 -1
- package/dist/context/TemplateVariableProvider/hydrationUtils.js.map +0 -1
- package/dist/context/TemplateVariableProvider/index.d.ts +0 -2
- package/dist/context/TemplateVariableProvider/index.d.ts.map +0 -1
- package/dist/context/TemplateVariableProvider/index.js +0 -15
- package/dist/context/TemplateVariableProvider/index.js.map +0 -1
- package/dist/context/TemplateVariableProvider/query-params.d.ts.map +0 -1
- package/dist/context/TemplateVariableProvider/query-params.js.map +0 -1
- package/dist/context/TemplateVariableProvider/utils.d.ts.map +0 -1
- package/dist/context/TemplateVariableProvider/utils.js.map +0 -1
- package/dist/stories/decorators/WithTemplateVariables.js.map +0 -1
- package/dist/utils/time.d.ts +0 -5
- package/dist/utils/time.d.ts.map +0 -1
- package/dist/utils/time.js +0 -23
- package/dist/utils/time.js.map +0 -1
- package/dist/validation/index.d.ts +0 -2
- package/dist/validation/index.d.ts.map +0 -1
- package/dist/validation/index.js.map +0 -1
- package/dist/validation/panel.d.ts +0 -19
- package/dist/validation/panel.d.ts.map +0 -1
- package/dist/validation/panel.js +0 -21
- package/dist/validation/panel.js.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Copyright
|
|
1
|
+
// Copyright 2024 The Perses Authors
|
|
2
2
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
3
3
|
// you may not use this file except in compliance with the License.
|
|
4
4
|
// You may obtain a copy of the License at
|
|
@@ -43,7 +43,7 @@ const _ChevronUp = /*#__PURE__*/ _interop_require_default(require("mdi-material-
|
|
|
43
43
|
const _pluginsystem = require("@perses-dev/plugin-system");
|
|
44
44
|
const _components = require("@perses-dev/components");
|
|
45
45
|
const _context = require("../../context");
|
|
46
|
-
const _hydrationUtils = require("../../context/
|
|
46
|
+
const _hydrationUtils = require("../../context/VariableProvider/hydrationUtils");
|
|
47
47
|
const _BuiltinVariableAccordions = require("./BuiltinVariableAccordions");
|
|
48
48
|
function _interop_require_default(obj) {
|
|
49
49
|
return obj && obj.__esModule ? obj : {
|
|
@@ -51,8 +51,7 @@ function _interop_require_default(obj) {
|
|
|
51
51
|
};
|
|
52
52
|
}
|
|
53
53
|
function getVariableLabelByKind(kind) {
|
|
54
|
-
|
|
55
|
-
return (_VARIABLE_TYPES_find = _pluginsystem.VARIABLE_TYPES.find((variableType)=>variableType.kind === kind)) === null || _VARIABLE_TYPES_find === void 0 ? void 0 : _VARIABLE_TYPES_find.label;
|
|
54
|
+
return _pluginsystem.VARIABLE_TYPES.find((variableType)=>variableType.kind === kind)?.label;
|
|
56
55
|
}
|
|
57
56
|
function getValidation(variableDefinitions) {
|
|
58
57
|
const errors = [];
|
|
@@ -77,14 +76,14 @@ function VariableEditor(props) {
|
|
|
77
76
|
]);
|
|
78
77
|
const [variableState] = (0, _react.useMemo)(()=>{
|
|
79
78
|
return [
|
|
80
|
-
(0, _hydrationUtils.
|
|
79
|
+
(0, _hydrationUtils.hydrateVariableDefinitionStates)(variableDefinitions, {}, externalVariableDefinitions)
|
|
81
80
|
];
|
|
82
81
|
}, [
|
|
83
82
|
externalVariableDefinitions,
|
|
84
83
|
variableDefinitions
|
|
85
84
|
]);
|
|
86
85
|
const currentEditingVariableDefinition = typeof variableEditIdx === 'number' && variableDefinitions[variableEditIdx];
|
|
87
|
-
const { openDiscardChangesConfirmationDialog
|
|
86
|
+
const { openDiscardChangesConfirmationDialog, closeDiscardChangesConfirmationDialog } = (0, _context.useDiscardChangesConfirmationDialog)();
|
|
88
87
|
const handleCancel = ()=>{
|
|
89
88
|
if (JSON.stringify(props.variableDefinitions) !== JSON.stringify(variableDefinitions)) {
|
|
90
89
|
openDiscardChangesConfirmationDialog({
|
|
@@ -164,25 +163,27 @@ function VariableEditor(props) {
|
|
|
164
163
|
draft.push(v);
|
|
165
164
|
});
|
|
166
165
|
};
|
|
167
|
-
var _getVariableLabelByKind, _v_spec_display_description, _getVariableLabelByKind1, _v_spec_display_description1;
|
|
168
166
|
return /*#__PURE__*/ (0, _jsxruntime.jsxs)(_jsxruntime.Fragment, {
|
|
169
167
|
children: [
|
|
170
|
-
currentEditingVariableDefinition && /*#__PURE__*/ (0, _jsxruntime.jsx)(_pluginsystem.
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
168
|
+
currentEditingVariableDefinition && /*#__PURE__*/ (0, _jsxruntime.jsx)(_pluginsystem.ValidationProvider, {
|
|
169
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_pluginsystem.VariableEditorForm, {
|
|
170
|
+
initialVariableDefinition: currentEditingVariableDefinition,
|
|
171
|
+
action: variableFormAction,
|
|
172
|
+
isDraft: true,
|
|
173
|
+
onActionChange: setVariableFormAction,
|
|
174
|
+
onSave: (definition)=>{
|
|
175
|
+
setVariableDefinitions((draft)=>{
|
|
176
|
+
draft[variableEditIdx] = definition;
|
|
177
|
+
setVariableEditIdx(null);
|
|
178
|
+
});
|
|
179
|
+
},
|
|
180
|
+
onClose: ()=>{
|
|
181
|
+
if (variableFormAction === 'create') {
|
|
182
|
+
removeVariable(variableEditIdx);
|
|
183
|
+
}
|
|
177
184
|
setVariableEditIdx(null);
|
|
178
|
-
});
|
|
179
|
-
},
|
|
180
|
-
onClose: ()=>{
|
|
181
|
-
if (variableFormAction === 'create') {
|
|
182
|
-
removeVariable(variableEditIdx);
|
|
183
185
|
}
|
|
184
|
-
|
|
185
|
-
}
|
|
186
|
+
})
|
|
186
187
|
}),
|
|
187
188
|
!currentEditingVariableDefinition && /*#__PURE__*/ (0, _jsxruntime.jsxs)(_jsxruntime.Fragment, {
|
|
188
189
|
children: [
|
|
@@ -266,15 +267,13 @@ function VariableEditor(props) {
|
|
|
266
267
|
})
|
|
267
268
|
}),
|
|
268
269
|
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.TableBody, {
|
|
269
|
-
children: variableDefinitions.map((v, idx)
|
|
270
|
-
var _v_spec_display, _v_spec_display1;
|
|
271
|
-
/*#__PURE__*/ return (0, _jsxruntime.jsxs)(_material.TableRow, {
|
|
270
|
+
children: variableDefinitions.map((v, idx)=>/*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.TableRow, {
|
|
272
271
|
children: [
|
|
273
272
|
/*#__PURE__*/ (0, _jsxruntime.jsx)(TableCell, {
|
|
274
273
|
component: "th",
|
|
275
274
|
scope: "row",
|
|
276
275
|
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Switch, {
|
|
277
|
-
checked:
|
|
276
|
+
checked: v.spec.display?.hidden !== true,
|
|
278
277
|
onChange: (e)=>{
|
|
279
278
|
toggleVariableVisibility(idx, e.target.checked);
|
|
280
279
|
}
|
|
@@ -294,10 +293,10 @@ function VariableEditor(props) {
|
|
|
294
293
|
})
|
|
295
294
|
}),
|
|
296
295
|
/*#__PURE__*/ (0, _jsxruntime.jsx)(TableCell, {
|
|
297
|
-
children:
|
|
296
|
+
children: getVariableLabelByKind(v.kind) ?? v.kind
|
|
298
297
|
}),
|
|
299
298
|
/*#__PURE__*/ (0, _jsxruntime.jsx)(TableCell, {
|
|
300
|
-
children:
|
|
299
|
+
children: v.spec.display?.description ?? ''
|
|
301
300
|
}),
|
|
302
301
|
/*#__PURE__*/ (0, _jsxruntime.jsxs)(TableCell, {
|
|
303
302
|
align: "right",
|
|
@@ -326,8 +325,7 @@ function VariableEditor(props) {
|
|
|
326
325
|
]
|
|
327
326
|
})
|
|
328
327
|
]
|
|
329
|
-
}, v.spec.name)
|
|
330
|
-
})
|
|
328
|
+
}, v.spec.name))
|
|
331
329
|
})
|
|
332
330
|
]
|
|
333
331
|
})
|
|
@@ -346,8 +344,7 @@ function VariableEditor(props) {
|
|
|
346
344
|
})
|
|
347
345
|
]
|
|
348
346
|
}),
|
|
349
|
-
externalVariableDefinitions && !externalVariableDefinitions.every((v)=>v.definitions.length === 0) && externalVariableDefinitions.map((extVar)=>{
|
|
350
|
-
return extVar.definitions.length > 0 && /*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Accordion, {
|
|
347
|
+
externalVariableDefinitions && !externalVariableDefinitions.every((v)=>v.definitions.length === 0) && externalVariableDefinitions.map((extVar, key)=>extVar.definitions.length > 0 && /*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Accordion, {
|
|
351
348
|
sx: (theme)=>({
|
|
352
349
|
'.MuiAccordionSummary-root': {
|
|
353
350
|
backgroundColor: theme.palette.background.lighter
|
|
@@ -428,15 +425,13 @@ function VariableEditor(props) {
|
|
|
428
425
|
})
|
|
429
426
|
}),
|
|
430
427
|
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.TableBody, {
|
|
431
|
-
children: extVar.definitions.map((v)
|
|
432
|
-
var _v_spec_display, _v_spec_display1;
|
|
433
|
-
/*#__PURE__*/ return (0, _jsxruntime.jsxs)(_material.TableRow, {
|
|
428
|
+
children: extVar.definitions.map((v)=>/*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.TableRow, {
|
|
434
429
|
children: [
|
|
435
430
|
/*#__PURE__*/ (0, _jsxruntime.jsx)(TableCell, {
|
|
436
431
|
component: "th",
|
|
437
432
|
scope: "row",
|
|
438
433
|
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Switch, {
|
|
439
|
-
checked:
|
|
434
|
+
checked: v.spec.display?.hidden !== true,
|
|
440
435
|
disabled: true
|
|
441
436
|
})
|
|
442
437
|
}),
|
|
@@ -455,10 +450,10 @@ function VariableEditor(props) {
|
|
|
455
450
|
})
|
|
456
451
|
}),
|
|
457
452
|
/*#__PURE__*/ (0, _jsxruntime.jsx)(TableCell, {
|
|
458
|
-
children:
|
|
453
|
+
children: getVariableLabelByKind(v.kind) ?? v.kind
|
|
459
454
|
}),
|
|
460
455
|
/*#__PURE__*/ (0, _jsxruntime.jsx)(TableCell, {
|
|
461
|
-
children:
|
|
456
|
+
children: v.spec.display?.description ?? ''
|
|
462
457
|
}),
|
|
463
458
|
/*#__PURE__*/ (0, _jsxruntime.jsxs)(TableCell, {
|
|
464
459
|
align: "right",
|
|
@@ -492,16 +487,14 @@ function VariableEditor(props) {
|
|
|
492
487
|
]
|
|
493
488
|
})
|
|
494
489
|
]
|
|
495
|
-
}, v.spec.name)
|
|
496
|
-
})
|
|
490
|
+
}, v.spec.name))
|
|
497
491
|
})
|
|
498
492
|
]
|
|
499
493
|
})
|
|
500
494
|
})
|
|
501
495
|
})
|
|
502
496
|
]
|
|
503
|
-
})
|
|
504
|
-
}),
|
|
497
|
+
}, key)),
|
|
505
498
|
builtinVariableDefinitions && /*#__PURE__*/ (0, _jsxruntime.jsx)(_BuiltinVariableAccordions.BuiltinVariableAccordions, {
|
|
506
499
|
builtinVariableDefinitions: builtinVariableDefinitions
|
|
507
500
|
})
|
|
@@ -513,20 +506,20 @@ function VariableEditor(props) {
|
|
|
513
506
|
]
|
|
514
507
|
});
|
|
515
508
|
}
|
|
516
|
-
const TableCell = (0, _material.styled)(_material.TableCell)(({ theme
|
|
509
|
+
const TableCell = (0, _material.styled)(_material.TableCell)(({ theme })=>({
|
|
517
510
|
borderBottom: `solid 1px ${theme.palette.divider}`
|
|
518
511
|
}));
|
|
519
512
|
function VariableName(props) {
|
|
520
|
-
const { name
|
|
513
|
+
const { name, state } = props;
|
|
521
514
|
return /*#__PURE__*/ (0, _jsxruntime.jsxs)(_jsxruntime.Fragment, {
|
|
522
515
|
children: [
|
|
523
|
-
!
|
|
524
|
-
!
|
|
516
|
+
!state?.overridden && `${name} `,
|
|
517
|
+
!state?.overridden && state?.overriding && /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Box, {
|
|
525
518
|
fontWeight: "normal",
|
|
526
519
|
color: (theme)=>theme.palette.primary.main,
|
|
527
520
|
children: "(overriding)"
|
|
528
521
|
}),
|
|
529
|
-
|
|
522
|
+
state?.overridden && /*#__PURE__*/ (0, _jsxruntime.jsxs)(_jsxruntime.Fragment, {
|
|
530
523
|
children: [
|
|
531
524
|
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Box, {
|
|
532
525
|
color: (theme)=>theme.palette.grey[500],
|
|
@@ -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
|
|
@@ -21,47 +21,48 @@ function _export(target, all) {
|
|
|
21
21
|
});
|
|
22
22
|
}
|
|
23
23
|
_export(exports, {
|
|
24
|
-
|
|
25
|
-
return
|
|
24
|
+
VariableList: function() {
|
|
25
|
+
return VariableList;
|
|
26
26
|
},
|
|
27
|
-
|
|
28
|
-
return
|
|
27
|
+
VariableListItem: function() {
|
|
28
|
+
return VariableListItem;
|
|
29
29
|
}
|
|
30
30
|
});
|
|
31
31
|
const _jsxruntime = require("react/jsx-runtime");
|
|
32
32
|
const _material = require("@mui/material");
|
|
33
33
|
const _context = require("../../context");
|
|
34
34
|
const _constants = require("../../constants");
|
|
35
|
-
const
|
|
36
|
-
function
|
|
37
|
-
const variableDefinitions = (0, _context.
|
|
38
|
-
const externalVariableDefinitions = (0, _context.
|
|
35
|
+
const _Variable = require("./Variable");
|
|
36
|
+
function VariableList() {
|
|
37
|
+
const variableDefinitions = (0, _context.useVariableDefinitions)();
|
|
38
|
+
const externalVariableDefinitions = (0, _context.useExternalVariableDefinitions)();
|
|
39
39
|
return /*#__PURE__*/ (0, _jsxruntime.jsxs)(_jsxruntime.Fragment, {
|
|
40
40
|
children: [
|
|
41
41
|
externalVariableDefinitions.slice().reverse() // We reverse to have the most prioritized on top
|
|
42
|
-
.map((def)=>def.definitions.map((v)=>/*#__PURE__*/ (0, _jsxruntime.jsx)(
|
|
42
|
+
.map((def)=>def.definitions.map((v)=>/*#__PURE__*/ (0, _jsxruntime.jsx)(VariableListItem, {
|
|
43
43
|
spec: v.spec,
|
|
44
44
|
source: def.source
|
|
45
45
|
}, v.spec.name + def.source))),
|
|
46
|
-
variableDefinitions.map((v)=>/*#__PURE__*/ (0, _jsxruntime.jsx)(
|
|
46
|
+
variableDefinitions.map((v)=>/*#__PURE__*/ (0, _jsxruntime.jsx)(VariableListItem, {
|
|
47
47
|
spec: v.spec
|
|
48
48
|
}, v.spec.name))
|
|
49
49
|
]
|
|
50
50
|
});
|
|
51
51
|
}
|
|
52
|
-
function
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
52
|
+
function VariableListItem({ spec, source }) {
|
|
53
|
+
const ctx = (0, _context.useVariableDefinitionAndState)(spec.name, source);
|
|
54
|
+
if (ctx.state?.overridden) {
|
|
55
|
+
return null;
|
|
56
|
+
}
|
|
56
57
|
return /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Box, {
|
|
57
|
-
display:
|
|
58
|
-
minWidth: `${_constants.
|
|
59
|
-
maxWidth: `${_constants.
|
|
58
|
+
display: spec.display?.hidden ? 'none' : undefined,
|
|
59
|
+
minWidth: `${_constants.MIN_VARIABLE_WIDTH}px`,
|
|
60
|
+
maxWidth: `${_constants.MAX_VARIABLE_WIDTH}px`,
|
|
60
61
|
flexShrink: 0,
|
|
61
|
-
"data-testid": '
|
|
62
|
-
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(
|
|
62
|
+
"data-testid": 'variable-' + spec.name,
|
|
63
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_Variable.Variable, {
|
|
63
64
|
name: spec.name,
|
|
64
65
|
source: source
|
|
65
|
-
}, (
|
|
66
|
-
}, (
|
|
66
|
+
}, (spec.name + source) ?? '')
|
|
67
|
+
}, (spec.name + source) ?? '');
|
|
67
68
|
}
|
|
@@ -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
|
|
@@ -16,7 +16,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
16
16
|
});
|
|
17
17
|
_export_star(require("./BuiltinVariableAccordions"), exports);
|
|
18
18
|
_export_star(require("./EditVariablesButton"), exports);
|
|
19
|
-
_export_star(require("./
|
|
19
|
+
_export_star(require("./Variable"), exports);
|
|
20
20
|
_export_star(require("./VariableEditor"), exports);
|
|
21
21
|
_export_star(require("./VariableList"), exports);
|
|
22
22
|
function _export_star(from, to) {
|
|
@@ -34,8 +34,6 @@ _export_star(require("./PanelGroupDialog"), exports);
|
|
|
34
34
|
_export_star(require("./QuerySummaryTable"), exports);
|
|
35
35
|
_export_star(require("./SaveChangesConfirmationDialog"), exports);
|
|
36
36
|
_export_star(require("./SaveDashboardButton"), exports);
|
|
37
|
-
_export_star(require("./TimeRangeControls"), exports);
|
|
38
|
-
_export_star(require("./ToolbarIconButton"), exports);
|
|
39
37
|
_export_star(require("./Variables"), exports);
|
|
40
38
|
function _export_star(from, to) {
|
|
41
39
|
Object.keys(from).forEach(function(k) {
|
|
@@ -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
|
|
@@ -21,14 +21,20 @@ function _export(target, all) {
|
|
|
21
21
|
});
|
|
22
22
|
}
|
|
23
23
|
_export(exports, {
|
|
24
|
-
|
|
25
|
-
return
|
|
24
|
+
HEADER_ACTIONS_CONTAINER_NAME: function() {
|
|
25
|
+
return HEADER_ACTIONS_CONTAINER_NAME;
|
|
26
|
+
},
|
|
27
|
+
HEADER_ACTIONS_MIN_WIDTH: function() {
|
|
28
|
+
return HEADER_ACTIONS_MIN_WIDTH;
|
|
26
29
|
},
|
|
27
|
-
|
|
28
|
-
return
|
|
30
|
+
MAX_VARIABLE_WIDTH: function() {
|
|
31
|
+
return MAX_VARIABLE_WIDTH;
|
|
29
32
|
},
|
|
30
|
-
|
|
31
|
-
return
|
|
33
|
+
MIN_VARIABLE_WIDTH: function() {
|
|
34
|
+
return MIN_VARIABLE_WIDTH;
|
|
35
|
+
},
|
|
36
|
+
editButtonStyle: function() {
|
|
37
|
+
return editButtonStyle;
|
|
32
38
|
}
|
|
33
39
|
});
|
|
34
40
|
const editButtonStyle = {
|
|
@@ -38,5 +44,7 @@ const editButtonStyle = {
|
|
|
38
44
|
marginRight: 0.5
|
|
39
45
|
}
|
|
40
46
|
};
|
|
41
|
-
const
|
|
42
|
-
const
|
|
47
|
+
const MIN_VARIABLE_WIDTH = 120;
|
|
48
|
+
const MAX_VARIABLE_WIDTH = 500;
|
|
49
|
+
const HEADER_ACTIONS_MIN_WIDTH = 200;
|
|
50
|
+
const HEADER_ACTIONS_CONTAINER_NAME = 'header-actions-container';
|
|
@@ -21,11 +21,11 @@ function _export(target, all) {
|
|
|
21
21
|
});
|
|
22
22
|
}
|
|
23
23
|
_export(exports, {
|
|
24
|
-
TOOLTIP_TEXT: function() {
|
|
25
|
-
return TOOLTIP_TEXT;
|
|
26
|
-
},
|
|
27
24
|
ARIA_LABEL_TEXT: function() {
|
|
28
25
|
return ARIA_LABEL_TEXT;
|
|
26
|
+
},
|
|
27
|
+
TOOLTIP_TEXT: function() {
|
|
28
|
+
return TOOLTIP_TEXT;
|
|
29
29
|
}
|
|
30
30
|
});
|
|
31
31
|
const TOOLTIP_TEXT = {
|
|
@@ -36,8 +36,6 @@ const TOOLTIP_TEXT = {
|
|
|
36
36
|
editDatasources: 'Edit datasources',
|
|
37
37
|
editJson: 'Edit JSON',
|
|
38
38
|
editVariables: 'Edit variables',
|
|
39
|
-
refreshDashboard: 'Refresh dashboard',
|
|
40
|
-
refreshDashboardInterval: 'Auto refresh interval',
|
|
41
39
|
viewJson: 'View JSON',
|
|
42
40
|
// Group buttons
|
|
43
41
|
addPanelToGroup: 'Add panel to group',
|
|
@@ -46,6 +44,7 @@ const TOOLTIP_TEXT = {
|
|
|
46
44
|
moveGroupDown: 'Move group down',
|
|
47
45
|
moveGroupUp: 'Move group up',
|
|
48
46
|
// Panel buttons
|
|
47
|
+
viewPanel: 'Toggle View Mode',
|
|
49
48
|
editPanel: 'Edit',
|
|
50
49
|
duplicatePanel: 'Duplicate',
|
|
51
50
|
deletePanel: 'Delete',
|
|
@@ -62,8 +61,10 @@ const ARIA_LABEL_TEXT = {
|
|
|
62
61
|
moveGroupDown: (groupName)=>`move group ${groupName} down`,
|
|
63
62
|
moveGroupUp: (groupName)=>`move group ${groupName} up`,
|
|
64
63
|
// Panel buttons
|
|
64
|
+
viewPanel: (panelName)=>`toggle panel ${panelName} view mode`,
|
|
65
65
|
editPanel: (panelName)=>`edit panel ${panelName}`,
|
|
66
66
|
duplicatePanel: (panelName)=>`duplicate panel ${panelName}`,
|
|
67
67
|
deletePanel: (panelName)=>`delete panel ${panelName}`,
|
|
68
|
+
showPanelActions: (panelName)=>`show panel actions for ${panelName} `,
|
|
68
69
|
movePanel: (panelName)=>`move panel ${panelName}`
|
|
69
70
|
};
|
|
@@ -24,15 +24,16 @@ _export(exports, {
|
|
|
24
24
|
DashboardContext: function() {
|
|
25
25
|
return DashboardContext;
|
|
26
26
|
},
|
|
27
|
-
useDashboardStore: function() {
|
|
28
|
-
return useDashboardStore;
|
|
29
|
-
},
|
|
30
27
|
DashboardProvider: function() {
|
|
31
28
|
return DashboardProvider;
|
|
29
|
+
},
|
|
30
|
+
useDashboardStore: function() {
|
|
31
|
+
return useDashboardStore;
|
|
32
32
|
}
|
|
33
33
|
});
|
|
34
34
|
const _jsxruntime = require("react/jsx-runtime");
|
|
35
35
|
const _zustand = require("zustand");
|
|
36
|
+
const _traditional = require("zustand/traditional");
|
|
36
37
|
const _middleware = require("zustand/middleware");
|
|
37
38
|
const _immer = require("zustand/middleware/immer");
|
|
38
39
|
const _shallow = require("zustand/shallow");
|
|
@@ -50,27 +51,27 @@ const _savechangesdialogslice = require("./save-changes-dialog-slice");
|
|
|
50
51
|
const _duplicatepanelslice = require("./duplicate-panel-slice");
|
|
51
52
|
const _editjsondialogslice = require("./edit-json-dialog-slice");
|
|
52
53
|
const _common = require("./common");
|
|
54
|
+
const _viewpanelslice = require("./view-panel-slice");
|
|
53
55
|
const DashboardContext = /*#__PURE__*/ (0, _react.createContext)(undefined);
|
|
54
56
|
function useDashboardStore(selector) {
|
|
55
57
|
const store = (0, _react.useContext)(DashboardContext);
|
|
56
58
|
if (store === undefined) {
|
|
57
59
|
throw new Error('No DashboardContext found. Did you forget a Provider?');
|
|
58
60
|
}
|
|
59
|
-
return (0,
|
|
61
|
+
return (0, _traditional.useStoreWithEqualityFn)(store, selector, _shallow.shallow);
|
|
60
62
|
}
|
|
61
63
|
function DashboardProvider(props) {
|
|
62
64
|
const createDashboardStore = (0, _react.useCallback)(initStore, [
|
|
63
65
|
props
|
|
64
66
|
]);
|
|
65
67
|
// load plugin to retrieve initial spec if default panel kind is defined
|
|
66
|
-
const { defaultPluginKinds
|
|
67
|
-
|
|
68
|
-
const
|
|
69
|
-
const { data: plugin } = (0, _pluginsystem.usePlugin)('Panel', defaultPanelKind);
|
|
68
|
+
const { defaultPluginKinds } = (0, _pluginsystem.usePluginRegistry)();
|
|
69
|
+
const defaultPanelKind = defaultPluginKinds?.['Panel'] ?? '';
|
|
70
|
+
const { data: plugin } = (0, _pluginsystem.usePlugin)('Panel', defaultPanelKind);
|
|
70
71
|
const [store] = (0, _react.useState)(createDashboardStore(props)); // prevent calling createDashboardStore every time it rerenders
|
|
71
72
|
(0, _react.useEffect)(()=>{
|
|
72
73
|
if (plugin === undefined) return;
|
|
73
|
-
const defaultPanelSpec = plugin.createInitialOptions();
|
|
74
|
+
const defaultPanelSpec = plugin.createInitialOptions ? plugin.createInitialOptions() : {};
|
|
74
75
|
// set default panel kind, spec, and queries for add panel editor
|
|
75
76
|
store.setState({
|
|
76
77
|
initialValues: {
|
|
@@ -88,12 +89,13 @@ function DashboardProvider(props) {
|
|
|
88
89
|
});
|
|
89
90
|
}
|
|
90
91
|
function initStore(props) {
|
|
91
|
-
const { initialState: { dashboardResource ,
|
|
92
|
-
const { spec: { display
|
|
93
|
-
|
|
92
|
+
const { initialState: { dashboardResource, isEditMode, viewPanelRef, setViewPanelRef } } = props;
|
|
93
|
+
const { kind, metadata, spec: { display, duration, refreshInterval = _core.DEFAULT_REFRESH_INTERVAL, datasources } } = dashboardResource;
|
|
94
|
+
const ttl = 'ttl' in dashboardResource.spec ? dashboardResource.spec.ttl : undefined;
|
|
95
|
+
let { spec: { layouts, panels } } = dashboardResource;
|
|
94
96
|
// Set fallbacks in case the frontend is used with a non-Perses backend
|
|
95
|
-
layouts = layouts
|
|
96
|
-
panels = panels
|
|
97
|
+
layouts = layouts ?? [];
|
|
98
|
+
panels = panels ?? {};
|
|
97
99
|
const store = (0, _zustand.createStore)()((0, _immer.immer)((0, _middleware.devtools)((...args)=>{
|
|
98
100
|
const [set] = args;
|
|
99
101
|
return {
|
|
@@ -104,29 +106,34 @@ function initStore(props) {
|
|
|
104
106
|
...(0, _paneleditorslice.createPanelEditorSlice)()(...args),
|
|
105
107
|
...(0, _deletepanelslice.createDeletePanelSlice)()(...args),
|
|
106
108
|
...(0, _duplicatepanelslice.createDuplicatePanelSlice)()(...args),
|
|
109
|
+
...(0, _viewpanelslice.createViewPanelSlice)(viewPanelRef, setViewPanelRef)(...args),
|
|
107
110
|
/* General */ ...(0, _discardchangesdialogslice.createDiscardChangesDialogSlice)(...args),
|
|
108
111
|
...(0, _editjsondialogslice.createEditJsonDialogSlice)(...args),
|
|
109
112
|
...(0, _savechangesdialogslice.createSaveChangesDialogSlice)(...args),
|
|
113
|
+
kind,
|
|
110
114
|
metadata,
|
|
111
115
|
display,
|
|
112
116
|
duration,
|
|
113
117
|
refreshInterval,
|
|
114
118
|
datasources,
|
|
119
|
+
ttl,
|
|
115
120
|
isEditMode: !!isEditMode,
|
|
116
121
|
setEditMode: (isEditMode)=>set({
|
|
117
122
|
isEditMode
|
|
118
123
|
}),
|
|
119
|
-
setDashboard: ({ metadata
|
|
124
|
+
setDashboard: ({ kind, metadata, spec: { display, panels = {}, layouts = [], duration, refreshInterval, datasources = {} } })=>{
|
|
120
125
|
set((state)=>{
|
|
126
|
+
state.kind = kind;
|
|
121
127
|
state.metadata = metadata;
|
|
122
128
|
state.display = display;
|
|
123
129
|
state.panels = panels;
|
|
124
|
-
const { panelGroups
|
|
130
|
+
const { panelGroups, panelGroupOrder } = (0, _panelgroupslice.convertLayoutsToPanelGroups)(layouts);
|
|
125
131
|
state.panelGroups = panelGroups;
|
|
126
132
|
state.panelGroupOrder = panelGroupOrder;
|
|
127
133
|
state.duration = duration;
|
|
128
|
-
state.refreshInterval = refreshInterval
|
|
134
|
+
state.refreshInterval = refreshInterval ?? _core.DEFAULT_REFRESH_INTERVAL;
|
|
129
135
|
state.datasources = datasources;
|
|
136
|
+
// TODO: add ttl here to e.g allow edition from JSON view, but probably requires quite some refactoring
|
|
130
137
|
});
|
|
131
138
|
}
|
|
132
139
|
};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
// Copyright 2024 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
|
+
Object.defineProperty(exports, "DashboardProviderWithQueryParams", {
|
|
18
|
+
enumerable: true,
|
|
19
|
+
get: function() {
|
|
20
|
+
return DashboardProviderWithQueryParams;
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
const _jsxruntime = require("react/jsx-runtime");
|
|
24
|
+
const _usequeryparams = require("use-query-params");
|
|
25
|
+
const _DashboardProvider = require("./DashboardProvider");
|
|
26
|
+
function DashboardProviderWithQueryParams({ children, initialState }) {
|
|
27
|
+
const [viewPanelRef, setViewPanelRef] = (0, _usequeryparams.useQueryParam)('viewPanelRef', _usequeryparams.StringParam);
|
|
28
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsx)(_DashboardProvider.DashboardProvider, {
|
|
29
|
+
initialState: {
|
|
30
|
+
viewPanelRef: viewPanelRef ?? undefined,
|
|
31
|
+
setViewPanelRef: setViewPanelRef,
|
|
32
|
+
...initialState
|
|
33
|
+
},
|
|
34
|
+
children: children
|
|
35
|
+
});
|
|
36
|
+
}
|
|
@@ -21,11 +21,11 @@ function _export(target, all) {
|
|
|
21
21
|
});
|
|
22
22
|
}
|
|
23
23
|
_export(exports, {
|
|
24
|
-
generateId: function() {
|
|
25
|
-
return generateId;
|
|
26
|
-
},
|
|
27
24
|
createPanelDefinition: function() {
|
|
28
25
|
return createPanelDefinition;
|
|
26
|
+
},
|
|
27
|
+
generateId: function() {
|
|
28
|
+
return generateId;
|
|
29
29
|
}
|
|
30
30
|
});
|
|
31
31
|
function generateId() {
|
|
@@ -43,8 +43,8 @@ function createPanelDefinition(defaultPanelKind, defaultPanelSpec) {
|
|
|
43
43
|
description: undefined
|
|
44
44
|
},
|
|
45
45
|
plugin: {
|
|
46
|
-
kind: defaultPanelKind
|
|
47
|
-
spec: defaultPanelSpec
|
|
46
|
+
kind: defaultPanelKind ?? '',
|
|
47
|
+
spec: defaultPanelSpec ?? {}
|
|
48
48
|
},
|
|
49
49
|
queries: []
|
|
50
50
|
}
|