summaryrefslogtreecommitdiffstats
path: root/tools/infra-dashboard/pages/slaves.php
diff options
context:
space:
mode:
authorjose.lausuch <jose.lausuch@ericsson.com>2016-06-01 23:00:08 +0200
committerjose.lausuch <jose.lausuch@ericsson.com>2016-06-02 20:12:49 +0200
commitaf427a992a96519c00ac9f98db8745f9fc1198fb (patch)
tree36f69164b289ce2405419f3946b7af0ba8f8b08e /tools/infra-dashboard/pages/slaves.php
parent43b44d05ed662d7e9e4f0a66b5f1744685d7b5cc (diff)
OPNFV Infra Dashboard
JIRA: RELENG-12 Change-Id: I7451a3d234e4e5d946cdb905d5720be6159b6544 Signed-off-by: jose.lausuch <jose.lausuch@ericsson.com>
Diffstat (limited to 'tools/infra-dashboard/pages/slaves.php')
-rw-r--r--tools/infra-dashboard/pages/slaves.php60
1 files changed, 60 insertions, 0 deletions
diff --git a/tools/infra-dashboard/pages/slaves.php b/tools/infra-dashboard/pages/slaves.php
new file mode 100644
index 00000000..4eb2add9
--- /dev/null
+++ b/tools/infra-dashboard/pages/slaves.php
@@ -0,0 +1,60 @@
+<script type="text/javascript">
+ $(document).ready(function() {
+ $('#example').DataTable( {
+ "order": [[ 2, "desc" ], [ 1, "desc" ]]
+ } );
+ } );
+</script>
+
+<?php
+ include '../utils/jenkinsAdapter.php';
+
+ echo '<table id="example" class="table table-striped table-bordered" cellspacing="0" width="100%">';
+ echo "<thead>";
+ echo "<tr>";
+ echo "<th>Slave name</th>";
+ echo "<th>Status</th>";
+ echo "<th>Current build</th>";
+ echo "</tr>";
+ echo "</thead>";
+ echo "<tbody>";
+
+ foreach ($SLAVES->xpath('computer') as &$value) {
+
+ $slave = $value->displayName;
+ $idle = $value->idle;
+ $slave_url = getSlaveUrl($slave);
+ $status = getSlaveStatus($slave);
+
+ if ($status == "online" and $idle == "true") {
+ $status = "online / idle";
+ $color = "#C8D6C3";
+ }
+ else if ($status == "online") $color = "#BEFAAA";
+ else $color = "#FAAAAB";
+
+ $job_name = "";
+ $job_url = "";
+ $job_scenario = "";
+
+
+ if ($status == 'online') {
+ $job_params = getJJob($slave);
+ $job_name = $job_params['name'];
+ $job_url = $job_params['url'];
+ $job_scenario = $job_params['scenario'];
+ }
+
+ echo "<tr>";
+ echo "<th><a target='_blank' href='".$slave_url."'>".$slave."</a></th>";
+
+ echo "<th style='background-color: ".$color.";'>".$status."</th>";
+ echo "<th><a class='blink_me' style='font-size:12px;color:#33cc00;' target='_blank' href='".$job_url."'>".$job_name."</a></th>";
+
+ echo "</tr>";
+ }
+ echo '</tbody>';
+ echo '</table>';
+
+
+?>