[MRM-496] fix the edit page

git-svn-id: https://svn.apache.org/repos/asf/maven/archiva/trunk@575123 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Brett Porter 2007-09-12 23:38:35 +00:00
parent 8f7502f4fd
commit 7b2e4063bf
2 changed files with 363 additions and 355 deletions

View File

@ -20,15 +20,15 @@
<%@ taglib prefix="ww" uri="/webwork" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<c:url var="iconDeleteUrl" value="/images/icons/delete.gif" />
<c:url var="iconCreateUrl" value="/images/icons/create.png" />
<c:url var="iconDeleteUrl" value="/images/icons/delete.gif"/>
<c:url var="iconCreateUrl" value="/images/icons/create.png"/>
<c:choose>
<c:when test="${mode == 'edit'}">
<c:set var="addedit" value="Edit" />
<c:set var="addedit" value="Edit"/>
</c:when>
<c:otherwise>
<c:set var="addedit" value="Add" />
<c:set var="addedit" value="Add"/>
</c:otherwise>
</c:choose>
@ -44,20 +44,20 @@
<div id="contentArea">
<ww:actionerror/>
<ww:actionmessage/>
<ww:actionerror/>
<ww:actionmessage/>
<ww:form name="saveProxyConnector" method="post" action="saveProxyConnector" namespace="/admin">
<ww:hidden name="mode"/>
<ww:form name="saveProxyConnector" method="post" action="saveProxyConnector" namespace="/admin">
<ww:hidden name="mode"/>
<input type="hidden" name="pattern"/>
<ww:select name="connector.proxyId" list="proxyIdOptions" label="Network Proxy" required="true"/>
<ww:select name="connector.sourceRepoId" list="localRepoIdList"
<input type="hidden" name="pattern"/>
<ww:select name="connector.proxyId" list="proxyIdOptions" label="Network Proxy" required="true"/>
<ww:select name="connector.sourceRepoId" list="managedRepoIdList"
label="Managed Repository" required="true"/>
<ww:select name="connector.targetRepoId" list="remoteRepoIdList"
label="Remote Repository" required="true" />
<ww:select name="connector.targetRepoId" list="remoteRepoIdList"
label="Remote Repository" required="true"/>
<tr>
<tr>
<td valign="top"><label>Policies:</label>
</td>
<td>
@ -66,7 +66,8 @@
<tr>
<td>
<ww:label for="policy_${policy.key}" required="true"
theme="simple">${policy.key}:</ww:label>
theme="simple">${policy.key}:
</ww:label>
</td>
<td>
<ww:select name="connector.policies['${policy.key}']"
@ -74,27 +75,29 @@
value="connector.policies['${policy.key}']"
id="policy_${policy.key}"
theme="simple"
cssStyle="width: 10em" />
cssStyle="width: 10em"/>
</td>
</tr>
</c:forEach>
</table>
</td></tr>
</td>
</tr>
<tr class="seperator">
<tr class="seperator">
<td valign="top">
<label for="propertiesEntry">Properties:</label>
</td>
<td>
<ww:textfield name="propertyKey" size="15" id="propertiesEntry" theme="simple"
onkeypress="submitenter(event, 'editProxyConnector!addProperty.action')" /> :
onkeypress="submitenter(event, 'editProxyConnector!addProperty.action')"/>
:
<ww:textfield name="propertyValue" size="15" id="propertiesValue" theme="simple"
onkeypress="submitenter(event, 'editProxyConnector!addProperty.action')"/>
<ww:submit name="action:editProxyConnector!addProperty" value="Add Property" theme="simple" />
<ww:submit name="action:editProxyConnector!addProperty" value="Add Property" theme="simple"/>
</td>
</tr>
</tr>
<tr>
<tr>
<td>
</td>
<td>
@ -105,7 +108,7 @@
<c:otherwise>
<ww:url id="removePropertyUrl"
action="editProxyConnector"
method="removeProperty" />
method="removeProperty"/>
<table>
<c:forEach items="${connector.properties}" var="property" varStatus="i">
<tr>
@ -117,13 +120,13 @@
<ww:textfield name="connector.properties['${property.key}']"
size="15"
id="property_${property.key}"
theme="simple" />
theme="simple"/>
</td>
<td>
<ww:a href="#" title="Remove [${property.key}] Property"
onclick="setAndSubmit('propertyKey', '${property.key}', '%{removePropertyUrl}')"
theme="simple">
<img src="${iconDeleteUrl}" /></ww:a>
<img src="${iconDeleteUrl}"/></ww:a>
</td>
</tr>
@ -132,26 +135,26 @@
</c:otherwise>
</c:choose>
</td>
</tr>
</tr>
<tr class="seperator">
<tr class="seperator">
<td valign="top">
<label for="blackListEntry">Black List:</label>
</td>
<td>
<ww:textfield name="blackListPattern" size="30" id="blackListEntry" theme="simple"
onkeypress="submitenter(event, 'editProxyConnector!addBlackListPattern.action')"/>
<ww:submit name="action:editProxyConnector!addBlackListPattern" value="Add Pattern" theme="simple" />
<ww:submit name="action:editProxyConnector!addBlackListPattern" value="Add Pattern" theme="simple"/>
</td>
</tr>
</tr>
<tr>
<tr>
<td>
</td>
<td>
<ww:url id="removeBlackListPatternUrl"
action="editProxyConnector"
method="removeBlackListPattern" />
method="removeBlackListPattern"/>
<c:choose>
<c:when test="${empty(connector.blackListPatterns)}">
<i>No black list patterns have been set.</i>
@ -168,7 +171,7 @@
<ww:a href="#" title="Remove [${pattern}] Pattern"
onclick="setAndSubmit('pattern', '${pattern}', '%{removeBlackListPatternUrl}')"
theme="simple">
<img src="${iconDeleteUrl}" /></ww:a>
<img src="${iconDeleteUrl}"/></ww:a>
</td>
</tr>
</c:forEach>
@ -176,25 +179,25 @@
</c:otherwise>
</c:choose>
</td>
</tr>
</tr>
<tr class="seperator">
<tr class="seperator">
<td valign="top">
<label for="whiteListEntry">White List:</label>
</td>
<td>
<ww:textfield name="whiteListPattern" size="30" id="whiteListEntry" theme="simple"
onkeypress="submitenter(event, 'editProxyConnector!addWhiteListPattern.action')"/>
<ww:submit name="action:editProxyConnector!addWhiteListPattern" value="Add Pattern" theme="simple" />
<ww:submit name="action:editProxyConnector!addWhiteListPattern" value="Add Pattern" theme="simple"/>
</td>
</tr>
<tr>
</tr>
<tr>
<td>
</td>
<td>
<ww:url id="removeWhiteListPatternUrl"
action="editProxyConnector"
method="removeWhiteListPattern" />
method="removeWhiteListPattern"/>
<c:choose>
<c:when test="${empty(connector.whiteListPatterns)}">
<i>No white list patterns have been set.</i>
@ -211,7 +214,7 @@
<ww:a href="#" title="Remove [${pattern}] Pattern"
onclick="setAndSubmit('pattern', '${pattern}', '%{removeWhiteListPatternUrl}')"
theme="simple">
<img src="${iconDeleteUrl}" /></ww:a>
<img src="${iconDeleteUrl}"/></ww:a>
</td>
</tr>
</c:forEach>
@ -219,17 +222,17 @@
</c:otherwise>
</c:choose>
</td>
</tr>
</tr>
<ww:submit value="Save Proxy Connector"/>
</ww:form>
<ww:submit value="Save Proxy Connector"/>
</ww:form>
<script type="text/javascript">
<script type="text/javascript">
<!--
document.getElementById("saveProxyConnector_proxyId").focus();
function setAndSubmit(id, value, action)
function setAndSubmit( id, value, action )
{
var f = document.forms['saveProxyConnector'];
@ -250,11 +253,11 @@
{
var keycode;
if (window.event)
if ( window.event )
{
keycode = window.event.keyCode;
}
else if (e)
else if ( e )
{
keycode = e.which;
}
@ -263,9 +266,9 @@
return true;
}
if (keycode == 13)
if ( keycode == 13 )
{
submitForm( action );
submitForm(action);
return false;
}
else
@ -275,7 +278,7 @@
}
//-->
</script>
</script>
</div>

