From: Olivier Lamy Date: Tue, 7 Feb 2012 18:24:18 +0000 (+0000) Subject: [MRM-1576] rewrite proxies connector page X-Git-Tag: archiva-1.4-M3~1351 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=98cbfe1aae87abafe224fe16546cc985a182c3a1;p=archiva.git [MRM-1576] rewrite proxies connector page pushing some stuff for edition. git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1241544 13f79535-47bb-0310-9956-ffa450edef68 --- 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 011db78b7..1ad691917 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 @@ -59,7 +59,8 @@ $(function() { this.order=ko.observable(order); this.order.subscribe(function(newValue){self.modified(true)}); - this.modified=ko.observable(false); + this.modified=ko.observable(true); + this.modified.subscribe(function(newValue){$.log("ProxyConnector modified")}); } PolicyInformation=function(options,defaultOption,id,name){ @@ -82,21 +83,41 @@ $(function() { //private String name; this.name=ko.observable(name); this.name.subscribe(function(newValue){self.modified(true)}); + } ManagedRepositoryConnectorView=function(source,targetRepos){ var self=this; this.modified=ko.observable(false); + this.source=ko.observable(source); this.targetRepos=ko.observableArray(targetRepos); } ProxyConnectorViewModel=function(proxyConnector,update,proxyConnectorsViewModel){ var self=this; - this.proxyConnector=ko.observable(); + this.proxyConnector=ko.observable(proxyConnector); this.proxyConnectorsViewModel=proxyConnectorsViewModel; - //mappe policies avec policyInformations pour avoir object + plus complexe + this.update=update; + getSelectedPolicyOption=function(id){ + var policies=self.proxyConnector().policies(); + for (i=0;i {{each(i, row) itemsOnCurrentPage()}} - + {{var val = row.source()}}
@@ -133,22 +133,43 @@ value: proxyConnector.targetRepoId"> -
+
- {{each proxyConnector.policies}} - - - - - + {{each proxyConnectorsViewModel.policyInformations()}} + {{var policyId=$value.id()}} + + + + {{/each}}
${$.i18n.prop('proxy-connector.policies')}
${$value.key}${$value.value}
${$value.name()} + +
+ + + \ No newline at end of file diff --git a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/knockout.simpleGrid.js b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/knockout.simpleGrid.js index af95ad36a..cc56f592b 100644 --- a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/knockout.simpleGrid.js +++ b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/knockout.simpleGrid.js @@ -47,8 +47,9 @@ var viewModel = viewModelAccessor(), allBindings = allBindingsAccessor(); // Empty the element - while(element.firstChild) + while(element.firstChild) { ko.removeNode(element.firstChild); + } // Allow the default templates to be overridden var gridTemplateName = allBindings.simpleGridTemplate || "ko_usersGrid_grid",