From 6b9d8d7d9a5dba5f8e97f11b65bcc50fb44de3d4 Mon Sep 17 00:00:00 2001 From: Olivier Lamy Date: Thu, 26 Jan 2012 22:58:15 +0000 Subject: [PATCH] [MRM-1578] delete network proxy implemented git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1236439 13f79535-47bb-0310-9956-ffa450edef68 --- .../main/webapp/js/archiva/network-proxies.js | 20 ++++++++++++++++++- .../js/archiva/templates/network-proxies.html | 4 +++- 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/network-proxies.js b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/network-proxies.js index 77b9a7c40..b717fe9cd 100644 --- a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/network-proxies.js +++ b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/network-proxies.js @@ -116,7 +116,25 @@ $(function() { } removeNetworkProxy=function(networkProxy){ - + openDialogConfirm( + function(){$.ajax("restServices/archivaServices/networkProxyService/deleteNetworkProxy/"+encodeURIComponent(networkProxy.id()), + { + type: "get", + success: function(data) { + self.networkProxies.remove(networkProxy); + clearUserMessages(); + displaySuccessMessage($.i18n.prop('networkproxy.deleted')); + activateNetworkProxiesGridTab(); + }, + error: function(data) { + var res = $.parseJSON(data.responseText); + displayRestError(res); + }, + complete: function(){ + closeDialogConfirm(); + } + } + )}, $.i18n.prop('ok'), $.i18n.prop('cancel'), $.i18n.prop('networkproxy.delete.confirm',networkProxy.id()),null); } } diff --git a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/templates/network-proxies.html b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/templates/network-proxies.html index 50cf35e43..f66e64d73 100644 --- a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/templates/network-proxies.html +++ b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/templates/network-proxies.html @@ -47,7 +47,9 @@ ${$.i18n.prop('edit')} - ${$.i18n.prop('delete')} + + + {{/each}} -- 2.39.5