diff options
Diffstat (limited to 'tools/infra-dashboard/pages/slaves.php')
-rw-r--r-- | tools/infra-dashboard/pages/slaves.php | 60 |
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>'; + + +?> |