Permalink
Browse files

JENKINS-16180

Make paintInterval configurable via URL
  • Loading branch information...
jenkins-pipeline-code committed Dec 20, 2012
1 parent fc17b3d commit a2cfea5cafed927bebfde762f2c7603d0a4d6b2c
@@ -23,6 +23,7 @@
private String sortOrder = WallDisplayPlugin.sortOrder[0];
private int jenkinsTimeOut = 15;
private int jenkinsUpdateInterval = 20;
+ private int paintInterval = 1;
private Boolean showDetails = false;
private Boolean showGravatar = false;
private Boolean showBuildNumber = true;
@@ -138,6 +139,16 @@ public void setShowGravatar(Boolean showGravatar) {
this.showGravatar = showGravatar;
}
+ @Exported
+ public int getPaintInterval() {
+ return paintInterval;
+ }
+
+ public void setPaintInterval(int paintInterval) {
+ this.paintInterval = paintInterval;
+ }
+
+
@Exported
public String getFontFamily() {
if (fontFamily != null)
@@ -49,6 +49,10 @@
<f:textbox name="jenkinsUpdateInterval" value="${it.config.jenkinsUpdateInterval}" default="20" />
</f:entry>
+ <f:entry title="${%Paint Interval}" name="paintInterval" help="${rootURL}/../plugin/jenkinswalldisplay/help-globalConfig-paintInterval.html">
+ <f:textbox name="paintInterval" value="${it.config.paintInterval}" default="1" />
+ </f:entry>
+
<f:entry title="${%Show Job Details}" name="jenkinsShowDetails" help="${rootURL}/../plugin/jenkinswalldisplay/help-globalConfig-jenkinsShowDetails.html">
<f:checkbox name="jenkinsShowDetails" checked="${it.config.showDetails}" />
</f:entry>
@@ -732,6 +732,11 @@
jenkinsUpdateInterval = plugin.config.jenkinsUpdateInterval * 1000;
}
+ if (isNumber(plugin.config.paintInterval))
+ {
+ paintInterval = plugin.config.paintInterval * 1000;
+ }
+
if (isNumber(plugin.config.jenkinsTimeOut))
{
jenkinsTimeOut = plugin.config.jenkinsTimeOut * 1000;
@@ -747,6 +752,14 @@
lastJenkinsTimeOut = jenkinsTimeOut;
}
+ if (lastPaintInterval != paintInterval)

This comment has been minimized.

Show comment Hide comment
@sravanM

sravanM Jan 4, 2013

lastPaintInterval doesn't seem to be defined anywhere

@sravanM

sravanM Jan 4, 2013

lastPaintInterval doesn't seem to be defined anywhere

+ {
+ clearPaintInterval();
+ setPaintInterval();
+
+ lastPaintInterval = paintInterval;
+ }
+
if (theme != null)
{
if (lastTheme != theme)
@@ -934,8 +947,18 @@
document.title = "Jenkins Wall Display (" + viewName + ")";
setApiInterval();
+ setPaintInterval();
+
- setInterval(function() {
+ });
+
+ window.onresize = function(event) {
+ updateWindowSizes();
+ }
+
+ function setPaintInterval()
+ {
+ paintIntervalId = setInterval(function() {
serverTime += paintInterval;
if (!paintRunning)
{
@@ -944,18 +967,13 @@
paintRunning = false;
}
- }, paintInterval);;
-
- });
-
- window.onresize = function(event) {
- updateWindowSizes();
+ }, paintInterval);
+ }
+
+ function clearPaintInterval()
+ {
+ clearInterval(paintIntervalId);
}
-
- function clearApiInterval()
- {
- clearInterval(jenkinsApiIntervalId);
- }
function setApiInterval()
{
@@ -980,6 +998,11 @@
}, jenkinsUpdateInterval);
}
+
+ function clearApiInterval()
+ {
+ clearInterval(jenkinsApiIntervalId);
+ }
</script>
</head>

0 comments on commit a2cfea5

Please sign in to comment.