diff --git a/public/app/features/dashboard/viewStateSrv.js b/public/app/features/dashboard/viewStateSrv.js
index 63bb999e3ca..c523cd709d7 100644
--- a/public/app/features/dashboard/viewStateSrv.js
+++ b/public/app/features/dashboard/viewStateSrv.js
@@ -167,7 +167,11 @@ function (angular, _, $) {
self.panelScopes.push(panelScope);
if (self.state.panelId === panelScope.ctrl.panel.id) {
- self.enterFullscreen(panelScope);
+ if (self.state.edit) {
+ panelScope.ctrl.editPanel();
+ } else {
+ panelScope.ctrl.viewPanel();
+ }
}
panelScope.$on('$destroy', function() {
diff --git a/public/app/features/panel/panel.ts b/public/app/features/panel/panel.ts
index a3bf35db9a4..550f453260b 100644
--- a/public/app/features/panel/panel.ts
+++ b/public/app/features/panel/panel.ts
@@ -1,17 +1,26 @@
///
-import PanelMeta from './panel_meta3';
+import config from 'app/core/config';
+
+function generalOptionsTabEditorTab() {
+ return {templateUrl: 'public/app/partials/panelgeneral.html'};
+}
export class PanelCtrl {
- meta: any;
panel: any;
row: any;
dashboard: any;
- tabIndex: number;
+ editorTabIndex: number;
+ name: string;
+ icon: string;
+ editorTabs: any;
constructor(private scope) {
- this.meta = new PanelMeta(this.panel);
- this.tabIndex = 0;
+ var plugin = config.panels[this.panel.type];
+
+ this.name = plugin.name;
+ this.icon = plugin.info.icon;
+ this.editorTabIndex = 0;
this.publishAppEvent('panel-instantiated', {scope: scope});
}
@@ -30,12 +39,30 @@ export class PanelCtrl {
}
editPanel() {
+ if (!this.editorTabs) {
+ this.initEditorTabs();
+ }
+
this.changeView(true, true);
}
exitFullscreen() {
this.changeView(false, false);
}
+
+ initEditorTabs() {
+ this.editorTabs = [];
+ this.editorTabs.push({title: 'General', directiveFn: generalOptionsTabEditorTab});
+ }
+
+ getMenu() {
+ let menu = [];
+ menu.push({text: 'View', click: 'ctrl.viewPanel(); dismiss();'});
+ menu.push({text: 'Edit', click: 'ctrl.editPanel(); dismiss();', role: 'Editor'});
+ menu.push({text: 'Duplicate', click: 'ctrl.duplicate()', role: 'Editor' });
+ menu.push({text: 'Share', click: 'ctrl.share(); dismiss();'});
+ return menu;
+ }
}
export class PanelDirective {
diff --git a/public/app/features/panel/panel_menu.js b/public/app/features/panel/panel_menu.js
index 16ee311ff52..5ec5129dc38 100644
--- a/public/app/features/panel/panel_menu.js
+++ b/public/app/features/panel/panel_menu.js
@@ -13,7 +13,7 @@ function (angular, $, _) {
'' +
'{{ctrl.panel.title | interpolateTemplateVars:this}}' +
'' +
- ' {{ctrl.panelMeta.timeInfo}}' +
+ ' {{ctrl.timeInfo}}' +
'';
function createExternalLinkMenu(ctrl) {
@@ -44,7 +44,7 @@ function (angular, $, _) {
template += '