1 <script type="text/javascript">
2 $(document).ready(function() {
3 $('#example').DataTable( {
4 "order": [[ 3, "desc" ],[ 2, "desc" ]]
10 include '../utils/jenkinsAdapter.php';
11 include '../utils/database.php';
14 $result = mysql_query("SELECT * FROM resource, pod WHERE resource.resource_id=pod.resource_id;");
17 echo '<table id="example" class="table table-striped table-bordered" cellspacing="0" width="100%">';
21 echo "<th>Slave Name</th>";
22 echo "<th>Status</th>";
23 echo "<th>Installer</th>";
24 echo "<th>Scenario</th>";
25 echo "<th>Branch</th>";
31 while ($row = mysql_fetch_array($result)) {
32 $slave = $row{'slavename'};
33 if (! isCiPod($slave)) continue;
35 $slave_url = getSlaveUrl($slave);
36 $status = getSlaveStatus($slave);
45 if ($status == 'online'){
46 $job_params = getJJob($slave);
47 $job_name = $job_params['name'];
48 $job_installer = $job_params['installer'];
49 $job_branch = $job_params['branch'];
50 $job_url = $job_params['url']."lastBuild/consoleFull";
51 $job_scenario = $job_params['scenario'];
52 $job_type = $job_params['type'];
56 echo "<th><a target='_blank' href='".$row{'link'}."'>".$row{'name'}."</a></th>";
57 echo "<th><a target='_blank' href='".$slave_url."'>".$slave."</a></th>";
58 if ($status == "online") $color = "#BEFAAA";
59 else $color = "#FAAAAB";
60 echo "<th style='background-color: ".$color.";'>".$status."</th>";
61 if ($job_type == "0") $class = "blink_me";
63 echo "<th class='".$class."'>".$job_installer."</th>";
64 echo "<th class='".$class."'>".$job_scenario."</th>";
65 echo "<th class='".$class."'>".$job_branch."</th>";
70 if ($job_type == "0") { // job running
71 echo "<th><a class='blink_me' style='font-size:12px;color:".$grey.";' target='_blank' href='".$job_url."'>".$job_name."</a></th>";
73 else if ($job_type == "1") {// last job successful
74 echo "<th><a style='font-size:12px;color:".$green.";' target='_blank' href='".$job_url."'>".$job_name."</a></th>";
76 else if ($job_type == "2") {// last job failed
77 echo "<th><a style='font-size:12px;color:".$red."' target='_blank' href='".$job_url."'>".$job_name."</a></th>";
79 else if ($job_type == "3") {// last job is unstable
80 echo "<th><a style='font-size:12px;color:".$orange."' target='_blank' href='".$job_url."'>".$job_name."</a></th>";
83 echo "<th><a style='font-size:12px;' target='_blank' href='".$job_url."'>".$job_name."</a></th>";