Skip to content
Permalink
Browse files
[JENKINS-11513] Change f:textbox to f:number
- Add min, max, step and clazz attributes if appropriate
  • Loading branch information
ohtake authored and kohsuke committed Nov 7, 2011
1 parent 2ce68ec commit 8067940aadfe8dc73b5e166b7f4b0fc5be504468
@@ -41,7 +41,7 @@ THE SOFTWARE.
<f:textbox name="proxy.server" value="${app.proxy.name}" />
</f:entry>
<f:entry title="${%Port}" help="/help/update-center/proxy-port.html">
<f:textbox name="proxy.port" value="${app.proxy.port}"
<f:number name="proxy.port" value="${app.proxy.port}" clazz="number" min="0" max="65535" step="1"
checkUrl="'${rootURL}/pluginManager/checkProxyPort?value='+escape(this.value)" />
</f:entry>
</f:block>
@@ -33,7 +33,7 @@ THE SOFTWARE.
</f:entry>

<f:entry title="${%# of executors}" field="numExecutors">
<f:textbox />
<f:number clazz="positive-number" min="1" step="1" />
</f:entry>

<f:entry title="${%Remote FS root}" field="remoteFS">
@@ -26,12 +26,12 @@ THE SOFTWARE.
<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">
<f:entry title="${%In demand delay}" help="/help/system-config/master-slave/demand/inDemandDelay.html">
<f:textbox clazz="required number"
<f:number clazz="required number" min="0"
name="retentionStrategy.inDemandDelay" value="${instance.inDemandDelay}"
checkMessage="${%In demand delay is mandatory and must be a number.}"/>
</f:entry>
<f:entry title="${%Idle delay}" help="/help/system-config/master-slave/demand/idleDelay.html">
<f:textbox clazz="required number"
<f:number clazz="required number" min="0"
name="retentionStrategy.idleDelay" value="${instance.idleDelay}"
checkMessage="${%Idle delay is mandatory and must be a number.}"/>
</f:entry>
@@ -31,7 +31,7 @@ THE SOFTWARE.
</f:entry>
<f:entry title="${%Scheduled Uptime}"
description="${%uptime.description}">
<f:textbox clazz="required number"
<f:number clazz="required number" min="0"
name="retentionStrategy.upTimeMins" value="${instance.upTimeMins}"
checkMessage="${%Scheduled Uptime is mandatory and must be a number.}"/>
</f:entry>
@@ -26,23 +26,23 @@ THE SOFTWARE.
<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">
<f:entry title="${%Days to keep builds}"
description="${%if not empty, build records are only kept up to this number of days}">
<f:textbox clazz="positive-number"
<f:number clazz="positive-number" min="1" step="1"
name="logrotate_days" value="${it.logRotator.daysToKeepStr}"/>
</f:entry>
<f:entry title="${%Max # of builds to keep}"
description="${%if not empty, only up to this number of build records are kept}">
<f:textbox clazz="positive-number"
<f:number clazz="positive-number" min="1" step="1"
name="logrotate_nums" value="${it.logRotator.numToKeepStr}"/>
</f:entry>
<f:advanced>
<f:entry title="${%Days to keep artifacts}"
description="${%if not empty, artifacts from builds older than this number of days will be deleted, but the logs, history, reports, etc for the build will be kept}">
<f:textbox clazz="positive-number"
<f:number clazz="positive-number" min="1" step="1"
name="logrotate_artifact_days" value="${it.logRotator.artifactDaysToKeepStr}" />
</f:entry>
<f:entry title="${%Max # of builds to keep with artifacts}"
description="${%if not empty, only up to this number of builds have their artifacts retained}">
<f:textbox clazz="positive-number"
<f:number clazz="positive-number" min="1" step="1"
name="logrotate_artifact_nums" value="${it.logRotator.artifactNumToKeepStr}" />
</f:entry>
</f:advanced>
@@ -31,7 +31,8 @@ THE SOFTWARE.
-->
<f:section title="${%SCM Polling}">
<f:entry title="${%Max # of concurrent polling}" field="pollingThreadCount">
<f:textbox value="${descriptor.pollingThreadCount==0 ? '' : descriptor.pollingThreadCount}"/>
<f:number value="${descriptor.pollingThreadCount==0 ? '' : descriptor.pollingThreadCount}"
clazz="positive-number" min="1" step="1"/>
</f:entry>
</f:section>
</j:if>
@@ -3,5 +3,5 @@ package jenkins.model.GlobalQuietPeriodConfiguration
def f=namespace(lib.FormTagLib)

f.entry(title:_("Quiet period"), field:"quietPeriod") {
f.textbox(clazz:"number")
f.number(clazz:"number", min:0)
}
@@ -3,5 +3,5 @@ package jenkins.model.GlobalSCMRetryCountConfiguration
def f=namespace(lib.FormTagLib)

f.entry(title:_("SCM checkout retry count"), field:"scmCheckoutRetryCount") {
f.textbox(clazz:"number")
f.number(clazz:"number", min:0)
}
@@ -3,7 +3,7 @@ package jenkins.model.MasterBuildConfiguration
def f=namespace(lib.FormTagLib)

f.entry(title:_("# of executors"), field:"numExecutors") {
f.textbox()
f.number(clazz:"positive-number", min:1, step:1)
}
if (!app.slaves.isEmpty() || !app.clouds.isEmpty()) {
f.entry(title:_("Labels"),field:"labelString") {
@@ -29,7 +29,7 @@ THE SOFTWARE.
help="/descriptor/jenkins.model.GlobalQuietPeriodConfiguration/help/quietPeriod">
<f:entry title="${%Quiet period}"
description="${%Number of seconds}">
<f:textbox clazz="number" name="quiet_period" value="${it.quietPeriod}"/>
<f:number clazz="number" name="quiet_period" value="${it.quietPeriod}" min="0" step="1"/>
</f:entry>
</f:optionalBlock>
</j:jelly>
@@ -28,7 +28,7 @@ THE SOFTWARE.
<f:optionalBlock name="hasCustomScmCheckoutRetryCount" title="${%Retry Count}" checked="${it.hasCustomScmCheckoutRetryCount()}"
help="/help/project-config/scmCheckoutRetryCount.html">
<f:entry title="${%SCM checkout retry count}">
<f:textbox clazz="number" name="scmCheckoutRetryCount" value="${it.scmCheckoutRetryCount}"/>
<f:number clazz="number" name="scmCheckoutRetryCount" value="${it.scmCheckoutRetryCount}" min="0" step="1"/>
</f:entry>
</f:optionalBlock>
</j:jelly>

0 comments on commit 8067940

Please sign in to comment.