@perses-dev/dashboards 0.0.0-snapshot-time-range-height-80d08fc
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/LICENSE +201 -0
- package/dist/cjs/components/Dashboard/Dashboard.js +37 -0
- package/dist/cjs/components/Dashboard/index.js +28 -0
- package/dist/cjs/components/DashboardToolbar/DashboardToolbar.js +176 -0
- package/dist/cjs/components/DashboardToolbar/index.js +28 -0
- package/dist/cjs/components/DeletePanelDialog/DeletePanelDialog.js +92 -0
- package/dist/cjs/components/DeletePanelDialog/index.js +28 -0
- package/dist/cjs/components/DeletePanelGroupDialog/DeletePanelGroupDialog.js +88 -0
- package/dist/cjs/components/DeletePanelGroupDialog/index.js +28 -0
- package/dist/cjs/components/DownloadButton/DownloadButton.js +109 -0
- package/dist/cjs/components/DownloadButton/index.js +28 -0
- package/dist/cjs/components/GridLayout/GridContainer.js +219 -0
- package/dist/cjs/components/GridLayout/GridItemContent.js +41 -0
- package/dist/cjs/components/GridLayout/GridLayout.js +104 -0
- package/dist/cjs/components/GridLayout/GridTitle.js +100 -0
- package/dist/cjs/components/GridLayout/index.js +29 -0
- package/dist/cjs/components/Panel/Panel.js +123 -0
- package/dist/cjs/components/Panel/Panel.test.js +129 -0
- package/dist/cjs/components/Panel/PanelContent.js +44 -0
- package/dist/cjs/components/Panel/PanelHeader.js +120 -0
- package/dist/cjs/components/Panel/index.js +28 -0
- package/dist/cjs/components/PanelDrawer/PanelDrawer.js +98 -0
- package/dist/cjs/components/PanelDrawer/PanelDrawer.test.js +131 -0
- package/dist/cjs/components/PanelDrawer/PanelEditorForm.js +202 -0
- package/dist/cjs/components/PanelDrawer/PanelPreview.js +47 -0
- package/dist/cjs/components/PanelDrawer/index.js +28 -0
- package/dist/cjs/components/PanelGroupDialog/PanelGroupDialog.js +101 -0
- package/dist/cjs/components/PanelGroupDialog/PanelGroupDialog.test.js +87 -0
- package/dist/cjs/components/PanelGroupDialog/PanelGroupEditorForm.js +92 -0
- package/dist/cjs/components/PanelGroupDialog/index.js +28 -0
- package/dist/cjs/components/TimeRangeControls/TimeRangeControls.js +136 -0
- package/dist/cjs/components/TimeRangeControls/TimeRangeControls.test.js +95 -0
- package/dist/cjs/components/TimeRangeControls/index.js +28 -0
- package/dist/cjs/components/UnsavedChangesConfirmationDialog/UnsavedChangesConfirmationDialog.js +67 -0
- package/dist/cjs/components/UnsavedChangesConfirmationDialog/index.js +28 -0
- package/dist/cjs/components/Variables/Variable.js +194 -0
- package/dist/cjs/components/Variables/VariableEditor.js +276 -0
- package/dist/cjs/components/Variables/VariableEditorForm/VariableEditorForm.js +459 -0
- package/dist/cjs/components/Variables/VariableEditorForm/index.js +28 -0
- package/dist/cjs/components/Variables/VariableEditorForm/variable-editor-form-model.js +89 -0
- package/dist/cjs/components/Variables/VariableList.js +150 -0
- package/dist/cjs/components/Variables/index.js +30 -0
- package/dist/cjs/components/Variables/variable-model.js +117 -0
- package/dist/cjs/components/Variables/variable-model.test.js +106 -0
- package/dist/cjs/components/index.js +39 -0
- package/dist/cjs/context/DashboardProvider/DashboardProvider.js +95 -0
- package/dist/cjs/context/DashboardProvider/common.js +28 -0
- package/dist/cjs/context/DashboardProvider/dashboard-provider-api.js +191 -0
- package/dist/cjs/context/DashboardProvider/delete-panel-group-slice.js +70 -0
- package/dist/cjs/context/DashboardProvider/delete-panel-slice.js +85 -0
- package/dist/cjs/context/DashboardProvider/index.js +29 -0
- package/dist/cjs/context/DashboardProvider/panel-editor-slice.js +205 -0
- package/dist/cjs/context/DashboardProvider/panel-group-editor-slice.js +85 -0
- package/dist/cjs/context/DashboardProvider/panel-group-slice.js +113 -0
- package/dist/cjs/context/DashboardProvider/panel-slice.js +25 -0
- package/dist/cjs/context/DatasourceStoreProvider.js +170 -0
- package/dist/cjs/context/TemplateVariableProvider/TemplateVariableProvider.js +228 -0
- package/dist/cjs/context/TemplateVariableProvider/index.js +28 -0
- package/dist/cjs/context/TemplateVariableProvider/query-params.js +81 -0
- package/dist/cjs/context/TemplateVariableProvider/query-params.test.js +82 -0
- package/dist/cjs/context/index.js +31 -0
- package/dist/cjs/context/useDashboard.js +94 -0
- package/dist/cjs/index.js +30 -0
- package/dist/cjs/test/dashboard-provider.js +51 -0
- package/dist/cjs/test/index.js +30 -0
- package/dist/cjs/test/plugin-registry.js +42 -0
- package/dist/cjs/test/render.js +62 -0
- package/dist/cjs/test/setup-tests.js +23 -0
- package/dist/cjs/test/testDashboard.js +293 -0
- package/dist/cjs/utils/functions.js +23 -0
- package/dist/cjs/views/ViewDashboard/DashboardApp.js +96 -0
- package/dist/cjs/views/ViewDashboard/ViewDashboard.js +68 -0
- package/dist/cjs/views/ViewDashboard/index.js +28 -0
- package/dist/cjs/views/ViewDashboard/tests/panelGroups.test.js +110 -0
- package/dist/cjs/views/index.js +28 -0
- package/dist/components/Dashboard/Dashboard.d.ts +8 -0
- package/dist/components/Dashboard/Dashboard.d.ts.map +1 -0
- package/dist/components/Dashboard/Dashboard.js +33 -0
- package/dist/components/Dashboard/Dashboard.js.map +1 -0
- package/dist/components/Dashboard/index.d.ts +2 -0
- package/dist/components/Dashboard/index.d.ts.map +1 -0
- package/dist/components/Dashboard/index.js +15 -0
- package/dist/components/Dashboard/index.js.map +1 -0
- package/dist/components/DashboardToolbar/DashboardToolbar.d.ts +11 -0
- package/dist/components/DashboardToolbar/DashboardToolbar.d.ts.map +1 -0
- package/dist/components/DashboardToolbar/DashboardToolbar.js +165 -0
- package/dist/components/DashboardToolbar/DashboardToolbar.js.map +1 -0
- package/dist/components/DashboardToolbar/index.d.ts +2 -0
- package/dist/components/DashboardToolbar/index.d.ts.map +1 -0
- package/dist/components/DashboardToolbar/index.js +15 -0
- package/dist/components/DashboardToolbar/index.js.map +1 -0
- package/dist/components/DeletePanelDialog/DeletePanelDialog.d.ts +3 -0
- package/dist/components/DeletePanelDialog/DeletePanelDialog.d.ts.map +1 -0
- package/dist/components/DeletePanelDialog/DeletePanelDialog.js +81 -0
- package/dist/components/DeletePanelDialog/DeletePanelDialog.js.map +1 -0
- package/dist/components/DeletePanelDialog/index.d.ts +2 -0
- package/dist/components/DeletePanelDialog/index.d.ts.map +1 -0
- package/dist/components/DeletePanelDialog/index.js +15 -0
- package/dist/components/DeletePanelDialog/index.js.map +1 -0
- package/dist/components/DeletePanelGroupDialog/DeletePanelGroupDialog.d.ts +3 -0
- package/dist/components/DeletePanelGroupDialog/DeletePanelGroupDialog.d.ts.map +1 -0
- package/dist/components/DeletePanelGroupDialog/DeletePanelGroupDialog.js +77 -0
- package/dist/components/DeletePanelGroupDialog/DeletePanelGroupDialog.js.map +1 -0
- package/dist/components/DeletePanelGroupDialog/index.d.ts +2 -0
- package/dist/components/DeletePanelGroupDialog/index.d.ts.map +1 -0
- package/dist/components/DeletePanelGroupDialog/index.js +15 -0
- package/dist/components/DeletePanelGroupDialog/index.js.map +1 -0
- package/dist/components/DownloadButton/DownloadButton.d.ts +3 -0
- package/dist/components/DownloadButton/DownloadButton.d.ts.map +1 -0
- package/dist/components/DownloadButton/DownloadButton.js +60 -0
- package/dist/components/DownloadButton/DownloadButton.js.map +1 -0
- package/dist/components/DownloadButton/index.d.ts +2 -0
- package/dist/components/DownloadButton/index.d.ts.map +1 -0
- package/dist/components/DownloadButton/index.js +15 -0
- package/dist/components/DownloadButton/index.js.map +1 -0
- package/dist/components/GridLayout/GridContainer.d.ts +6 -0
- package/dist/components/GridLayout/GridContainer.d.ts.map +1 -0
- package/dist/components/GridLayout/GridContainer.js +213 -0
- package/dist/components/GridLayout/GridContainer.js.map +1 -0
- package/dist/components/GridLayout/GridItemContent.d.ts +10 -0
- package/dist/components/GridLayout/GridItemContent.d.ts.map +1 -0
- package/dist/components/GridLayout/GridItemContent.js +37 -0
- package/dist/components/GridLayout/GridItemContent.js.map +1 -0
- package/dist/components/GridLayout/GridLayout.d.ts +10 -0
- package/dist/components/GridLayout/GridLayout.d.ts.map +1 -0
- package/dist/components/GridLayout/GridLayout.js +100 -0
- package/dist/components/GridLayout/GridLayout.js.map +1 -0
- package/dist/components/GridLayout/GridTitle.d.ts +16 -0
- package/dist/components/GridLayout/GridTitle.d.ts.map +1 -0
- package/dist/components/GridLayout/GridTitle.js +92 -0
- package/dist/components/GridLayout/GridTitle.js.map +1 -0
- package/dist/components/GridLayout/index.d.ts +3 -0
- package/dist/components/GridLayout/index.d.ts.map +1 -0
- package/dist/components/GridLayout/index.js +16 -0
- package/dist/components/GridLayout/index.js.map +1 -0
- package/dist/components/Panel/Panel.d.ts +13 -0
- package/dist/components/Panel/Panel.d.ts.map +1 -0
- package/dist/components/Panel/Panel.js +114 -0
- package/dist/components/Panel/Panel.js.map +1 -0
- package/dist/components/Panel/Panel.test.d.ts +2 -0
- package/dist/components/Panel/Panel.test.d.ts.map +1 -0
- package/dist/components/Panel/Panel.test.js +122 -0
- package/dist/components/Panel/Panel.test.js.map +1 -0
- package/dist/components/Panel/PanelContent.d.ts +12 -0
- package/dist/components/Panel/PanelContent.d.ts.map +1 -0
- package/dist/components/Panel/PanelContent.js +41 -0
- package/dist/components/Panel/PanelContent.js.map +1 -0
- package/dist/components/Panel/PanelHeader.d.ts +16 -0
- package/dist/components/Panel/PanelHeader.d.ts.map +1 -0
- package/dist/components/Panel/PanelHeader.js +109 -0
- package/dist/components/Panel/PanelHeader.js.map +1 -0
- package/dist/components/Panel/index.d.ts +2 -0
- package/dist/components/Panel/index.d.ts.map +1 -0
- package/dist/components/Panel/index.js +15 -0
- package/dist/components/Panel/index.js.map +1 -0
- package/dist/components/PanelDrawer/PanelDrawer.d.ts +6 -0
- package/dist/components/PanelDrawer/PanelDrawer.d.ts.map +1 -0
- package/dist/components/PanelDrawer/PanelDrawer.js +94 -0
- package/dist/components/PanelDrawer/PanelDrawer.js.map +1 -0
- package/dist/components/PanelDrawer/PanelDrawer.test.d.ts +2 -0
- package/dist/components/PanelDrawer/PanelDrawer.test.d.ts.map +1 -0
- package/dist/components/PanelDrawer/PanelDrawer.test.js +124 -0
- package/dist/components/PanelDrawer/PanelDrawer.test.js.map +1 -0
- package/dist/components/PanelDrawer/PanelEditorForm.d.ts +12 -0
- package/dist/components/PanelDrawer/PanelEditorForm.d.ts.map +1 -0
- package/dist/components/PanelDrawer/PanelEditorForm.js +192 -0
- package/dist/components/PanelDrawer/PanelEditorForm.js.map +1 -0
- package/dist/components/PanelDrawer/PanelPreview.d.ts +4 -0
- package/dist/components/PanelDrawer/PanelPreview.d.ts.map +1 -0
- package/dist/components/PanelDrawer/PanelPreview.js +41 -0
- package/dist/components/PanelDrawer/PanelPreview.js.map +1 -0
- package/dist/components/PanelDrawer/index.d.ts +2 -0
- package/dist/components/PanelDrawer/index.d.ts.map +1 -0
- package/dist/components/PanelDrawer/index.js +15 -0
- package/dist/components/PanelDrawer/index.js.map +1 -0
- package/dist/components/PanelGroupDialog/PanelGroupDialog.d.ts +6 -0
- package/dist/components/PanelGroupDialog/PanelGroupDialog.d.ts.map +1 -0
- package/dist/components/PanelGroupDialog/PanelGroupDialog.js +92 -0
- package/dist/components/PanelGroupDialog/PanelGroupDialog.js.map +1 -0
- package/dist/components/PanelGroupDialog/PanelGroupDialog.test.d.ts +2 -0
- package/dist/components/PanelGroupDialog/PanelGroupDialog.test.d.ts.map +1 -0
- package/dist/components/PanelGroupDialog/PanelGroupDialog.test.js +80 -0
- package/dist/components/PanelGroupDialog/PanelGroupDialog.test.js.map +1 -0
- package/dist/components/PanelGroupDialog/PanelGroupEditorForm.d.ts +12 -0
- package/dist/components/PanelGroupDialog/PanelGroupEditorForm.d.ts.map +1 -0
- package/dist/components/PanelGroupDialog/PanelGroupEditorForm.js +82 -0
- package/dist/components/PanelGroupDialog/PanelGroupEditorForm.js.map +1 -0
- package/dist/components/PanelGroupDialog/index.d.ts +2 -0
- package/dist/components/PanelGroupDialog/index.d.ts.map +1 -0
- package/dist/components/PanelGroupDialog/index.js +15 -0
- package/dist/components/PanelGroupDialog/index.js.map +1 -0
- package/dist/components/TimeRangeControls/TimeRangeControls.d.ts +9 -0
- package/dist/components/TimeRangeControls/TimeRangeControls.d.ts.map +1 -0
- package/dist/components/TimeRangeControls/TimeRangeControls.js +119 -0
- package/dist/components/TimeRangeControls/TimeRangeControls.js.map +1 -0
- package/dist/components/TimeRangeControls/TimeRangeControls.test.d.ts +2 -0
- package/dist/components/TimeRangeControls/TimeRangeControls.test.d.ts.map +1 -0
- package/dist/components/TimeRangeControls/TimeRangeControls.test.js +88 -0
- package/dist/components/TimeRangeControls/TimeRangeControls.test.js.map +1 -0
- package/dist/components/TimeRangeControls/index.d.ts +2 -0
- package/dist/components/TimeRangeControls/index.d.ts.map +1 -0
- package/dist/components/TimeRangeControls/index.js +15 -0
- package/dist/components/TimeRangeControls/index.js.map +1 -0
- package/dist/components/UnsavedChangesConfirmationDialog/UnsavedChangesConfirmationDialog.d.ts +8 -0
- package/dist/components/UnsavedChangesConfirmationDialog/UnsavedChangesConfirmationDialog.d.ts.map +1 -0
- package/dist/components/UnsavedChangesConfirmationDialog/UnsavedChangesConfirmationDialog.js +56 -0
- package/dist/components/UnsavedChangesConfirmationDialog/UnsavedChangesConfirmationDialog.js.map +1 -0
- package/dist/components/UnsavedChangesConfirmationDialog/index.d.ts +2 -0
- package/dist/components/UnsavedChangesConfirmationDialog/index.d.ts.map +1 -0
- package/dist/components/UnsavedChangesConfirmationDialog/index.js +15 -0
- package/dist/components/UnsavedChangesConfirmationDialog/index.js.map +1 -0
- package/dist/components/Variables/Variable.d.ts +8 -0
- package/dist/components/Variables/Variable.d.ts.map +1 -0
- package/dist/components/Variables/Variable.js +188 -0
- package/dist/components/Variables/Variable.js.map +1 -0
- package/dist/components/Variables/VariableEditor.d.ts +8 -0
- package/dist/components/Variables/VariableEditor.d.ts.map +1 -0
- package/dist/components/Variables/VariableEditor.js +265 -0
- package/dist/components/Variables/VariableEditor.js.map +1 -0
- package/dist/components/Variables/VariableEditorForm/VariableEditorForm.d.ts +8 -0
- package/dist/components/Variables/VariableEditorForm/VariableEditorForm.d.ts.map +1 -0
- package/dist/components/Variables/VariableEditorForm/VariableEditorForm.js +409 -0
- package/dist/components/Variables/VariableEditorForm/VariableEditorForm.js.map +1 -0
- package/dist/components/Variables/VariableEditorForm/index.d.ts +2 -0
- package/dist/components/Variables/VariableEditorForm/index.d.ts.map +1 -0
- package/dist/components/Variables/VariableEditorForm/index.js +15 -0
- package/dist/components/Variables/VariableEditorForm/index.js.map +1 -0
- package/dist/components/Variables/VariableEditorForm/variable-editor-form-model.d.ts +22 -0
- package/dist/components/Variables/VariableEditorForm/variable-editor-form-model.d.ts.map +1 -0
- package/dist/components/Variables/VariableEditorForm/variable-editor-form-model.js +77 -0
- package/dist/components/Variables/VariableEditorForm/variable-editor-form-model.js.map +1 -0
- package/dist/components/Variables/VariableList.d.ts +9 -0
- package/dist/components/Variables/VariableList.d.ts.map +1 -0
- package/dist/components/Variables/VariableList.js +100 -0
- package/dist/components/Variables/VariableList.js.map +1 -0
- package/dist/components/Variables/index.d.ts +4 -0
- package/dist/components/Variables/index.d.ts.map +1 -0
- package/dist/components/Variables/index.js +17 -0
- package/dist/components/Variables/index.js.map +1 -0
- package/dist/components/Variables/variable-model.d.ts +16 -0
- package/dist/components/Variables/variable-model.d.ts.map +1 -0
- package/dist/components/Variables/variable-model.js +105 -0
- package/dist/components/Variables/variable-model.js.map +1 -0
- package/dist/components/Variables/variable-model.test.d.ts +2 -0
- package/dist/components/Variables/variable-model.test.d.ts.map +1 -0
- package/dist/components/Variables/variable-model.test.js +104 -0
- package/dist/components/Variables/variable-model.test.js.map +1 -0
- package/dist/components/index.d.ts +13 -0
- package/dist/components/index.d.ts.map +1 -0
- package/dist/components/index.js +26 -0
- package/dist/components/index.js.map +1 -0
- package/dist/context/DashboardProvider/DashboardProvider.d.ts +28 -0
- package/dist/context/DashboardProvider/DashboardProvider.d.ts.map +1 -0
- package/dist/context/DashboardProvider/DashboardProvider.js +77 -0
- package/dist/context/DashboardProvider/DashboardProvider.js.map +1 -0
- package/dist/context/DashboardProvider/common.d.ts +12 -0
- package/dist/context/DashboardProvider/common.d.ts.map +1 -0
- package/dist/context/DashboardProvider/common.js +24 -0
- package/dist/context/DashboardProvider/common.js.map +1 -0
- package/dist/context/DashboardProvider/dashboard-provider-api.d.ts +74 -0
- package/dist/context/DashboardProvider/dashboard-provider-api.d.ts.map +1 -0
- package/dist/context/DashboardProvider/dashboard-provider-api.js +190 -0
- package/dist/context/DashboardProvider/dashboard-provider-api.js.map +1 -0
- package/dist/context/DashboardProvider/delete-panel-group-slice.d.ts +23 -0
- package/dist/context/DashboardProvider/delete-panel-group-slice.d.ts.map +1 -0
- package/dist/context/DashboardProvider/delete-panel-group-slice.js +64 -0
- package/dist/context/DashboardProvider/delete-panel-group-slice.js.map +1 -0
- package/dist/context/DashboardProvider/delete-panel-slice.d.ts +36 -0
- package/dist/context/DashboardProvider/delete-panel-slice.d.ts.map +1 -0
- package/dist/context/DashboardProvider/delete-panel-slice.js +81 -0
- package/dist/context/DashboardProvider/delete-panel-slice.js.map +1 -0
- package/dist/context/DashboardProvider/index.d.ts +7 -0
- package/dist/context/DashboardProvider/index.d.ts.map +1 -0
- package/dist/context/DashboardProvider/index.js +16 -0
- package/dist/context/DashboardProvider/index.js.map +1 -0
- package/dist/context/DashboardProvider/panel-editor-slice.d.ts +56 -0
- package/dist/context/DashboardProvider/panel-editor-slice.d.ts.map +1 -0
- package/dist/context/DashboardProvider/panel-editor-slice.js +201 -0
- package/dist/context/DashboardProvider/panel-editor-slice.js.map +1 -0
- package/dist/context/DashboardProvider/panel-group-editor-slice.d.ts +33 -0
- package/dist/context/DashboardProvider/panel-group-editor-slice.d.ts.map +1 -0
- package/dist/context/DashboardProvider/panel-group-editor-slice.js +79 -0
- package/dist/context/DashboardProvider/panel-group-editor-slice.js.map +1 -0
- package/dist/context/DashboardProvider/panel-group-slice.d.ts +59 -0
- package/dist/context/DashboardProvider/panel-group-slice.d.ts.map +1 -0
- package/dist/context/DashboardProvider/panel-group-slice.js +105 -0
- package/dist/context/DashboardProvider/panel-group-slice.js.map +1 -0
- package/dist/context/DashboardProvider/panel-slice.d.ts +14 -0
- package/dist/context/DashboardProvider/panel-slice.d.ts.map +1 -0
- package/dist/context/DashboardProvider/panel-slice.js +21 -0
- package/dist/context/DashboardProvider/panel-slice.js.map +1 -0
- package/dist/context/DatasourceStoreProvider.d.ts +24 -0
- package/dist/context/DatasourceStoreProvider.d.ts.map +1 -0
- package/dist/context/DatasourceStoreProvider.js +166 -0
- package/dist/context/DatasourceStoreProvider.js.map +1 -0
- package/dist/context/TemplateVariableProvider/TemplateVariableProvider.d.ts +30 -0
- package/dist/context/TemplateVariableProvider/TemplateVariableProvider.d.ts.map +1 -0
- package/dist/context/TemplateVariableProvider/TemplateVariableProvider.js +212 -0
- package/dist/context/TemplateVariableProvider/TemplateVariableProvider.js.map +1 -0
- package/dist/context/TemplateVariableProvider/index.d.ts +2 -0
- package/dist/context/TemplateVariableProvider/index.d.ts.map +1 -0
- package/dist/context/TemplateVariableProvider/index.js +15 -0
- package/dist/context/TemplateVariableProvider/index.js.map +1 -0
- package/dist/context/TemplateVariableProvider/query-params.d.ts +12 -0
- package/dist/context/TemplateVariableProvider/query-params.d.ts.map +1 -0
- package/dist/context/TemplateVariableProvider/query-params.js +66 -0
- package/dist/context/TemplateVariableProvider/query-params.js.map +1 -0
- package/dist/context/TemplateVariableProvider/query-params.test.d.ts +2 -0
- package/dist/context/TemplateVariableProvider/query-params.test.d.ts.map +1 -0
- package/dist/context/TemplateVariableProvider/query-params.test.js +80 -0
- package/dist/context/TemplateVariableProvider/query-params.test.js.map +1 -0
- package/dist/context/index.d.ts +5 -0
- package/dist/context/index.d.ts.map +1 -0
- package/dist/context/index.js +18 -0
- package/dist/context/index.js.map +1 -0
- package/dist/context/useDashboard.d.ts +6 -0
- package/dist/context/useDashboard.d.ts.map +1 -0
- package/dist/context/useDashboard.js +88 -0
- package/dist/context/useDashboard.js.map +1 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +17 -0
- package/dist/index.js.map +1 -0
- package/dist/test/dashboard-provider.d.ts +19 -0
- package/dist/test/dashboard-provider.d.ts.map +1 -0
- package/dist/test/dashboard-provider.js +40 -0
- package/dist/test/dashboard-provider.js.map +1 -0
- package/dist/test/index.d.ts +4 -0
- package/dist/test/index.d.ts.map +1 -0
- package/dist/test/index.js +17 -0
- package/dist/test/index.js.map +1 -0
- package/dist/test/plugin-registry.d.ts +3 -0
- package/dist/test/plugin-registry.d.ts.map +1 -0
- package/dist/test/plugin-registry.js +37 -0
- package/dist/test/plugin-registry.js.map +1 -0
- package/dist/test/render.d.ts +8 -0
- package/dist/test/render.d.ts.map +1 -0
- package/dist/test/render.js +58 -0
- package/dist/test/render.js.map +1 -0
- package/dist/test/setup-tests.d.ts +2 -0
- package/dist/test/setup-tests.d.ts.map +1 -0
- package/dist/test/setup-tests.js +22 -0
- package/dist/test/setup-tests.js.map +1 -0
- package/dist/test/testDashboard.d.ts +4 -0
- package/dist/test/testDashboard.d.ts.map +1 -0
- package/dist/test/testDashboard.js +287 -0
- package/dist/test/testDashboard.js.map +1 -0
- package/dist/utils/functions.d.ts +2 -0
- package/dist/utils/functions.d.ts.map +1 -0
- package/dist/utils/functions.js +17 -0
- package/dist/utils/functions.js.map +1 -0
- package/dist/views/ViewDashboard/DashboardApp.d.ts +10 -0
- package/dist/views/ViewDashboard/DashboardApp.d.ts.map +1 -0
- package/dist/views/ViewDashboard/DashboardApp.js +90 -0
- package/dist/views/ViewDashboard/DashboardApp.js.map +1 -0
- package/dist/views/ViewDashboard/ViewDashboard.d.ts +16 -0
- package/dist/views/ViewDashboard/ViewDashboard.d.ts.map +1 -0
- package/dist/views/ViewDashboard/ViewDashboard.js +64 -0
- package/dist/views/ViewDashboard/ViewDashboard.js.map +1 -0
- package/dist/views/ViewDashboard/index.d.ts +2 -0
- package/dist/views/ViewDashboard/index.d.ts.map +1 -0
- package/dist/views/ViewDashboard/index.js +15 -0
- package/dist/views/ViewDashboard/index.js.map +1 -0
- package/dist/views/ViewDashboard/tests/panelGroups.test.d.ts +2 -0
- package/dist/views/ViewDashboard/tests/panelGroups.test.d.ts.map +1 -0
- package/dist/views/ViewDashboard/tests/panelGroups.test.js +103 -0
- package/dist/views/ViewDashboard/tests/panelGroups.test.js.map +1 -0
- package/dist/views/index.d.ts +2 -0
- package/dist/views/index.d.ts.map +1 -0
- package/dist/views/index.js +15 -0
- package/dist/views/index.js.map +1 -0
- package/package.json +57 -0
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
// Copyright 2022 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, "TemplateVariableList", {
|
|
18
|
+
enumerable: true,
|
|
19
|
+
get: ()=>TemplateVariableList
|
|
20
|
+
});
|
|
21
|
+
const _jsxRuntime = require("react/jsx-runtime");
|
|
22
|
+
const _react = /*#__PURE__*/ _interopRequireWildcard(require("react"));
|
|
23
|
+
const _material = require("@mui/material");
|
|
24
|
+
const _pencil = /*#__PURE__*/ _interopRequireDefault(require("mdi-material-ui/Pencil"));
|
|
25
|
+
const _pinOutline = /*#__PURE__*/ _interopRequireDefault(require("mdi-material-ui/PinOutline"));
|
|
26
|
+
const _pinOffOutline = /*#__PURE__*/ _interopRequireDefault(require("mdi-material-ui/PinOffOutline"));
|
|
27
|
+
const _components = require("@perses-dev/components");
|
|
28
|
+
const _context = require("../../context");
|
|
29
|
+
const _variable = require("./Variable");
|
|
30
|
+
const _variableEditor = require("./VariableEditor");
|
|
31
|
+
function _interopRequireDefault(obj) {
|
|
32
|
+
return obj && obj.__esModule ? obj : {
|
|
33
|
+
default: obj
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
function _getRequireWildcardCache(nodeInterop) {
|
|
37
|
+
if (typeof WeakMap !== "function") return null;
|
|
38
|
+
var cacheBabelInterop = new WeakMap();
|
|
39
|
+
var cacheNodeInterop = new WeakMap();
|
|
40
|
+
return (_getRequireWildcardCache = function(nodeInterop) {
|
|
41
|
+
return nodeInterop ? cacheNodeInterop : cacheBabelInterop;
|
|
42
|
+
})(nodeInterop);
|
|
43
|
+
}
|
|
44
|
+
function _interopRequireWildcard(obj, nodeInterop) {
|
|
45
|
+
if (!nodeInterop && obj && obj.__esModule) {
|
|
46
|
+
return obj;
|
|
47
|
+
}
|
|
48
|
+
if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
|
|
49
|
+
return {
|
|
50
|
+
default: obj
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
var cache = _getRequireWildcardCache(nodeInterop);
|
|
54
|
+
if (cache && cache.has(obj)) {
|
|
55
|
+
return cache.get(obj);
|
|
56
|
+
}
|
|
57
|
+
var newObj = {};
|
|
58
|
+
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
59
|
+
for(var key in obj){
|
|
60
|
+
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
61
|
+
var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
|
|
62
|
+
if (desc && (desc.get || desc.set)) {
|
|
63
|
+
Object.defineProperty(newObj, key, desc);
|
|
64
|
+
} else {
|
|
65
|
+
newObj[key] = obj[key];
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
newObj.default = obj;
|
|
70
|
+
if (cache) {
|
|
71
|
+
cache.set(obj, newObj);
|
|
72
|
+
}
|
|
73
|
+
return newObj;
|
|
74
|
+
}
|
|
75
|
+
function TemplateVariableList(props) {
|
|
76
|
+
const [isEditing, setIsEditing] = (0, _react.useState)(false);
|
|
77
|
+
const [isPin, setIsPin] = (0, _react.useState)(props.initialVariableIsSticky);
|
|
78
|
+
const variableDefinitions = (0, _context.useTemplateVariableDefinitions)();
|
|
79
|
+
const { isEditMode } = (0, _context.useEditMode)();
|
|
80
|
+
const { setVariableDefinitions } = (0, _context.useTemplateVariableActions)();
|
|
81
|
+
const scrollTrigger = (0, _material.useScrollTrigger)({
|
|
82
|
+
disableHysteresis: true
|
|
83
|
+
});
|
|
84
|
+
const isSticky = scrollTrigger && props.initialVariableIsSticky && isPin;
|
|
85
|
+
const onClose = ()=>{
|
|
86
|
+
setIsEditing(false);
|
|
87
|
+
};
|
|
88
|
+
return /*#__PURE__*/ (0, _jsxRuntime.jsxs)(_material.Box, {
|
|
89
|
+
children: [
|
|
90
|
+
/*#__PURE__*/ (0, _jsxRuntime.jsx)(_components.Drawer, {
|
|
91
|
+
isOpen: isEditing,
|
|
92
|
+
onClose: onClose,
|
|
93
|
+
PaperProps: {
|
|
94
|
+
sx: {
|
|
95
|
+
width: '50%'
|
|
96
|
+
}
|
|
97
|
+
},
|
|
98
|
+
children: /*#__PURE__*/ (0, _jsxRuntime.jsx)(_variableEditor.VariableEditor, {
|
|
99
|
+
variableDefinitions: variableDefinitions,
|
|
100
|
+
onCancel: onClose,
|
|
101
|
+
onChange: (v)=>{
|
|
102
|
+
setVariableDefinitions(v);
|
|
103
|
+
setIsEditing(false);
|
|
104
|
+
}
|
|
105
|
+
})
|
|
106
|
+
}),
|
|
107
|
+
isEditMode && /*#__PURE__*/ (0, _jsxRuntime.jsx)(_material.Box, {
|
|
108
|
+
pb: 2,
|
|
109
|
+
children: /*#__PURE__*/ (0, _jsxRuntime.jsx)(_material.Button, {
|
|
110
|
+
onClick: ()=>setIsEditing(true),
|
|
111
|
+
startIcon: /*#__PURE__*/ (0, _jsxRuntime.jsx)(_pencil.default, {}),
|
|
112
|
+
children: "Edit Variables"
|
|
113
|
+
})
|
|
114
|
+
}),
|
|
115
|
+
/*#__PURE__*/ (0, _jsxRuntime.jsx)(_material.AppBar, {
|
|
116
|
+
color: 'inherit',
|
|
117
|
+
position: isSticky ? 'fixed' : 'static',
|
|
118
|
+
elevation: isSticky ? 4 : 0,
|
|
119
|
+
sx: {
|
|
120
|
+
...props.sx
|
|
121
|
+
},
|
|
122
|
+
children: /*#__PURE__*/ (0, _jsxRuntime.jsxs)(_material.Box, {
|
|
123
|
+
display: 'flex',
|
|
124
|
+
justifyContent: "space-between",
|
|
125
|
+
my: isSticky ? 2 : 0,
|
|
126
|
+
ml: isSticky ? 2 : 0,
|
|
127
|
+
children: [
|
|
128
|
+
/*#__PURE__*/ (0, _jsxRuntime.jsx)(_material.Stack, {
|
|
129
|
+
direction: "row",
|
|
130
|
+
spacing: 1,
|
|
131
|
+
children: isEditMode && variableDefinitions.map((v)=>{
|
|
132
|
+
var ref;
|
|
133
|
+
/*#__PURE__*/ return (0, _jsxRuntime.jsx)(_material.Box, {
|
|
134
|
+
display: ((ref = v.spec.display) === null || ref === void 0 ? void 0 : ref.hidden) ? 'none' : undefined,
|
|
135
|
+
children: /*#__PURE__*/ (0, _jsxRuntime.jsx)(_variable.TemplateVariable, {
|
|
136
|
+
name: v.spec.name
|
|
137
|
+
}, v.spec.name)
|
|
138
|
+
}, v.spec.name);
|
|
139
|
+
})
|
|
140
|
+
}),
|
|
141
|
+
props.initialVariableIsSticky && /*#__PURE__*/ (0, _jsxRuntime.jsx)(_material.IconButton, {
|
|
142
|
+
onClick: ()=>setIsPin(!isPin),
|
|
143
|
+
children: isPin ? /*#__PURE__*/ (0, _jsxRuntime.jsx)(_pinOutline.default, {}) : /*#__PURE__*/ (0, _jsxRuntime.jsx)(_pinOffOutline.default, {})
|
|
144
|
+
})
|
|
145
|
+
]
|
|
146
|
+
})
|
|
147
|
+
})
|
|
148
|
+
]
|
|
149
|
+
});
|
|
150
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
// Copyright 2022 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
|
+
_exportStar(require("./Variable"), exports);
|
|
18
|
+
_exportStar(require("./VariableList"), exports);
|
|
19
|
+
_exportStar(require("./VariableEditorForm"), exports);
|
|
20
|
+
function _exportStar(from, to) {
|
|
21
|
+
Object.keys(from).forEach(function(k) {
|
|
22
|
+
if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) Object.defineProperty(to, k, {
|
|
23
|
+
enumerable: true,
|
|
24
|
+
get: function() {
|
|
25
|
+
return from[k];
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
});
|
|
29
|
+
return from;
|
|
30
|
+
}
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
// Copyright 2022 The Perses Authors
|
|
2
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
3
|
+
// you may not use this file except in compliance with the License.
|
|
4
|
+
// You may obtain a copy of the License at
|
|
5
|
+
//
|
|
6
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
|
7
|
+
//
|
|
8
|
+
// Unless required by applicable law or agreed to in writing, software
|
|
9
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
10
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11
|
+
// See the License for the specific language governing permissions and
|
|
12
|
+
// limitations under the License.
|
|
13
|
+
"use strict";
|
|
14
|
+
Object.defineProperty(exports, "__esModule", {
|
|
15
|
+
value: true
|
|
16
|
+
});
|
|
17
|
+
function _export(target, all) {
|
|
18
|
+
for(var name1 in all)Object.defineProperty(target, name1, {
|
|
19
|
+
enumerable: true,
|
|
20
|
+
get: all[name1]
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
_export(exports, {
|
|
24
|
+
filterVariableList: ()=>filterVariableList,
|
|
25
|
+
useListVariablePluginValues: ()=>useListVariablePluginValues,
|
|
26
|
+
getVariableValuesKey: ()=>getVariableValuesKey,
|
|
27
|
+
VARIABLE_TYPES: ()=>VARIABLE_TYPES
|
|
28
|
+
});
|
|
29
|
+
const _pluginSystem = require("@perses-dev/plugin-system");
|
|
30
|
+
const _reactQuery = require("@tanstack/react-query");
|
|
31
|
+
function filterVariableList(data, capturedRegexp) {
|
|
32
|
+
const result = [];
|
|
33
|
+
const filteredSet = new Set();
|
|
34
|
+
for (const variableValue of data){
|
|
35
|
+
const matches = variableValue.value.matchAll(capturedRegexp);
|
|
36
|
+
let concat = '';
|
|
37
|
+
for (const match of matches){
|
|
38
|
+
for(let i = 1; i < match.length; i++){
|
|
39
|
+
const m = match[i];
|
|
40
|
+
if (m !== undefined) {
|
|
41
|
+
concat = `${concat}${m}`;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
if (concat !== '' && !filteredSet.has(concat)) {
|
|
46
|
+
// like that we are avoiding to have duplicating variable value
|
|
47
|
+
filteredSet.add(concat);
|
|
48
|
+
result.push({
|
|
49
|
+
label: variableValue.label,
|
|
50
|
+
value: concat
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
return result;
|
|
55
|
+
}
|
|
56
|
+
function useListVariablePluginValues(definition) {
|
|
57
|
+
const { data: variablePlugin } = (0, _pluginSystem.usePlugin)('Variable', definition.spec.plugin.kind);
|
|
58
|
+
const datasourceStore = (0, _pluginSystem.useDatasourceStore)();
|
|
59
|
+
const allVariables = (0, _pluginSystem.useTemplateVariableValues)();
|
|
60
|
+
const { absoluteTimeRange: timeRange , refreshKey } = (0, _pluginSystem.useTimeRange)();
|
|
61
|
+
const variablePluginCtx = {
|
|
62
|
+
timeRange,
|
|
63
|
+
datasourceStore,
|
|
64
|
+
variables: allVariables
|
|
65
|
+
};
|
|
66
|
+
const spec = definition.spec.plugin.spec;
|
|
67
|
+
const capturingRegexp = definition.spec.capturing_regexp !== undefined ? new RegExp(definition.spec.capturing_regexp, 'g') : undefined;
|
|
68
|
+
let dependsOnVariables;
|
|
69
|
+
if (variablePlugin === null || variablePlugin === void 0 ? void 0 : variablePlugin.dependsOn) {
|
|
70
|
+
const dependencies = variablePlugin.dependsOn(spec, variablePluginCtx);
|
|
71
|
+
dependsOnVariables = dependencies.variables;
|
|
72
|
+
}
|
|
73
|
+
const variables = (0, _pluginSystem.useTemplateVariableValues)(dependsOnVariables);
|
|
74
|
+
let waitToLoad = false;
|
|
75
|
+
if (dependsOnVariables) {
|
|
76
|
+
waitToLoad = dependsOnVariables.some((v)=>{
|
|
77
|
+
var ref;
|
|
78
|
+
return (ref = variables[v]) === null || ref === void 0 ? void 0 : ref.loading;
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
const variablesValueKey = getVariableValuesKey(variables);
|
|
82
|
+
return (0, _reactQuery.useQuery)([
|
|
83
|
+
name,
|
|
84
|
+
definition,
|
|
85
|
+
variablesValueKey,
|
|
86
|
+
timeRange,
|
|
87
|
+
refreshKey
|
|
88
|
+
], async ()=>{
|
|
89
|
+
const resp = await (variablePlugin === null || variablePlugin === void 0 ? void 0 : variablePlugin.getVariableOptions(spec, {
|
|
90
|
+
datasourceStore,
|
|
91
|
+
variables,
|
|
92
|
+
timeRange
|
|
93
|
+
}));
|
|
94
|
+
if (resp === undefined) {
|
|
95
|
+
return [];
|
|
96
|
+
}
|
|
97
|
+
if (capturingRegexp === undefined) {
|
|
98
|
+
return resp.data;
|
|
99
|
+
}
|
|
100
|
+
return filterVariableList(resp.data, capturingRegexp);
|
|
101
|
+
}, {
|
|
102
|
+
enabled: !!variablePlugin || waitToLoad
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
function getVariableValuesKey(v) {
|
|
106
|
+
return Object.values(v).map((v)=>JSON.stringify(v.value)).join(',');
|
|
107
|
+
}
|
|
108
|
+
const VARIABLE_TYPES = [
|
|
109
|
+
{
|
|
110
|
+
label: 'List',
|
|
111
|
+
kind: 'ListVariable'
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
label: 'Text',
|
|
115
|
+
kind: 'TextVariable'
|
|
116
|
+
}
|
|
117
|
+
];
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
// Copyright 2022 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
|
+
const _variableModel = require("./variable-model");
|
|
18
|
+
describe('filterVariableList', ()=>{
|
|
19
|
+
const testSuite = [
|
|
20
|
+
{
|
|
21
|
+
title: 'basic case',
|
|
22
|
+
capturing_regexp: /([^-]*)-host-([^-]*)/g,
|
|
23
|
+
originalValues: [
|
|
24
|
+
{
|
|
25
|
+
label: 'l1',
|
|
26
|
+
value: 'us1-host-ahdix'
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
label: 'l2',
|
|
30
|
+
value: 'us1-host-diua'
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
label: 'l3',
|
|
34
|
+
value: 'eu1-host-adf'
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
label: 'l4',
|
|
38
|
+
value: 'bar'
|
|
39
|
+
}
|
|
40
|
+
],
|
|
41
|
+
result: [
|
|
42
|
+
{
|
|
43
|
+
label: 'l1',
|
|
44
|
+
value: 'us1ahdix'
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
label: 'l2',
|
|
48
|
+
value: 'us1diua'
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
label: 'l3',
|
|
52
|
+
value: 'eu1adf'
|
|
53
|
+
}
|
|
54
|
+
]
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
title: 'duplicate captured value',
|
|
58
|
+
capturing_regexp: /prometheus-(.+):\d+/g,
|
|
59
|
+
originalValues: [
|
|
60
|
+
{
|
|
61
|
+
label: 'l1',
|
|
62
|
+
value: 'prometheus-app:9090'
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
label: 'l2',
|
|
66
|
+
value: 'prometheus-app:9091'
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
label: 'l3',
|
|
70
|
+
value: 'prometheus-platform:9091'
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
label: 'l4',
|
|
74
|
+
value: 'prometheus-database:9091'
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
label: 'l5',
|
|
78
|
+
value: 'prometheus-perses:9091'
|
|
79
|
+
}
|
|
80
|
+
],
|
|
81
|
+
result: [
|
|
82
|
+
{
|
|
83
|
+
label: 'l1',
|
|
84
|
+
value: 'app'
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
label: 'l3',
|
|
88
|
+
value: 'platform'
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
label: 'l4',
|
|
92
|
+
value: 'database'
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
label: 'l5',
|
|
96
|
+
value: 'perses'
|
|
97
|
+
}
|
|
98
|
+
]
|
|
99
|
+
}
|
|
100
|
+
];
|
|
101
|
+
testSuite.forEach(({ title , capturing_regexp , originalValues , result })=>{
|
|
102
|
+
it(title, ()=>{
|
|
103
|
+
expect((0, _variableModel.filterVariableList)(originalValues, capturing_regexp)).toEqual(result);
|
|
104
|
+
});
|
|
105
|
+
});
|
|
106
|
+
});
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
// Copyright 2022 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
|
+
_exportStar(require("./Dashboard"), exports);
|
|
18
|
+
_exportStar(require("./DashboardToolbar"), exports);
|
|
19
|
+
_exportStar(require("./DeletePanelDialog"), exports);
|
|
20
|
+
_exportStar(require("./DeletePanelGroupDialog"), exports);
|
|
21
|
+
_exportStar(require("./DownloadButton"), exports);
|
|
22
|
+
_exportStar(require("./GridLayout"), exports);
|
|
23
|
+
_exportStar(require("./Panel"), exports);
|
|
24
|
+
_exportStar(require("./PanelDrawer"), exports);
|
|
25
|
+
_exportStar(require("./PanelGroupDialog"), exports);
|
|
26
|
+
_exportStar(require("./TimeRangeControls"), exports);
|
|
27
|
+
_exportStar(require("./UnsavedChangesConfirmationDialog"), exports);
|
|
28
|
+
_exportStar(require("./Variables"), exports);
|
|
29
|
+
function _exportStar(from, to) {
|
|
30
|
+
Object.keys(from).forEach(function(k) {
|
|
31
|
+
if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) Object.defineProperty(to, k, {
|
|
32
|
+
enumerable: true,
|
|
33
|
+
get: function() {
|
|
34
|
+
return from[k];
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
});
|
|
38
|
+
return from;
|
|
39
|
+
}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
// Copyright 2022 The Perses Authors
|
|
2
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
3
|
+
// you may not use this file except in compliance with the License.
|
|
4
|
+
// You may obtain a copy of the License at
|
|
5
|
+
//
|
|
6
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
|
7
|
+
//
|
|
8
|
+
// Unless required by applicable law or agreed to in writing, software
|
|
9
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
10
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11
|
+
// See the License for the specific language governing permissions and
|
|
12
|
+
// limitations under the License.
|
|
13
|
+
"use strict";
|
|
14
|
+
Object.defineProperty(exports, "__esModule", {
|
|
15
|
+
value: true
|
|
16
|
+
});
|
|
17
|
+
function _export(target, all) {
|
|
18
|
+
for(var name in all)Object.defineProperty(target, name, {
|
|
19
|
+
enumerable: true,
|
|
20
|
+
get: all[name]
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
_export(exports, {
|
|
24
|
+
DashboardContext: ()=>DashboardContext,
|
|
25
|
+
useDashboardStore: ()=>useDashboardStore,
|
|
26
|
+
DashboardProvider: ()=>DashboardProvider
|
|
27
|
+
});
|
|
28
|
+
const _jsxRuntime = require("react/jsx-runtime");
|
|
29
|
+
const _zustand = require("zustand");
|
|
30
|
+
const _middleware = require("zustand/middleware");
|
|
31
|
+
const _immer = require("zustand/middleware/immer");
|
|
32
|
+
const _shallow = /*#__PURE__*/ _interopRequireDefault(require("zustand/shallow"));
|
|
33
|
+
const _react = require("react");
|
|
34
|
+
const _panelGroupEditorSlice = require("./panel-group-editor-slice");
|
|
35
|
+
const _panelGroupSlice = require("./panel-group-slice");
|
|
36
|
+
const _panelEditorSlice = require("./panel-editor-slice");
|
|
37
|
+
const _panelSlice = require("./panel-slice");
|
|
38
|
+
const _deletePanelGroupSlice = require("./delete-panel-group-slice");
|
|
39
|
+
const _deletePanelSlice = require("./delete-panel-slice");
|
|
40
|
+
function _interopRequireDefault(obj) {
|
|
41
|
+
return obj && obj.__esModule ? obj : {
|
|
42
|
+
default: obj
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
const DashboardContext = /*#__PURE__*/ (0, _react.createContext)(undefined);
|
|
46
|
+
function useDashboardStore(selector) {
|
|
47
|
+
const store = (0, _react.useContext)(DashboardContext);
|
|
48
|
+
if (store === undefined) {
|
|
49
|
+
throw new Error('No DashboardContext found. Did you forget a Provider?');
|
|
50
|
+
}
|
|
51
|
+
return (0, _zustand.useStore)(store, selector, _shallow.default);
|
|
52
|
+
}
|
|
53
|
+
function DashboardProvider(props) {
|
|
54
|
+
const createDashboardStore = (0, _react.useCallback)(initStore, [
|
|
55
|
+
props
|
|
56
|
+
]);
|
|
57
|
+
const [store] = (0, _react.useState)(createDashboardStore(props)); // prevent calling createDashboardStore every time it rerenders
|
|
58
|
+
return /*#__PURE__*/ (0, _jsxRuntime.jsx)(DashboardContext.Provider, {
|
|
59
|
+
value: store,
|
|
60
|
+
children: props.children
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
function initStore(props) {
|
|
64
|
+
const { initialState: { dashboardResource , isEditMode } , } = props;
|
|
65
|
+
const { spec: { layouts , panels , duration } , metadata , } = dashboardResource;
|
|
66
|
+
const store = (0, _zustand.createStore)()((0, _immer.immer)((0, _middleware.devtools)((...args)=>{
|
|
67
|
+
const [set] = args;
|
|
68
|
+
return {
|
|
69
|
+
...(0, _panelGroupSlice.createPanelGroupSlice)(layouts)(...args),
|
|
70
|
+
...(0, _panelSlice.createPanelSlice)(panels)(...args),
|
|
71
|
+
...(0, _panelGroupEditorSlice.createPanelGroupEditorSlice)(...args),
|
|
72
|
+
...(0, _deletePanelGroupSlice.createDeletePanelGroupSlice)(...args),
|
|
73
|
+
...(0, _panelEditorSlice.createPanelEditorSlice)()(...args),
|
|
74
|
+
...(0, _deletePanelSlice.createDeletePanelSlice)()(...args),
|
|
75
|
+
metadata,
|
|
76
|
+
defaultTimeRange: {
|
|
77
|
+
pastDuration: duration
|
|
78
|
+
},
|
|
79
|
+
isEditMode: !!isEditMode,
|
|
80
|
+
setEditMode: (isEditMode)=>set({
|
|
81
|
+
isEditMode
|
|
82
|
+
}),
|
|
83
|
+
setDashboard: ({ metadata , spec: { panels , layouts } })=>{
|
|
84
|
+
set((state)=>{
|
|
85
|
+
state.metadata = metadata;
|
|
86
|
+
const { panelGroups , panelGroupOrder } = (0, _panelGroupSlice.convertLayoutsToPanelGroups)(layouts);
|
|
87
|
+
state.panels = panels;
|
|
88
|
+
state.panelGroups = panelGroups;
|
|
89
|
+
state.panelGroupOrder = panelGroupOrder;
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
};
|
|
93
|
+
})));
|
|
94
|
+
return store;
|
|
95
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
// Copyright 2022 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
|
+
/**
|
|
14
|
+
* The middleware applied to the DashboardStore (can be used as generic argument in StateCreator).
|
|
15
|
+
*/ "use strict";
|
|
16
|
+
Object.defineProperty(exports, "__esModule", {
|
|
17
|
+
value: true
|
|
18
|
+
});
|
|
19
|
+
Object.defineProperty(exports, "generateId", {
|
|
20
|
+
enumerable: true,
|
|
21
|
+
get: ()=>generateId
|
|
22
|
+
});
|
|
23
|
+
function generateId() {
|
|
24
|
+
if (globalThis.dashboardStoreId === undefined) {
|
|
25
|
+
globalThis.dashboardStoreId = 0;
|
|
26
|
+
}
|
|
27
|
+
return globalThis.dashboardStoreId++;
|
|
28
|
+
}
|