From 0182f1892b37cab23e9dda1d94fe07d566337165 Mon Sep 17 00:00:00 2001 From: Olivier Lamy Date: Sat, 11 Feb 2012 08:07:22 +0000 Subject: [PATCH] [MRM-1576] rewrite proxies connector page display policy name rather than id in settings popover. git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1243015 13f79535-47bb-0310-9956-ffa450edef68 --- .../apache/archiva/i18n/default.properties | 2 ++ .../webapp/js/archiva/proxy-connectors.js | 23 ++++++++++++++++++- .../archiva/templates/proxy-connectors.html | 7 +++--- 3 files changed, 28 insertions(+), 4 deletions(-) diff --git a/archiva-modules/archiva-web/archiva-web-common/src/main/resources/org/apache/archiva/i18n/default.properties b/archiva-modules/archiva-web/archiva-web-common/src/main/resources/org/apache/archiva/i18n/default.properties index ef88c63a4..9b03ca57d 100644 --- a/archiva-modules/archiva-web/archiva-web-common/src/main/resources/org/apache/archiva/i18n/default.properties +++ b/archiva-modules/archiva-web/archiva-web-common/src/main/resources/org/apache/archiva/i18n/default.properties @@ -90,6 +90,7 @@ remoteIndexUrl=Remote Index Url remoteDownloadNetworkProxyId=Proxy for Remote Download Index downloadRemoteIndexOnStartup=Download Remote Index on Startup remoteDownloadTimeout=Download Remote Timeout +remoterepository.added=Remote Repository added. #network proxy networkproxy.updated=Network Proxy " {0} " updated. @@ -100,6 +101,7 @@ networkproxy.delete.confirm=Are you sure to delete Network Proxy {0} networkproxy.deleted=Network Proxy {0} deleted bulk.save.confirm.title=Network Proxy Bulk Save networkproxy.bulk.save.confirm=Are you sure to update {0} network proxy(ies) +network.proxy.useNtlm=Use NTLM #menu menu.users=User Management 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 76fdba8af..015555e24 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 @@ -112,6 +112,7 @@ $(function() { this.name.subscribe(function(newValue){self.modified(true)}); } + ProxyConnectorViewModel=function(proxyConnector,update,proxyConnectorsViewModel){ var self=this; this.proxyConnector=proxyConnector; @@ -256,6 +257,13 @@ $(function() { ProxyConnectorsViewModel=function(){ var self=this; this.proxyConnectors=ko.observableArray([]); + this.proxyConnectors.subscribe(function(newValue){ + $.log("ProxyConnectorsViewModel#proxyConnectors modified") + self.proxyConnectors().sort(function(a,b){ + if ( a.sourceRepoId()== b.sourceRepoId()) return a.order() - b.order(); + return (a.sourceRepoId() > b.sourceRepoId())? -1:1; + }); + }); this.policyInformations=ko.observableArray([]); this.managedRepositories=ko.observableArray([]); this.remoteRepositories=ko.observableArray([]); @@ -347,7 +355,10 @@ $(function() { +proxyConnector.sourceRepoId()+"-"+proxyConnector.targetRepoId()); targetContent.html(""); targetContent.append($("#proxy-connectors-remote-settings-popover-tmpl") - .tmpl(ko.toJS(proxyConnector))); + .tmpl({ + proxyConnectorsViewModel: self, + proxyConnector:ko.toJS(proxyConnector) + })); var targetImg = $("#proxy-connectors-grid-remoterepo-settings-edit-"+proxyConnector.sourceRepoId() +"-"+proxyConnector.targetRepoId()); @@ -363,6 +374,16 @@ $(function() { } + this.findPolicyInformationName=function(id){ + for(i=0;i
{{if proxyId}} - ${$.i18n.prop('proxy-connectors.remoterepo.settings.networkproxy')}: ${proxyId} + ${$.i18n.prop('proxy-connectors.remoterepo.settings.networkproxy')}: ${proxyConnector.proxyId} {{else}} ${$.i18n.prop('proxy-connectors.remoterepo.settings.networkproxy')}: ${$.i18n.prop('none')} {{/if}} @@ -100,9 +100,10 @@ ${$.i18n.prop('proxy-connector.policies')} - {{each(i, entry) policiesEntries}} + {{each(i, entry) proxyConnector.policiesEntries}} + {{var name = proxyConnectorsViewModel.findPolicyInformationName(entry.key)}} - ${entry.key} + ${name} ${entry.value} {{/each}} -- 2.39.5