You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@archiva.apache.org by ol...@apache.org on 2012/02/10 18:23:50 UTC

svn commit: r1242862 - in /archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva: proxy-connectors.js templates/proxy-connectors.html

Author: olamy
Date: Fri Feb 10 17:23:50 2012
New Revision: 1242862

URL: http://svn.apache.org/viewvc?rev=1242862&view=rev
Log:
[MRM-1576] rewrite proxies connector page
fix update of policies.

Modified:
    archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/proxy-connectors.js
    archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/templates/proxy-connectors.html

Modified: archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/proxy-connectors.js
URL: http://svn.apache.org/viewvc/archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/proxy-connectors.js?rev=1242862&r1=1242861&r2=1242862&view=diff
==============================================================================
--- archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/proxy-connectors.js (original)
+++ archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/proxy-connectors.js Fri Feb 10 17:23:50 2012
@@ -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++){

Modified: archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/templates/proxy-connectors.html
URL: http://svn.apache.org/viewvc/archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/templates/proxy-connectors.html?rev=1242862&r1=1242861&r2=1242862&view=diff
==============================================================================
--- archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/templates/proxy-connectors.html (original)
+++ archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/templates/proxy-connectors.html Fri Feb 10 17:23:50 2012
@@ -51,6 +51,9 @@
           ${$.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>
         <th>
@@ -63,10 +66,11 @@
     <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()}"
@@ -143,7 +147,10 @@
                   <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>