managedrepository.deleted=Managed Repository " {0} " deleted.
managedrepository.location.already.exists=WARNING: Repository location already exists.
managedrepository.location.already.exists.warning.message=Are you sure you want to use this directory
-managedrepository.add.title=Add Managed Repository
\ No newline at end of file
+managedrepository.add.title=Add Managed Repository
+managedrepository.scan.now=Scan Repository Now
+managedrepository.scan.all=Process All Artifacts
+managedrepository.scanned=Managed Repository " {0} " scanned.
\ No newline at end of file
activateManagedRepositoryFormValidation();
}
+ scanNow=function(managedRepository){
+ clearUserMessages();
+ openDialogConfirm(
+ function(){
+ $("#dialog-confirm-modal #modal-login-footer").append(smallSpinnerImg());
+ var checked = $("#managed-repository-scan-now-all").get(0).checked;
+ var url = "restServices/archivaServices/repositoriesService/scanRepositoryNow?";
+ url += "repositoryId="+encodeURIComponent(managedRepository.id());
+ url += "&fullScan="+(checked==true?"true":"false");
+ $.ajax(url,
+ {
+ type: "GET",
+ success: function(data) {
+ self.managedRepositories.remove(managedRepository);
+ displaySuccessMessage($.i18n.prop("managedrepository.scanned",managedRepository.name()));
+
+ },
+ error: function(data) {
+ var res = $.parseJSON(data.responseText);
+ displayRestError(res);
+ },
+ complete: function(){
+ removeSmallSpinnerImg();
+ closeDialogConfirm();
+ }
+ }
+ );
+ },
+ $.i18n.prop("ok"),
+ $.i18n.prop("cancel"),
+ $.i18n.prop("managedrepository.scan.now"),
+ $("#managed-repository-scan-now-modal-tmpl").tmpl(managedRepository));
+
+ }
+
removeManagedRepository=function(managedRepository){
clearUserMessages();
openDialogConfirm(
{{/each}}
<th>${$.i18n.prop('release.included')}</th>
<th>${$.i18n.prop('snapshots.included')}</th>
+ <th>${$.i18n.prop('managedrepository.scan.now')}</th>
<th>${$.i18n.prop('edit')}</th>
<th>${$.i18n.prop('delete')}</th>
</tr>
<img src="images/dialog-error.png"/>
{{/if}}
</td>
+ <td><a href="#" data-bind="click: function(){ scanNow(row) }">${$.i18n.prop('managedrepository.scan.now')}</a></td>
<td><a href="#" data-bind="click: function(){ editManagedRepository(row) }">${$.i18n.prop('edit')}</a></td>
<td>
<a href="#" data-bind="click: function(){ removeManagedRepository(row) }">
<div>${$.i18n.prop('name')}: ${name()}</div>
</div>
</div>
+</script>
+<script id="managed-repository-scan-now-modal-tmpl" type='text/x-jquery-tmpl'>
+ <div>
+ ${$.i18n.prop('managedrepository.scan.all')}: <input type="checkbox" id="managed-repository-scan-now-all">
+ </div>
+
</script>
\ No newline at end of file