浏览代码

Merge pull request #11264 from grafana/11102_duplicate_panel_shortcut

Keyboard shortcut to duplicate panel
Daniel Lee 7 年之前
父节点
当前提交
c53fda4b5a
共有 1 个文件被更改,包括 8 次插入0 次删除
  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) {