Skip to content

Commit 7e195ad

Browse files
committed
use agent-subpage for disconnect, mark offline and update offline pages
1 parent 0a20678 commit 7e195ad

6 files changed

Lines changed: 41 additions & 47 deletions

File tree

core/src/main/java/jenkins/model/details/MonitoringDetails.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import hudson.model.Computer;
44

5-
public class MonitoringDetails extends Detail{
5+
public class MonitoringDetails extends Detail {
66
public MonitoringDetails(Computer computer) {
77
super(computer);
88
}

core/src/main/resources/hudson/model/Computer/markOffline.jelly

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -28,22 +28,20 @@ THE SOFTWARE.
2828
<st:redirect url="setOfflineCause"/>
2929
</j:if>
3030

31-
<l:layout title="${%title(it.displayName)}">
32-
<st:include page="sidepanel.jelly" />
33-
<l:breadcrumb title="${%Mark offline}" />
34-
<l:main-panel>
35-
<l:hasPermission permission="${it.DISCONNECT}">
36-
<h2>${%title(it.displayName)}</h2>
31+
<l:agent-subpage title="${%Mark offline}" agent="${it}">
32+
<l:userExperimentalFlag var="newAgentPage" flagClassName="jenkins.model.experimentalflags.NewAgentPageUserExperimentalFlag" />
33+
34+
<l:app-bar title="${newAgentPage ? '%Take Offline' : '%title(it.displayName)'}"/>
35+
<l:hasPermission permission="${it.DISCONNECT}">
36+
<p>
37+
${%blurb}
38+
</p>
39+
<form method="post" action="toggleOffline">
40+
<f:textarea name="offlineMessage" />
3741
<p>
38-
${%blurb}
42+
<f:submit value="${%submit}" />
3943
</p>
40-
<form method="post" action="toggleOffline">
41-
<f:textarea name="offlineMessage" />
42-
<p>
43-
<f:submit value="${%submit}" />
44-
</p>
45-
</form>
46-
</l:hasPermission>
47-
</l:main-panel>
48-
</l:layout>
44+
</form>
45+
</l:hasPermission>
46+
</l:agent-subpage>
4947
</j:jelly>
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
title=Taking {0} Offline
22
blurb=You can optionally explain why you are taking this node offline, so that others can see why:
3-
submit=Mark this node temporarily offline
3+
submit=Mark temporarily offline

core/src/main/resources/hudson/model/Computer/setOfflineCause.jelly

Lines changed: 13 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -24,22 +24,19 @@ 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" xmlns:i="jelly:fmt">
27-
<l:layout title="${%title(it.displayName)}">
28-
<st:include page="sidepanel.jelly" />
29-
<l:breadcrumb title="${%Update offline reason}" />
30-
<l:main-panel>
31-
<l:hasPermission permission="${it.DISCONNECT}">
32-
<h2>${%title(it.displayName)}</h2>
27+
<l:agent-subpage title="${%Update offline reason}" agent="${it}">
28+
<l:hasPermission permission="${it.DISCONNECT}">
29+
<l:userExperimentalFlag var="newAgentPage" flagClassName="jenkins.model.experimentalflags.NewAgentPageUserExperimentalFlag" />
30+
<l:app-bar title="${newAgentPage ? '%Set Offline Reason' : '%title(it.displayName)'}"/>
31+
<p>
32+
${%blurb}
33+
</p>
34+
<form method="post" action="changeOfflineCause">
35+
<f:textarea name="offlineMessage" value="${it.temporaryOfflineCauseReason}"/>
3336
<p>
34-
${%blurb}
37+
<f:submit value="${%submit}" />
3538
</p>
36-
<form method="post" action="changeOfflineCause">
37-
<f:textarea name="offlineMessage" value="${it.temporaryOfflineCauseReason}"/>
38-
<p>
39-
<f:submit value="${%submit}" />
40-
</p>
41-
</form>
42-
</l:hasPermission>
43-
</l:main-panel>
44-
</l:layout>
39+
</form>
40+
</l:hasPermission>
41+
</l:agent-subpage>
4542
</j:jelly>
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
title=Set {0} Offline Reason
2-
blurb=You can set or update the reason why this node offline, so that others can see why:
2+
blurb=You can set or update the reason why this node is offline, so that others can see why:
33
submit=Update reason

core/src/main/resources/hudson/slaves/SlaveComputer/disconnect.jelly

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,15 @@ THE SOFTWARE.
2525
<!-- Disconnect confirmation -->
2626
<?jelly escape-by-default='true'?>
2727
<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" xmlns:i="jelly:fmt">
28-
<l:layout title="${it.displayName} ${%disconnect}">
29-
<st:include page="sidepanel.jelly" />
30-
<l:breadcrumb title="${%Disconnect}" />
31-
<l:main-panel>
32-
<form method="post" action="doDisconnect">
33-
${%disconnect.computer(it.displayName)}
34-
<f:submit value="${%Yes}" />
35-
<p>${%blurb}</p>
36-
<f:textarea name="offlineMessage" />
37-
</form>
38-
</l:main-panel>
39-
</l:layout>
28+
<l:agent-subpage title="${%Disconnect}" agent="${it}">
29+
<l:userExperimentalFlag var="newAgentPage" flagClassName="jenkins.model.experimentalflags.NewAgentPageUserExperimentalFlag" />
30+
<l:app-bar title="${newAgentPage ? '%Disconnect' : '%disconnect.computer(it.displayName)'}"/>
31+
<p>${%blurb}</p>
32+
<form method="post" action="doDisconnect">
33+
<f:textarea name="offlineMessage"/>
34+
<p>
35+
<f:submit value="${%Disconnect}"/>
36+
</p>
37+
</form>
38+
</l:agent-subpage>
4039
</j:jelly>

0 commit comments

Comments
 (0)