@perses-dev/dashboards 0.53.0 → 0.54.0-beta.0
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/DashboardLinks/DashboardLinksEditor.js +366 -0
- package/dist/cjs/components/DashboardLinks/EditDashboardLinksButton.js +81 -0
- package/dist/cjs/components/DashboardLinks/index.js +31 -0
- package/dist/cjs/components/DashboardShortcuts/index.js +23 -0
- package/dist/cjs/components/DashboardShortcuts/useDashboardShortcuts.js +373 -0
- package/dist/cjs/components/DashboardToolbar/DashboardToolbar.js +16 -1
- package/dist/cjs/components/Datasources/EditDatasourcesButton.js +1 -7
- package/dist/cjs/components/GridLayout/GridItemContent.js +19 -6
- package/dist/cjs/components/{Panel/PanelLinks.js → LinksDisplay/LinksDisplay.js} +59 -10
- package/dist/cjs/components/LinksDisplay/index.js +30 -0
- package/dist/cjs/components/Panel/PanelActions.js +58 -35
- package/dist/cjs/components/PanelDrawer/PanelQueriesSharedControls.js +16 -1
- package/dist/cjs/components/SaveChangesConfirmationDialog/SaveChangesConfirmationDialog.js +4 -4
- package/dist/cjs/components/SaveDashboardButton/SaveDashboardButton.js +3 -61
- package/dist/cjs/components/Variables/ListVariableListBox.js +6 -6
- package/dist/cjs/components/Variables/Variable.js +3 -3
- package/dist/cjs/components/index.js +2 -0
- package/dist/cjs/constants/user-interface-text.js +1 -0
- package/dist/cjs/context/DashboardProvider/DashboardProvider.js +5 -1
- package/dist/cjs/context/DashboardProvider/dashboard-provider-api.js +16 -0
- package/dist/cjs/context/DashboardProvider/index.js +7 -0
- package/dist/cjs/context/DashboardProvider/links-slice.js +32 -0
- package/dist/cjs/context/DashboardProvider/panel-group-slice.js +2 -2
- package/dist/cjs/context/DashboardProvider/use-save-dashboard.js +104 -0
- package/dist/cjs/context/DatasourceStoreProvider.js +3 -9
- package/dist/cjs/context/VariableProvider/VariableProvider.js +7 -6
- package/dist/cjs/context/VariableProvider/hydrationUtils.js +3 -3
- package/dist/cjs/context/useDashboard.js +7 -4
- package/dist/cjs/index.js +2 -0
- package/dist/cjs/keyboard-shortcuts/PanelFocusProvider.js +157 -0
- package/dist/cjs/keyboard-shortcuts/default-shortcuts/dashboard.js +75 -0
- package/dist/cjs/keyboard-shortcuts/default-shortcuts/global.js +121 -0
- package/dist/cjs/keyboard-shortcuts/default-shortcuts/index.js +33 -0
- package/dist/cjs/keyboard-shortcuts/default-shortcuts/panel.js +90 -0
- package/dist/cjs/keyboard-shortcuts/default-shortcuts/time-range.js +142 -0
- package/dist/cjs/keyboard-shortcuts/events.js +93 -0
- package/dist/cjs/keyboard-shortcuts/index.js +89 -0
- package/dist/cjs/keyboard-shortcuts/types.js +42 -0
- package/dist/cjs/keyboard-shortcuts/utils.js +76 -0
- package/dist/cjs/model/DashboardResource.js +16 -0
- package/dist/cjs/model/index.js +30 -0
- package/dist/cjs/test/render.js +18 -3
- package/dist/cjs/views/ViewDashboard/DashboardApp.js +17 -2
- package/dist/cjs/views/ViewDashboard/ViewDashboard.js +2 -1
- package/dist/components/Dashboard/Dashboard.d.ts.map +1 -1
- package/dist/components/Dashboard/Dashboard.js.map +1 -1
- package/dist/components/DashboardLinks/DashboardLinksEditor.d.ts +9 -0
- package/dist/components/DashboardLinks/DashboardLinksEditor.d.ts.map +1 -0
- package/dist/components/DashboardLinks/DashboardLinksEditor.js +353 -0
- package/dist/components/DashboardLinks/DashboardLinksEditor.js.map +1 -0
- package/dist/components/DashboardLinks/EditDashboardLinksButton.d.ts +18 -0
- package/dist/components/DashboardLinks/EditDashboardLinksButton.d.ts.map +1 -0
- package/dist/components/DashboardLinks/EditDashboardLinksButton.js +68 -0
- package/dist/components/DashboardLinks/EditDashboardLinksButton.js.map +1 -0
- package/dist/components/DashboardLinks/index.d.ts +3 -0
- package/dist/components/DashboardLinks/index.d.ts.map +1 -0
- package/dist/components/DashboardLinks/index.js +16 -0
- package/dist/components/DashboardLinks/index.js.map +1 -0
- package/dist/components/DashboardShortcuts/index.d.ts +3 -0
- package/dist/components/DashboardShortcuts/index.d.ts.map +1 -0
- package/dist/components/DashboardShortcuts/index.js +15 -0
- package/dist/components/DashboardShortcuts/index.js.map +1 -0
- package/dist/components/DashboardShortcuts/useDashboardShortcuts.d.ts +12 -0
- package/dist/components/DashboardShortcuts/useDashboardShortcuts.d.ts.map +1 -0
- package/dist/components/DashboardShortcuts/useDashboardShortcuts.js +365 -0
- package/dist/components/DashboardShortcuts/useDashboardShortcuts.js.map +1 -0
- package/dist/components/DashboardToolbar/DashboardToolbar.d.ts +1 -0
- package/dist/components/DashboardToolbar/DashboardToolbar.d.ts.map +1 -1
- package/dist/components/DashboardToolbar/DashboardToolbar.js +17 -2
- package/dist/components/DashboardToolbar/DashboardToolbar.js.map +1 -1
- package/dist/components/Datasources/DatasourceEditor.d.ts +1 -1
- package/dist/components/Datasources/DatasourceEditor.d.ts.map +1 -1
- package/dist/components/Datasources/DatasourceEditor.js.map +1 -1
- package/dist/components/Datasources/EditDatasourcesButton.d.ts.map +1 -1
- package/dist/components/Datasources/EditDatasourcesButton.js +1 -7
- package/dist/components/Datasources/EditDatasourcesButton.js.map +1 -1
- package/dist/components/DownloadButton/serializeDashboard.d.ts +2 -2
- package/dist/components/DownloadButton/serializeDashboard.d.ts.map +1 -1
- package/dist/components/DownloadButton/serializeDashboard.js.map +1 -1
- package/dist/components/GridLayout/GridItemContent.d.ts.map +1 -1
- package/dist/components/GridLayout/GridItemContent.js +21 -8
- package/dist/components/GridLayout/GridItemContent.js.map +1 -1
- package/dist/components/GridLayout/GridLayout.d.ts +1 -1
- package/dist/components/GridLayout/GridLayout.d.ts.map +1 -1
- package/dist/components/GridLayout/GridLayout.js.map +1 -1
- package/dist/components/GridLayout/GridTitle.d.ts +1 -1
- package/dist/components/GridLayout/GridTitle.js.map +1 -1
- package/dist/components/GridLayout/Row.d.ts +2 -1
- package/dist/components/GridLayout/Row.d.ts.map +1 -1
- package/dist/components/GridLayout/Row.js.map +1 -1
- package/dist/components/LeaveDialog/LeaveDialog.d.ts +3 -3
- package/dist/components/LeaveDialog/LeaveDialog.d.ts.map +1 -1
- package/dist/components/LeaveDialog/LeaveDialog.js.map +1 -1
- package/dist/components/LinksDisplay/LinksDisplay.d.ts +10 -0
- package/dist/components/LinksDisplay/LinksDisplay.d.ts.map +1 -0
- package/dist/components/{Panel/PanelLinks.js → LinksDisplay/LinksDisplay.js} +59 -10
- package/dist/components/LinksDisplay/LinksDisplay.js.map +1 -0
- package/dist/components/LinksDisplay/index.d.ts +2 -0
- package/dist/components/LinksDisplay/index.d.ts.map +1 -0
- package/dist/components/LinksDisplay/index.js +15 -0
- package/dist/components/LinksDisplay/index.js.map +1 -0
- package/dist/components/Panel/Panel.d.ts +2 -1
- package/dist/components/Panel/Panel.d.ts.map +1 -1
- package/dist/components/Panel/Panel.js.map +1 -1
- package/dist/components/Panel/PanelActions.d.ts +1 -1
- package/dist/components/Panel/PanelActions.d.ts.map +1 -1
- package/dist/components/Panel/PanelActions.js +59 -36
- package/dist/components/Panel/PanelActions.js.map +1 -1
- package/dist/components/Panel/PanelContent.d.ts +1 -1
- package/dist/components/Panel/PanelContent.js.map +1 -1
- package/dist/components/Panel/PanelHeader.d.ts +1 -1
- package/dist/components/Panel/PanelHeader.js.map +1 -1
- package/dist/components/Panel/PanelPluginLoader.d.ts +1 -1
- package/dist/components/Panel/PanelPluginLoader.js.map +1 -1
- package/dist/components/PanelDrawer/PanelDrawer.js.map +1 -1
- package/dist/components/PanelDrawer/PanelEditorForm.d.ts +2 -1
- package/dist/components/PanelDrawer/PanelEditorForm.d.ts.map +1 -1
- package/dist/components/PanelDrawer/PanelEditorForm.js.map +1 -1
- package/dist/components/PanelDrawer/PanelPreview.d.ts +1 -1
- package/dist/components/PanelDrawer/PanelPreview.js.map +1 -1
- package/dist/components/PanelDrawer/PanelQueriesSharedControls.d.ts +1 -1
- package/dist/components/PanelDrawer/PanelQueriesSharedControls.d.ts.map +1 -1
- package/dist/components/PanelDrawer/PanelQueriesSharedControls.js +16 -1
- package/dist/components/PanelDrawer/PanelQueriesSharedControls.js.map +1 -1
- package/dist/components/PanelDrawer/usePanelEditor.d.ts +1 -1
- package/dist/components/PanelDrawer/usePanelEditor.js.map +1 -1
- package/dist/components/QuerySummaryTable/QuerySummaryTable.js.map +1 -1
- package/dist/components/QueryViewerDialog/QueryViewerDialog.d.ts +1 -1
- package/dist/components/QueryViewerDialog/QueryViewerDialog.js.map +1 -1
- package/dist/components/SaveChangesConfirmationDialog/SaveChangesConfirmationDialog.js +1 -1
- package/dist/components/SaveChangesConfirmationDialog/SaveChangesConfirmationDialog.js.map +1 -1
- package/dist/components/SaveDashboardButton/SaveDashboardButton.d.ts.map +1 -1
- package/dist/components/SaveDashboardButton/SaveDashboardButton.js +4 -62
- package/dist/components/SaveDashboardButton/SaveDashboardButton.js.map +1 -1
- package/dist/components/Variables/BuiltinVariableAccordions.d.ts +1 -1
- package/dist/components/Variables/BuiltinVariableAccordions.js.map +1 -1
- package/dist/components/Variables/EditVariablesButton.d.ts.map +1 -1
- package/dist/components/Variables/EditVariablesButton.js.map +1 -1
- package/dist/components/Variables/ListVariableListBox.js +1 -1
- package/dist/components/Variables/ListVariableListBox.js.map +1 -1
- package/dist/components/Variables/Variable.d.ts +1 -1
- package/dist/components/Variables/Variable.js +1 -1
- package/dist/components/Variables/Variable.js.map +1 -1
- package/dist/components/Variables/VariableEditor.d.ts +2 -1
- package/dist/components/Variables/VariableEditor.d.ts.map +1 -1
- package/dist/components/Variables/VariableEditor.js.map +1 -1
- package/dist/components/Variables/VariableList.d.ts +1 -1
- package/dist/components/Variables/VariableList.d.ts.map +1 -1
- package/dist/components/Variables/VariableList.js.map +1 -1
- package/dist/components/index.d.ts +2 -0
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/index.js +2 -0
- package/dist/components/index.js.map +1 -1
- package/dist/constants/user-interface-text.d.ts +1 -0
- package/dist/constants/user-interface-text.d.ts.map +1 -1
- package/dist/constants/user-interface-text.js +1 -0
- package/dist/constants/user-interface-text.js.map +1 -1
- package/dist/context/DashboardProvider/DashboardProvider.d.ts +8 -6
- package/dist/context/DashboardProvider/DashboardProvider.d.ts.map +1 -1
- package/dist/context/DashboardProvider/DashboardProvider.js +5 -1
- package/dist/context/DashboardProvider/DashboardProvider.js.map +1 -1
- package/dist/context/DashboardProvider/common.d.ts +3 -2
- 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 +15 -2
- package/dist/context/DashboardProvider/dashboard-provider-api.d.ts.map +1 -1
- package/dist/context/DashboardProvider/dashboard-provider-api.js +14 -0
- package/dist/context/DashboardProvider/dashboard-provider-api.js.map +1 -1
- package/dist/context/DashboardProvider/delete-panel-group-slice.d.ts +1 -1
- package/dist/context/DashboardProvider/delete-panel-group-slice.js.map +1 -1
- package/dist/context/DashboardProvider/delete-panel-slice.js.map +1 -1
- package/dist/context/DashboardProvider/duplicate-panel-slice.js.map +1 -1
- package/dist/context/DashboardProvider/index.d.ts +2 -0
- package/dist/context/DashboardProvider/index.d.ts.map +1 -1
- package/dist/context/DashboardProvider/index.js +1 -0
- package/dist/context/DashboardProvider/index.js.map +1 -1
- package/dist/context/DashboardProvider/links-slice.d.ts +19 -0
- package/dist/context/DashboardProvider/links-slice.d.ts.map +1 -0
- package/dist/context/DashboardProvider/links-slice.js +27 -0
- package/dist/context/DashboardProvider/links-slice.js.map +1 -0
- package/dist/context/DashboardProvider/panel-editor-slice.d.ts +2 -1
- package/dist/context/DashboardProvider/panel-editor-slice.d.ts.map +1 -1
- package/dist/context/DashboardProvider/panel-editor-slice.js.map +1 -1
- package/dist/context/DashboardProvider/panel-group-editor-slice.d.ts +1 -1
- package/dist/context/DashboardProvider/panel-group-editor-slice.js.map +1 -1
- package/dist/context/DashboardProvider/panel-group-slice.d.ts +2 -1
- package/dist/context/DashboardProvider/panel-group-slice.d.ts.map +1 -1
- package/dist/context/DashboardProvider/panel-group-slice.js +1 -1
- package/dist/context/DashboardProvider/panel-group-slice.js.map +1 -1
- package/dist/context/DashboardProvider/panel-slice.d.ts +1 -1
- package/dist/context/DashboardProvider/panel-slice.js.map +1 -1
- package/dist/context/DashboardProvider/use-save-dashboard.d.ts +25 -0
- package/dist/context/DashboardProvider/use-save-dashboard.d.ts.map +1 -0
- package/dist/context/DashboardProvider/use-save-dashboard.js +105 -0
- package/dist/context/DashboardProvider/use-save-dashboard.js.map +1 -0
- package/dist/context/DashboardProvider/view-panel-slice.d.ts.map +1 -1
- package/dist/context/DashboardProvider/view-panel-slice.js.map +1 -1
- package/dist/context/DatasourceStoreProvider.d.ts +4 -2
- package/dist/context/DatasourceStoreProvider.d.ts.map +1 -1
- package/dist/context/DatasourceStoreProvider.js +3 -9
- package/dist/context/DatasourceStoreProvider.js.map +1 -1
- package/dist/context/VariableProvider/VariableProvider.d.ts +2 -1
- package/dist/context/VariableProvider/VariableProvider.d.ts.map +1 -1
- package/dist/context/VariableProvider/VariableProvider.js +2 -1
- package/dist/context/VariableProvider/VariableProvider.js.map +1 -1
- package/dist/context/VariableProvider/hydrationUtils.d.ts +2 -1
- package/dist/context/VariableProvider/hydrationUtils.d.ts.map +1 -1
- package/dist/context/VariableProvider/hydrationUtils.js +1 -1
- package/dist/context/VariableProvider/hydrationUtils.js.map +1 -1
- package/dist/context/VariableProvider/query-params.d.ts +1 -1
- package/dist/context/VariableProvider/query-params.js.map +1 -1
- package/dist/context/VariableProvider/utils.d.ts +2 -1
- package/dist/context/VariableProvider/utils.d.ts.map +1 -1
- package/dist/context/VariableProvider/utils.js.map +1 -1
- package/dist/context/useDashboard.d.ts +11 -3
- package/dist/context/useDashboard.d.ts.map +1 -1
- package/dist/context/useDashboard.js +6 -3
- package/dist/context/useDashboard.js.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/keyboard-shortcuts/PanelFocusProvider.d.ts +12 -0
- package/dist/keyboard-shortcuts/PanelFocusProvider.d.ts.map +1 -0
- package/dist/keyboard-shortcuts/PanelFocusProvider.js +97 -0
- package/dist/keyboard-shortcuts/PanelFocusProvider.js.map +1 -0
- package/dist/keyboard-shortcuts/default-shortcuts/dashboard.d.ts +6 -0
- package/dist/keyboard-shortcuts/default-shortcuts/dashboard.d.ts.map +1 -0
- package/dist/keyboard-shortcuts/default-shortcuts/dashboard.js +53 -0
- package/dist/keyboard-shortcuts/default-shortcuts/dashboard.js.map +1 -0
- package/dist/keyboard-shortcuts/default-shortcuts/global.d.ts +9 -0
- package/dist/keyboard-shortcuts/default-shortcuts/global.d.ts.map +1 -0
- package/dist/keyboard-shortcuts/default-shortcuts/global.js +90 -0
- package/dist/keyboard-shortcuts/default-shortcuts/global.js.map +1 -0
- package/dist/keyboard-shortcuts/default-shortcuts/index.d.ts +5 -0
- package/dist/keyboard-shortcuts/default-shortcuts/index.d.ts.map +1 -0
- package/dist/keyboard-shortcuts/default-shortcuts/index.js +18 -0
- package/dist/keyboard-shortcuts/default-shortcuts/index.js.map +1 -0
- package/dist/keyboard-shortcuts/default-shortcuts/panel.d.ts +7 -0
- package/dist/keyboard-shortcuts/default-shortcuts/panel.d.ts.map +1 -0
- package/dist/keyboard-shortcuts/default-shortcuts/panel.js +65 -0
- package/dist/keyboard-shortcuts/default-shortcuts/panel.js.map +1 -0
- package/dist/keyboard-shortcuts/default-shortcuts/time-range.d.ts +10 -0
- package/dist/keyboard-shortcuts/default-shortcuts/time-range.d.ts.map +1 -0
- package/dist/keyboard-shortcuts/default-shortcuts/time-range.js +108 -0
- package/dist/keyboard-shortcuts/default-shortcuts/time-range.js.map +1 -0
- package/dist/keyboard-shortcuts/events.d.ts +18 -0
- package/dist/keyboard-shortcuts/events.d.ts.map +1 -0
- package/dist/keyboard-shortcuts/events.js +35 -0
- package/dist/keyboard-shortcuts/events.js.map +1 -0
- package/dist/keyboard-shortcuts/index.d.ts +9 -0
- package/dist/keyboard-shortcuts/index.d.ts.map +1 -0
- package/dist/keyboard-shortcuts/index.js +21 -0
- package/dist/keyboard-shortcuts/index.js.map +1 -0
- package/dist/keyboard-shortcuts/types.d.ts +37 -0
- package/dist/keyboard-shortcuts/types.d.ts.map +1 -0
- package/dist/keyboard-shortcuts/types.js +26 -0
- package/dist/keyboard-shortcuts/types.js.map +1 -0
- package/dist/keyboard-shortcuts/utils.d.ts +12 -0
- package/dist/keyboard-shortcuts/utils.d.ts.map +1 -0
- package/dist/keyboard-shortcuts/utils.js +51 -0
- package/dist/keyboard-shortcuts/utils.js.map +1 -0
- package/dist/model/DashboardResource.d.ts +15 -0
- package/dist/model/DashboardResource.d.ts.map +1 -0
- package/dist/model/DashboardResource.js +18 -0
- package/dist/model/DashboardResource.js.map +1 -0
- package/dist/model/index.d.ts +2 -0
- package/dist/model/index.d.ts.map +1 -0
- package/dist/model/index.js +15 -0
- package/dist/model/index.js.map +1 -0
- package/dist/test/dashboard-provider.d.ts +1 -1
- package/dist/test/dashboard-provider.d.ts.map +1 -1
- package/dist/test/dashboard-provider.js.map +1 -1
- package/dist/test/datasource-provider.js.map +1 -1
- package/dist/test/plugin-registry.js.map +1 -1
- package/dist/test/render.d.ts.map +1 -1
- package/dist/test/render.js +18 -3
- package/dist/test/render.js.map +1 -1
- package/dist/test/testDashboard.d.ts +11 -2
- package/dist/test/testDashboard.d.ts.map +1 -1
- package/dist/test/testDashboard.js.map +1 -1
- package/dist/utils/panelUtils.js.map +1 -1
- package/dist/views/ViewDashboard/DashboardApp.d.ts +5 -3
- package/dist/views/ViewDashboard/DashboardApp.d.ts.map +1 -1
- package/dist/views/ViewDashboard/DashboardApp.js +18 -3
- package/dist/views/ViewDashboard/DashboardApp.js.map +1 -1
- package/dist/views/ViewDashboard/ViewDashboard.d.ts.map +1 -1
- package/dist/views/ViewDashboard/ViewDashboard.js +3 -2
- package/dist/views/ViewDashboard/ViewDashboard.js.map +1 -1
- package/package.json +6 -4
- package/dist/components/Panel/PanelLinks.d.ts +0 -6
- package/dist/components/Panel/PanelLinks.d.ts.map +0 -1
- package/dist/components/Panel/PanelLinks.js.map +0 -1
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
// Copyright 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: Object.getOwnPropertyDescriptor(all, name).get
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
_export(exports, {
|
|
24
|
+
get TIME_COPY_SHORTCUT () {
|
|
25
|
+
return TIME_COPY_SHORTCUT;
|
|
26
|
+
},
|
|
27
|
+
get TIME_MAKE_ABSOLUTE_SHORTCUT () {
|
|
28
|
+
return TIME_MAKE_ABSOLUTE_SHORTCUT;
|
|
29
|
+
},
|
|
30
|
+
get TIME_PASTE_SHORTCUT () {
|
|
31
|
+
return TIME_PASTE_SHORTCUT;
|
|
32
|
+
},
|
|
33
|
+
get TIME_RANGE_SHORTCUTS () {
|
|
34
|
+
return TIME_RANGE_SHORTCUTS;
|
|
35
|
+
},
|
|
36
|
+
get TIME_SHIFT_BACK_SHORTCUT () {
|
|
37
|
+
return TIME_SHIFT_BACK_SHORTCUT;
|
|
38
|
+
},
|
|
39
|
+
get TIME_SHIFT_FORWARD_SHORTCUT () {
|
|
40
|
+
return TIME_SHIFT_FORWARD_SHORTCUT;
|
|
41
|
+
},
|
|
42
|
+
get TIME_ZOOM_IN_SHORTCUT () {
|
|
43
|
+
return TIME_ZOOM_IN_SHORTCUT;
|
|
44
|
+
},
|
|
45
|
+
get TIME_ZOOM_OUT_SHORTCUT () {
|
|
46
|
+
return TIME_ZOOM_OUT_SHORTCUT;
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
const _events = require("../events");
|
|
50
|
+
const TIME_ZOOM_OUT_SHORTCUT = {
|
|
51
|
+
id: 'time-zoom-out',
|
|
52
|
+
sequence: [
|
|
53
|
+
'T',
|
|
54
|
+
'O'
|
|
55
|
+
],
|
|
56
|
+
name: 'Zoom Out',
|
|
57
|
+
description: 'Zoom out time range (2x)',
|
|
58
|
+
category: 'time-range',
|
|
59
|
+
scope: 'dashboard',
|
|
60
|
+
event: _events.TIME_ZOOM_OUT_EVENT
|
|
61
|
+
};
|
|
62
|
+
const TIME_ZOOM_IN_SHORTCUT = {
|
|
63
|
+
id: 'time-zoom-in',
|
|
64
|
+
sequence: [
|
|
65
|
+
'T',
|
|
66
|
+
'I'
|
|
67
|
+
],
|
|
68
|
+
name: 'Zoom In',
|
|
69
|
+
description: 'Zoom in time range (½)',
|
|
70
|
+
category: 'time-range',
|
|
71
|
+
scope: 'dashboard',
|
|
72
|
+
event: _events.TIME_ZOOM_IN_EVENT
|
|
73
|
+
};
|
|
74
|
+
const TIME_SHIFT_BACK_SHORTCUT = {
|
|
75
|
+
id: 'time-shift-back',
|
|
76
|
+
sequence: [
|
|
77
|
+
'T',
|
|
78
|
+
'ArrowLeft'
|
|
79
|
+
],
|
|
80
|
+
name: 'Shift Back',
|
|
81
|
+
description: 'Shift time range backward',
|
|
82
|
+
category: 'time-range',
|
|
83
|
+
scope: 'dashboard',
|
|
84
|
+
event: _events.TIME_SHIFT_BACK_EVENT
|
|
85
|
+
};
|
|
86
|
+
const TIME_SHIFT_FORWARD_SHORTCUT = {
|
|
87
|
+
id: 'time-shift-forward',
|
|
88
|
+
sequence: [
|
|
89
|
+
'T',
|
|
90
|
+
'ArrowRight'
|
|
91
|
+
],
|
|
92
|
+
name: 'Shift Forward',
|
|
93
|
+
description: 'Shift time range forward',
|
|
94
|
+
category: 'time-range',
|
|
95
|
+
scope: 'dashboard',
|
|
96
|
+
event: _events.TIME_SHIFT_FORWARD_EVENT
|
|
97
|
+
};
|
|
98
|
+
const TIME_MAKE_ABSOLUTE_SHORTCUT = {
|
|
99
|
+
id: 'time-make-absolute',
|
|
100
|
+
sequence: [
|
|
101
|
+
'T',
|
|
102
|
+
'A'
|
|
103
|
+
],
|
|
104
|
+
name: 'Make Absolute',
|
|
105
|
+
description: 'Convert time range to absolute',
|
|
106
|
+
category: 'time-range',
|
|
107
|
+
scope: 'dashboard',
|
|
108
|
+
event: _events.TIME_MAKE_ABSOLUTE_EVENT
|
|
109
|
+
};
|
|
110
|
+
const TIME_COPY_SHORTCUT = {
|
|
111
|
+
id: 'time-copy',
|
|
112
|
+
sequence: [
|
|
113
|
+
'T',
|
|
114
|
+
'C'
|
|
115
|
+
],
|
|
116
|
+
name: 'Copy Time Range',
|
|
117
|
+
description: 'Copy time range to clipboard',
|
|
118
|
+
category: 'time-range',
|
|
119
|
+
scope: 'dashboard',
|
|
120
|
+
event: _events.TIME_COPY_EVENT
|
|
121
|
+
};
|
|
122
|
+
const TIME_PASTE_SHORTCUT = {
|
|
123
|
+
id: 'time-paste',
|
|
124
|
+
sequence: [
|
|
125
|
+
'T',
|
|
126
|
+
'V'
|
|
127
|
+
],
|
|
128
|
+
name: 'Paste Time Range',
|
|
129
|
+
description: 'Paste time range from clipboard',
|
|
130
|
+
category: 'time-range',
|
|
131
|
+
scope: 'dashboard',
|
|
132
|
+
event: _events.TIME_PASTE_EVENT
|
|
133
|
+
};
|
|
134
|
+
const TIME_RANGE_SHORTCUTS = [
|
|
135
|
+
TIME_ZOOM_OUT_SHORTCUT,
|
|
136
|
+
TIME_ZOOM_IN_SHORTCUT,
|
|
137
|
+
TIME_SHIFT_BACK_SHORTCUT,
|
|
138
|
+
TIME_SHIFT_FORWARD_SHORTCUT,
|
|
139
|
+
TIME_MAKE_ABSOLUTE_SHORTCUT,
|
|
140
|
+
TIME_COPY_SHORTCUT,
|
|
141
|
+
TIME_PASTE_SHORTCUT
|
|
142
|
+
];
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
// Copyright 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
|
+
// Dashboard events
|
|
14
|
+
"use strict";
|
|
15
|
+
Object.defineProperty(exports, "__esModule", {
|
|
16
|
+
value: true
|
|
17
|
+
});
|
|
18
|
+
function _export(target, all) {
|
|
19
|
+
for(var name in all)Object.defineProperty(target, name, {
|
|
20
|
+
enumerable: true,
|
|
21
|
+
get: Object.getOwnPropertyDescriptor(all, name).get
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
_export(exports, {
|
|
25
|
+
get OPEN_SEARCH_EVENT () {
|
|
26
|
+
return OPEN_SEARCH_EVENT;
|
|
27
|
+
},
|
|
28
|
+
get PANEL_DELETE_EVENT () {
|
|
29
|
+
return PANEL_DELETE_EVENT;
|
|
30
|
+
},
|
|
31
|
+
get PANEL_DUPLICATE_EVENT () {
|
|
32
|
+
return PANEL_DUPLICATE_EVENT;
|
|
33
|
+
},
|
|
34
|
+
get PANEL_EDIT_EVENT () {
|
|
35
|
+
return PANEL_EDIT_EVENT;
|
|
36
|
+
},
|
|
37
|
+
get PANEL_FULLSCREEN_EVENT () {
|
|
38
|
+
return PANEL_FULLSCREEN_EVENT;
|
|
39
|
+
},
|
|
40
|
+
get REFRESH_DASHBOARD_EVENT () {
|
|
41
|
+
return REFRESH_DASHBOARD_EVENT;
|
|
42
|
+
},
|
|
43
|
+
get SAVE_DASHBOARD_EVENT () {
|
|
44
|
+
return SAVE_DASHBOARD_EVENT;
|
|
45
|
+
},
|
|
46
|
+
get SHOW_SHORTCUTS_EVENT () {
|
|
47
|
+
return SHOW_SHORTCUTS_EVENT;
|
|
48
|
+
},
|
|
49
|
+
get TIME_COPY_EVENT () {
|
|
50
|
+
return TIME_COPY_EVENT;
|
|
51
|
+
},
|
|
52
|
+
get TIME_MAKE_ABSOLUTE_EVENT () {
|
|
53
|
+
return TIME_MAKE_ABSOLUTE_EVENT;
|
|
54
|
+
},
|
|
55
|
+
get TIME_PASTE_EVENT () {
|
|
56
|
+
return TIME_PASTE_EVENT;
|
|
57
|
+
},
|
|
58
|
+
get TIME_SHIFT_BACK_EVENT () {
|
|
59
|
+
return TIME_SHIFT_BACK_EVENT;
|
|
60
|
+
},
|
|
61
|
+
get TIME_SHIFT_FORWARD_EVENT () {
|
|
62
|
+
return TIME_SHIFT_FORWARD_EVENT;
|
|
63
|
+
},
|
|
64
|
+
get TIME_ZOOM_IN_EVENT () {
|
|
65
|
+
return TIME_ZOOM_IN_EVENT;
|
|
66
|
+
},
|
|
67
|
+
get TIME_ZOOM_OUT_EVENT () {
|
|
68
|
+
return TIME_ZOOM_OUT_EVENT;
|
|
69
|
+
},
|
|
70
|
+
get TOGGLE_EDIT_MODE_EVENT () {
|
|
71
|
+
return TOGGLE_EDIT_MODE_EVENT;
|
|
72
|
+
},
|
|
73
|
+
get TOGGLE_THEME_EVENT () {
|
|
74
|
+
return TOGGLE_THEME_EVENT;
|
|
75
|
+
}
|
|
76
|
+
});
|
|
77
|
+
const SAVE_DASHBOARD_EVENT = 'perses:save-dashboard';
|
|
78
|
+
const REFRESH_DASHBOARD_EVENT = 'perses:refresh-dashboard';
|
|
79
|
+
const TOGGLE_EDIT_MODE_EVENT = 'perses:toggle-edit-mode';
|
|
80
|
+
const TIME_ZOOM_OUT_EVENT = 'perses:time-zoom-out';
|
|
81
|
+
const TIME_ZOOM_IN_EVENT = 'perses:time-zoom-in';
|
|
82
|
+
const TIME_SHIFT_BACK_EVENT = 'perses:time-shift-back';
|
|
83
|
+
const TIME_SHIFT_FORWARD_EVENT = 'perses:time-shift-forward';
|
|
84
|
+
const TIME_MAKE_ABSOLUTE_EVENT = 'perses:time-make-absolute';
|
|
85
|
+
const TIME_COPY_EVENT = 'perses:time-copy';
|
|
86
|
+
const TIME_PASTE_EVENT = 'perses:time-paste';
|
|
87
|
+
const PANEL_EDIT_EVENT = 'perses:panel-edit';
|
|
88
|
+
const PANEL_FULLSCREEN_EVENT = 'perses:panel-fullscreen';
|
|
89
|
+
const PANEL_DUPLICATE_EVENT = 'perses:panel-duplicate';
|
|
90
|
+
const PANEL_DELETE_EVENT = 'perses:panel-delete';
|
|
91
|
+
const OPEN_SEARCH_EVENT = 'perses:open-search';
|
|
92
|
+
const SHOW_SHORTCUTS_EVENT = 'perses:show-shortcuts';
|
|
93
|
+
const TOGGLE_THEME_EVENT = 'perses:toggle-theme';
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
// Copyright 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: Object.getOwnPropertyDescriptor(all, name).get
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
_export(exports, {
|
|
24
|
+
get HotkeysProvider () {
|
|
25
|
+
return _reacthotkeys.HotkeysProvider;
|
|
26
|
+
},
|
|
27
|
+
get PanelFocusProvider () {
|
|
28
|
+
return _PanelFocusProvider.PanelFocusProvider;
|
|
29
|
+
},
|
|
30
|
+
get buildShortcutOptions () {
|
|
31
|
+
return _utils.buildShortcutOptions;
|
|
32
|
+
},
|
|
33
|
+
get dispatchShortcutEvent () {
|
|
34
|
+
return _utils.dispatchShortcutEvent;
|
|
35
|
+
},
|
|
36
|
+
get formatForDisplay () {
|
|
37
|
+
return _hotkeys.formatForDisplay;
|
|
38
|
+
},
|
|
39
|
+
get requireShortcutEvent () {
|
|
40
|
+
return _utils.requireShortcutEvent;
|
|
41
|
+
},
|
|
42
|
+
get requireShortcutHotkey () {
|
|
43
|
+
return _utils.requireShortcutHotkey;
|
|
44
|
+
},
|
|
45
|
+
get requireShortcutSequence () {
|
|
46
|
+
return _utils.requireShortcutSequence;
|
|
47
|
+
},
|
|
48
|
+
get useFocusedPanel () {
|
|
49
|
+
return _PanelFocusProvider.useFocusedPanel;
|
|
50
|
+
},
|
|
51
|
+
get useHotkey () {
|
|
52
|
+
return _reacthotkeys.useHotkey;
|
|
53
|
+
},
|
|
54
|
+
get useHotkeyRegistrations () {
|
|
55
|
+
return _reacthotkeys.useHotkeyRegistrations;
|
|
56
|
+
},
|
|
57
|
+
get useHotkeySequence () {
|
|
58
|
+
return _reacthotkeys.useHotkeySequence;
|
|
59
|
+
},
|
|
60
|
+
get useHotkeySequences () {
|
|
61
|
+
return _reacthotkeys.useHotkeySequences;
|
|
62
|
+
},
|
|
63
|
+
get useHotkeys () {
|
|
64
|
+
return _reacthotkeys.useHotkeys;
|
|
65
|
+
},
|
|
66
|
+
get usePanelFocusHandlers () {
|
|
67
|
+
return _PanelFocusProvider.usePanelFocusHandlers;
|
|
68
|
+
}
|
|
69
|
+
});
|
|
70
|
+
_export_star(require("./types"), exports);
|
|
71
|
+
_export_star(require("./events"), exports);
|
|
72
|
+
const _PanelFocusProvider = require("./PanelFocusProvider");
|
|
73
|
+
const _utils = require("./utils");
|
|
74
|
+
_export_star(require("./default-shortcuts"), exports);
|
|
75
|
+
const _reacthotkeys = require("@tanstack/react-hotkeys");
|
|
76
|
+
const _hotkeys = require("@tanstack/hotkeys");
|
|
77
|
+
function _export_star(from, to) {
|
|
78
|
+
Object.keys(from).forEach(function(k) {
|
|
79
|
+
if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) {
|
|
80
|
+
Object.defineProperty(to, k, {
|
|
81
|
+
enumerable: true,
|
|
82
|
+
get: function() {
|
|
83
|
+
return from[k];
|
|
84
|
+
}
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
});
|
|
88
|
+
return from;
|
|
89
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
// Copyright 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: Object.getOwnPropertyDescriptor(all, name).get
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
_export(exports, {
|
|
24
|
+
get SHORTCUT_CATEGORY_LABELS () {
|
|
25
|
+
return SHORTCUT_CATEGORY_LABELS;
|
|
26
|
+
},
|
|
27
|
+
get SHORTCUT_CATEGORY_ORDER () {
|
|
28
|
+
return SHORTCUT_CATEGORY_ORDER;
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
const SHORTCUT_CATEGORY_LABELS = {
|
|
32
|
+
global: 'Global',
|
|
33
|
+
'time-range': 'Time Range',
|
|
34
|
+
dashboard: 'Dashboard',
|
|
35
|
+
'focused-panel': 'Focused Panel'
|
|
36
|
+
};
|
|
37
|
+
const SHORTCUT_CATEGORY_ORDER = [
|
|
38
|
+
'global',
|
|
39
|
+
'time-range',
|
|
40
|
+
'dashboard',
|
|
41
|
+
'focused-panel'
|
|
42
|
+
];
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
// Copyright 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: Object.getOwnPropertyDescriptor(all, name).get
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
_export(exports, {
|
|
24
|
+
get buildShortcutOptions () {
|
|
25
|
+
return buildShortcutOptions;
|
|
26
|
+
},
|
|
27
|
+
get dispatchShortcutEvent () {
|
|
28
|
+
return dispatchShortcutEvent;
|
|
29
|
+
},
|
|
30
|
+
get requireShortcutEvent () {
|
|
31
|
+
return requireShortcutEvent;
|
|
32
|
+
},
|
|
33
|
+
get requireShortcutHotkey () {
|
|
34
|
+
return requireShortcutHotkey;
|
|
35
|
+
},
|
|
36
|
+
get requireShortcutSequence () {
|
|
37
|
+
return requireShortcutSequence;
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
|
+
function buildShortcutOptions(def, enabled) {
|
|
41
|
+
return {
|
|
42
|
+
enabled,
|
|
43
|
+
meta: {
|
|
44
|
+
id: def.id,
|
|
45
|
+
name: def.name,
|
|
46
|
+
description: def.description,
|
|
47
|
+
category: def.category,
|
|
48
|
+
scope: def.scope,
|
|
49
|
+
displayOverride: def.displayOverride
|
|
50
|
+
},
|
|
51
|
+
...def.ignoreInputs !== undefined ? {
|
|
52
|
+
ignoreInputs: def.ignoreInputs
|
|
53
|
+
} : {}
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
function requireShortcutHotkey(def) {
|
|
57
|
+
if (def.hotkey === undefined) {
|
|
58
|
+
throw new Error(`Shortcut ${def.id} is missing a hotkey definition`);
|
|
59
|
+
}
|
|
60
|
+
return def.hotkey;
|
|
61
|
+
}
|
|
62
|
+
function requireShortcutSequence(def) {
|
|
63
|
+
if (def.sequence === undefined) {
|
|
64
|
+
throw new Error(`Shortcut ${def.id} is missing a sequence definition`);
|
|
65
|
+
}
|
|
66
|
+
return def.sequence;
|
|
67
|
+
}
|
|
68
|
+
function requireShortcutEvent(def) {
|
|
69
|
+
if (def.event === undefined) {
|
|
70
|
+
throw new Error(`Shortcut ${def.id} is missing an event definition`);
|
|
71
|
+
}
|
|
72
|
+
return def.event;
|
|
73
|
+
}
|
|
74
|
+
function dispatchShortcutEvent(eventName) {
|
|
75
|
+
window.dispatchEvent(new CustomEvent(eventName));
|
|
76
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
// Copyright 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
|
+
});
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
// Copyright 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
|
+
_export_star(require("./DashboardResource"), exports);
|
|
18
|
+
function _export_star(from, to) {
|
|
19
|
+
Object.keys(from).forEach(function(k) {
|
|
20
|
+
if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) {
|
|
21
|
+
Object.defineProperty(to, k, {
|
|
22
|
+
enumerable: true,
|
|
23
|
+
get: function() {
|
|
24
|
+
return from[k];
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
});
|
|
29
|
+
return from;
|
|
30
|
+
}
|
package/dist/cjs/test/render.js
CHANGED
|
@@ -23,6 +23,7 @@ Object.defineProperty(exports, "renderWithContext", {
|
|
|
23
23
|
const _jsxruntime = require("react/jsx-runtime");
|
|
24
24
|
const _components = require("@perses-dev/components");
|
|
25
25
|
const _pluginsystem = require("@perses-dev/plugin-system");
|
|
26
|
+
const _reacthotkeys = require("@tanstack/react-hotkeys");
|
|
26
27
|
const _reactquery = require("@tanstack/react-query");
|
|
27
28
|
const _react = require("@testing-library/react");
|
|
28
29
|
const _history = require("history");
|
|
@@ -31,6 +32,7 @@ const _reactrouterdom = require("react-router-dom");
|
|
|
31
32
|
const _usequeryparams = require("use-query-params");
|
|
32
33
|
const _reactrouter6 = require("use-query-params/adapters/react-router-6");
|
|
33
34
|
const _context = require("../context");
|
|
35
|
+
const _keyboardshortcuts = require("../keyboard-shortcuts");
|
|
34
36
|
const _test = require("../test");
|
|
35
37
|
const _pluginregistry = require("./plugin-registry");
|
|
36
38
|
/*
|
|
@@ -79,9 +81,22 @@ function renderWithContext(ui, options, history) {
|
|
|
79
81
|
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_pluginsystem.PluginRegistry, {
|
|
80
82
|
pluginLoader: mockRegistry.pluginLoader,
|
|
81
83
|
defaultPluginKinds: mockRegistry.defaultPluginKinds,
|
|
82
|
-
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(
|
|
83
|
-
|
|
84
|
-
|
|
84
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_reacthotkeys.HotkeysProvider, {
|
|
85
|
+
defaultOptions: {
|
|
86
|
+
hotkey: {
|
|
87
|
+
preventDefault: true,
|
|
88
|
+
stopPropagation: true
|
|
89
|
+
},
|
|
90
|
+
hotkeySequence: {
|
|
91
|
+
timeout: 1000
|
|
92
|
+
}
|
|
93
|
+
},
|
|
94
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_keyboardshortcuts.PanelFocusProvider, {
|
|
95
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_context.DatasourceStoreProvider, {
|
|
96
|
+
..._test.defaultDatasourceProps,
|
|
97
|
+
children: ui
|
|
98
|
+
})
|
|
99
|
+
})
|
|
85
100
|
})
|
|
86
101
|
})
|
|
87
102
|
})
|
|
@@ -27,8 +27,16 @@ const _components = require("@perses-dev/components");
|
|
|
27
27
|
const _pluginsystem = require("@perses-dev/plugin-system");
|
|
28
28
|
const _components1 = require("../../components");
|
|
29
29
|
const _context = require("../../context");
|
|
30
|
+
const _keyboardshortcuts = require("../../keyboard-shortcuts");
|
|
30
31
|
const DashboardApp = (props)=>{
|
|
31
|
-
|
|
32
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsx)(_keyboardshortcuts.PanelFocusProvider, {
|
|
33
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(DashboardAppContent, {
|
|
34
|
+
...props
|
|
35
|
+
})
|
|
36
|
+
});
|
|
37
|
+
};
|
|
38
|
+
const DashboardAppContent = (props)=>{
|
|
39
|
+
const { dashboardResource, emptyDashboardProps, isReadonly, isVariableEnabled, isDatasourceEnabled, disableShortcuts, isCreating, isInitialVariableSticky, isLeavingConfirmDialogEnabled, dashboardTitleComponent, onSave, onDiscard } = props;
|
|
32
40
|
const chartsTheme = (0, _components.useChartsTheme)();
|
|
33
41
|
const { isEditMode, setEditMode } = (0, _context.useEditMode)();
|
|
34
42
|
const { dashboard, setDashboard } = (0, _context.useDashboard)();
|
|
@@ -43,7 +51,7 @@ const DashboardApp = (props)=>{
|
|
|
43
51
|
setEditMode(false);
|
|
44
52
|
closeDiscardChangesConfirmationDialog();
|
|
45
53
|
if (onDiscard) {
|
|
46
|
-
onDiscard(dashboard);
|
|
54
|
+
onDiscard(dashboard.metadata.name, dashboard.spec);
|
|
47
55
|
}
|
|
48
56
|
};
|
|
49
57
|
const onEditButtonClick = ()=>{
|
|
@@ -66,6 +74,13 @@ const DashboardApp = (props)=>{
|
|
|
66
74
|
});
|
|
67
75
|
}
|
|
68
76
|
};
|
|
77
|
+
(0, _components1.useDashboardShortcuts)({
|
|
78
|
+
onSave,
|
|
79
|
+
isReadonly,
|
|
80
|
+
onEditButtonClick,
|
|
81
|
+
onCancelButtonClick,
|
|
82
|
+
disabled: disableShortcuts
|
|
83
|
+
});
|
|
69
84
|
return /*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Box, {
|
|
70
85
|
sx: {
|
|
71
86
|
flexGrow: 1,
|
|
@@ -30,7 +30,7 @@ const _context = require("../../context");
|
|
|
30
30
|
const _DashboardProviderWithQueryParams = require("../../context/DashboardProvider/DashboardProviderWithQueryParams");
|
|
31
31
|
const _DashboardApp = require("./DashboardApp");
|
|
32
32
|
function ViewDashboard(props) {
|
|
33
|
-
const { dashboardResource, datasourceApi, externalVariableDefinitions, emptyDashboardProps, isReadonly, isVariableEnabled, isDatasourceEnabled, isEditing, isCreating, isInitialVariableSticky, isLeavingConfirmDialogEnabled, dashboardTitleComponent, onSave, onDiscard, sx, ...others } = props;
|
|
33
|
+
const { dashboardResource, datasourceApi, externalVariableDefinitions, emptyDashboardProps, isReadonly, isVariableEnabled, isDatasourceEnabled, disableShortcuts, isEditing, isCreating, isInitialVariableSticky, isLeavingConfirmDialogEnabled, dashboardTitleComponent, onSave, onDiscard, sx, ...others } = props;
|
|
34
34
|
const { spec } = dashboardResource;
|
|
35
35
|
const dashboardDuration = spec.duration ?? _core.DEFAULT_DASHBOARD_DURATION;
|
|
36
36
|
const dashboardRefreshInterval = spec.refreshInterval ?? _core.DEFAULT_REFRESH_INTERVAL;
|
|
@@ -107,6 +107,7 @@ function ViewDashboard(props) {
|
|
|
107
107
|
isReadonly: isReadonly,
|
|
108
108
|
isVariableEnabled: isVariableEnabled,
|
|
109
109
|
isDatasourceEnabled: isDatasourceEnabled,
|
|
110
|
+
disableShortcuts: disableShortcuts,
|
|
110
111
|
isCreating: isCreating,
|
|
111
112
|
isInitialVariableSticky: isInitialVariableSticky,
|
|
112
113
|
isLeavingConfirmDialogEnabled: isLeavingConfirmDialogEnabled,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Dashboard.d.ts","sourceRoot":"","sources":["../../../src/components/Dashboard/Dashboard.tsx"],"names":[],"mappings":"AAaA,OAAO,EAAO,QAAQ,EAAE,MAAM,eAAe,CAAC;AAE9C,OAAO,EAAE,YAAY,EAAU,MAAM,OAAO,CAAC;AAG7C,OAAO,EAAkB,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AACxE,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"Dashboard.d.ts","sourceRoot":"","sources":["../../../src/components/Dashboard/Dashboard.tsx"],"names":[],"mappings":"AAaA,OAAO,EAAO,QAAQ,EAAE,MAAM,eAAe,CAAC;AAE9C,OAAO,EAAE,YAAY,EAAU,MAAM,OAAO,CAAC;AAG7C,OAAO,EAAkB,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AACxE,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAExC,MAAM,MAAM,cAAc,GAAG,QAAQ,GAAG;IACtC;;;;OAIG;IACH,mBAAmB,CAAC,EAAE,mBAAmB,CAAC;IAC1C,YAAY,CAAC,EAAE,YAAY,CAAC;CAC7B,CAAC;AAGF;;GAEG;AACH,wBAAgB,SAAS,CAAC,EAAE,mBAAmB,EAAE,YAAY,EAAE,GAAG,QAAQ,EAAE,EAAE,cAAc,GAAG,YAAY,CA2B1G"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/Dashboard/Dashboard.tsx"],"sourcesContent":["// Copyright The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { Box, BoxProps } from '@mui/material';\nimport { ErrorBoundary, ErrorAlert } from '@perses-dev/components';\nimport { ReactElement, useRef } from 'react';\nimport { usePanelGroupIds } from '../../context';\nimport { GridLayout } from '../GridLayout';\nimport { EmptyDashboard, EmptyDashboardProps } from '../EmptyDashboard';\nimport { PanelOptions } from '../Panel';\nexport type DashboardProps = BoxProps & {\n /**\n * Props for `EmptyDashboard` component that will be rendered when the dashboard\n * is empty (i.e. has no panel groups). If not specified, the defaults will\n * be used.\n */\n emptyDashboardProps?: EmptyDashboardProps;\n panelOptions?: PanelOptions;\n};\nconst HEADER_HEIGHT = 165; // Approximate height of the header in dashboard view (including the navbar and variables toolbar)\n\n/**\n * Renders a Dashboard for the provided Dashboard spec.\n */\nexport function Dashboard({ emptyDashboardProps, panelOptions, ...boxProps }: DashboardProps): ReactElement {\n const panelGroupIds = usePanelGroupIds();\n const boxRef = useRef<HTMLDivElement>(null);\n const isEmpty = !panelGroupIds.length;\n const dashboardTopPosition = boxRef.current?.getBoundingClientRect().top ?? HEADER_HEIGHT;\n const panelFullHeight = window.innerHeight - dashboardTopPosition - window.scrollY;\n\n return (\n <Box {...boxProps} sx={{ height: '100%' }} ref={boxRef}>\n <ErrorBoundary FallbackComponent={ErrorAlert}>\n {isEmpty && (\n <Box sx={{ height: '100%', display: 'flex', alignItems: 'center' }}>\n <EmptyDashboard {...emptyDashboardProps} />\n </Box>\n )}\n {!isEmpty &&\n panelGroupIds.map((panelGroupId) => (\n <GridLayout\n key={panelGroupId}\n panelGroupId={panelGroupId}\n panelOptions={panelOptions}\n panelFullHeight={panelFullHeight}\n />\n ))}\n </ErrorBoundary>\n </Box>\n );\n}\n"],"names":["Box","ErrorBoundary","ErrorAlert","useRef","usePanelGroupIds","GridLayout","EmptyDashboard","HEADER_HEIGHT","Dashboard","emptyDashboardProps","panelOptions","boxProps","panelGroupIds","boxRef","isEmpty","length","dashboardTopPosition","current","getBoundingClientRect","top","panelFullHeight","window","innerHeight","scrollY","sx","height","ref","FallbackComponent","display","alignItems","map","panelGroupId"],"mappings":"AAAA,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;;AAEjC,SAASA,GAAG,QAAkB,gBAAgB;AAC9C,SAASC,aAAa,EAAEC,UAAU,QAAQ,yBAAyB;AACnE,SAAuBC,MAAM,QAAQ,QAAQ;AAC7C,SAASC,gBAAgB,QAAQ,gBAAgB;AACjD,SAASC,UAAU,QAAQ,gBAAgB;AAC3C,SAASC,cAAc,QAA6B,oBAAoB;
|
|
1
|
+
{"version":3,"sources":["../../../src/components/Dashboard/Dashboard.tsx"],"sourcesContent":["// Copyright The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { Box, BoxProps } from '@mui/material';\nimport { ErrorBoundary, ErrorAlert } from '@perses-dev/components';\nimport { ReactElement, useRef } from 'react';\nimport { usePanelGroupIds } from '../../context';\nimport { GridLayout } from '../GridLayout';\nimport { EmptyDashboard, EmptyDashboardProps } from '../EmptyDashboard';\nimport { PanelOptions } from '../Panel';\n\nexport type DashboardProps = BoxProps & {\n /**\n * Props for `EmptyDashboard` component that will be rendered when the dashboard\n * is empty (i.e. has no panel groups). If not specified, the defaults will\n * be used.\n */\n emptyDashboardProps?: EmptyDashboardProps;\n panelOptions?: PanelOptions;\n};\nconst HEADER_HEIGHT = 165; // Approximate height of the header in dashboard view (including the navbar and variables toolbar)\n\n/**\n * Renders a Dashboard for the provided Dashboard spec.\n */\nexport function Dashboard({ emptyDashboardProps, panelOptions, ...boxProps }: DashboardProps): ReactElement {\n const panelGroupIds = usePanelGroupIds();\n const boxRef = useRef<HTMLDivElement>(null);\n const isEmpty = !panelGroupIds.length;\n const dashboardTopPosition = boxRef.current?.getBoundingClientRect().top ?? HEADER_HEIGHT;\n const panelFullHeight = window.innerHeight - dashboardTopPosition - window.scrollY;\n\n return (\n <Box {...boxProps} sx={{ height: '100%' }} ref={boxRef}>\n <ErrorBoundary FallbackComponent={ErrorAlert}>\n {isEmpty && (\n <Box sx={{ height: '100%', display: 'flex', alignItems: 'center' }}>\n <EmptyDashboard {...emptyDashboardProps} />\n </Box>\n )}\n {!isEmpty &&\n panelGroupIds.map((panelGroupId) => (\n <GridLayout\n key={panelGroupId}\n panelGroupId={panelGroupId}\n panelOptions={panelOptions}\n panelFullHeight={panelFullHeight}\n />\n ))}\n </ErrorBoundary>\n </Box>\n );\n}\n"],"names":["Box","ErrorBoundary","ErrorAlert","useRef","usePanelGroupIds","GridLayout","EmptyDashboard","HEADER_HEIGHT","Dashboard","emptyDashboardProps","panelOptions","boxProps","panelGroupIds","boxRef","isEmpty","length","dashboardTopPosition","current","getBoundingClientRect","top","panelFullHeight","window","innerHeight","scrollY","sx","height","ref","FallbackComponent","display","alignItems","map","panelGroupId"],"mappings":"AAAA,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;;AAEjC,SAASA,GAAG,QAAkB,gBAAgB;AAC9C,SAASC,aAAa,EAAEC,UAAU,QAAQ,yBAAyB;AACnE,SAAuBC,MAAM,QAAQ,QAAQ;AAC7C,SAASC,gBAAgB,QAAQ,gBAAgB;AACjD,SAASC,UAAU,QAAQ,gBAAgB;AAC3C,SAASC,cAAc,QAA6B,oBAAoB;AAYxE,MAAMC,gBAAgB,KAAK,kGAAkG;AAE7H;;CAEC,GACD,OAAO,SAASC,UAAU,EAAEC,mBAAmB,EAAEC,YAAY,EAAE,GAAGC,UAA0B;IAC1F,MAAMC,gBAAgBR;IACtB,MAAMS,SAASV,OAAuB;IACtC,MAAMW,UAAU,CAACF,cAAcG,MAAM;IACrC,MAAMC,uBAAuBH,OAAOI,OAAO,EAAEC,wBAAwBC,OAAOZ;IAC5E,MAAMa,kBAAkBC,OAAOC,WAAW,GAAGN,uBAAuBK,OAAOE,OAAO;IAElF,qBACE,KAACvB;QAAK,GAAGW,QAAQ;QAAEa,IAAI;YAAEC,QAAQ;QAAO;QAAGC,KAAKb;kBAC9C,cAAA,MAACZ;YAAc0B,mBAAmBzB;;gBAC/BY,yBACC,KAACd;oBAAIwB,IAAI;wBAAEC,QAAQ;wBAAQG,SAAS;wBAAQC,YAAY;oBAAS;8BAC/D,cAAA,KAACvB;wBAAgB,GAAGG,mBAAmB;;;gBAG1C,CAACK,WACAF,cAAckB,GAAG,CAAC,CAACC,6BACjB,KAAC1B;wBAEC0B,cAAcA;wBACdrB,cAAcA;wBACdU,iBAAiBA;uBAHZW;;;;AASnB"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ReactElement } from 'react';
|
|
2
|
+
import { Link } from '@perses-dev/spec';
|
|
3
|
+
export interface DashboardLinksEditorProps {
|
|
4
|
+
links: Link[];
|
|
5
|
+
onChange: (links: Link[]) => void;
|
|
6
|
+
onCancel: () => void;
|
|
7
|
+
}
|
|
8
|
+
export declare function DashboardLinksEditor({ links: initialLinks, onChange, onCancel, }: DashboardLinksEditorProps): ReactElement;
|
|
9
|
+
//# sourceMappingURL=DashboardLinksEditor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DashboardLinksEditor.d.ts","sourceRoot":"","sources":["../../../src/components/DashboardLinks/DashboardLinksEditor.tsx"],"names":[],"mappings":"AAaA,OAAO,EAAY,YAAY,EAAE,MAAM,OAAO,CAAC;AAqB/C,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAKxC,MAAM,WAAW,yBAAyB;IACxC,KAAK,EAAE,IAAI,EAAE,CAAC;IACd,QAAQ,EAAE,CAAC,KAAK,EAAE,IAAI,EAAE,KAAK,IAAI,CAAC;IAClC,QAAQ,EAAE,MAAM,IAAI,CAAC;CACtB;AAUD,wBAAgB,oBAAoB,CAAC,EACnC,KAAK,EAAE,YAAY,EACnB,QAAQ,EACR,QAAQ,GACT,EAAE,yBAAyB,GAAG,YAAY,CAgJ1C"}
|