提交 9ae93b67 编写于 作者: D Daniel Beck

Link to the deprecation URL, not the plugin URL

上级 ab97dbbd
......@@ -145,6 +145,7 @@ import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;
import java.util.concurrent.CopyOnWriteArrayList;
import java.util.concurrent.Future;
import java.util.function.Function;
import java.util.function.Supplier;
import java.util.jar.JarEntry;
import java.util.jar.JarFile;
......@@ -2257,10 +2258,10 @@ public abstract class PluginManager extends AbstractModelObject implements OnMas
return !getDeprecatedPlugins().isEmpty();
}
public List<PluginWrapper> getDeprecatedPlugins() {
public Map<PluginWrapper, String> getDeprecatedPlugins() {
return Jenkins.get().getPluginManager().getPlugins().stream()
.filter(PluginWrapper::isDeprecated)
.collect(Collectors.toList());
.collect(Collectors.toMap(Function.identity(), it -> it.getDeprecations().get(0).url));
}
}
......
......@@ -27,15 +27,8 @@ THE SOFTWARE.
<div class="alert alert-warning">
<dl>
<dt>${%DeprecatedPlugins}</dt>
<j:forEach var="p" items="${it.getDeprecatedPlugins()}">
<j:choose>
<j:when test="${p.url != null and p.url.matches('(?i)^https?.+$')}">
<dd><a href="${p.url}" target="_blank">${p.displayName}</a></dd>
</j:when>
<j:otherwise>
<dd>${p.displayName}}</dd>
</j:otherwise>
</j:choose>
<j:forEach var="e" items="${it.getDeprecatedPlugins()}">
<dd><a href="${e.value}" target="_blank">${e.key.displayName}</a></dd>
</j:forEach>
</dl>
<p>${%DeprecatedPluginsDescription}</p>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册