<commit_before><!--
  Config page
-->
<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:d="jelly:define" xmlns:l="/lib/layout" xmlns:t="/lib/hudson" xmlns:s="/lib/form">
<l:layout secured="true">
  <st:include page="sidepanel.jelly" />
  <l:main-panel>
    <s:form method="post" action="configSubmit">
      <s:block>
        <h1>Installed Plugins</h1>
        <div style="margin: 1em; height: 1em">
          <div class="error" id="needRestart" style="display:none">
            Changes will take effect when you restart Hudson
          </div>
        </div>
        <j:choose>
          <j:when test="${empty(it.pluginManager.plugins) &amp;&amp; empty(it.pluginManager.failedPlugins)}">
            No plugins installed.
          </j:when>
          <j:otherwise>
            <table id="pluginList">
              <j:forEach var="p" items="${it.pluginManager.plugins}">
                <tr class="hoverback">
                  <td class="plugin-description">
                    <h4>${p.longName} &#x2014; ver.${p.version}</h4>
                    <div stlyle="padding-left: 1em">
                      <j:set var="indexPage" value="${p.indexPage.toString()}" />
                      <j:if test="${!empty(indexPage)}">
                        <j:include uri="${indexPage}" />
                      </j:if>
                    </div>
                  </td>
                  <td>
                    <j:set var="state" value="${h.ifThenElse(p.enabled,'Disable','Enable')}"/>
                    <input type="button" value="${state}" onclick="flip(event)"
                           url="pluginManager/plugin/${p.shortName}"
                           original="${h.ifThenElse(p.active,'Disable','Enable')}"/>
                  </td>
                </tr>
              </j:forEach>
              <!-- failed ones -->
              <j:forEach var="p" items="${it.pluginManager.failedPlugins}">
                <tr class="hoverback">
                  <td class="plugin-description">
                    <h4 class="error">Failed : ${p.name}</h4>
                    <div stlyle="padding-left: 1em">
                      <pre>${p.exceptionString}</pre>
                    </div>
                  </td>
                </tr>
              </j:forEach>
            </table>
          </j:otherwise>
        </j:choose>
      </s:block>
    </s:form>
    <script>
      <!-- function to toggle the enable/disable state -->
      function flip(o) {
        btn = Event.element(o);

        <!-- trigger -->
        new Ajax.Request(btn.getAttribute('url')+"/make"+btn.value+"d", {
          onFailure : function(req,o) {
            $('needRestart').innerHTML = req.responseText;
          }
        });

        <!-- flip -->
        if(btn.value=="Enable")
          btn.value = "Disable";
        else
          btn.value = "Enable";

        updateMsg();
      }

      function updateMsg() {
        <!-- is anything changed since its original state? -->
        var e = $A($('pluginList').getElementsByTagName('input')).find(function(e) {
          return e.value!=e.getAttribute('original');
        });

        $('needRestart').style.display = (e!=null?"block":"none");
      }

      updateMsg(); // set the initial state
    </script>

    <s:form method="post" action="uploadPlugin" enctype="multipart/form-data">
      <s:block>
        <h1>Upload Plugin</h1>
        <div style="margin-bottom: 1em;">
          Upload a plugin from your computer by using the form below, or
          place your plugin at <tt>$HUDSON_HOME/plugins</tt> on the server.
        </div>
      </s:block>
      <s:block>
        <!-- @size is for other browsers, @style is for IE -->
        File: <input type="file" name="name" class="setting-input" style="width:80%" size='40' />
      </s:block>
      <s:block><div align="right"><commit_msg>fixed script error on client.<commit_after><!--
  Config page
-->
<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:d="jelly:define" xmlns:l="/lib/layout" xmlns:t="/lib/hudson" xmlns:s="/lib/form">
<l:layout secured="true">
  <st:include page="sidepanel.jelly" />
  <l:main-panel>
    <s:form method="post" action="configSubmit">
      <s:block>
        <h1>Installed Plugins</h1>
        <div style="margin: 1em; height: 1em">
          <div class="error" id="needRestart" style="display:none">
            Changes will take effect when you restart Hudson
          </div>
        </div>
        <j:choose>
          <j:when test="${empty(it.pluginManager.plugins) &amp;&amp; empty(it.pluginManager.failedPlugins)}">
            No plugins installed.
            <span id="pluginList"/>
          </j:when>
          <j:otherwise>
            <table id="pluginList">
              <j:forEach var="p" items="${it.pluginManager.plugins}">
                <tr class="hoverback">
                  <td class="plugin-description">
                    <h4>${p.longName} &#x2014; ver.${p.version}</h4>
                    <div stlyle="padding-left: 1em">
                      <j:set var="indexPage" value="${p.indexPage.toString()}" />
                      <j:if test="${!empty(indexPage)}">
                        <j:include uri="${indexPage}" />
                      </j:if>
                    </div>
                  </td>
                  <td>
                    <j:set var="state" value="${h.ifThenElse(p.enabled,'Disable','Enable')}"/>
                    <input type="button" value="${state}" onclick="flip(event)"
                           url="pluginManager/plugin/${p.shortName}"
                           original="${h.ifThenElse(p.active,'Disable','Enable')}"/>
                  </td>
                </tr>
              </j:forEach>
              <!-- failed ones -->
              <j:forEach var="p" items="${it.pluginManager.failedPlugins}">
                <tr class="hoverback">
                  <td class="plugin-description">
                    <h4 class="error">Failed : ${p.name}</h4>
                    <div stlyle="padding-left: 1em">
                      <pre>${p.exceptionString}</pre>
                    </div>
                  </td>
                </tr>
              </j:forEach>
            </table>
          </j:otherwise>
        </j:choose>
      </s:block>
    </s:form>
    <script>
      <!-- function to toggle the enable/disable state -->
      function flip(o) {
        btn = Event.element(o);

        <!-- trigger -->
        new Ajax.Request(btn.getAttribute('url')+"/make"+btn.value+"d", {
          onFailure : function(req,o) {
            $('needRestart').innerHTML = req.responseText;
          }
        });

        <!-- flip -->
        if(btn.value=="Enable")
          btn.value = "Disable";
        else
          btn.value = "Enable";

        updateMsg();
      }

      function updateMsg() {
        <!-- is anything changed since its original state? -->
        var e = $A($('pluginList').getElementsByTagName('input')).find(function(e) {
          return e.value!=e.getAttribute('original');
        });

        $('needRestart').style.display = (e!=null?"block":"none");
      }

      updateMsg(); // set the initial state
    </script>

    <s:form method="post" action="uploadPlugin" enctype="multipart/form-data">
      <s:block>
        <h1>Upload Plugin</h1>
        <div style="margin-bottom: 1em;">
          Upload a plugin from your computer by using the form below, or
          place your plugin at <tt>$HUDSON_HOME/plugins</tt> on the server.
        </div>
      </s:block>
      <s:block>
        <!-- @size is for other browsers, @style is for IE -->
        File: <input type="file" name="name" class="setting-input" style="width:80%" size='40' />
      </s:block>
      <s:block><div>
{'fraction_non_alphanumeric': 0.17222653219550038, 'fraction_numerical': 0.005430566330488751, 'mean_word_length': 1.7140350877192982, 'pattern_counts': {'":': 2, '<': 154, '<?xml version=': 0, '>': 154, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 12}, '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': '6613710', 'n_tokens_mistral': 2318, 'n_tokens_neox': 2199, 'n_words': 430}