提交 a13016c2 编写于 作者: M mindless

[FIXED HUDSON-4976] Add per-directory sorting for artifact list and tree display.

Also, always show a link to directory browser (as "download as zip" is accessible here)
instead of only when there are 40+ artifacts.


git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@24413 71c3de6d-444a-0410-be80-ed276b4c234a
上级 0766f1f5
......@@ -69,6 +69,7 @@ import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Calendar;
import java.util.Collections;
import java.util.Comparator;
......@@ -744,6 +745,7 @@ public abstract class Run <JobT extends Job<JobT,RunT>,RunT extends Run<JobT,Run
private void addArtifacts( File dir, String path, String pathHref, ArtifactList r, Artifact parent ) {
String[] children = dir.list();
if(children==null) return;
Arrays.sort(children, String.CASE_INSENSITIVE_ORDER);
String childPath, childHref;
boolean collapsed;
Artifact a;
......@@ -1024,6 +1026,7 @@ public abstract class Run <JobT extends Job<JobT,RunT>,RunT extends Run<JobT,Run
removeRunFromParent();
}
@SuppressWarnings("unchecked") // seems this is too clever for Java's type system?
private void removeRunFromParent() {
getParent().removeRun((RunT)this);
......
......@@ -40,10 +40,10 @@ THE SOFTWARE.
<j:set var="artifacts" value="${build.artifacts}" />
<j:if test="${!build.building and !empty(artifacts)}">
<t:summary icon="package.gif">
<a href="${baseURL}artifact/">${caption}</a>
<j:choose>
<j:when test="${size(artifacts) le build.LIST_CUTOFF}">
<!-- if not too many, just list them -->
${caption}<br />
<ul>
<j:forEach var="f" items="${artifacts}">
<li>
......@@ -64,7 +64,7 @@ THE SOFTWARE.
<script language="javascript">// &lt;![CDATA[
YAHOO.util.Event.onContentReady('artifact-tree', function () {
var artifactTree = new YAHOO.widget.TreeView('artifact-tree');
var artifactRoot = new YAHOO.widget.TextNode('${h.jsStringEscape(caption)}',
var artifactRoot = new YAHOO.widget.TextNode('${h.jsStringEscape('%View')}',
artifactTree.getRoot(), false);
<j:forEach var="e" items="${artifacts.getTree().entrySet()}">
<j:set var="f" value="${e.key}"/>
......@@ -80,10 +80,7 @@ THE SOFTWARE.
});
// ]]&gt;</script>
</j:when>
<j:otherwise>
<!-- otherwise use a link to directory browser -->
<a href="${baseURL}artifact/">${caption}</a>
</j:otherwise>
<!-- otherwise just show link to directory browser -->
</j:choose>
</t:summary>
</j:if>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册