<commit_before><%--
  ~ Licensed to the Apache Software Foundation (ASF) under one
  ~ or more contributor license agreements.  See the NOTICE file
  ~ distributed with this work for additional information
  ~ regarding copyright ownership.  The ASF licenses this file
  ~ to you under the Apache License, Version 2.0 (the
  ~ "License"); you may not use this file except in compliance
  ~ with the License.  You may obtain a copy of the License at
  ~
  ~   http://www.apache.org/licenses/LICENSE-2.0
  ~
  ~ Unless required by applicable law or agreed to in writing,
  ~ software distributed under the License is distributed on an
  ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  ~ KIND, either express or implied.  See the License for the
  ~ specific language governing permissions and limitations
  ~ under the License.
  --%>

<%@ taglib prefix="ww" uri="/webwork" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%@ taglib prefix="redback" uri="http://plexus.codehaus.org/redback/taglib-1.0" %>
<%@ taglib prefix="archiva" uri="http://archiva.apache.org" %>

<html>
<head>
  <title>Administration - Proxy Connectors</title>
  <ww:head/>
</head>

<body>

<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="iconUpUrl" value="/images/icons/up.gif"/>
<c:url var="iconDownUrl" value="/images/icons/down.gif"/>

<div id="contentArea">

<ww:actionerror/>
<ww:actionmessage/>

<div style="float:right">
  <redback:ifAnyAuthorized permissions="archiva-manage-configuration">
    <ww:url id="addProxyConnectorUrl" action="addProxyConnector"/>
    <ww:a href="%{addProxyConnectorUrl}" cssClass="create">
      <img src="<c:url value="/images/icons/create.png" />"/>
      Add
    </ww:a>
  </redback:ifAnyAuthorized>
</div>

<h2>Repository Proxy Connectors</h2>

<c:choose>
<c:when test="${empty (proxyConnectorMap)}">
  <strong>No Repository Proxy Connectors Defined.</strong>
</c:when>
<c:otherwise>

<div class="admin">

<c:forEach items="${proxyConnectorMap}" var="repository" varStatus="i">

<div class="proxyConfig">
  <div class="managedRepo">
    <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>

  <c:set var="numberOfRepos" value="${fn:length(repository.value)}" />

  <c:forEach items="${repository.value}" var="connector" varStatus="pc">
  
  <c:choose>
    <c:when test='${(pc.index)%2 eq 0}'>
      <c:set var="rowColor" value="dark" scope="page"/>
    </c:when>
    <c:otherwise>
      <c:set var="rowColor" value="lite" scope="page"/>
    </c:otherwise>
  </c:choose>
  
  <div class="connector ${rowColor}"> 
    <div class="controls">
      <redback:ifAnyAuthorized permissions="archiva-manage-configuration">
        <ww:url id="sortDownProxyConnectorUrl" action="sortDownProxyConnector">
          <ww:param name="target" value="%{'${connector.targetRepoId}'}"/>
          <ww:param name="source" value="%{'${connector.sourceRepoId}'}"/>
        </ww:url>
        <ww:url id="sortUpProxyConnectorUrl" action="sortUpProxyConnector">
          <ww:param name="target" value="%{'${connector.targetRepoId}'}"/>
          <ww:param name="source" value="%{'${connector.sourceRepoId}'}"/>
        </ww:url>
        <ww:url id="editProxyConnectorUrl" action="editProxyConnector">
          <ww:param name="target" value="%{'${connector.targetRepoId}'}"/>
          <ww:param name="source" value="%{'${connector.sourceRepoId}'}"/>
        </ww:url>
        <ww:url id="deleteProxyConnectorUrl" action="deleteProxyConnector" method="confirmDelete">
          <ww:param name="source" value="%{'${connector.sourceRepoId}'}"/>
          <ww:param name="target" value="%{'${connector.targetRepoId}'}"/>
        </ww:url>
        <ww:url id="enableProxyConnectorUrl" action="enableProxyConnector" method="confirmEnable">
          <ww:param name="source" value="%{'${connector.sourceRepoId}'}"/>
          <ww:param name="target" value="%{'${connector.targetRepoId}'}"/>
        </ww:url>
        <ww:url id="disableProxyConnectorUrl" action="disableProxyConnector" method="confirmDisable">
          <ww:param name="source" value="%{'${connector.sourceRepoId}'}"/>
          <ww:param name="target" value="%{'${connector.targetRepoId}'}"/>
        </ww:url>
        <c:if test="${connector.disabled}">
            <ww:a href="%{enableProxyConnectorUrl}" label="Enable Proxy Connector">
                Enable
            </ww:a>
        </c:if>
        <c:if test="${connector.disabled == false}">
            <ww:a href="%{disableProxyConnectorUrl}" title="Disable Proxy Connector">
                Disable
            </ww:a>
        </c:if>
        <c:if test="${pc.count > 1}">
          <ww:a href="%{sortUpProxyConnectorUrl}" cssClass="up" title="Move Proxy Connector Up">
            <img src="${iconUpUrl}"/>
          </ww:a>
        </c:if>
        <c:if test="${pc.count < numberOfRepos}"><commit_msg>MRM-541 - convenient way to take Archiva proxies "offline"<commit_after><%--
  ~ Licensed to the Apache Software Foundation (ASF) under one
  ~ or more contributor license agreements.  See the NOTICE file
  ~ distributed with this work for additional information
  ~ regarding copyright ownership.  The ASF licenses this file
  ~ to you under the Apache License, Version 2.0 (the
  ~ "License"); you may not use this file except in compliance
  ~ with the License.  You may obtain a copy of the License at
  ~
  ~   http://www.apache.org/licenses/LICENSE-2.0
  ~
  ~ Unless required by applicable law or agreed to in writing,
  ~ software distributed under the License is distributed on an
  ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  ~ KIND, either express or implied.  See the License for the
  ~ specific language governing permissions and limitations
  ~ under the License.
  --%>

