ask confirmation before deleting remote repository

git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1236448 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Olivier Lamy 2012-01-26 23:43:19 +00:00
parent d3626d0e81
commit ade168dbad
1 changed files with 21 additions and 13 deletions

View File

@ -608,19 +608,27 @@ $(function() {
}
removeRemoteRepository=function(remoteRepository){
$.ajax("restServices/archivaServices/remoteRepositoriesService/deleteRemoteRepository/"+remoteRepository.id(),
{
type: "GET",
success: function(data) {
self.remoteRepositories.remove(remoteRepository);
displaySuccessMessage($.i18n.prop('remoterepository.deleted'));
},
error: function(data) {
var res = $.parseJSON(data.responseText);
displayRestError(res);
}
}
);
clearUserMessages();
openDialogConfirm(
function(){$.ajax("restServices/archivaServices/remoteRepositoriesService/deleteRemoteRepository/"+remoteRepository.id(),
{
type: "GET",
success: function(data) {
self.remoteRepositories.remove(remoteRepository);
displaySuccessMessage($.i18n.prop('remoterepository.deleted'));
},
error: function(data) {
var res = $.parseJSON(data.responseText);
displayRestError(res);
},
complete:function(){
closeDialogConfirm();
}
}
)}, $.i18n.prop('ok'),
$.i18n.prop('cancel'),
$.i18n.prop('remoterepository.delete.confirm',remoteRepository.id()),null);
}
scheduleDownloadRemoteIndex=function(remoteRepository){