mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
feat(top_nav): option to make dashboards editable again
closes #2587 closes #2554
This commit is contained in:
parent
f163ceffd0
commit
9ece45caa5
@ -49,6 +49,21 @@ function (angular, _) {
|
||||
$scope.appEvent('hide-dash-search');
|
||||
};
|
||||
|
||||
$scope.makeEditable = function(evt) {
|
||||
$scope.dashboard.editable = true;
|
||||
|
||||
var clone = $scope.dashboard.getSaveModelClone();
|
||||
|
||||
backendSrv.saveDashboard(clone, {overwrite: false}).then(function(data) {
|
||||
$scope.dashboard.version = data.version;
|
||||
$scope.appEvent('dashboard-saved', $scope.dashboard);
|
||||
$scope.appEvent('alert-success', ['Dashboard saved', 'Saved as ' + clone.title]);
|
||||
|
||||
//force refresh whole page
|
||||
window.location.href = window.location.href;
|
||||
}, $scope.handleSaveDashError);
|
||||
};
|
||||
|
||||
$scope.saveDashboard = function(options) {
|
||||
if ($scope.dashboardMeta.canSave === false) {
|
||||
return;
|
||||
|
Loading…
Reference in New Issue
Block a user