mirror of https://github.com/apache/archiva.git
[MRM-1576] rewrite proxies connector page
fix update of properties. git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1242863 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
50f5f885fd
commit
e56582fb8f
|
@ -393,7 +393,7 @@ public abstract class AbstractRepositoryConnector
|
||||||
|
|
||||||
public void setPropertiesEntries( List<PropertyEntry> propertiesEntries )
|
public void setPropertiesEntries( List<PropertyEntry> propertiesEntries )
|
||||||
{
|
{
|
||||||
for ( PropertyEntry propertyEntry : policiesEntries )
|
for ( PropertyEntry propertyEntry : propertiesEntries )
|
||||||
{
|
{
|
||||||
addProperty( propertyEntry.getKey(), propertyEntry.getValue() );
|
addProperty( propertyEntry.getKey(), propertyEntry.getValue() );
|
||||||
}
|
}
|
||||||
|
|
|
@ -88,27 +88,6 @@ $(function() {
|
||||||
this.modified=ko.observable(false);
|
this.modified=ko.observable(false);
|
||||||
this.modified.subscribe(function(newValue){$.log("ProxyConnector modified:"+newValue)});
|
this.modified.subscribe(function(newValue){$.log("ProxyConnector modified:"+newValue)});
|
||||||
|
|
||||||
|
|
||||||
this.deleteProperty=function(key){
|
|
||||||
$.log("delete property key:"+key());
|
|
||||||
for(i=0;i<self.propertiesEntries().length;i++){
|
|
||||||
var entry=self.propertiesEntries()[i];
|
|
||||||
if (entry.key()==key()){
|
|
||||||
self.propertiesEntries.remove(entry);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
this.addProperty=function(){
|
|
||||||
var mainContent=$("#main-content");
|
|
||||||
var key=mainContent.find("#property-key").val();
|
|
||||||
var value=mainContent.find("#property-value").val();
|
|
||||||
var oldTab = self.propertiesEntries();
|
|
||||||
oldTab.push(new Entry(key,value));
|
|
||||||
self.propertiesEntries(oldTab);
|
|
||||||
}
|
|
||||||
|
|
||||||
this.updatePolicyEntry=function(key,value){
|
this.updatePolicyEntry=function(key,value){
|
||||||
for(i=0;i<policiesEntries.length;i++){
|
for(i=0;i<policiesEntries.length;i++){
|
||||||
if (policiesEntries[i].key==key){
|
if (policiesEntries[i].key==key){
|
||||||
|
@ -116,6 +95,7 @@ $(function() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
PolicyInformation=function(options,defaultOption,id,name){
|
PolicyInformation=function(options,defaultOption,id,name){
|
||||||
|
@ -249,6 +229,28 @@ $(function() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this.deleteProperty=function(key){
|
||||||
|
$.log("delete property key:"+key());
|
||||||
|
for(i=0;i<self.proxyConnector.propertiesEntries().length;i++){
|
||||||
|
var entry=self.proxyConnector.propertiesEntries()[i];
|
||||||
|
if (entry.key()==key()){
|
||||||
|
self.proxyConnector.propertiesEntries.remove(entry);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
this.addProperty=function(){
|
||||||
|
var mainContent=$("#main-content");
|
||||||
|
var key=mainContent.find("#property-key").val();
|
||||||
|
var value=mainContent.find("#property-value").val();
|
||||||
|
var oldTab = self.proxyConnector.propertiesEntries();
|
||||||
|
oldTab.push(new Entry(key,value));
|
||||||
|
self.proxyConnector.propertiesEntries(oldTab);
|
||||||
|
mainContent.find("#property-key").val("");
|
||||||
|
mainContent.find("#property-value").val("");
|
||||||
|
}
|
||||||
|
|
||||||
displayGrid=function(){
|
displayGrid=function(){
|
||||||
activateProxyConnectorsGridTab();
|
activateProxyConnectorsGridTab();
|
||||||
}
|
}
|
||||||
|
|
|
@ -163,13 +163,13 @@
|
||||||
<thead>
|
<thead>
|
||||||
<th><input type="text" id="property-key"/></th>
|
<th><input type="text" id="property-key"/></th>
|
||||||
<th><input type="text" id="property-value"/></th>
|
<th><input type="text" id="property-value"/></th>
|
||||||
<th><a href="#" data-bind="click: function(){ proxyConnector.addProperty() }">${$.i18n.prop('add')}</a></th>
|
<th><a href="#" data-bind="click: function(){ addProperty() }">${$.i18n.prop('add')}</a></th>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody data-bind="foreach: proxyConnector.propertiesEntries">
|
<tbody data-bind="foreach: proxyConnector.propertiesEntries">
|
||||||
<tr>
|
<tr>
|
||||||
<td data-bind="text: key"></td>
|
<td data-bind="text: key"></td>
|
||||||
<td data-bind="text: value"></td>
|
<td data-bind="text: value"></td>
|
||||||
<td><a href="#" data-bind="click: function(){$data.deleteProperty(key)}">${$.i18n.prop('delete')}</a></td>
|
<td><a href="#" data-bind="click: function(){ $parent.deleteProperty(key)}">${$.i18n.prop('delete')}</a></td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
|
Loading…
Reference in New Issue