Browse Source

Merge pull request #11264 from grafana/11102_duplicate_panel_shortcut

Keyboard shortcut to duplicate panel
Daniel Lee 7 years ago
parent
commit
c53fda4b5a
1 changed files with 8 additions and 0 deletions
  1. 8 0
      public/app/core/services/keybindingSrv.ts

+ 8 - 0
public/app/core/services/keybindingSrv.ts

@@ -178,6 +178,14 @@ export class KeybindingSrv {
       }
     });
 
+    // duplicate panel
+    this.bind('p d', () => {
+      if (dashboard.meta.focusPanelId && dashboard.meta.canEdit) {
+        let panelIndex = dashboard.getPanelInfoById(dashboard.meta.focusPanelId).index;
+        dashboard.duplicatePanel(dashboard.panels[panelIndex]);
+      }
+    });
+
     // share panel
     this.bind('p s', () => {
       if (dashboard.meta.focusPanelId) {