<%@ taglib prefix="ww" uri="/webwork" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%@ taglib prefix="redback" uri="http://plexus.codehaus.org/redback/taglib-1.0" %>
<%@ taglib prefix="archiva" uri="http://archiva.apache.org" %>

<html>
<head>
  <title>Administration - Proxy Connectors</title>
  <ww:head/>
</head>

<body>

<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="iconUpUrl" value="/images/icons/up.gif"/>
<c:url var="iconDownUrl" value="/images/icons/down.gif"/>

<div id="contentArea">

<ww:actionerror/>
<ww:actionmessage/>

<div style="float:right">
  <redback:ifAnyAuthorized permissions="archiva-manage-configuration">
    <ww:url id="addProxyConnectorUrl" action="addProxyConnector"/>
    <ww:a href="%{addProxyConnectorUrl}" cssClass="create">
      <img src="<c:url value="/images/icons/create.png" />"/>
      Add
    </ww:a>
  </redback:ifAnyAuthorized>
</div>

<h2>Repository Proxy Connectors</h2>

<c:choose>
<c:when test="${empty (proxyConnectorMap)}">
  <strong>No Repository Proxy Connectors Defined.</strong>
</c:when>
<c:otherwise>

<div class="admin">

<c:forEach items="${proxyConnectorMap}" var="repository" varStatus="i">

<div class="proxyConfig">
  <div class="managedRepo">
    <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>

  <c:set var="numberOfRepos" value="${fn:length(repository.value)}" />

  <c:forEach items="${repository.value}" var="connector" varStatus="pc">
  
  <c:choose>
    <c:when test='${(pc.index)%2 eq 0}'>
      <c:set var="rowColor" value="dark" scope="page"/>
    </c:when>
    <c:otherwise>
      <c:set var="rowColor" value="lite" scope="page"/>
    </c:otherwise>
  </c:choose>
  
  <div class="connector ${rowColor}"> 
    <div class="controls">
      <redback:ifAnyAuthorized permissions="archiva-manage-configuration">
        <ww:url id="sortDownProxyConnectorUrl" action="sortDownProxyConnector">
          <ww:param name="target" value="%{'${connector.targetRepoId}'}"/>
          <ww:param name="source" value="%{'${connector.sourceRepoId}'}"/>
        </ww:url>
        <ww:url id="sortUpProxyConnectorUrl" action="sortUpProxyConnector">
          <ww:param name="target" value="%{'${connector.targetRepoId}'}"/>
          <ww:param name="source" value="%{'${connector.sourceRepoId}'}"/>
        </ww:url>
        <ww:url id="editProxyConnectorUrl" action="editProxyConnector">
          <ww:param name="target" value="%{'${connector.targetRepoId}'}"/>
          <ww:param name="source" value="%{'${connector.sourceRepoId}'}"/>
        </ww:url>
        <ww:url id="deleteProxyConnectorUrl" action="deleteProxyConnector" method="confirmDelete">
          <ww:param name="source" value="%{'${connector.sourceRepoId}'}"/>
          <ww:param name="target" value="%{'${connector.targetRepoId}'}"/>
        </ww:url>
        <ww:url id="enableProxyConnectorUrl" action="enableProxyConnector" method="confirmEnable">
          <ww:param name="source" value="%{'${connector.sourceRepoId}'}"/>
          <ww:param name="target" value="%{'${connector.targetRepoId}'}"/>
        </ww:url>
        <ww:url id="disableProxyConnectorUrl" action="disableProxyConnector" method="confirmDisable">
          <ww:param name="source" value="%{'${connector.sourceRepoId}'}"/>
          <ww:param name="target" value="%{'${connector.targetRepoId}'}"/>
        </ww:url>
        <c:if test="${connector.disabled}">
            <ww:a href="%{enableProxyConnectorUrl}" title="Enable Proxy Connector">Enable</ww:a>
        </c:if>
        <c:if test="${connector.disabled == false}">
            <ww:a href="%{disableProxyConnectorUrl}" title="Disable Proxy Connector">Disable</ww:a>
        </c:if>
        <c:if test="${pc.count > 1}">
          <ww:a href="%{sortUpProxyConnectorUrl}" title="Move Proxy Connector Up">
            <img src="${iconUpUrl}"/>
          </ww:a>
        </c:if>
        <c:if test="${pc.count < numberOfRepos}">
{'fraction_non_alphanumeric': 0.18551253722739935, 'fraction_numerical': 0.0031703333653569027, 'mean_word_length': 3.9571428571428573, 'pattern_counts': {'":': 0, '<': 209, '<?xml version=': 0, '>': 209, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7492759', 'n_tokens_mistral': 3363, 'n_tokens_neox': 3365, 'n_words': 679}