mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
feat(plugins): various fixes entering edit mode after adding a new panel
This commit is contained in:
parent
c465e594d7
commit
908765e0e7
@ -103,6 +103,11 @@ function (angular, _, $) {
|
|||||||
if (!panelScope) {
|
if (!panelScope) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!panelScope.ctrl.editModeInitiated) {
|
||||||
|
panelScope.ctrl.initEditMode();
|
||||||
|
}
|
||||||
|
|
||||||
this.enterFullscreen(panelScope);
|
this.enterFullscreen(panelScope);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -41,6 +41,7 @@ class MetricsPanelCtrl extends PanelCtrl {
|
|||||||
}
|
}
|
||||||
|
|
||||||
initEditMode() {
|
initEditMode() {
|
||||||
|
super.initEditMode();
|
||||||
this.addEditorTab('Metrics', 'public/app/partials/metrics.html');
|
this.addEditorTab('Metrics', 'public/app/partials/metrics.html');
|
||||||
this.addEditorTab('Time range', 'public/app/features/panel/partials/panelTime.html');
|
this.addEditorTab('Time range', 'public/app/features/panel/partials/panelTime.html');
|
||||||
this.datasources = this.datasourceSrv.getMetricSources();
|
this.datasources = this.datasourceSrv.getMetricSources();
|
||||||
|
@ -63,12 +63,6 @@ export class PanelCtrl {
|
|||||||
}
|
}
|
||||||
|
|
||||||
editPanel() {
|
editPanel() {
|
||||||
if (!this.editModeInitiated) {
|
|
||||||
this.editorTabs = [];
|
|
||||||
this.addEditorTab('General', 'public/app/partials/panelgeneral.html');
|
|
||||||
this.initEditMode();
|
|
||||||
}
|
|
||||||
|
|
||||||
this.changeView(true, true);
|
this.changeView(true, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -77,7 +71,9 @@ export class PanelCtrl {
|
|||||||
}
|
}
|
||||||
|
|
||||||
initEditMode() {
|
initEditMode() {
|
||||||
return;
|
this.editorTabs = [];
|
||||||
|
this.addEditorTab('General', 'public/app/partials/panelgeneral.html');
|
||||||
|
this.editModeInitiated = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
addEditorTab(title, directiveFn, index?) {
|
addEditorTab(title, directiveFn, index?) {
|
||||||
@ -166,12 +162,12 @@ export class PanelCtrl {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
sharePanel() {
|
sharePanel() {
|
||||||
var shareScope = this.$scope.$new();
|
var shareScope = this.$scope.$new();
|
||||||
shareScope.panel = this.panel;
|
shareScope.panel = this.panel;
|
||||||
shareScope.dashboard = this.dashboard;
|
shareScope.dashboard = this.dashboard;
|
||||||
|
|
||||||
this.publishAppEvent('show-modal', {
|
this.publishAppEvent('show-modal', {
|
||||||
src: 'public/app/features/dashboard/partials/shareModal.html',
|
src: 'public/app/features/dashboard/partials/shareModal.html',
|
||||||
scope: shareScope
|
scope: shareScope
|
||||||
});
|
});
|
||||||
|
@ -32,6 +32,8 @@ class SingleStatPanel extends PanelDirective {
|
|||||||
$panelContainer = elem.parents('.panel-container');
|
$panelContainer = elem.parents('.panel-container');
|
||||||
firstRender = false;
|
firstRender = false;
|
||||||
hookupDrilldownLinkTooltip();
|
hookupDrilldownLinkTooltip();
|
||||||
|
} else {
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -57,7 +57,7 @@ export class TablePanelCtrl extends MetricsPanelCtrl {
|
|||||||
|
|
||||||
initEditMode() {
|
initEditMode() {
|
||||||
super.initEditMode();
|
super.initEditMode();
|
||||||
this.addEditorTab('Options', tablePanelEditor, 1);
|
this.addEditorTab('Options', tablePanelEditor, 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
getExtendedMenu() {
|
getExtendedMenu() {
|
||||||
|
@ -21,8 +21,10 @@ export class TextPanelCtrl extends PanelCtrl {
|
|||||||
}
|
}
|
||||||
|
|
||||||
initEditMode() {
|
initEditMode() {
|
||||||
|
super.initEditMode();
|
||||||
this.icon = 'fa fa-text-width';
|
this.icon = 'fa fa-text-width';
|
||||||
this.addEditorTab('Options', 'public/app/plugins/panel/text/editor.html');
|
this.addEditorTab('Options', 'public/app/plugins/panel/text/editor.html');
|
||||||
|
this.editorTabIndex = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
refresh() {
|
refresh() {
|
||||||
|
Loading…
Reference in New Issue
Block a user