diff options
Diffstat (limited to 'archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva')
2 files changed, 46 insertions, 34 deletions
diff --git a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/repositories.js b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/repositories.js index 8fd0b496e..99c2e73c3 100644 --- a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/repositories.js +++ b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/repositories.js @@ -34,7 +34,7 @@ define("archiva.repositories",["jquery","i18n","jquery.tmpl","bootstrap","jquery ManagedRepository=function(id,name,layout,indexDirectory,location,snapshots,releases,blockRedeployments,cronExpression, scanned,daysOlder,retentionCount,deleteReleasedSnapshots,stageRepoNeeded,description, - skipPackedIndexCreation,feedsUrl){ + skipPackedIndexCreation,feedsUrl,url){ var self=this; @@ -105,6 +105,8 @@ define("archiva.repositories",["jquery","i18n","jquery.tmpl","bootstrap","jquery this.feedsUrl=feedsUrl; + this.url=url; + this.getTypeLabel=function(){ for(var i=0;i<window.managedRepositoryTypes.length;i++){ if (window.managedRepositoryTypes[i].type==self.layout()){ @@ -154,6 +156,7 @@ define("archiva.repositories",["jquery","i18n","jquery.tmpl","bootstrap","jquery var mappedManagedRepositories = $.map(data, function(item) { var managedRepository = mapManagedRepository(item); managedRepository.feedsUrl=applicationUrl+"/feeds/"+managedRepository.id(); + managedRepository.url=applicationUrl+"/repository/"+managedRepository.id() return managedRepository; }); return mappedManagedRepositories; diff --git a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/repository-groups.js b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/repository-groups.js index 9744d4f4d..651671cfd 100644 --- a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/repository-groups.js +++ b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/repository-groups.js @@ -177,44 +177,53 @@ function() { var self=this; loadManagedRepositories(function(data) { - self.repositoryGroupsViewModel.managedRepositories(mapManagedRepositories(data)); - $.ajax("restServices/archivaServices/repositoryGroupService/getRepositoriesGroups", { + $.ajax({ + url: "restServices/archivaServices/archivaAdministrationService/applicationUrl", type: "GET", - dataType: 'json', - success: function(data) { - var mappedRepositoryGroups=mapRepositoryGroups(data); - for(var i=0;i<mappedRepositoryGroups.length;i++){ - mappedRepositoryGroups[i] - .managedRepositories(self.mapManagedRepositoriesToRepositoryGroup(mappedRepositoryGroups[i])); - mappedRepositoryGroups[i].modified(false); - $.log("mappedRepositoryGroups.repositories().length:"+mappedRepositoryGroups[i].repositories().length); - } - mainContent.html($("#repositoryGroupsMain").tmpl()); - self.repositoryGroupsViewModel.repositoryGroups(mappedRepositoryGroups); - $.log("displayRepositoryGroups#applyBindings before"); - ko.applyBindings(repositoryGroupsViewModel,mainContent.find("#repository-groups-view" ).get(0)); - $.log("displayRepositoryGroups#applyBindings after"); - - - mainContent.find("#repository-groups-view-tabs").on('show', function (e) { - if ($(e.target).attr("href")=="#repository-groups-edit") { - var repositoryGroup = new RepositoryGroup(); - var repositoryGroupViewModel=new RepositoryGroupViewModel(repositoryGroup,false,self.repositoryGroupsViewModel); - activateRepositoryGroupEditTab(); - ko.applyBindings(repositoryGroupViewModel,mainContent.find("#repository-groups-edit" ).get(0)); - } - if ($(e.target).attr("href")=="#repository-groups-view") { - mainContent.find("#repository-groups-view-tabs-li-edit a").html($.i18n.prop("add")); - clearUserMessages(); + dataType: 'text', + success: function(applicationUrl){ + + self.repositoryGroupsViewModel.managedRepositories(mapManagedRepositories(data,applicationUrl)); + + $.ajax("restServices/archivaServices/repositoryGroupService/getRepositoriesGroups", { + type: "GET", + dataType: 'json', + success: function(data) { + var mappedRepositoryGroups=mapRepositoryGroups(data); + for(var i=0;i<mappedRepositoryGroups.length;i++){ + mappedRepositoryGroups[i] + .managedRepositories(self.mapManagedRepositoriesToRepositoryGroup(mappedRepositoryGroups[i])); + mappedRepositoryGroups[i].modified(false); + $.log("mappedRepositoryGroups.repositories().length:"+mappedRepositoryGroups[i].repositories().length); + } + mainContent.html($("#repositoryGroupsMain").tmpl()); + self.repositoryGroupsViewModel.repositoryGroups(mappedRepositoryGroups); + $.log("displayRepositoryGroups#applyBindings before"); + ko.applyBindings(repositoryGroupsViewModel,mainContent.find("#repository-groups-view" ).get(0)); + $.log("displayRepositoryGroups#applyBindings after"); + + + mainContent.find("#repository-groups-view-tabs").on('show', function (e) { + if ($(e.target).attr("href")=="#repository-groups-edit") { + var repositoryGroup = new RepositoryGroup(); + var repositoryGroupViewModel=new RepositoryGroupViewModel(repositoryGroup,false,self.repositoryGroupsViewModel); + activateRepositoryGroupEditTab(); + ko.applyBindings(repositoryGroupViewModel,mainContent.find("#repository-groups-edit" ).get(0)); + } + if ($(e.target).attr("href")=="#repository-groups-view") { + mainContent.find("#repository-groups-view-tabs-li-edit a").html($.i18n.prop("add")); + clearUserMessages(); + } + + }); + + } } - - }); + ); } - } - ); - + }); }); this.mapManagedRepositoriesToRepositoryGroup=function(repositoryGroup){ |