diff options
author | Olivier Lamy <olamy@apache.org> | 2013-12-17 07:28:16 +0000 |
---|---|---|
committer | Olivier Lamy <olamy@apache.org> | 2013-12-17 07:28:16 +0000 |
commit | dcd4afcdb83196959206d4e2d95f114976bea848 (patch) | |
tree | b6bed868448fec658e3fecbb5d3365d60cafda95 /archiva-modules/archiva-web | |
parent | f7cdee7b23b9119886f3f4019eb85947c7f78d55 (diff) | |
download | archiva-dcd4afcdb83196959206d4e2d95f114976bea848.tar.gz archiva-dcd4afcdb83196959206d4e2d95f114976bea848.zip |
configure cron expression to merge remote indexes tru the UI
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1551471 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'archiva-modules/archiva-web')
3 files changed, 25 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 df9dade1a..be56ca1f8 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 @@ -314,6 +314,7 @@ repository-groups.grid.tab.title=Repository Groups repository.group.delete.confirm=Are you sure to delete Repository Group {0} ? repository.group.mergedIndexPath=Merged Index Path repository.group.mergedIndexTtl=Merged Index Time to Live (in Minutes) +repository.group.cronExpression=Cron expression to merge remote indexes #roles roles.bulk.save.confirm=Are you sure to update {0} Role(s) diff --git a/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/archiva/admin/repository/maven2/repository-groups.js b/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/archiva/admin/repository/maven2/repository-groups.js index f323c26ff..474466313 100644 --- a/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/archiva/admin/repository/maven2/repository-groups.js +++ b/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/archiva/admin/repository/maven2/repository-groups.js @@ -20,7 +20,7 @@ define("archiva/admin/repository/maven2/repository-groups",["jquery","jquery.ui" ,"knockout.simpleGrid","knockout.sortable","archiva/admin/repository/maven2/repositories"], function(jquery,jqueryUi,i18n,jqueryTmpl,bootstrap,jqueryValidate,ko) { - RepositoryGroup=function(id,repositories,mergedIndexPath,mergedIndexTtl){ + RepositoryGroup=function(id,repositories,mergedIndexPath,mergedIndexTtl,cronExpression){ var self=this; @@ -44,6 +44,9 @@ function(jquery,jqueryUi,i18n,jqueryTmpl,bootstrap,jqueryValidate,ko) { this.managedRepositories=ko.observableArray([]); this.managedRepositories.subscribe(function(newValue){self.modified(true)}); + this.cronExpression = ko.observable(cronExpression); + this.cronExpression.subscribe(function(newValue){self.modified(true)}); + this.modified=ko.observable(false); } @@ -223,7 +226,9 @@ function(jquery,jqueryUi,i18n,jqueryTmpl,bootstrap,jqueryValidate,ko) { var userMessages=$("#user-messages"); userMessages.html(mediumSpinnerImg()); var valid = $("#main-content").find("#repository-group-edit-form" ).valid(); - + if (valid==false) { + return; + } $("#repository-group-save" ).button('loading'); $.ajax("restServices/archivaServices/repositoryGroupService/updateRepositoryGroup", @@ -395,15 +400,22 @@ function(jquery,jqueryUi,i18n,jqueryTmpl,bootstrap,jqueryValidate,ko) { rules: { id: { required: true - }, + }, mergedIndexPath:{ required:true + }, + cronExpression: { + remote: { + url: "restServices/archivaServices/commonServices/validateCronExpression", + type: "get" } + } }, showErrors: function(validator, errorMap, errorList) { customShowError("#main-content #repository-group-edit-form",validator,errorMap,errorMap); } }); + validator.settings.messages["cronExpression"]=$.i18n.prop("cronExpression.notvalid"); return validator; } @@ -418,7 +430,8 @@ function(jquery,jqueryUi,i18n,jqueryTmpl,bootstrap,jqueryValidate,ko) { } mapRepositoryGroup=function(data){ - return new RepositoryGroup(data.id, mapStringArray(data.repositories),data.mergedIndexPath,data.mergedIndexTtl); + return new RepositoryGroup(data.id, mapStringArray(data.repositories),data.mergedIndexPath + ,data.mergedIndexTtl,data.cronExpression); } }); diff --git a/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/templates/archiva/repositories.html b/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/templates/archiva/repositories.html index 0544adf68..9a6564b41 100644 --- a/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/templates/archiva/repositories.html +++ b/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/templates/archiva/repositories.html @@ -1449,6 +1449,13 @@ data-bind="value: repositoryGroup.mergedIndexTtl"/> </div> </div> + <div class="control-group"> + <label class="control-label" for="cronExpression">${$.i18n.prop('repository.group.cronExpression')}</label> + <div class="controls"> + <input type="text" class="input-large" id="cronExpression" name="cronExpression" + data-bind="value: repositoryGroup.cronExpression"/> + </div> + </div> <div> <a href="${window.archivaRuntimeInfo.baseUrl}/repository/${repositoryGroup.id()}" target="_blank"> {{if repositoryGroup.id()}} |