Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

added support for showing more than three build queue positions

  • Loading branch information...
commit ec2600d7e2b65c04b570bf8ddad88e3ed17736f0 1 parent 5159747
pelle authored
Showing with 58 additions and 34 deletions.
  1. +1 −1  pom.xml
  2. +57 −33 src/main/webapp/walldisplay.html
View
2  pom.xml
@@ -10,7 +10,7 @@
</parent>
<groupId>org.jenkins-ci.plugins</groupId>
- <artifactId>jenkinswalldisplay</artifactId>
+ <artifactId>jenkinswalldisplay-pom</artifactId>
<packaging>hpi</packaging>
<version>0.6.2-SNAPSHOT</version>
<name>Jenkins Wall Display Master Project</name>
View
90 src/main/webapp/walldisplay.html
@@ -105,6 +105,61 @@
<script type="text/javascript">
+ function getQueueDivs(jobWidth, jobHeight, queuePosition)
+ {
+ var queueDivs = new Array();
+
+ var maxPerColumn = 3;
+ var perColumn = queuePosition;
+ if (perColumn > maxPerColumn)
+ {
+ perColumn = maxPerColumn;
+ }
+
+ var queueColumns = Math.ceil(queuePosition / perColumn);
+
+ var maxQueueItems = 15;
+ if (queuePosition > maxQueueItems)
+ {
+ queuePosition = maxQueueItems;
+ }
+
+ var radius = Math.round(jobHeight / (maxPerColumn + 1));
+ var increment = (jobHeight - perColumn * radius) / (perColumn + 1);
+
+ var queueLeft = jobWidth - 2 * radius;
+
+ for(queueColumn=0; queueColumn < queueColumns; queueColumn++)
+ {
+ var queueTop = increment;
+
+ for (i=0; i < perColumn; i++)
+ {
+ if (queueDivs.length < queuePosition)
+ {
+ var queueDiv = $('<div />');
+ queueDiv.css({
+ "position": "absolute",
+ "top": queueTop + "px",
+ "left": queueLeft + "px",
+ "height": radius + "px",
+ "width": radius + "px",
+ "border-radius": + Math.round(radius / 2) + "px",
+ "-moz-border-radius": Math.round(radius / 2) + "px",
+ "-webkit-border-radius": Math.round(radius / 2) + "px"
+ });
+ queueDiv.addClass("queued");
+ queueDivs.push(queueDiv);
+ }
+ queueTop += increment + radius;
+ }
+
+ queueLeft -= increment + radius;
+ }
+
+ return queueDivs;
+ }
+
function getParameterByName(name, defaultValue)
{
name = name.replace(/[\[]/, "\\\[").replace(/[\]]/, "\\\]");
@@ -355,40 +410,9 @@
percentageDiv.addClass("job");
percentageDiv.addClass("job_color_" + jobColor + "_building");
}
-
- var maxQueueItems = 3;
- var queuePosition = getBuildQueuePosition(job.name);
-
- if (queuePosition > maxQueueItems)
- {
- queuePosition = maxQueueItems;
- }
-
- var radius = Math.round(jobHeight / (maxQueueItems + 1));
- var queueDivs = new Array();
-
- var increment = (jobHeight - queuePosition * radius) / (queuePosition + 1);
- var queueTop = increment;
- for (i=0; i < queuePosition; i++)
- {
- var queueDiv = $('<div />');
- queueDiv.css({
- "position": "absolute",
- "top": queueTop + "px",
- "left": jobWidth - 2 * radius + "px",
- "height": radius + "px",
- "width": radius + "px",
- "border-radius": + Math.round(radius / 2) + "px",
- "-moz-border-radius": Math.round(radius / 2) + "px",
- "-webkit-border-radius": Math.round(radius / 2) + "px"
- });
- queueDiv.addClass("queued");
- queueDivs.push(queueDiv);
- queueTop += increment + radius;
- }
-
-
+ var queueDivs = getQueueDivs(jobWidth, jobHeight, getBuildQueuePosition(job.name));
+
//- create the job content div ---------------------
var jobContent = $('<div />');
jobContent.css({
Please sign in to comment.
Something went wrong with that request. Please try again.