@perses-dev/dashboards 0.0.0-snapshot-scatter-chart-embed-8efdfab → 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 +1 -1
- package/dist/cjs/components/AddPanelButton/AddPanelButton.js +2 -2
- package/dist/cjs/components/Dashboard/Dashboard.js +1 -1
- package/dist/cjs/components/DashboardStickyToolbar/DashboardStickyToolbar.js +2 -2
- package/dist/cjs/components/DashboardToolbar/DashboardToolbar.js +5 -5
- package/dist/cjs/components/Datasources/DatasourceEditor.js +2 -3
- package/dist/cjs/components/Datasources/EditDatasourcesButton.js +10 -4
- package/dist/cjs/components/DeletePanelDialog/DeletePanelDialog.js +4 -4
- package/dist/cjs/components/DeletePanelGroupDialog/DeletePanelGroupDialog.js +1 -1
- 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 +14 -7
- package/dist/cjs/components/EmptyDashboard/EmptyDashboard.js +3 -3
- package/dist/cjs/components/GridLayout/GridContainer.js +1 -1
- package/dist/cjs/components/GridLayout/GridItemContent.js +6 -7
- package/dist/cjs/components/GridLayout/GridLayout.js +4 -4
- package/dist/cjs/components/GridLayout/GridTitle.js +5 -6
- package/dist/cjs/components/Panel/Panel.js +2 -2
- package/dist/cjs/components/Panel/PanelContent.js +2 -2
- package/dist/cjs/components/Panel/PanelHeader.js +2 -2
- package/dist/cjs/components/PanelDrawer/PanelEditorForm.js +18 -15
- package/dist/cjs/components/PanelDrawer/PanelPreview.js +2 -3
- package/dist/cjs/components/PanelDrawer/usePanelEditor.js +2 -2
- package/dist/cjs/components/PanelGroupDialog/PanelGroupEditorForm.js +1 -1
- package/dist/cjs/components/QuerySummaryTable/QuerySummaryTable.js +2 -2
- package/dist/cjs/components/SaveChangesConfirmationDialog/SaveChangesConfirmationDialog.js +4 -4
- package/dist/cjs/components/SaveDashboardButton/SaveDashboardButton.js +7 -7
- package/dist/cjs/components/Variables/BuiltinVariableAccordions.js +7 -6
- package/dist/cjs/components/Variables/EditVariablesButton.js +2 -2
- package/dist/cjs/components/Variables/TemplateVariable.js +20 -11
- package/dist/cjs/components/Variables/VariableEditor.js +13 -14
- package/dist/cjs/components/Variables/VariableList.js +1 -1
- package/dist/cjs/components/index.js +0 -2
- package/dist/cjs/constants/styles.js +4 -4
- package/dist/cjs/constants/user-interface-text.js +3 -5
- package/dist/cjs/context/DashboardProvider/DashboardProvider.js +15 -10
- package/dist/cjs/context/DashboardProvider/common.js +3 -3
- package/dist/cjs/context/DashboardProvider/dashboard-provider-api.js +40 -40
- package/dist/cjs/context/DashboardProvider/delete-panel-group-slice.js +1 -1
- package/dist/cjs/context/DashboardProvider/delete-panel-slice.js +3 -3
- package/dist/cjs/context/DashboardProvider/duplicate-panel-slice.js +1 -1
- package/dist/cjs/context/DashboardProvider/panel-editor-slice.js +4 -6
- package/dist/cjs/context/DashboardProvider/panel-group-slice.js +6 -6
- package/dist/cjs/context/DatasourceStoreProvider.js +15 -9
- package/dist/cjs/context/TemplateVariableProvider/TemplateVariableProvider.js +81 -77
- package/dist/cjs/context/TemplateVariableProvider/query-params.js +7 -7
- package/dist/cjs/context/TemplateVariableProvider/utils.js +3 -3
- package/dist/cjs/context/useDashboard.js +21 -6
- package/dist/cjs/test/dashboard-provider.js +3 -3
- package/dist/cjs/test/datasource-provider.js +4 -4
- package/dist/cjs/test/render.js +1 -1
- package/dist/cjs/utils/index.js +0 -1
- package/dist/cjs/utils/panelUtils.js +5 -5
- package/dist/cjs/views/ViewDashboard/DashboardApp.js +5 -5
- package/dist/cjs/views/ViewDashboard/ViewDashboard.js +3 -3
- 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 +1 -1
- package/dist/components/AddGroupButton/AddGroupButton.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 +2 -2
- package/dist/components/AddPanelButton/AddPanelButton.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/DashboardStickyToolbar/DashboardStickyToolbar.d.ts +1 -2
- package/dist/components/DashboardStickyToolbar/DashboardStickyToolbar.d.ts.map +1 -1
- package/dist/components/DashboardStickyToolbar/DashboardStickyToolbar.js +1 -1
- package/dist/components/DashboardStickyToolbar/DashboardStickyToolbar.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 +4 -4
- package/dist/components/DashboardToolbar/DashboardToolbar.js.map +1 -1
- package/dist/components/Datasources/DatasourceEditor.d.ts +1 -2
- package/dist/components/Datasources/DatasourceEditor.d.ts.map +1 -1
- package/dist/components/Datasources/DatasourceEditor.js +2 -3
- package/dist/components/Datasources/DatasourceEditor.js.map +1 -1
- package/dist/components/Datasources/EditDatasourcesButton.d.ts +1 -2
- package/dist/components/Datasources/EditDatasourcesButton.d.ts.map +1 -1
- package/dist/components/Datasources/EditDatasourcesButton.js +10 -4
- package/dist/components/Datasources/EditDatasourcesButton.js.map +1 -1
- 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/DeletePanelGroupDialog/DeletePanelGroupDialog.d.ts +1 -2
- package/dist/components/DeletePanelGroupDialog/DeletePanelGroupDialog.d.ts.map +1 -1
- package/dist/components/DeletePanelGroupDialog/DeletePanelGroupDialog.js +1 -1
- package/dist/components/DeletePanelGroupDialog/DeletePanelGroupDialog.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/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/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/EditJsonButton/EditJsonButton.d.ts +1 -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 +1 -2
- package/dist/components/EditJsonDialog/EditJsonDialog.d.ts.map +1 -1
- package/dist/components/EditJsonDialog/EditJsonDialog.js +14 -7
- package/dist/components/EditJsonDialog/EditJsonDialog.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/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 +6 -7
- 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 +4 -4
- 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/Panel/Panel.d.ts +2 -2
- package/dist/components/Panel/Panel.d.ts.map +1 -1
- package/dist/components/Panel/Panel.js +2 -2
- package/dist/components/Panel/Panel.js.map +1 -1
- package/dist/components/Panel/PanelContent.d.ts +1 -2
- package/dist/components/Panel/PanelContent.d.ts.map +1 -1
- package/dist/components/Panel/PanelContent.js +2 -2
- 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/PanelDrawer/PanelDrawer.d.ts +1 -2
- package/dist/components/PanelDrawer/PanelDrawer.d.ts.map +1 -1
- package/dist/components/PanelDrawer/PanelDrawer.js.map +1 -1
- package/dist/components/PanelDrawer/PanelEditorForm.d.ts +1 -2
- package/dist/components/PanelDrawer/PanelEditorForm.d.ts.map +1 -1
- package/dist/components/PanelDrawer/PanelEditorForm.js +18 -15
- 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 +2 -3
- package/dist/components/PanelDrawer/PanelPreview.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/QuerySummaryTable/QuerySummaryTable.d.ts +1 -2
- package/dist/components/QuerySummaryTable/QuerySummaryTable.d.ts.map +1 -1
- package/dist/components/QuerySummaryTable/QuerySummaryTable.js +2 -2
- package/dist/components/QuerySummaryTable/QuerySummaryTable.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 +4 -4
- package/dist/components/SaveChangesConfirmationDialog/SaveChangesConfirmationDialog.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 +7 -7
- package/dist/components/SaveDashboardButton/SaveDashboardButton.js.map +1 -1
- package/dist/components/Variables/BuiltinVariableAccordions.d.ts +2 -3
- package/dist/components/Variables/BuiltinVariableAccordions.d.ts.map +1 -1
- package/dist/components/Variables/BuiltinVariableAccordions.js +7 -6
- package/dist/components/Variables/BuiltinVariableAccordions.js.map +1 -1
- 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 +2 -2
- package/dist/components/Variables/EditVariablesButton.js.map +1 -1
- package/dist/components/Variables/TemplateVariable.d.ts +2 -3
- package/dist/components/Variables/TemplateVariable.d.ts.map +1 -1
- package/dist/components/Variables/TemplateVariable.js +20 -11
- package/dist/components/Variables/TemplateVariable.js.map +1 -1
- package/dist/components/Variables/VariableEditor.d.ts +2 -3
- package/dist/components/Variables/VariableEditor.d.ts.map +1 -1
- package/dist/components/Variables/VariableEditor.js +13 -14
- 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 +1 -1
- package/dist/components/Variables/VariableList.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/user-interface-text.d.ts +0 -2
- package/dist/constants/user-interface-text.d.ts.map +1 -1
- package/dist/constants/user-interface-text.js +0 -2
- package/dist/constants/user-interface-text.js.map +1 -1
- package/dist/context/DashboardProvider/DashboardProvider.d.ts +6 -4
- package/dist/context/DashboardProvider/DashboardProvider.d.ts.map +1 -1
- package/dist/context/DashboardProvider/DashboardProvider.js +12 -7
- 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 +15 -15
- 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 +3 -3
- 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/panel-editor-slice.js +4 -6
- package/dist/context/DashboardProvider/panel-editor-slice.js.map +1 -1
- 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 +2 -2
- 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/DatasourceStoreProvider.d.ts +5 -5
- package/dist/context/DatasourceStoreProvider.d.ts.map +1 -1
- package/dist/context/DatasourceStoreProvider.js +15 -9
- package/dist/context/DatasourceStoreProvider.js.map +1 -1
- package/dist/context/TemplateVariableProvider/TemplateVariableProvider.d.ts +6 -6
- package/dist/context/TemplateVariableProvider/TemplateVariableProvider.d.ts.map +1 -1
- package/dist/context/TemplateVariableProvider/TemplateVariableProvider.js +70 -66
- 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.map +1 -1
- package/dist/context/TemplateVariableProvider/query-params.js.map +1 -1
- package/dist/context/TemplateVariableProvider/utils.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 +21 -6
- package/dist/context/useDashboard.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/test/dashboard-provider.js.map +1 -1
- package/dist/test/datasource-provider.js.map +1 -1
- package/dist/test/render.js +1 -1
- 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/validation/panel.d.ts +1 -1
- package/dist/validation/panel.d.ts.map +1 -1
- package/dist/validation/panel.js.map +1 -1
- package/dist/views/ViewDashboard/DashboardApp.d.ts +3 -3
- package/dist/views/ViewDashboard/DashboardApp.d.ts.map +1 -1
- package/dist/views/ViewDashboard/DashboardApp.js +5 -5
- package/dist/views/ViewDashboard/DashboardApp.js.map +1 -1
- package/dist/views/ViewDashboard/ViewDashboard.d.ts +1 -2
- package/dist/views/ViewDashboard/ViewDashboard.d.ts.map +1 -1
- package/dist/views/ViewDashboard/ViewDashboard.js +3 -3
- package/dist/views/ViewDashboard/ViewDashboard.js.map +1 -1
- package/package.json +6 -6
- 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/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 +0 -15
- 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/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
|
@@ -25,7 +25,7 @@ function createDeletePanelSlice() {
|
|
|
25
25
|
return (set, get)=>({
|
|
26
26
|
deletePanel (panelGroupItemId) {
|
|
27
27
|
set((draft)=>{
|
|
28
|
-
const { panelGroupId
|
|
28
|
+
const { panelGroupId, panelGroupItemLayoutId: panelGroupLayoutId } = panelGroupItemId;
|
|
29
29
|
const existingGroup = draft.panelGroups[panelGroupId];
|
|
30
30
|
if (existingGroup === undefined) {
|
|
31
31
|
throw new Error(`Missing panel group ${panelGroupId}`);
|
|
@@ -45,8 +45,8 @@ function createDeletePanelSlice() {
|
|
|
45
45
|
});
|
|
46
46
|
},
|
|
47
47
|
openDeletePanelDialog (panelGroupItemId) {
|
|
48
|
-
const { panelGroupId
|
|
49
|
-
const { panels
|
|
48
|
+
const { panelGroupId, panelGroupItemLayoutId: panelGroupLayoutId } = panelGroupItemId;
|
|
49
|
+
const { panels, panelGroups } = get();
|
|
50
50
|
const panelGroup = panelGroups[panelGroupId];
|
|
51
51
|
if (panelGroup === undefined) {
|
|
52
52
|
throw new Error(`Panel group not found ${panelGroupId}`);
|
|
@@ -28,7 +28,7 @@ function createDuplicatePanelSlice() {
|
|
|
28
28
|
set((state)=>{
|
|
29
29
|
const panels = state.panels;
|
|
30
30
|
// Figure out the panel key at that location
|
|
31
|
-
const { panelGroupId
|
|
31
|
+
const { panelGroupId, panelGroupItemLayoutId: panelGroupLayoutId } = panelGroupItemId;
|
|
32
32
|
const group = state.panelGroups[panelGroupId];
|
|
33
33
|
if (group === undefined) {
|
|
34
34
|
throw new Error(`Missing panel group ${panelGroupId}`);
|
|
@@ -25,14 +25,13 @@ const _common = require("./common");
|
|
|
25
25
|
const _panelgroupslice = require("./panel-group-slice");
|
|
26
26
|
function createPanelEditorSlice() {
|
|
27
27
|
// Return the state creator function for Zustand that uses the panels provided as intitial state
|
|
28
|
-
return (set, get)=>{
|
|
29
|
-
return {
|
|
28
|
+
return (set, get)=>({
|
|
30
29
|
panelEditor: undefined,
|
|
31
30
|
openEditPanel (panelGroupItemId) {
|
|
32
31
|
var _panelGroups_panelGroupId;
|
|
33
|
-
const { panels
|
|
32
|
+
const { panels, panelGroups } = get();
|
|
34
33
|
// Figure out the panel key at that location
|
|
35
|
-
const { panelGroupId
|
|
34
|
+
const { panelGroupId, panelGroupItemLayoutId: panelGroupLayoutId } = panelGroupItemId;
|
|
36
35
|
const panelKey = (_panelGroups_panelGroupId = panelGroups[panelGroupId]) === null || _panelGroups_panelGroupId === void 0 ? void 0 : _panelGroups_panelGroupId.itemPanelKeys[panelGroupLayoutId];
|
|
37
36
|
if (panelKey === undefined) {
|
|
38
37
|
throw new Error(`Could not find Panel Group item ${panelGroupItemId}`);
|
|
@@ -149,6 +148,5 @@ function createPanelEditorSlice() {
|
|
|
149
148
|
state.panelEditor = editorState;
|
|
150
149
|
});
|
|
151
150
|
}
|
|
152
|
-
};
|
|
153
|
-
};
|
|
151
|
+
});
|
|
154
152
|
}
|
|
@@ -21,8 +21,8 @@ function _export(target, all) {
|
|
|
21
21
|
});
|
|
22
22
|
}
|
|
23
23
|
_export(exports, {
|
|
24
|
-
|
|
25
|
-
return
|
|
24
|
+
addPanelGroup: function() {
|
|
25
|
+
return addPanelGroup;
|
|
26
26
|
},
|
|
27
27
|
convertLayoutsToPanelGroups: function() {
|
|
28
28
|
return convertLayoutsToPanelGroups;
|
|
@@ -30,14 +30,14 @@ _export(exports, {
|
|
|
30
30
|
createEmptyPanelGroup: function() {
|
|
31
31
|
return createEmptyPanelGroup;
|
|
32
32
|
},
|
|
33
|
-
|
|
34
|
-
return
|
|
33
|
+
createPanelGroupSlice: function() {
|
|
34
|
+
return createPanelGroupSlice;
|
|
35
35
|
}
|
|
36
36
|
});
|
|
37
37
|
const _core = require("@perses-dev/core");
|
|
38
38
|
const _common = require("./common");
|
|
39
39
|
function createPanelGroupSlice(layouts) {
|
|
40
|
-
const { panelGroups
|
|
40
|
+
const { panelGroups, panelGroupOrder } = convertLayoutsToPanelGroups(layouts);
|
|
41
41
|
// Return the state creator function for Zustand
|
|
42
42
|
return (set)=>({
|
|
43
43
|
panelGroups,
|
|
@@ -75,7 +75,7 @@ function convertLayoutsToPanelGroups(layouts) {
|
|
|
75
75
|
const panelGroups = {};
|
|
76
76
|
const panelGroupIdOrder = [];
|
|
77
77
|
for (const layout of layouts){
|
|
78
|
-
var
|
|
78
|
+
var _layout_spec_display_collapse, _layout_spec_display, _layout_spec_display1;
|
|
79
79
|
const itemLayouts = [];
|
|
80
80
|
const itemPanelKeys = {};
|
|
81
81
|
// Split layout information from panel keys to make it easier to update just layouts on move/resize of panels
|
|
@@ -25,16 +25,16 @@ const _react = require("react");
|
|
|
25
25
|
const _core = require("@perses-dev/core");
|
|
26
26
|
const _pluginsystem = require("@perses-dev/plugin-system");
|
|
27
27
|
function DatasourceStoreProvider(props) {
|
|
28
|
-
const { projectName
|
|
28
|
+
const { projectName, datasourceApi, onCreate, children } = props;
|
|
29
29
|
const [dashboardResource, setDashboardResource] = (0, _react.useState)(props.dashboardResource);
|
|
30
30
|
var _props_savedDatasources;
|
|
31
31
|
const [savedDatasources, setSavedDatasources] = (0, _react.useState)((_props_savedDatasources = props.savedDatasources) !== null && _props_savedDatasources !== void 0 ? _props_savedDatasources : {});
|
|
32
32
|
const project = projectName !== null && projectName !== void 0 ? projectName : dashboardResource === null || dashboardResource === void 0 ? void 0 : dashboardResource.metadata.project;
|
|
33
|
-
const { getPlugin
|
|
33
|
+
const { getPlugin, listPluginMetadata } = (0, _pluginsystem.usePluginRegistry)();
|
|
34
34
|
const findDatasource = (0, _core.useEvent)(async (selector)=>{
|
|
35
35
|
// Try to find it in dashboard spec
|
|
36
36
|
if (dashboardResource) {
|
|
37
|
-
const { datasources
|
|
37
|
+
const { datasources } = dashboardResource.spec;
|
|
38
38
|
const dashboardDatasource = findDashboardDatasource(datasources, selector);
|
|
39
39
|
if (dashboardDatasource !== undefined) {
|
|
40
40
|
return {
|
|
@@ -74,15 +74,15 @@ function DatasourceStoreProvider(props) {
|
|
|
74
74
|
});
|
|
75
75
|
// Gets a datasource spec for a given selector
|
|
76
76
|
const getDatasource = (0, _react.useCallback)(async (selector)=>{
|
|
77
|
-
const { spec
|
|
77
|
+
const { spec } = await findDatasource(selector);
|
|
78
78
|
return spec;
|
|
79
79
|
}, [
|
|
80
80
|
findDatasource
|
|
81
81
|
]);
|
|
82
82
|
// Given a Datasource selector, finds the spec for it and then uses its corresponding plugin the create a client
|
|
83
83
|
const getDatasourceClient = (0, _react.useCallback)(async function getClient(selector) {
|
|
84
|
-
const { kind
|
|
85
|
-
const [{ spec
|
|
84
|
+
const { kind } = selector;
|
|
85
|
+
const [{ spec, proxyUrl }, plugin] = await Promise.all([
|
|
86
86
|
findDatasource(selector),
|
|
87
87
|
getPlugin('Datasource', kind)
|
|
88
88
|
]);
|
|
@@ -111,7 +111,7 @@ function DatasourceStoreProvider(props) {
|
|
|
111
111
|
throw new Error(`Could not find a Datasource plugin with kind '${datasourcePluginKind}'`);
|
|
112
112
|
}
|
|
113
113
|
// Get helper for computing results properly
|
|
114
|
-
const { results
|
|
114
|
+
const { results, addItem } = buildDatasourceSelectItemGroups(datasourcePluginMetadata.display.name);
|
|
115
115
|
// Start with dashboard datasources with the highest precedence
|
|
116
116
|
if (dashboardResource === null || dashboardResource === void 0 ? void 0 : dashboardResource.spec.datasources) {
|
|
117
117
|
for(const selectorName in dashboardResource.spec.datasources){
|
|
@@ -161,7 +161,13 @@ function DatasourceStoreProvider(props) {
|
|
|
161
161
|
]);
|
|
162
162
|
const setLocalDatasources = (0, _react.useCallback)((datasources)=>{
|
|
163
163
|
if (dashboardResource) {
|
|
164
|
-
setDashboardResource({
|
|
164
|
+
setDashboardResource(dashboardResource.kind === 'Dashboard' ? {
|
|
165
|
+
...dashboardResource,
|
|
166
|
+
spec: {
|
|
167
|
+
...dashboardResource.spec,
|
|
168
|
+
datasources: datasources
|
|
169
|
+
}
|
|
170
|
+
} : {
|
|
165
171
|
...dashboardResource,
|
|
166
172
|
spec: {
|
|
167
173
|
...dashboardResource.spec,
|
|
@@ -229,7 +235,7 @@ function findDashboardDatasource(dashboardDatasources, selector) {
|
|
|
229
235
|
let explicitDefaultAdded = false;
|
|
230
236
|
const groupIndices = {};
|
|
231
237
|
let currentGroupIndex = 1; // 0 is the default group, always there as it contains at least the first item.
|
|
232
|
-
const addItem = ({ spec
|
|
238
|
+
const addItem = ({ spec, selectorName, selectorGroup: group, editLink, saved })=>{
|
|
233
239
|
var _spec_display;
|
|
234
240
|
group = group !== null && group !== void 0 ? group : '';
|
|
235
241
|
// Ensure the default group is always present as soon as an item is added.
|
|
@@ -21,11 +21,14 @@ function _export(target, all) {
|
|
|
21
21
|
});
|
|
22
22
|
}
|
|
23
23
|
_export(exports, {
|
|
24
|
-
|
|
25
|
-
return
|
|
24
|
+
TemplateVariableProvider: function() {
|
|
25
|
+
return TemplateVariableProvider;
|
|
26
26
|
},
|
|
27
|
-
|
|
28
|
-
return
|
|
27
|
+
TemplateVariableProviderWithQueryParams: function() {
|
|
28
|
+
return TemplateVariableProviderWithQueryParams;
|
|
29
|
+
},
|
|
30
|
+
useTemplateExternalVariableDefinitions: function() {
|
|
31
|
+
return useTemplateExternalVariableDefinitions;
|
|
29
32
|
},
|
|
30
33
|
useTemplateVariable: function() {
|
|
31
34
|
return useTemplateVariable;
|
|
@@ -36,17 +39,14 @@ _export(exports, {
|
|
|
36
39
|
useTemplateVariableDefinitions: function() {
|
|
37
40
|
return useTemplateVariableDefinitions;
|
|
38
41
|
},
|
|
39
|
-
useTemplateExternalVariableDefinitions: function() {
|
|
40
|
-
return useTemplateExternalVariableDefinitions;
|
|
41
|
-
},
|
|
42
42
|
useTemplateVariableStore: function() {
|
|
43
43
|
return useTemplateVariableStore;
|
|
44
44
|
},
|
|
45
|
-
|
|
46
|
-
return
|
|
45
|
+
useTemplateVariableStoreCtx: function() {
|
|
46
|
+
return useTemplateVariableStoreCtx;
|
|
47
47
|
},
|
|
48
|
-
|
|
49
|
-
return
|
|
48
|
+
useTemplateVariableValues: function() {
|
|
49
|
+
return useTemplateVariableValues;
|
|
50
50
|
}
|
|
51
51
|
});
|
|
52
52
|
const _jsxruntime = require("react/jsx-runtime");
|
|
@@ -149,11 +149,11 @@ function useTemplateVariableStore() {
|
|
|
149
149
|
const store = useTemplateVariableStoreCtx();
|
|
150
150
|
return (0, _zustand.useStore)(store);
|
|
151
151
|
}
|
|
152
|
-
function PluginProvider({ children
|
|
152
|
+
function PluginProvider({ children, builtinVariables }) {
|
|
153
153
|
const originalValues = useTemplateVariableValues();
|
|
154
154
|
const definitions = useTemplateVariableDefinitions();
|
|
155
155
|
const externalDefinitions = useTemplateExternalVariableDefinitions();
|
|
156
|
-
const { absoluteTimeRange
|
|
156
|
+
const { absoluteTimeRange } = (0, _pluginsystem.useTimeRange)();
|
|
157
157
|
const values = (0, _react.useMemo)(()=>{
|
|
158
158
|
const contextValues = {};
|
|
159
159
|
// This will loop through all the current variables values
|
|
@@ -182,74 +182,80 @@ function PluginProvider({ children , builtinVariables }) {
|
|
|
182
182
|
definitions,
|
|
183
183
|
externalDefinitions
|
|
184
184
|
]);
|
|
185
|
-
const allBuiltinVariables =
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
value: ()=>absoluteTimeRange.start.valueOf().toString(),
|
|
191
|
-
source: 'Dashboard',
|
|
192
|
-
display: {
|
|
185
|
+
const allBuiltinVariables = (0, _react.useMemo)(()=>{
|
|
186
|
+
const result = [
|
|
187
|
+
{
|
|
188
|
+
kind: 'BuiltinVariable',
|
|
189
|
+
spec: {
|
|
193
190
|
name: '__from',
|
|
194
|
-
|
|
195
|
-
|
|
191
|
+
value: ()=>absoluteTimeRange.start.valueOf().toString(),
|
|
192
|
+
source: 'Dashboard',
|
|
193
|
+
display: {
|
|
194
|
+
name: '__from',
|
|
195
|
+
description: 'Start time of the current time range in unix millisecond epoch',
|
|
196
|
+
hidden: true
|
|
197
|
+
}
|
|
196
198
|
}
|
|
197
|
-
}
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
spec: {
|
|
202
|
-
name: '__to',
|
|
203
|
-
value: ()=>absoluteTimeRange.end.valueOf().toString(),
|
|
204
|
-
source: 'Dashboard',
|
|
205
|
-
display: {
|
|
199
|
+
},
|
|
200
|
+
{
|
|
201
|
+
kind: 'BuiltinVariable',
|
|
202
|
+
spec: {
|
|
206
203
|
name: '__to',
|
|
207
|
-
|
|
208
|
-
|
|
204
|
+
value: ()=>absoluteTimeRange.end.valueOf().toString(),
|
|
205
|
+
source: 'Dashboard',
|
|
206
|
+
display: {
|
|
207
|
+
name: '__to',
|
|
208
|
+
description: 'End time of the current time range in unix millisecond epoch',
|
|
209
|
+
hidden: true
|
|
210
|
+
}
|
|
209
211
|
}
|
|
210
|
-
}
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
spec: {
|
|
215
|
-
name: '__range',
|
|
216
|
-
value: ()=>(0, _core.formatDuration)((0, _core.intervalToPrometheusDuration)(absoluteTimeRange)),
|
|
217
|
-
source: 'Dashboard',
|
|
218
|
-
display: {
|
|
212
|
+
},
|
|
213
|
+
{
|
|
214
|
+
kind: 'BuiltinVariable',
|
|
215
|
+
spec: {
|
|
219
216
|
name: '__range',
|
|
220
|
-
|
|
221
|
-
|
|
217
|
+
value: ()=>(0, _core.formatDuration)((0, _core.intervalToPrometheusDuration)(absoluteTimeRange)),
|
|
218
|
+
source: 'Dashboard',
|
|
219
|
+
display: {
|
|
220
|
+
name: '__range',
|
|
221
|
+
description: 'The range for the current dashboard in human readable format',
|
|
222
|
+
hidden: true
|
|
223
|
+
}
|
|
222
224
|
}
|
|
223
|
-
}
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
spec: {
|
|
228
|
-
name: '__range_s',
|
|
229
|
-
value: ()=>((absoluteTimeRange.end.valueOf() - absoluteTimeRange.start.valueOf()) / 1000).toString(),
|
|
230
|
-
source: 'Dashboard',
|
|
231
|
-
display: {
|
|
225
|
+
},
|
|
226
|
+
{
|
|
227
|
+
kind: 'BuiltinVariable',
|
|
228
|
+
spec: {
|
|
232
229
|
name: '__range_s',
|
|
233
|
-
|
|
234
|
-
|
|
230
|
+
value: ()=>((absoluteTimeRange.end.valueOf() - absoluteTimeRange.start.valueOf()) / 1000).toString(),
|
|
231
|
+
source: 'Dashboard',
|
|
232
|
+
display: {
|
|
233
|
+
name: '__range_s',
|
|
234
|
+
description: 'The range for the current dashboard in second',
|
|
235
|
+
hidden: true
|
|
236
|
+
}
|
|
235
237
|
}
|
|
236
|
-
}
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
spec: {
|
|
241
|
-
name: '__range_ms',
|
|
242
|
-
value: ()=>(absoluteTimeRange.end.valueOf() - absoluteTimeRange.start.valueOf()).toString(),
|
|
243
|
-
source: 'Dashboard',
|
|
244
|
-
display: {
|
|
238
|
+
},
|
|
239
|
+
{
|
|
240
|
+
kind: 'BuiltinVariable',
|
|
241
|
+
spec: {
|
|
245
242
|
name: '__range_ms',
|
|
246
|
-
|
|
247
|
-
|
|
243
|
+
value: ()=>(absoluteTimeRange.end.valueOf() - absoluteTimeRange.start.valueOf()).toString(),
|
|
244
|
+
source: 'Dashboard',
|
|
245
|
+
display: {
|
|
246
|
+
name: '__range_ms',
|
|
247
|
+
description: 'The range for the current dashboard in millisecond',
|
|
248
|
+
hidden: true
|
|
249
|
+
}
|
|
248
250
|
}
|
|
249
251
|
}
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
252
|
+
];
|
|
253
|
+
builtinVariables === null || builtinVariables === void 0 ? void 0 : builtinVariables.forEach((def)=>result.push(def));
|
|
254
|
+
return result;
|
|
255
|
+
}, [
|
|
256
|
+
absoluteTimeRange,
|
|
257
|
+
builtinVariables
|
|
258
|
+
]);
|
|
253
259
|
return /*#__PURE__*/ (0, _jsxruntime.jsx)(_pluginsystem.BuiltinVariableContext.Provider, {
|
|
254
260
|
value: {
|
|
255
261
|
variables: allBuiltinVariables
|
|
@@ -262,10 +268,9 @@ function PluginProvider({ children , builtinVariables }) {
|
|
|
262
268
|
})
|
|
263
269
|
});
|
|
264
270
|
}
|
|
265
|
-
function createTemplateVariableSrvStore({ initialVariableDefinitions =[]
|
|
271
|
+
function createTemplateVariableSrvStore({ initialVariableDefinitions = [], externalVariableDefinitions = [], queryParams }) {
|
|
266
272
|
const initialParams = (0, _queryparams.getInitalValuesFromQueryParameters)(queryParams ? queryParams[0] : {});
|
|
267
|
-
const store = (0, _zustand.createStore)()((0, _middleware.devtools)((0, _immer.immer)((set, get)=>{
|
|
268
|
-
return {
|
|
273
|
+
const store = (0, _zustand.createStore)()((0, _middleware.devtools)((0, _immer.immer)((set, get)=>({
|
|
269
274
|
variableState: (0, _hydrationUtils.hydrateTemplateVariableStates)(initialVariableDefinitions, initialParams, externalVariableDefinitions),
|
|
270
275
|
variableDefinitions: initialVariableDefinitions,
|
|
271
276
|
externalVariableDefinitions: externalVariableDefinitions,
|
|
@@ -367,11 +372,10 @@ function createTemplateVariableSrvStore({ initialVariableDefinitions =[] , exter
|
|
|
367
372
|
getSavedVariablesStatus: ()=>{
|
|
368
373
|
return (0, _utils.checkSavedDefaultVariableStatus)(get().variableDefinitions, get().variableState);
|
|
369
374
|
}
|
|
370
|
-
};
|
|
371
|
-
})));
|
|
375
|
+
}))));
|
|
372
376
|
return store;
|
|
373
377
|
}
|
|
374
|
-
function TemplateVariableProvider({ children
|
|
378
|
+
function TemplateVariableProvider({ children, initialVariableDefinitions = [], externalVariableDefinitions = [], builtinVariables = [] }) {
|
|
375
379
|
const [store] = (0, _react.useState)(createTemplateVariableSrvStore({
|
|
376
380
|
initialVariableDefinitions,
|
|
377
381
|
externalVariableDefinitions
|
|
@@ -384,7 +388,7 @@ function TemplateVariableProvider({ children , initialVariableDefinitions =[] ,
|
|
|
384
388
|
})
|
|
385
389
|
});
|
|
386
390
|
}
|
|
387
|
-
function TemplateVariableProviderWithQueryParams({ children
|
|
391
|
+
function TemplateVariableProviderWithQueryParams({ children, initialVariableDefinitions = [], externalVariableDefinitions = [], builtinVariables = [] }) {
|
|
388
392
|
const allVariableDefs = (0, _utils.mergeVariableDefinitions)(initialVariableDefinitions, externalVariableDefinitions);
|
|
389
393
|
const queryParams = (0, _queryparams.useVariableQueryParams)(allVariableDefs);
|
|
390
394
|
const [store] = (0, _react.useState)(createTemplateVariableSrvStore({
|
|
@@ -21,20 +21,20 @@ function _export(target, all) {
|
|
|
21
21
|
});
|
|
22
22
|
}
|
|
23
23
|
_export(exports, {
|
|
24
|
-
|
|
25
|
-
return
|
|
24
|
+
decodeVariableValue: function() {
|
|
25
|
+
return decodeVariableValue;
|
|
26
26
|
},
|
|
27
27
|
encodeVariableValue: function() {
|
|
28
28
|
return encodeVariableValue;
|
|
29
29
|
},
|
|
30
|
-
|
|
31
|
-
return
|
|
30
|
+
getInitalValuesFromQueryParameters: function() {
|
|
31
|
+
return getInitalValuesFromQueryParameters;
|
|
32
|
+
},
|
|
33
|
+
getURLQueryParamName: function() {
|
|
34
|
+
return getURLQueryParamName;
|
|
32
35
|
},
|
|
33
36
|
useVariableQueryParams: function() {
|
|
34
37
|
return useVariableQueryParams;
|
|
35
|
-
},
|
|
36
|
-
getInitalValuesFromQueryParameters: function() {
|
|
37
|
-
return getInitalValuesFromQueryParameters;
|
|
38
38
|
}
|
|
39
39
|
});
|
|
40
40
|
const _usequeryparams = require("use-query-params");
|
|
@@ -24,14 +24,14 @@ _export(exports, {
|
|
|
24
24
|
checkSavedDefaultVariableStatus: function() {
|
|
25
25
|
return checkSavedDefaultVariableStatus;
|
|
26
26
|
},
|
|
27
|
-
mergeVariableDefinitions: function() {
|
|
28
|
-
return mergeVariableDefinitions;
|
|
29
|
-
},
|
|
30
27
|
findVariableDefinitionByName: function() {
|
|
31
28
|
return findVariableDefinitionByName;
|
|
32
29
|
},
|
|
33
30
|
forEachVariableDefinition: function() {
|
|
34
31
|
return forEachVariableDefinition;
|
|
32
|
+
},
|
|
33
|
+
mergeVariableDefinitions: function() {
|
|
34
|
+
return mergeVariableDefinitions;
|
|
35
35
|
}
|
|
36
36
|
});
|
|
37
37
|
function checkSavedDefaultVariableStatus(definitions, varState) {
|
|
@@ -24,22 +24,24 @@ const _core = require("@perses-dev/core");
|
|
|
24
24
|
const _DashboardProvider = require("./DashboardProvider");
|
|
25
25
|
const _TemplateVariableProvider = require("./TemplateVariableProvider");
|
|
26
26
|
function useDashboard() {
|
|
27
|
-
const { panels
|
|
27
|
+
const { panels, panelGroups, panelGroupOrder, setDashboard: setDashboardResource, kind, metadata, display, duration, refreshInterval, datasources, ttl } = (0, _DashboardProvider.useDashboardStore)(({ panels, panelGroups, panelGroupOrder, setDashboard, kind, metadata, display, duration, refreshInterval, datasources, ttl })=>({
|
|
28
28
|
panels,
|
|
29
29
|
panelGroups,
|
|
30
30
|
panelGroupOrder,
|
|
31
31
|
setDashboard,
|
|
32
|
+
kind,
|
|
32
33
|
metadata,
|
|
33
34
|
display,
|
|
34
35
|
duration,
|
|
35
36
|
refreshInterval,
|
|
36
|
-
datasources
|
|
37
|
+
datasources,
|
|
38
|
+
ttl
|
|
37
39
|
}));
|
|
38
|
-
const { setVariableDefinitions
|
|
40
|
+
const { setVariableDefinitions } = (0, _TemplateVariableProvider.useTemplateVariableActions)();
|
|
39
41
|
const variables = (0, _TemplateVariableProvider.useTemplateVariableDefinitions)();
|
|
40
42
|
const layouts = convertPanelGroupsToLayouts(panelGroups, panelGroupOrder);
|
|
41
|
-
const dashboard = {
|
|
42
|
-
kind
|
|
43
|
+
const dashboard = kind === 'Dashboard' ? {
|
|
44
|
+
kind,
|
|
43
45
|
metadata,
|
|
44
46
|
spec: {
|
|
45
47
|
display,
|
|
@@ -50,6 +52,19 @@ function useDashboard() {
|
|
|
50
52
|
refreshInterval,
|
|
51
53
|
datasources
|
|
52
54
|
}
|
|
55
|
+
} : {
|
|
56
|
+
kind,
|
|
57
|
+
metadata,
|
|
58
|
+
spec: {
|
|
59
|
+
display,
|
|
60
|
+
panels,
|
|
61
|
+
layouts,
|
|
62
|
+
variables,
|
|
63
|
+
duration,
|
|
64
|
+
refreshInterval,
|
|
65
|
+
datasources,
|
|
66
|
+
ttl
|
|
67
|
+
}
|
|
53
68
|
};
|
|
54
69
|
const setDashboard = (dashboardResource)=>{
|
|
55
70
|
setVariableDefinitions(dashboardResource.spec.variables);
|
|
@@ -67,7 +82,7 @@ function convertPanelGroupsToLayouts(panelGroups, panelGroupOrder) {
|
|
|
67
82
|
if (group === undefined) {
|
|
68
83
|
throw new Error('panel group not found');
|
|
69
84
|
}
|
|
70
|
-
const { title
|
|
85
|
+
const { title, isCollapsed, itemLayouts, itemPanelKeys } = group;
|
|
71
86
|
let display = undefined;
|
|
72
87
|
if (title) {
|
|
73
88
|
display = {
|
|
@@ -21,11 +21,11 @@ function _export(target, all) {
|
|
|
21
21
|
});
|
|
22
22
|
}
|
|
23
23
|
_export(exports, {
|
|
24
|
-
getTestDashboard: function() {
|
|
25
|
-
return getTestDashboard;
|
|
26
|
-
},
|
|
27
24
|
createDashboardProviderSpy: function() {
|
|
28
25
|
return createDashboardProviderSpy;
|
|
26
|
+
},
|
|
27
|
+
getTestDashboard: function() {
|
|
28
|
+
return getTestDashboard;
|
|
29
29
|
}
|
|
30
30
|
});
|
|
31
31
|
const _react = require("react");
|
|
@@ -21,14 +21,14 @@ function _export(target, all) {
|
|
|
21
21
|
});
|
|
22
22
|
}
|
|
23
23
|
_export(exports, {
|
|
24
|
-
|
|
25
|
-
return
|
|
24
|
+
defaultDatasourceProps: function() {
|
|
25
|
+
return defaultDatasourceProps;
|
|
26
26
|
},
|
|
27
27
|
prometheusDemo: function() {
|
|
28
28
|
return prometheusDemo;
|
|
29
29
|
},
|
|
30
|
-
|
|
31
|
-
return
|
|
30
|
+
prometheusDemoUrl: function() {
|
|
31
|
+
return prometheusDemoUrl;
|
|
32
32
|
}
|
|
33
33
|
});
|
|
34
34
|
const _dashboardprovider = require("./dashboard-provider");
|
package/dist/cjs/test/render.js
CHANGED
|
@@ -36,7 +36,7 @@ const _pluginregistry = require("./plugin-registry");
|
|
|
36
36
|
/*
|
|
37
37
|
* Workaround for React router upgrade type errors.
|
|
38
38
|
* More details: https://stackoverflow.com/a/69948457/17575201
|
|
39
|
-
*/ const CustomRouter = ({ history
|
|
39
|
+
*/ const CustomRouter = ({ history, children })=>{
|
|
40
40
|
const [state, setState] = (0, _react.useState)({
|
|
41
41
|
action: history.action,
|
|
42
42
|
location: history.location
|
package/dist/cjs/utils/index.js
CHANGED
|
@@ -15,7 +15,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
15
15
|
value: true
|
|
16
16
|
});
|
|
17
17
|
_export_star(require("./panelUtils"), exports);
|
|
18
|
-
_export_star(require("./time"), exports);
|
|
19
18
|
function _export_star(from, to) {
|
|
20
19
|
Object.keys(from).forEach(function(k) {
|
|
21
20
|
if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) {
|
|
@@ -21,14 +21,14 @@ function _export(target, all) {
|
|
|
21
21
|
});
|
|
22
22
|
}
|
|
23
23
|
_export(exports, {
|
|
24
|
+
getValidPanelKey: function() {
|
|
25
|
+
return getValidPanelKey;
|
|
26
|
+
},
|
|
24
27
|
getYForNewRow: function() {
|
|
25
28
|
return getYForNewRow;
|
|
26
29
|
},
|
|
27
30
|
insertPanelInLayout: function() {
|
|
28
31
|
return insertPanelInLayout;
|
|
29
|
-
},
|
|
30
|
-
getValidPanelKey: function() {
|
|
31
|
-
return getValidPanelKey;
|
|
32
32
|
}
|
|
33
33
|
});
|
|
34
34
|
const _constants = require("../constants");
|
|
@@ -42,7 +42,7 @@ function getYForNewRow(group) {
|
|
|
42
42
|
}
|
|
43
43
|
return newRowY;
|
|
44
44
|
}
|
|
45
|
-
function getPanelBounds({ x
|
|
45
|
+
function getPanelBounds({ x, y, w, h }) {
|
|
46
46
|
return {
|
|
47
47
|
x1: x,
|
|
48
48
|
x2: x + w,
|
|
@@ -159,7 +159,7 @@ const removeWhiteSpaces = (str)=>{
|
|
|
159
159
|
function getUniquePanelKeys(panels) {
|
|
160
160
|
const uniquePanelKeys = {};
|
|
161
161
|
Object.keys(panels).forEach((panelKey)=>{
|
|
162
|
-
const { name
|
|
162
|
+
const { name, number } = getPanelKeyParts(panelKey);
|
|
163
163
|
if (uniquePanelKeys[name] === undefined) {
|
|
164
164
|
uniquePanelKeys[name] = 0;
|
|
165
165
|
}
|
|
@@ -28,13 +28,13 @@ const _pluginsystem = require("@perses-dev/plugin-system");
|
|
|
28
28
|
const _components1 = require("../../components");
|
|
29
29
|
const _context = require("../../context");
|
|
30
30
|
const DashboardApp = (props)=>{
|
|
31
|
-
const { dashboardResource
|
|
31
|
+
const { dashboardResource, dashboardTitleComponent, emptyDashboardProps, onSave, onDiscard, initialVariableIsSticky, isReadonly, isCreating } = props;
|
|
32
32
|
const chartsTheme = (0, _components.useChartsTheme)();
|
|
33
|
-
const { isEditMode
|
|
34
|
-
const { dashboard
|
|
33
|
+
const { isEditMode, setEditMode } = (0, _context.useEditMode)();
|
|
34
|
+
const { dashboard, setDashboard } = (0, _context.useDashboard)();
|
|
35
35
|
const [originalDashboard, setOriginalDashboard] = (0, _react.useState)(undefined);
|
|
36
|
-
const { setSavedDatasources
|
|
37
|
-
const { openDiscardChangesConfirmationDialog
|
|
36
|
+
const { setSavedDatasources } = (0, _pluginsystem.useDatasourceStore)();
|
|
37
|
+
const { openDiscardChangesConfirmationDialog, closeDiscardChangesConfirmationDialog } = (0, _context.useDiscardChangesConfirmationDialog)();
|
|
38
38
|
const handleDiscardChanges = ()=>{
|
|
39
39
|
// Reset to the original spec and exit edit mode
|
|
40
40
|
if (originalDashboard) {
|
|
@@ -29,15 +29,15 @@ const _react = require("react");
|
|
|
29
29
|
const _context = require("../../context");
|
|
30
30
|
const _DashboardApp = require("./DashboardApp");
|
|
31
31
|
function ViewDashboard(props) {
|
|
32
|
-
const { dashboardResource
|
|
33
|
-
const { spec
|
|
32
|
+
const { dashboardResource, datasourceApi, externalVariableDefinitions, dashboardTitleComponent, emptyDashboardProps, onSave, onDiscard, initialVariableIsSticky, isReadonly, isEditing, isCreating, sx, ...others } = props;
|
|
33
|
+
const { spec } = dashboardResource;
|
|
34
34
|
var _spec_duration;
|
|
35
35
|
const dashboardDuration = (_spec_duration = spec.duration) !== null && _spec_duration !== void 0 ? _spec_duration : _core.DEFAULT_DASHBOARD_DURATION;
|
|
36
36
|
var _spec_refreshInterval;
|
|
37
37
|
const dashboardRefreshInterval = (_spec_refreshInterval = spec.refreshInterval) !== null && _spec_refreshInterval !== void 0 ? _spec_refreshInterval : _core.DEFAULT_REFRESH_INTERVAL;
|
|
38
38
|
const initialTimeRange = (0, _pluginsystem.useInitialTimeRange)(dashboardDuration);
|
|
39
39
|
const initialRefreshInterval = (0, _pluginsystem.useInitialRefreshInterval)(dashboardRefreshInterval);
|
|
40
|
-
const { data
|
|
40
|
+
const { data } = (0, _pluginsystem.usePluginBuiltinVariableDefinitions)();
|
|
41
41
|
const builtinVariables = (0, _react.useMemo)(()=>{
|
|
42
42
|
const result = [
|
|
43
43
|
{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AddGroupButton.d.ts","sourceRoot":"","sources":["../../../src/components/AddGroupButton/AddGroupButton.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"AddGroupButton.d.ts","sourceRoot":"","sources":["../../../src/components/AddGroupButton/AddGroupButton.tsx"],"names":[],"mappings":"AAmBA,eAAO,MAAM,cAAc,+CAe1B,CAAC"}
|