Skip to content

Commit 8fb76cb

Browse files
committed
Refine how admin monitors are displayed
1 parent 06e3753 commit 8fb76cb

File tree

39 files changed

+360
-211
lines changed

39 files changed

+360
-211
lines changed

core/src/main/resources/hudson/PluginManager/PluginCycleDependenciesMonitor/message.jelly

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,12 @@ THE SOFTWARE.
2424

2525
<?jelly escape-by-default='true'?>
2626
<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">
27-
<div class="jenkins-alert jenkins-alert-danger">
27+
<l:adminMonitor severity="danger">
2828
<dl>
2929
<dt>${%PluginCycles}</dt>
3030
<j:forEach var="p" items="${it.pluginsWithCycle}">
3131
<dd><j:out value="${p.longName} v${p.version}"/></dd>
3232
</j:forEach>
3333
</dl>
34-
</div>
34+
</l:adminMonitor>
3535
</j:jelly>

core/src/main/resources/hudson/PluginManager/PluginDeprecationMonitor/message.jelly

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,13 @@ THE SOFTWARE.
2424

2525
<?jelly escape-by-default='true'?>
2626
<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">
27-
<div class="jenkins-alert jenkins-alert-warning">
27+
<l:adminMonitor>
2828
<dl>
2929
<dt>${%DeprecatedPlugins}</dt>
3030
<j:forEach var="e" items="${it.getDeprecatedPlugins()}">
3131
<dd><a href="${e.value}" rel="noopener noreferrer" target="_blank">${e.key.displayName}</a></dd>
3232
</j:forEach>
3333
</dl>
3434
<p>${%DeprecatedPluginsDescription}</p>
35-
</div>
35+
</l:adminMonitor>
3636
</j:jelly>

core/src/main/resources/hudson/PluginManager/PluginUpdateMonitor/message.jelly

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,12 @@ THE SOFTWARE.
2424

2525
<?jelly escape-by-default='true'?>
2626
<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">
27-
<div class="jenkins-alert jenkins-alert-danger">
27+
<l:adminMonitor severity="danger">
2828
<dl>
2929
<dt>${%RequiredPluginUpdates}</dt>
3030
<j:forEach var="p" items="${it.pluginsToBeUpdated}">
3131
<dd><j:out value="${p.pluginName}"/> — <j:out value="${p.message}"/></dd>
3232
</j:forEach>
3333
</dl>
34-
</div>
34+
</l:adminMonitor>
3535
</j:jelly>

core/src/main/resources/hudson/PluginWrapper/PluginWrapperAdministrativeMonitor/message.jelly

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
<?jelly escape-by-default='true'?>
2-
<j:jelly xmlns:j="jelly:core" xmlns:f="/lib/form">
3-
<div class="jenkins-alert jenkins-alert-danger" role="alert">
4-
<form method="post" action="${rootURL}/${it.url}/act" name="${it.id}">
5-
<f:submit name="correct" value="${%Correct}"/>
6-
</form>
7-
<p>${%blurbOriginal}</p>
2+
<j:jelly xmlns:j="jelly:core" xmlns:f="/lib/form" xmlns:l="/lib/layout">
3+
<l:adminMonitor severity="danger">
4+
<div class="buttons">
5+
<a href="${rootURL}/pluginManager" class="jenkins-button jenkins-button--primary">${%Correct}</a>
6+
</div>
7+
${%blurbOriginal}
88
<p><strong>${%DirectlyDependentPlugins.title}</strong></p>
99
<j:forEach items="${it.plugins}" var="plugin">
1010
<j:if test="${plugin.hasOriginalDependencyErrors()}">
@@ -30,5 +30,5 @@
3030
</j:forEach>
3131
</dl>
3232
</j:if>
33-
</div>
33+
</l:adminMonitor>
3434
</j:jelly>

core/src/main/resources/hudson/diagnosis/HudsonHomeDiskUsageMonitor/index.jelly

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ THE SOFTWARE.
2727
<l:layout title="${%JENKINS_HOME is almost full}">
2828
<l:main-panel>
2929
<h1>
30-
<l:icon class="icon-warning icon-xlg"/>
30+
<l:icon src="symbol-warning" class="icon-xlg jenkins-!-warning-color"/>
3131
${%blurb}
3232
</h1>
3333

core/src/main/resources/hudson/diagnosis/HudsonHomeDiskUsageMonitor/message.jelly

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,10 @@ THE SOFTWARE.
2424

2525
<?jelly escape-by-default='true'?>
2626
<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">
27-
<div class="jenkins-alert jenkins-alert-warning">
28-
<form method="post" action="${rootURL}/${it.url}/act" name="${it.id}">
29-
<f:submit name="yes" value="${%Tell me more}"/>
30-
<f:submit name="no" value="${%Dismiss}"/>
31-
</form>
32-
${%blurb(app.rootDir)}
33-
</div>
27+
<l:adminMonitor dismissable="true">
28+
<div class="buttons">
29+
<a href="${rootURL}/${it.url}/" class="jenkins-button jenkins-button--primary">${%Tell me more}</a>
30+
</div>
31+
${%blurb(app.rootDir)}
32+
</l:adminMonitor>
3433
</j:jelly>