View File

@ -33,63 +33,65 @@
<h1>Administration - Proxy Connectors</h1>
<c:url var="iconDeleteUrl" value="/images/icons/delete.gif" />
<c:url var="iconEditUrl" value="/images/icons/edit.png" />
<c:url var="iconCreateUrl" value="/images/icons/create.png" />
<c:url var="iconDeleteUrl" value="/images/icons/delete.gif"/>
<c:url var="iconEditUrl" value="/images/icons/edit.png"/>
<c:url var="iconCreateUrl" value="/images/icons/create.png"/>
<div id="contentArea">
<ww:actionerror />
<ww:actionmessage />
<ww:actionerror/>
<ww:actionmessage/>
<div style="float:right">
<div style="float:right">
<redback:ifAnyAuthorized permissions="archiva-manage-configuration">
<ww:url id="addProxyConnectorUrl" action="addProxyConnector" />
<ww:url id="addProxyConnectorUrl" action="addProxyConnector"/>
<ww:a href="%{addProxyConnectorUrl}" cssClass="create">
<img src="<c:url value="/images/icons/create.png" />" />
Add Proxy Connector
<img src="<c:url value="/images/icons/create.png" />"/>
Add
</ww:a>
</redback:ifAnyAuthorized>
</div>
</div>
<h2>Repository Proxy Connectors</h2>
<h2>Repository Proxy Connectors</h2>
<c:choose>
<c:when test="${empty(proxyConnectorMap)}">
<c:choose>
<c:when test="${empty(proxyConnectorMap)}">
<strong>No Repository Proxy Connectors Defined.</strong>
</c:when>
<c:otherwise>
<table width="100%">
<c:forEach items="${proxyConnectorMap}" var="repository" varStatus="i">
</c:when>
<c:otherwise>
<table width="100%">
<c:forEach items="${proxyConnectorMap}" var="repository" varStatus="i">
<c:forEach items="${repository.value}" var="connector" varStatus="pc">
<tr class="proxyConnector">
<c:if test="${pc.first}">
<c:forEach items="${repository.value}" var="connector" varStatus="pc">
<tr class="proxyConnector">
<c:if test="${pc.first}">
<td class="managedRepo" rowspan="${fn:length(repository.value)}">
<div>
<img src="<c:url value="/images/archiva-splat-32.gif"/>" />
<img src="<c:url value="/images/archiva-splat-32.gif"/>"/>
<p class="id">${repository.key}</p>
<p class="name">${repoMap[repository.key].name}</p>
</div>
</td>
</c:if>
<td class="connector">
</c:if>
<td class="connector">
<div class="wrap">
<div class="controls">
<redback:ifAnyAuthorized permissions="archiva-manage-configuration">
<ww:url id="editProxyConnectorUrl" action="editProxyConnector">
<ww:param name="target" value="%{'${connector.targetRepoId}'}" />
<ww:param name="source" value="%{'${connector.sourceRepoId}'}" />
<ww:param name="target" value="%{'${connector.targetRepoId}'}"/>
<ww:param name="source" value="%{'${connector.sourceRepoId}'}"/>
</ww:url>
<ww:url id="deleteProxyConnectorUrl" action="deleteProxyConnector" method="confirm">
<ww:param name="source" value="%{'${connector.sourceRepoId}'}" />
<ww:param name="target" value="%{'${connector.targetRepoId}'}" />
<ww:param name="source" value="%{'${connector.sourceRepoId}'}"/>
<ww:param name="target" value="%{'${connector.targetRepoId}'}"/>
</ww:url>
<ww:a href="%{editProxyConnectorUrl}" cssClass="edit" title="Edit Proxy Connector">
<img src="${iconEditUrl}" />
<img src="${iconEditUrl}"/>
</ww:a>
<ww:a href="%{deleteProxyConnectorUrl}" cssClass="delete" title="Delete Proxy Connector">
<img src="${iconDeleteUrl}" />
<img src="${iconDeleteUrl}"/>
</ww:a>
</redback:ifAnyAuthorized>
</div>
@ -105,11 +107,11 @@
</c:when>
<c:otherwise>
<ww:url id="editProxyIdUrl" action="editNetworkProxy">
<ww:param name="proxyid" value="%{'${connector.proxyId}'}" />
<ww:param name="proxyid" value="%{'${connector.proxyId}'}"/>
</ww:url>
<ww:a href="%{editProxyIdUrl}" cssClass="edit" title="Edit Network Proxy">
${connector.proxyId}
<img src="${iconEditUrl}" />
<img src="${iconEditUrl}"/>
</ww:a>
</c:otherwise>
</c:choose>
@ -158,21 +160,24 @@
</c:if>
</table>
</div>
</td>
<td class="remoteRepo">
</td>
<td class="remoteRepo">
<div>
<img src="<c:url value="/images/archiva-world.png"/>" />
<img src="<c:url value="/images/archiva-world.png"/>"/>
<p class="id">${connector.targetRepoId}</p>
<p class="name">${repoMap[connector.targetRepoId].name}</p>
<p class="url">${repoMap[connector.targetRepoId].url}</p>
</div>
</td>
</tr>
</c:forEach>
</c:forEach>
</table>
</c:otherwise>
</c:choose>
</td>
</tr>
</c:forEach>
</c:forEach>
</table>
</c:otherwise>
</c:choose>
</div>