From 426462bdc6bda08444344d834bda1b2e27f31b91 Mon Sep 17 00:00:00 2001 From: Olivier Lamy Date: Wed, 8 Feb 2012 23:56:50 +0000 Subject: [PATCH] [MRM-1576] rewrite proxies connector page white/black list pattern ui binding. git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1242184 13f79535-47bb-0310-9956-ffa450edef68 --- .../apache/archiva/i18n/default.properties | 2 + .../webapp/js/archiva/proxy-connectors.js | 29 ++++++++++-- .../archiva/templates/proxy-connectors.html | 44 ++++++++++++++++++- .../src/main/webapp/js/archiva/utils.js | 1 - 4 files changed, 70 insertions(+), 6 deletions(-) diff --git a/archiva-modules/archiva-web/archiva-web-common/src/main/resources/org/apache/archiva/i18n/default.properties b/archiva-modules/archiva-web/archiva-web-common/src/main/resources/org/apache/archiva/i18n/default.properties index 4c08f6194..ac437fd3e 100644 --- a/archiva-modules/archiva-web/archiva-web-common/src/main/resources/org/apache/archiva/i18n/default.properties +++ b/archiva-modules/archiva-web/archiva-web-common/src/main/resources/org/apache/archiva/i18n/default.properties @@ -138,4 +138,6 @@ proxy-connectors.grid.tab.title=Proxy Connectors proxy-connectors.grid.managedrepo.grid.header=Managed Repositories proxy-connectors.grid.remoterepo.title=Remote Repository proxy-connectors.grid.managedrepo.title=Managed Repository +proxy-connector.blacklist=Black List +proxy-connector.whitelist=White List diff --git a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/proxy-connectors.js b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/proxy-connectors.js index 77ff1d920..ec12e6832 100644 --- a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/proxy-connectors.js +++ b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/proxy-connectors.js @@ -172,12 +172,33 @@ $(function() { var mainContent=$("#main-content"); var key=mainContent.find("#property-key").val(); var value=mainContent.find("#property-value").val(); - $.log("add property:"+key+":"+value+",size:"+self.proxyConnector.properties().length); - var oldTab = proxyConnector.properties(); + var oldTab = self.proxyConnector.properties(); oldTab.push(new Entry(key,value)); self.proxyConnector.properties(oldTab); - $.log("add property:"+key+":"+value+",size:"+self.proxyConnector.properties().length); - self.proxyConnector.modified(true); + } + + addBlacklistPattern=function(){ + var pattern = $("#main-content #blacklist-value").val(); + var tab = self.proxyConnector.blackListPatterns(); + tab.push(pattern); + self.proxyConnector.blackListPatterns(tab); + + } + + removeBlacklistPattern=function(pattern){ + self.proxyConnector.blackListPatterns.remove(pattern); + } + + addWhitelistPattern=function(){ + var pattern = $("#main-content #whitelist-value").val(); + var tab = self.proxyConnector.whiteListPatterns(); + tab.push(pattern); + self.proxyConnector.whiteListPatterns(tab); + + } + + removeWhitelistPattern=function(pattern){ + self.proxyConnector.whiteListPatterns.remove(pattern); } } diff --git a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/templates/proxy-connectors.html b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/templates/proxy-connectors.html index 189a7f06d..3d707fb12 100644 --- a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/templates/proxy-connectors.html +++ b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/templates/proxy-connectors.html @@ -163,7 +163,6 @@ - @@ -172,8 +171,51 @@
+ + +
+ + + + + + + + +
${$.i18n.prop('proxy-connector.blacklist')}
${$.i18n.prop('add')}
+ + + + + + + +
${$.i18n.prop('delete')}
+ + +
+ + + + + + + + +
${$.i18n.prop('proxy-connector.whitelist')}
${$.i18n.prop('add')}
+ + + + + + + + +
${$.i18n.prop('delete')}
+
+ diff --git a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/utils.js b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/utils.js index 366d888fd..9eaf929ef 100644 --- a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/utils.js +++ b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/utils.js @@ -315,7 +315,6 @@ Entry=function(key,value){ this.modified=ko.observable(false); this.key=ko.observable(key); this.key.subscribe(function(newValue){self.modified(true)}); - this.value=ko.observable(value); this.value.subscribe(function(newValue){self.modified(true)}); } -- 2.39.5