core/src/main/resources/hudson/diagnosis/NullIdDescriptorMonitor/message.jelly

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,12 @@ THE SOFTWARE.
2424

2525
<?jelly escape-by-default='true'?>
2626
<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">
27-
<div class="jenkins-alert jenkins-alert-danger">
28-
<dl>
29-
<dt>${%blurb}</dt>
30-
<j:forEach var="d" items="${it.problems}">
31-
<dd>${%problem(d, d.displayName, app.pluginManager.whichPlugin(d.getClass()))}</dd>
32-
</j:forEach>
33-
</dl>
34-
</div>
27+
<l:adminMonitor severity="danger">
28+
<dl>
29+
<dt>${%blurb}</dt>
30+
<j:forEach var="d" items="${it.problems}">
31+
<dd>${%problem(d, d.displayName, app.pluginManager.whichPlugin(d.getClass()))}</dd>
32+
</j:forEach>
33+
</dl>
34+
</l:adminMonitor>
3535
</j:jelly>

core/src/main/resources/hudson/diagnosis/OldDataMonitor/message.jelly

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,10 @@ THE SOFTWARE.
2424

2525
<?jelly escape-by-default='true'?>
2626
<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">
27-
<div class="jenkins-alert jenkins-alert-warning">
28-
<form method="post" action="${rootURL}/${it.url}/act" name="${it.id}">
29-
<f:submit name="yes" value="${%Manage}"/>
30-
<f:submit name="no" value="${%Dismiss}"/>
31-
</form>
27+
<l:adminMonitor severity="warning" dismissable="true">
28+
<div class="buttons">
29+
<a href="${rootURL}/${it.url}/manage" class="jenkins-button jenkins-button--primary" style="margin-left: auto">${%Manage}</a>
30+
</div>
3231
${%You have data stored in an older format and/or unreadable data.}
33-
</div>
32+
</l:adminMonitor>
3433
</j:jelly>

core/src/main/resources/hudson/diagnosis/ReverseProxySetupMonitor/message.jelly

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -23,16 +23,12 @@ THE SOFTWARE.
2323
-->
2424
<?jelly escape-by-default='true'?>
2525
<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:f="/lib/form" xmlns:l="/lib/layout">
26-
<div id="redirect-error" class="jenkins-alert jenkins-alert-danger reverse-proxy__hidden"
27-
data-url="${rootURL}/${it.url}/test" data-context="${rootURL}">
28-
<form method="post" action="${rootURL}/${it.url}/act" name="${it.id}">
29-
<f:submit name="yes" value="${%More Info}"/>
30-
<l:isAdmin>
31-
<f:submit name="no" value="${%Dismiss}"/>
32-
</l:isAdmin>
33-
</form>
34-
<div>${%blurb}</div>
35-
<div class="js-context-message reverse-proxy__hidden">${%missingContextMessage(rootURL)}</div>
36-
</div>
26+
<l:adminMonitor severity="danger" dismissable="true" class="reverse-proxy__hidden" id="redirect-error">
27+
<div class="buttons">
28+
<a href="https://www.jenkins.io/redirect/troubleshooting/broken-reverse-proxy" class="jenkins-button jenkins-button--primary">${%More Info}</a>
29+
</div>
30+
<div id="redirect-data" data-url="${rootURL}/${it.url}/test" data-context="${rootURL}"/>
31+
<div>${%blurb} <span class="js-context-message reverse-proxy__hidden">${%missingContextMessage(rootURL)}</span></div>
32+
</l:adminMonitor>
3733
<st:adjunct includes="hudson.diagnosis.ReverseProxySetupMonitor.resources"/>
3834
</j:jelly>

core/src/main/resources/hudson/diagnosis/ReverseProxySetupMonitor/resources.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
(function () {
22
var redirectForm = document.getElementById("redirect-error");
3+
const redirectData = document.getElementById("redirect-data");
4+
35
if (!redirectForm) {
46
console.warn(
57
'This script expects to have an element with id="redirect-error" to be working.',
68
);
79
return;
810
}
911

10-
var urlToTest = redirectForm.getAttribute("data-url");
12+
var urlToTest = redirectData.getAttribute("data-url");
1113
var callUrlToTest = function (testWithContext, callback) {
1214
var headers = {};
1315
var body = null;
@@ -40,7 +42,7 @@
4042

4143
callUrlToTest(false, function (response) {
4244
if (response.status !== 200) {
43-
var context = redirectForm.getAttribute("data-context");
45+
var context = redirectData.getAttribute("data-context");
4446
// to cover the case where the JenkinsRootUrl is configured without the context
4547
if (context) {
4648
callUrlToTest(true, function (response2) {

0 commit comments

Comments
 (0)