mirror of https://github.com/apache/archiva.git
[MRM-1574] add select box for defining repository type.
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1232878 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
b480558763
commit
31b57ea2d1
|
@ -18,6 +18,19 @@
|
|||
*/
|
||||
$(function() {
|
||||
|
||||
// FIXME this must be dynamic if we do a plugin mechanism with dynamic repositories types
|
||||
// FIXME i18n
|
||||
|
||||
ManagedRepositoryType=function(type,label){
|
||||
this.type=type;
|
||||
this.label=label;
|
||||
}
|
||||
|
||||
window.managedRepositoryTypes = [
|
||||
new ManagedRepositoryType("default","Maven 2.x Repository"),
|
||||
new ManagedRepositoryType("legacy", "Maven 1.x Repository")
|
||||
];
|
||||
|
||||
ManagedRepository=function(id,name,layout,indexDirectory,location,snapshots,releases,blockRedeployments,cronExpression,
|
||||
scanned,daysOlder,retentionCount,deleteReleasedSnapshots,stageRepoNeeded){
|
||||
|
||||
|
@ -66,6 +79,16 @@ $(function() {
|
|||
//private boolean blockRedeployments = false;
|
||||
this.blockRedeployments=ko.observable(blockRedeployments);
|
||||
|
||||
var self=this;
|
||||
|
||||
this.getTypeLabel=function(){
|
||||
for(i=0;i<window.managedRepositoryTypes.length;i++){
|
||||
if (window.managedRepositoryTypes[i].type==self.layout()){
|
||||
return window.managedRepositoryTypes[i].label;
|
||||
}
|
||||
}
|
||||
return "no label";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -73,8 +96,20 @@ $(function() {
|
|||
this.managedRepository=managedRepository;
|
||||
this.managedRepositoriesViewModel = managedRepositoriesViewModel;
|
||||
this.update = update;
|
||||
|
||||
var self = this;
|
||||
|
||||
this.availableLayouts = window.managedRepositoryTypes;
|
||||
|
||||
/*getAvailableLayouts=function(){
|
||||
var layouts = new Array(window.managedRepositoryTypes.length);
|
||||
for(var i=0;i<window.managedRepositoryTypes.length;i++){
|
||||
layouts[i]=window.managedRepositoryTypes[i].label;
|
||||
}
|
||||
$.log("layouts.length:"+layouts.length)
|
||||
return layouts;
|
||||
}*/
|
||||
|
||||
save=function(){
|
||||
var valid = $("#main-content #managed-repository-edit-form").valid();
|
||||
if (valid==false) {
|
||||
|
@ -258,10 +293,10 @@ $(function() {
|
|||
rowText: "name"
|
||||
},
|
||||
{
|
||||
headerText: $.i18n.prop('type'),
|
||||
rowText: "layout",
|
||||
// FIXME i18n
|
||||
title: "Repository type (default is Maven 2)"
|
||||
headerText: $.i18n.prop('type'),
|
||||
rowText: "getTypeLabel",
|
||||
// FIXME i18n
|
||||
title: "Repository type (default is Maven 2)"
|
||||
}
|
||||
],
|
||||
pageSize: 5
|
||||
|
|
|
@ -137,6 +137,12 @@
|
|||
<input type="text" class="xlarge" id="indexDirectory" name="indexDirectory" size="50" data-bind="value: managedRepository.indexDirectory"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="clearfix">
|
||||
<label for="layout">${$.i18n.prop('type')}</label>
|
||||
<div class="input">
|
||||
<select id="layout" data-bind="options: availableLayouts,optionsText: 'label',optionsValue:'type',value: managedRepository.layout"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="clearfix">
|
||||
<label for="cronExpression">${$.i18n.prop('cronExpression')}</label>
|
||||
<div class="input">
|
||||
|
|
Loading…
Reference in New Issue