From 98cbfe1aae87abafe224fe16546cc985a182c3a1 Mon Sep 17 00:00:00 2001 From: Olivier Lamy Date: Tue, 7 Feb 2012 18:24:18 +0000 Subject: [PATCH] [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 --- .../webapp/js/archiva/proxy-connectors.js | 83 +++++++++++++++++-- .../archiva/templates/proxy-connectors.html | 37 +++++++-- .../src/main/webapp/js/knockout.simpleGrid.js | 3 +- 3 files changed, 108 insertions(+), 15 deletions(-) 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", -- 2.39.5