Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
nexpie-grafana-theme
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Registry
Registry
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kornkitt Poolsup
nexpie-grafana-theme
Commits
142a323e
Commit
142a323e
authored
Jul 17, 2015
by
Torkel Ödegaard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(save as): fixed issue with save as and overwriting a dashboard with the same name
parent
ea198fea
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
8 deletions
+25
-8
public/app/features/dashboard/saveDashboardAsCtrl.js
+25
-8
No files found.
public/app/features/dashboard/saveDashboardAsCtrl.js
View file @
142a323e
...
...
@@ -14,16 +14,33 @@ function (angular) {
$scope
.
clone
.
title
=
$scope
.
clone
.
title
+
" Copy"
;
};
$scope
.
saveClone
=
function
()
{
backendSrv
.
saveDashboard
(
$scope
.
clone
)
.
then
(
function
(
result
)
{
$scope
.
appEvent
(
'alert-success'
,
[
'Dashboard saved'
,
'Saved as '
+
$scope
.
clone
.
title
]);
function
saveDashboard
(
options
)
{
return
backendSrv
.
saveDashboard
(
$scope
.
clone
,
options
).
then
(
function
(
result
)
{
$scope
.
appEvent
(
'alert-success'
,
[
'Dashboard saved'
,
'Saved as '
+
$scope
.
clone
.
title
]);
$location
.
url
(
'/dashboard/db/'
+
result
.
slug
);
$location
.
url
(
'/dashboard/db/'
+
result
.
slug
);
$scope
.
appEvent
(
'dashboard-saved'
,
$scope
.
clone
);
$scope
.
dismiss
();
});
}
$scope
.
saveClone
=
function
()
{
saveDashboard
({
overwrite
:
false
}).
then
(
null
,
function
(
err
)
{
if
(
err
.
data
&&
err
.
data
.
status
===
"name-exists"
)
{
err
.
isHandled
=
true
;
$scope
.
appEvent
(
'dashboard-saved'
,
$scope
.
clone
);
$scope
.
dismiss
();
});
$scope
.
appEvent
(
'confirm-modal'
,
{
title
:
'Another dashboard with the same name exists'
,
text
:
"Would you still like to save this dashboard?"
,
yesText
:
"Save & Overwrite"
,
icon
:
"fa-warning"
,
onConfirm
:
function
()
{
saveDashboard
({
overwrite
:
true
});
}
});
}
});
};
});
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment