From af427a992a96519c00ac9f98db8745f9fc1198fb Mon Sep 17 00:00:00 2001 From: "jose.lausuch" Date: Wed, 1 Jun 2016 23:00:08 +0200 Subject: OPNFV Infra Dashboard JIRA: RELENG-12 Change-Id: I7451a3d234e4e5d946cdb905d5720be6159b6544 Signed-off-by: jose.lausuch --- tools/infra-dashboard/pages/ci_pods.php | 91 ++++++++ tools/infra-dashboard/pages/dev_pods.php | 342 +++++++++++++++++++++++++++++++ tools/infra-dashboard/pages/slaves.php | 60 ++++++ 3 files changed, 493 insertions(+) create mode 100644 tools/infra-dashboard/pages/ci_pods.php create mode 100644 tools/infra-dashboard/pages/dev_pods.php create mode 100644 tools/infra-dashboard/pages/slaves.php (limited to 'tools/infra-dashboard/pages') diff --git a/tools/infra-dashboard/pages/ci_pods.php b/tools/infra-dashboard/pages/ci_pods.php new file mode 100644 index 00000000..5f51530d --- /dev/null +++ b/tools/infra-dashboard/pages/ci_pods.php @@ -0,0 +1,91 @@ + + +'; + echo ""; + echo ""; + echo "Name"; + echo "Slave Name"; + echo "Status"; + echo "Installer"; + echo "Scenario"; + echo "Branch"; + echo "Job"; + echo ""; + echo ""; + echo ""; + + while ($row = mysql_fetch_array($result)) { + $slave = $row{'slavename'}; + if (! isCiPod($slave)) continue; + + $slave_url = getSlaveUrl($slave); + $status = getSlaveStatus($slave); + + $job_name = ""; + $job_installer = ""; + $job_branch = ""; + $job_url = ""; + $job_scenario = ""; + $job_type = ""; + + if ($status == 'online'){ + $job_params = getJJob($slave); + $job_name = $job_params['name']; + $job_installer = $job_params['installer']; + $job_branch = $job_params['branch']; + $job_url = $job_params['url']."lastBuild/consoleFull"; + $job_scenario = $job_params['scenario']; + $job_type = $job_params['type']; + } + + echo ""; + echo "".$row{'name'}.""; + echo "".$slave.""; + if ($status == "online") $color = "#BEFAAA"; + else $color = "#FAAAAB"; + echo "".$status.""; + if ($job_type == "0") $class = "blink_me"; + else $class=""; + echo "".$job_installer.""; + echo "".$job_scenario.""; + echo "".$job_branch.""; + $green = '#33cc00'; + $grey = '#646F73'; + $red = '#FF5555'; + $orange = '#EDD62B'; + if ($job_type == "0") { // job running + echo "".$job_name.""; + } + else if ($job_type == "1") {// last job successful + echo "".$job_name.""; + } + else if ($job_type == "2") {// last job failed + echo "".$job_name.""; + } + else if ($job_type == "3") {// last job is unstable + echo "".$job_name.""; + } + else { + echo "".$job_name.""; + } + echo ""; + } + echo ''; + echo ''; + + +?> diff --git a/tools/infra-dashboard/pages/dev_pods.php b/tools/infra-dashboard/pages/dev_pods.php new file mode 100644 index 00000000..144504b5 --- /dev/null +++ b/tools/infra-dashboard/pages/dev_pods.php @@ -0,0 +1,342 @@ + + + + + + + + b.starttime AND now() <= b.endtime ON r.resource_id = p.resource_id;"; + $result = mysql_query($q); + + //SELECT r.name as resname,r.slavename, r.link, r.resource_id,u.user_id,u.name as username,u.email,b.starttime,b.endtime,b.purpose from resource r LEFT JOIN pod p LEFT JOIN booking b INNER JOIN user u ON u.user_id = b.user_id ON b.resource_id = p.resource_id AND now() > b.starttime AND now() <= b.endtime ON r.resource_id = p.resource_id WHERE type_id=2; + closeDB(); + + echo ''; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + + while ($row = mysql_fetch_array($result)) { + $slave = $row{'slavename'}; + if (! isDevPod($slave)) continue; + + $slave_url = getSlaveUrl($slave); + $status = getSlaveStatus($slave); + echo ""; + echo ""; + echo ""; + if ($row{'username'} != "") $booker = $row{'username'}; + else $booker="-"; + echo ""; + + if ($row{'endtime'} != "") { + $until = strtotime($row{'endtime'}); + echo ""; + //$until = $row{'endtime'}; + } else { + $until="-"; + echo ""; + } + if ($row{'purpose'} != "") $purpose = $row{'purpose'}; + else $purpose="-"; + echo ""; + $active = 'true'; + if ($status == "online") $color = "#BEFAAA"; + else $color = "#FAAAAB"; + echo ""; + + echo ""; + echo ""; + } + echo ''; + echo '
NameSlave NameBooked byBooked untilPurposeStatus
".$row{'resname'}."".$slave."".$booker."".date('d/M/Y', $until)."".$until."".$purpose."".$status."
'; +?> + + +
+
+
+ +
+
+ + +
+ + + + + + + + + + + + + + + + + +
Booked by:

Start:

End:

Purpose:

+ + + + + + + + + + + + + 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 @@ + + +'; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + + 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 ""; + echo ""; + + echo ""; + echo ""; + + echo ""; + } + echo ''; + echo '
Slave nameStatusCurrent build
".$slave."".$status."".$job_name."
'; + + +?> -- cgit 1.2.3-korg