提交 88b39d23 编写于 作者: K kohsuke

show some indication when updates are available.

git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@9920 71c3de6d-444a-0410-be80-ed276b4c234a
上级 1f47018c
...@@ -176,6 +176,19 @@ public class UpdateCenter implements ModelObject { ...@@ -176,6 +176,19 @@ public class UpdateCenter implements ModelObject {
return r; return r;
} }
/**
* Does any of the plugin has updates?
*/
public boolean hasUpdates() {
Data data = getData();
if(data==null) return false;
for (PluginWrapper pw : Hudson.getInstance().getPluginManager().getPlugins()) {
if(pw.getUpdateInfo() !=null) return true;
}
return false;
}
public String getDisplayName() { public String getDisplayName() {
return "Update center"; return "Update center";
} }
......
...@@ -31,7 +31,10 @@ ...@@ -31,7 +31,10 @@
${%Useful when you modified config files directly on disk.} ${%Useful when you modified config files directly on disk.}
</local:feature> </local:feature>
<local:feature icon="gear2.gif" href="pluginManager/" title="${%Manage Plugins}"> <local:feature icon="gear2.gif" href="pluginManager/" title="${%Manage Plugins}">
${%Add, remove, disable or enable plugins that can extend the functionality of Hudson.} ${%Add, remove, disable or enable plugins that can extend the functionality of Hudson.}
<j:if test="${it.updateCenter.hasUpdates()}">
<span style="color:red; font-weight:bold">(${%updates available})</span>
</j:if>
</local:feature> </local:feature>
<local:feature icon="computer.gif" href="systemInfo" title="${%System Information}"> <local:feature icon="computer.gif" href="systemInfo" title="${%System Information}">
${%Displays various environmental information to assist trouble-shooting.} ${%Displays various environmental information to assist trouble-shooting.}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册