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){ removeRemoteRepository=function(remoteRepository){
$.ajax("restServices/archivaServices/remoteRepositoriesService/deleteRemoteRepository/"+remoteRepository.id(), clearUserMessages();
{ openDialogConfirm(
type: "GET", function(){$.ajax("restServices/archivaServices/remoteRepositoriesService/deleteRemoteRepository/"+remoteRepository.id(),
success: function(data) { {
self.remoteRepositories.remove(remoteRepository); type: "GET",
displaySuccessMessage($.i18n.prop('remoterepository.deleted')); success: function(data) {
}, self.remoteRepositories.remove(remoteRepository);
error: function(data) { displaySuccessMessage($.i18n.prop('remoterepository.deleted'));
var res = $.parseJSON(data.responseText); },
displayRestError(res); 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){ scheduleDownloadRemoteIndex=function(remoteRepository){