]> source.dussan.org Git - archiva.git/commitdiff
[MRM-1576] rewrite proxies connector page
authorOlivier Lamy <olamy@apache.org>
Fri, 10 Feb 2012 17:23:50 +0000 (17:23 +0000)
committerOlivier Lamy <olamy@apache.org>
Fri, 10 Feb 2012 17:23:50 +0000 (17:23 +0000)
fix update of policies.

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

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

index 523e9fd969b4ee67103cba5c8e9caee108fb3b77..bde340acb67c94a092e8f2c659b2582acc6d5eff 100644 (file)
@@ -108,6 +108,14 @@ $(function() {
       oldTab.push(new Entry(key,value));
       self.propertiesEntries(oldTab);
     }
+
+    this.updatePolicyEntry=function(key,value){
+      for(i=0;i<policiesEntries.length;i++){
+        if (policiesEntries[i].key==key){
+          policiesEntries[i].value=value;
+        }
+      }
+    }
   }
 
   PolicyInformation=function(options,defaultOption,id,name){
@@ -154,6 +162,13 @@ $(function() {
       }
       return "";
     }
+
+    changePolicyOption=function(id){
+      var value = $("#main-content #policy-"+id + " option:selected").val();
+      self.proxyConnector.updatePolicyEntry(id,value);
+    }
+
+
     getPolicyOptions=function(id){
       var policyInformations=self.proxyConnectorsViewModel.policyInformations();
       for(i=0;i<policyInformations.length;i++){
index 712816d69972bcbc28ac8e69721b048bb2844c32..b32e8bc04681666e83226695e4d947721a67977f 100644 (file)
@@ -50,6 +50,9 @@
         <th title="${$.i18n.prop('proxy-connectors.grid.remoterepo.title')}">
           ${$.i18n.prop('proxy-connectors.grid.remoterepo.grid.header')}
         </th>
+        <th>
+            ${$.i18n.prop('proxy-connectors.grid.remoterepo.settings.popover.title')}
+        </th>          
         <th>
           ${$.i18n.prop('edit')}
         </th>
     <tr>
       <td>${row.sourceRepoId()}</td>
       <td>${row.targetRepoId()}-${row.order()}</td>
+      <td><img src="images/utilities-system-monitor.png" id="proxy-connectors-grid-remoterepo-settings-edit-${row.sourceRepoId()}-${row.targetRepoId()}"
+               data-original-title="${$.i18n.prop('proxy-connectors.grid.remoterepo.settings.popover.title')}"
+               data-bind="event: { mouseover: function(){ showSettings(row)},}"></td>
       <td>
-        <a data-original-title="${$.i18n.prop('proxy-connectors.grid.remoterepo.settings.popover.title')}"
-           data-bind="event: { mouseover: function(){ showSettings(row)},},click: function(){ editProxyConnector(row)}"
-           id="proxy-connectors-grid-remoterepo-settings-edit-${row.sourceRepoId()}-${row.targetRepoId()}" href="#">
+        <a data-bind="click: function(){ editProxyConnector(row)}" href="#">
            ${$.i18n.prop('edit')}
         </a>
         <div id="proxy-connectors-grid-remoterepo-settings-content-${row.sourceRepoId()}-${row.targetRepoId()}"
                   <tr>
                     <td data-bind="text: name"></td>
                     <td>
-                      <select data-bind="options: getPolicyOptions(id()),value:getSelectedPolicyOption(id()),attr: { id: 'policy-'+id() }"></select>
+                      <select
+                              data-bind="options: getPolicyOptions(id()),value:getSelectedPolicyOption(id()),
+                              attr: { id: 'policy-'+id() },event: { change: function(){ changePolicyOption(id())},}"
+                              ></select>
                     </td>
                   </tr>
               </tbody>