提交 eade4cca 编写于 作者: M mindless

[FIXED HUDSON-2313] Show which plugins have already been upgraded in Plugin Manager.

Also some css cleanup in this area.


git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@26639 71c3de6d-444a-0410-be80-ed276b4c234a
上级 bdaa0153
/*
* The MIT License
*
* Copyright (c) 2004-2009, Sun Microsystems, Inc., Kohsuke Kawaguchi, Yahoo! Inc., Seiji Sogabe
* Copyright (c) 2004-2010, Sun Microsystems, Inc., Kohsuke Kawaguchi, Yahoo! Inc., Seiji Sogabe
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
......@@ -59,6 +59,7 @@ import java.net.URL;
import java.net.URLConnection;
import java.net.UnknownHostException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
......@@ -152,6 +153,22 @@ public class UpdateCenter extends AbstractModelObject implements Saveable {
}
}
/**
* Returns latest install/upgrade job for the given plugin.
* @return InstallationJob or null if not found
*/
public InstallationJob getJob(Plugin plugin) {
List<UpdateCenterJob> jobList = getJobs();
Collections.reverse(jobList);
for (UpdateCenterJob job : jobList)
if (job instanceof InstallationJob) {
InstallationJob ij = (InstallationJob)job;
if (ij.plugin.name.equals(plugin.name) && ij.plugin.sourceId.equals(plugin.sourceId))
return ij;
}
return null;
}
/**
* Returns the list of {@link UpdateSite}s to be used.
* This is a live list, whose change will be persisted automatically.
......
<!--
The MIT License
Copyright (c) 2004-2009, Sun Microsystems, Inc., Kohsuke Kawaguchi, Harald Wellmann
Copyright (c) 2004-2010, Sun Microsystems, Inc., Kohsuke Kawaguchi, Harald Wellmann
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
......@@ -29,11 +29,9 @@ THE SOFTWARE.
<l:layout title="Update Center" permission="${app.ADMINISTER}" norefresh="true">
<st:include page="sidepanel.jelly"/>
<l:main-panel>
<local:tabBar page="advanced" xmlns:local="/hudson/PluginManager">
<tr style="border-top: 0px;">
<th/>
</tr>
<tr>
<local:tabBar page="advanced" xmlns:local="/hudson/PluginManager" />
<table id="pluginsAdv" class="pane bigtable" style="margin-top:0; border-top:none">
<tr style="border-top:none">
<td>
<h1>${%HTTP Proxy Configuration}</h1>
<f:form method="post" action="proxyConfigure">
......@@ -73,7 +71,7 @@ THE SOFTWARE.
</f:form>
</td>
</tr>
</local:tabBar>
</table>
<div align="right" style="margin-top:1em">
<form method="post" action="checkUpdates">
${%lastUpdated(app.updateCenter.lastUpdatedString)}
......
<!--
The MIT License
Copyright (c) 2004-2009, Sun Microsystems, Inc., Kohsuke Kawaguchi, Harald Wellmann, Seiji Sogabe
Copyright (c) 2004-2010, Sun Microsystems, Inc., Kohsuke Kawaguchi, Harald Wellmann, Seiji Sogabe
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
......@@ -24,16 +24,14 @@ THE SOFTWARE.
<!--
Update Center main page
TODO:
categorize plugins
find excerpt from Wiki
-->
<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:d="jelly:define" xmlns:l="/lib/layout" xmlns:t="/lib/hudson" xmlns:f="/lib/form">
<local:table page="updates" list="${app.updateCenter.updates}" xmlns:local="/hudson/PluginManager">
<div style="margin-top:1em">
${%UpdatePageDescription}
<j:if test="${!empty(app.updateCenter.jobs)}">
&lt;br/&gt; ${%UpdatePageLegend(rootURL+'/updateCenter/')}
</j:if>
</div>
</local:table>
</j:jelly>
\ No newline at end of file
</j:jelly>
# The MIT License
#
# Copyright (c) 2004-2009, Sun Microsystems, Inc., Kohsuke Kawaguchi, Harald Wellmann
# Copyright (c) 2004-2010, Sun Microsystems, Inc., Kohsuke Kawaguchi, Harald Wellmann
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
......@@ -20,4 +20,6 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
UpdatePageDescription=This page lists updates to the plugins you currently use.
\ No newline at end of file
UpdatePageDescription=This page lists updates to the plugins you currently use.
UpdatePageLegend=Disabled rows are already upgraded, awaiting restart. \
Shaded but selectable rows are <a href="{0}">in progress or failed</a>.
......@@ -29,7 +29,8 @@ THE SOFTWARE.
<l:layout title="Update Center" permission="${app.ADMINISTER}" norefresh="true">
<st:include page="sidepanel.jelly"/>
<l:main-panel>
<local:tabBar page="installed" xmlns:local="/hudson/PluginManager">
<local:tabBar page="installed" xmlns:local="/hudson/PluginManager" />
<table id="plugins" class="sortable pane bigtable">
<j:choose>
<j:when test="${empty(app.pluginManager.plugins) and empty(app.pluginManager.failedPlugins)}">
<tr><td>
......@@ -83,7 +84,7 @@ THE SOFTWARE.
</j:forEach>
</j:otherwise>
</j:choose>
</local:tabBar>
</table>
<j:if test="${it.isPluginUploaded()}">
<div style="margin: 1em; height: 1em">
......@@ -102,7 +103,6 @@ THE SOFTWARE.
</div>
<script>
<!-- function to toggle the enable/disable state -->
function flip(o) {
......
<!--
The MIT License
Copyright (c) 2004-2009, Sun Microsystems, Inc., Kohsuke Kawaguchi
Copyright (c) 2004-2010, Sun Microsystems, Inc., Kohsuke Kawaguchi
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
......@@ -33,7 +33,4 @@ THE SOFTWARE.
<!--<l:tab name="${%Sites}" active="${page=='sites'}" href="./sites" />-->
<l:tab name="${%Advanced}" active="${page=='advanced'}" href="./advanced" />
</l:tabBar>
<table id="plugins" class="sortable pane bigtable" style="margin-top:0px; border-top: none;">
<d:invokeBody />
</table>
</j:jelly>
\ No newline at end of file
</j:jelly>
<!--
The MIT License
Copyright (c) 2004-2009, Sun Microsystems, Inc., Kohsuke Kawaguchi, Seiji Sogabe
Copyright (c) 2004-2010, Sun Microsystems, Inc., Kohsuke Kawaguchi, Seiji Sogabe
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
......@@ -53,7 +53,8 @@ THE SOFTWARE.
</script>
<form method="post" action="install">
<j:set var="isUpdates" value="${attrs.page=='updates'}" />
<local:tabBar page="${attrs.page}" xmlns:local="/hudson/PluginManager">
<local:tabBar page="${attrs.page}" xmlns:local="/hudson/PluginManager" />
<table id="plugins" class="sortable pane bigtable">
<tr style="border-top: 0px;">
<th initialSortDir="${isUpdates?null:'down'}" tooltip="${%Check to install the plugin}"
width="32" onclick="showhideCategories(this,1)">${%Install}</th>
......@@ -76,9 +77,13 @@ THE SOFTWARE.
</j:if>
<j:set var="lastCat" value="${thisCat}" />
</j:if>
<tr>
<j:set var="installJob" value="${isUpdates ? app.updateCenter.getJob(p) : null}" />
<j:set var="installedOk" value="${installJob.status.class.name=='hudson.model.UpdateCenter$DownloadJob$Success'}" />
<tr class="${installJob!=null ? 'already-upgraded' : null}">
<td class="pane" align="center" data="${thisCat}_">
<input type="checkbox" name="plugin.${p.name}.${p.sourceId}"/>
<input type="checkbox" name="plugin.${p.name}.${p.sourceId}"
checked="${installedOk ? 'checked' : null}"
disabled="${installedOk ? 'disabled' : null}" />
</td>
<td class="pane" data="${h.xmlEscape(p.displayName)}">
<div>
......@@ -119,7 +124,7 @@ THE SOFTWARE.
</tr>
</j:otherwise>
</j:choose>
</local:tabBar>
</table>
<j:if test="${!empty(list)}">
<div style="float:right; margin-top:1em">
......
/*
* The MIT License
*
* Copyright (c) 2004-2009, Sun Microsystems, Inc., Kohsuke Kawaguchi, Daniel Dyer, Stephen Connolly
* Copyright (c) 2004-2010, Sun Microsystems, Inc., Kohsuke Kawaguchi, Daniel Dyer, Stephen Connolly
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
......@@ -659,30 +659,19 @@ TABLE.fingerprint-in-build TD {
/* ========================= plugin manager ========================= */
#pluginList {
width:100%;
border: 1px solid #bbb;
border-spacing: 0px;
#plugins {
margin-top: 0;
border-top: none;
}
#pluginList TR:hover {
background-color: #eeeeec;
#plugins tr:hover {
background-color: #eeeee8;
}
#pluginList TD {
padding: 0.5em;
vertical-align: middle;
#plugins tr.already-upgraded {
background-color: #e8eeee;
}
/* Doesn't work because gear2.gif is not transparent
#pluginList TD.plugin-description {
background: url(../images/24x24/gear2.gif) no-repeat;
background-position: center left;
padding-left: 32px;
}
*/
/* ========================= repeatable elements ========================= */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册