Differential D7745 Diff 17529 src/applications/harbormaster/controller/HarbormasterBuildViewController.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/harbormaster/controller/HarbormasterBuildViewController.php
Show First 20 Lines • Show All 43 Lines • ▼ Show 20 Lines | public function processRequest() { | ||||
$build_targets = id(new HarbormasterBuildTargetQuery()) | $build_targets = id(new HarbormasterBuildTargetQuery()) | ||||
->setViewer($viewer) | ->setViewer($viewer) | ||||
->withBuildPHIDs(array($build->getPHID())) | ->withBuildPHIDs(array($build->getPHID())) | ||||
->execute(); | ->execute(); | ||||
$targets = array(); | $targets = array(); | ||||
foreach ($build_targets as $build_target) { | foreach ($build_targets as $build_target) { | ||||
$header = id(new PHUIHeaderView()) | $header = id(new PHUIHeaderView()) | ||||
->setHeader(pht('Build Target %d', $build_target->getID())) | ->setHeader(pht( | ||||
'Build Target %d (%s)', | |||||
$build_target->getID(), | |||||
$build_target->getImplementation()->getName())) | |||||
->setUser($viewer); | ->setUser($viewer); | ||||
$properties = new PHUIPropertyListView(); | $properties = new PHUIPropertyListView(); | ||||
$details = $build_target->getDetails(); | $details = $build_target->getDetails(); | ||||
if ($details) { | if ($details) { | ||||
$properties->addSectionHeader(pht('Configuration Details')); | $properties->addSectionHeader(pht('Configuration Details')); | ||||
foreach ($details as $key => $value) { | foreach ($details as $key => $value) { | ||||
$properties->addProperty($key, $value); | $properties->addProperty($key, $value); | ||||
▲ Show 20 Lines • Show All 214 Lines • ▼ Show 20 Lines | if ($build->getCancelRequested()) { | ||||
return pht('Cancelling'); | return pht('Cancelling'); | ||||
} | } | ||||
switch ($build->getBuildStatus()) { | switch ($build->getBuildStatus()) { | ||||
case HarbormasterBuild::STATUS_INACTIVE: | case HarbormasterBuild::STATUS_INACTIVE: | ||||
return pht('Inactive'); | return pht('Inactive'); | ||||
case HarbormasterBuild::STATUS_PENDING: | case HarbormasterBuild::STATUS_PENDING: | ||||
return pht('Pending'); | return pht('Pending'); | ||||
case HarbormasterBuild::STATUS_WAITING: | case HarbormasterBuild::STATUS_WAITING: | ||||
return pht('Waiting on Resource'); | return pht('Waiting'); | ||||
case HarbormasterBuild::STATUS_BUILDING: | case HarbormasterBuild::STATUS_BUILDING: | ||||
return pht('Building'); | return pht('Building'); | ||||
case HarbormasterBuild::STATUS_PASSED: | case HarbormasterBuild::STATUS_PASSED: | ||||
return pht('Passed'); | return pht('Passed'); | ||||
case HarbormasterBuild::STATUS_FAILED: | case HarbormasterBuild::STATUS_FAILED: | ||||
return pht('Failed'); | return pht('Failed'); | ||||
case HarbormasterBuild::STATUS_ERROR: | case HarbormasterBuild::STATUS_ERROR: | ||||
return pht('Unexpected Error'); | return pht('Unexpected Error'); | ||||
case HarbormasterBuild::STATUS_CANCELLED: | case HarbormasterBuild::STATUS_CANCELLED: | ||||
return pht('Cancelled'); | return pht('Cancelled'); | ||||
default: | default: | ||||
return pht('Unknown'); | return pht('Unknown'); | ||||
} | } | ||||
} | } | ||||
} | } |