]> source.dussan.org Git - archiva.git/commitdiff
[MRM-1576] rewrite proxies connector page
authorOlivier Lamy <olamy@apache.org>
Wed, 8 Feb 2012 23:56:50 +0000 (23:56 +0000)
committerOlivier Lamy <olamy@apache.org>
Wed, 8 Feb 2012 23:56:50 +0000 (23:56 +0000)
white/black list pattern ui binding.

git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1242184 13f79535-47bb-0310-9956-ffa450edef68

archiva-modules/archiva-web/archiva-web-common/src/main/resources/org/apache/archiva/i18n/default.properties
archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/proxy-connectors.js
archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/templates/proxy-connectors.html
archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/utils.js

index 4c08f619452bf4f5edaa9f12eb4cb417278e6cc6..ac437fd3e6f30e83868fd6ba70d6e88a2e1a8c87 100644 (file)
@@ -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
 
index 77ff1d920b2ec8c4f1182c85e52139a0fa51c273..ec12e68322efcc65e74b81bbfd6ba7b64bcd53d8 100644 (file)
@@ -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);
     }
   }
 
index 189a7f06d6d405404862de389020a79f2b10cd4a..3d707fb1210d55c374e46df6283cc0ce695845ba 100644 (file)
             </table>
 
             <table class="table">
-
               <tbody data-bind="foreach: proxyConnector.properties">
                 <tr>
                   <td data-bind="text: key"></td>
                 </tr>
               </tbody>
             </table>
+        </div>
+
+        <div class="control-group span6">
+            <table>
+                <thead>
+                  <th colspan="2" class="pull-left">${$.i18n.prop('proxy-connector.blacklist')}</th>
+                </thead>
+                <tr>
+                  <td><input type="text" id="blacklist-value"/></td>
+                  <td><a href="#" data-bind="click: function(){ addBlacklistPattern() }">${$.i18n.prop('add')}</a></td>
+                </tr>
+            </table>
 
+            <table class="table">
+              <tbody data-bind="foreach: proxyConnector.blackListPatterns">
+                <tr>
+                  <td data-bind="text: $data"></td>
+                  <td><a href="#" data-bind="click: function(){removeBlacklistPattern($data)}">${$.i18n.prop('delete')}</a></td>
+                </tr>
+              </tbody>
+            </table>
         </div>
+
+
+          <div class="control-group span6">
+            <table>
+                <thead>
+                  <th colspan="2" class="pull-left">${$.i18n.prop('proxy-connector.whitelist')}</th>
+                </thead>
+                <tr>
+                  <td><input type="text" id="whitelist-value"/></td>
+                  <td><a href="#" data-bind="click: function(){ addWhitelistPattern() }">${$.i18n.prop('add')}</a></td>
+                </tr>
+            </table>
+
+            <table class="table">
+              <tbody data-bind="foreach: proxyConnector.whiteListPatterns">
+                <tr>
+                  <td data-bind="text: $data"></td>
+                  <td><a href="#" data-bind="click: function(){removeWhitelistPattern($data)}">${$.i18n.prop('delete')}</a></td>
+                </tr>
+              </tbody>
+            </table>
+        </div>
+
       </fieldset>
     </form>
 
index 366d888fd5684e347dcffbaadcb6dd10ed0c9a50..9eaf929ef5bb5126fe5086305cc1bea75ddaab40 100644 (file)
@@ -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)});
 }