[JENKINS-38187] Fixes @daniel-beck reviews

上级 5cff734b
......@@ -1220,6 +1220,7 @@ public class Jenkins extends AbstractCIBase implements DirectlyModifiableTopLeve
}
@Extension
@Restricted(NoExternalUse.class)
public static class EnforceSlaveAgentPortAdministrativeMonitor extends AdministrativeMonitor {
@Inject
Jenkins j;
......@@ -1234,15 +1235,8 @@ public class Jenkins extends AbstractCIBase implements DirectlyModifiableTopLeve
return Jenkins.getSlaveAgentPortInitialValue(slaveAgentPort);
}
public String getExpectedPortString() {
return Integer.toString(getExpectedPort());
}
/**
* Depending on whether the user said "yes" or "no", send him to the right place.
*/
public void doAct(StaplerRequest req, StaplerResponse rsp) throws IOException {
if (req.hasParameter("fix")) {
if (req.hasParameter("reset")) {
j.setSlaveAgentPort(getExpectedPort());
}
rsp.sendRedirect2(req.getContextPath() + "/manage");
......
<!--
The MIT License
Copyright (c) 2016, CloudBees
Copyright (c) 2016, CloudBees, Inc.
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,10 +24,10 @@ THE SOFTWARE.
<?jelly escape-by-default='true'?>
<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">
<div class="warning">
${%description(it.expectedPortString)}
${%description(it.expectedPort)}
<form method="post" action="${rootURL}/${it.url}/act" name="${it.id}">
<div style="float:right">
<f:submit name="fix" value="${%Fix}"/>
<f:submit name="reset" value="${%reset(it.expectedPort)}"/>
</div>
</form>
</div>
......
description=Slave Agent Port has been manually changed. Its value will be reset to {0} on restart.
description=Slave Agent Port has been manually changed. Its value will be reset to {0,number,#} on restart.
reset=Reset to {0,number,#}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册