mirror of https://github.com/apache/archiva.git
if applicationUrl defined it was not used in repository group screen
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1391455 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
9a70ec8ecc
commit
4a7bf4c10b
|
@ -45,6 +45,7 @@ function() {
|
||||||
this.update=update;
|
this.update=update;
|
||||||
this.repositoryGroupsViewModel=repositoryGroupsViewModel;
|
this.repositoryGroupsViewModel=repositoryGroupsViewModel;
|
||||||
this.availableRepositories=ko.observableArray([]);
|
this.availableRepositories=ko.observableArray([]);
|
||||||
|
this.applicationUrl=null;
|
||||||
|
|
||||||
for (var i=0;i<repositoryGroupsViewModel.managedRepositories().length;i++){
|
for (var i=0;i<repositoryGroupsViewModel.managedRepositories().length;i++){
|
||||||
if ( $.inArray(repositoryGroupsViewModel.managedRepositories()[i].id(),this.repositoryGroup.repositories())<0){
|
if ( $.inArray(repositoryGroupsViewModel.managedRepositories()[i].id(),this.repositoryGroup.repositories())<0){
|
||||||
|
@ -78,6 +79,7 @@ function() {
|
||||||
var self=this;
|
var self=this;
|
||||||
this.repositoryGroups=ko.observableArray([]);
|
this.repositoryGroups=ko.observableArray([]);
|
||||||
this.managedRepositories=ko.observableArray([]);
|
this.managedRepositories=ko.observableArray([]);
|
||||||
|
this.applicationUrl="";
|
||||||
|
|
||||||
this.findManagedRepository=function(id){
|
this.findManagedRepository=function(id){
|
||||||
return findManagedRepository(id,self.managedRepositories());
|
return findManagedRepository(id,self.managedRepositories());
|
||||||
|
@ -108,12 +110,22 @@ function() {
|
||||||
}
|
}
|
||||||
|
|
||||||
this.editRepositoryGroup=function(repositoryGroup){
|
this.editRepositoryGroup=function(repositoryGroup){
|
||||||
|
|
||||||
|
|
||||||
|
$.ajax({
|
||||||
|
url: "restServices/archivaServices/archivaAdministrationService/applicationUrl",
|
||||||
|
type: "GET",
|
||||||
|
dataType: 'text',
|
||||||
|
success: function(applicationUrl){
|
||||||
$.log("editRepositoryGroup:"+repositoryGroup.id()+",repositories:"+repositoryGroup.repositories().length+",managed:"+repositoryGroup.managedRepositories().length);
|
$.log("editRepositoryGroup:"+repositoryGroup.id()+",repositories:"+repositoryGroup.repositories().length+",managed:"+repositoryGroup.managedRepositories().length);
|
||||||
var repositoryGroupViewModel=new RepositoryGroupViewModel(repositoryGroup,true,self);
|
var repositoryGroupViewModel=new RepositoryGroupViewModel(repositoryGroup,true,self);
|
||||||
|
repositoryGroupViewModel.applicationUrl=applicationUrl;
|
||||||
activateRepositoryGroupEditTab();
|
activateRepositoryGroupEditTab();
|
||||||
ko.applyBindings(repositoryGroupViewModel,$("#main-content").find("#repository-groups-edit" ).get(0));
|
ko.applyBindings(repositoryGroupViewModel,$("#main-content").find("#repository-groups-edit" ).get(0));
|
||||||
$("#main-content" ).find("#repository-groups-view-tabs-li-edit" ).find("a").html($.i18n.prop("edit"));
|
$("#main-content" ).find("#repository-groups-view-tabs-li-edit" ).find("a").html($.i18n.prop("edit"));
|
||||||
}
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
this.saveRepositoryGroup=function(repositoryGroup){
|
this.saveRepositoryGroup=function(repositoryGroup){
|
||||||
clearUserMessages();
|
clearUserMessages();
|
||||||
|
@ -185,7 +197,7 @@ function() {
|
||||||
success: function(applicationUrl){
|
success: function(applicationUrl){
|
||||||
|
|
||||||
self.repositoryGroupsViewModel.managedRepositories(mapManagedRepositories(data,applicationUrl));
|
self.repositoryGroupsViewModel.managedRepositories(mapManagedRepositories(data,applicationUrl));
|
||||||
|
self.repositoryGroupsViewModel.applicationUrl=applicationUrl;
|
||||||
$.ajax("restServices/archivaServices/repositoryGroupService/getRepositoriesGroups", {
|
$.ajax("restServices/archivaServices/repositoryGroupService/getRepositoriesGroups", {
|
||||||
type: "GET",
|
type: "GET",
|
||||||
dataType: 'json',
|
dataType: 'json',
|
||||||
|
@ -200,7 +212,7 @@ function() {
|
||||||
mainContent.html($("#repositoryGroupsMain").tmpl());
|
mainContent.html($("#repositoryGroupsMain").tmpl());
|
||||||
self.repositoryGroupsViewModel.repositoryGroups(mappedRepositoryGroups);
|
self.repositoryGroupsViewModel.repositoryGroups(mappedRepositoryGroups);
|
||||||
$.log("displayRepositoryGroups#applyBindings before");
|
$.log("displayRepositoryGroups#applyBindings before");
|
||||||
ko.applyBindings(repositoryGroupsViewModel,mainContent.find("#repository-groups-view" ).get(0));
|
ko.applyBindings(self.repositoryGroupsViewModel,mainContent.find("#repository-groups-view" ).get(0));
|
||||||
$.log("displayRepositoryGroups#applyBindings after");
|
$.log("displayRepositoryGroups#applyBindings after");
|
||||||
|
|
||||||
|
|
||||||
|
@ -208,6 +220,7 @@ function() {
|
||||||
if ($(e.target).attr("href")=="#repository-groups-edit") {
|
if ($(e.target).attr("href")=="#repository-groups-edit") {
|
||||||
var repositoryGroup = new RepositoryGroup();
|
var repositoryGroup = new RepositoryGroup();
|
||||||
var repositoryGroupViewModel=new RepositoryGroupViewModel(repositoryGroup,false,self.repositoryGroupsViewModel);
|
var repositoryGroupViewModel=new RepositoryGroupViewModel(repositoryGroup,false,self.repositoryGroupsViewModel);
|
||||||
|
|
||||||
activateRepositoryGroupEditTab();
|
activateRepositoryGroupEditTab();
|
||||||
ko.applyBindings(repositoryGroupViewModel,mainContent.find("#repository-groups-edit" ).get(0));
|
ko.applyBindings(repositoryGroupViewModel,mainContent.find("#repository-groups-edit" ).get(0));
|
||||||
}
|
}
|
||||||
|
|
|
@ -1146,7 +1146,7 @@
|
||||||
${repositoryGroup.id}
|
${repositoryGroup.id}
|
||||||
<br/>
|
<br/>
|
||||||
<a href="${window.archivaRuntimeInfo.baseUrl}/repository/${repositoryGroup.id()}" target="_blank">
|
<a href="${window.archivaRuntimeInfo.baseUrl}/repository/${repositoryGroup.id()}" target="_blank">
|
||||||
${window.archivaRuntimeInfo.baseUrl}/repository/${repositoryGroup.id()}
|
${applicationUrl}/repository/${repositoryGroup.id()}
|
||||||
</a>
|
</a>
|
||||||
</blockquote>
|
</blockquote>
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Reference in New Issue