Differential D21529 Diff 51260 src/infrastructure/storage/management/workflow/PhabricatorStorageManagementStatusWorkflow.php
Changeset View
Changeset View
Standalone View
Standalone View
src/infrastructure/storage/management/workflow/PhabricatorStorageManagementStatusWorkflow.php
Show All 27 Lines | foreach ($this->getAPIs() as $api) { | ||||
return 1; | return 1; | ||||
} | } | ||||
$ref = $api->getRef(); | $ref = $api->getRef(); | ||||
$table = id(new PhutilConsoleTable()) | $table = id(new PhutilConsoleTable()) | ||||
->setShowHeader(false) | ->setShowHeader(false) | ||||
->addColumn('id', array('title' => pht('ID'))) | ->addColumn('id', array('title' => pht('ID'))) | ||||
->addColumn('phase', array('title' => pht('Phase'))) | |||||
->addColumn('host', array('title' => pht('Host'))) | ->addColumn('host', array('title' => pht('Host'))) | ||||
->addColumn('status', array('title' => pht('Status'))) | ->addColumn('status', array('title' => pht('Status'))) | ||||
->addColumn('duration', array('title' => pht('Duration'))) | ->addColumn('duration', array('title' => pht('Duration'))) | ||||
->addColumn('type', array('title' => pht('Type'))) | ->addColumn('type', array('title' => pht('Type'))) | ||||
->addColumn('name', array('title' => pht('Name'))); | ->addColumn('name', array('title' => pht('Name'))); | ||||
$durations = $api->getPatchDurations(); | $durations = $api->getPatchDurations(); | ||||
foreach ($patches as $patch) { | foreach ($patches as $patch) { | ||||
$duration = idx($durations, $patch->getFullKey()); | $duration = idx($durations, $patch->getFullKey()); | ||||
if ($duration === null) { | if ($duration === null) { | ||||
$duration = '-'; | $duration = '-'; | ||||
} else { | } else { | ||||
$duration = pht('%s us', new PhutilNumber($duration)); | $duration = pht('%s us', new PhutilNumber($duration)); | ||||
} | } | ||||
$table->addRow(array( | if (in_array($patch->getFullKey(), $applied)) { | ||||
$status = pht('Applied'); | |||||
} else { | |||||
$status = pht('Not Applied'); | |||||
} | |||||
$table->addRow( | |||||
array( | |||||
'id' => $patch->getFullKey(), | 'id' => $patch->getFullKey(), | ||||
'phase' => $patch->getPhase(), | |||||
'host' => $ref->getRefKey(), | 'host' => $ref->getRefKey(), | ||||
'status' => in_array($patch->getFullKey(), $applied) | 'status' => $status, | ||||
? pht('Applied') | |||||
: pht('Not Applied'), | |||||
'duration' => $duration, | 'duration' => $duration, | ||||
'type' => $patch->getType(), | 'type' => $patch->getType(), | ||||
'name' => $patch->getName(), | 'name' => $patch->getName(), | ||||
)); | )); | ||||
} | } | ||||
$table->draw(); | $table->draw(); | ||||
} | } | ||||
return 0; | return 0; | ||||
} | } | ||||
} | } |