Changeset View
Changeset View
Standalone View
Standalone View
src/applications/almanac/view/AlmanacBindingTableView.php
Show First 20 Lines • Show All 50 Lines • ▼ Show 20 Lines | $icon_disabled = id(new PHUIIconView()) | ||||
->addSigil('has-tooltip') | ->addSigil('has-tooltip') | ||||
->setMetadata( | ->setMetadata( | ||||
array( | array( | ||||
'tip' => pht('Disabled'), | 'tip' => pht('Disabled'), | ||||
)); | )); | ||||
$icon_active = id(new PHUIIconView()) | $icon_active = id(new PHUIIconView()) | ||||
->setIcon('fa-check') | ->setIcon('fa-check') | ||||
->setColor('green') | |||||
->addSigil('has-tooltip') | ->addSigil('has-tooltip') | ||||
->setMetadata( | ->setMetadata( | ||||
array( | array( | ||||
'tip' => pht('Active'), | 'tip' => pht('Active'), | ||||
)); | )); | ||||
$icon_device_disabled = id(new PHUIIconView()) | |||||
->setIcon('fa-times') | |||||
->setColor('grey') | |||||
->addSigil('has-tooltip') | |||||
->setMetadata( | |||||
array( | |||||
'tip' => pht('Device Disabled'), | |||||
)); | |||||
$rows = array(); | $rows = array(); | ||||
foreach ($bindings as $binding) { | foreach ($bindings as $binding) { | ||||
$addr = $binding->getInterface()->getAddress(); | $addr = $binding->getInterface()->getAddress(); | ||||
$port = $binding->getInterface()->getPort(); | $port = $binding->getInterface()->getPort(); | ||||
$device = $binding->getDevice(); | |||||
if ($device->isDisabled()) { | |||||
$binding_icon = $icon_device_disabled; | |||||
} else if ($binding->getIsDisabled()) { | |||||
$binding_icon = $icon_disabled; | |||||
} else { | |||||
$binding_icon = $icon_active; | |||||
} | |||||
$rows[] = array( | $rows[] = array( | ||||
$binding->getID(), | $binding->getID(), | ||||
($binding->getIsDisabled() ? $icon_disabled : $icon_active), | $binding_icon, | ||||
$handles->renderHandle($binding->getServicePHID()), | $handles->renderHandle($binding->getServicePHID()), | ||||
$handles->renderHandle($binding->getDevicePHID()), | $handles->renderHandle($binding->getDevicePHID()), | ||||
$handles->renderHandle($binding->getInterface()->getNetworkPHID()), | $handles->renderHandle($binding->getInterface()->getNetworkPHID()), | ||||
$binding->getInterface()->renderDisplayAddress(), | $binding->getInterface()->renderDisplayAddress(), | ||||
phutil_tag( | phutil_tag( | ||||
'a', | 'a', | ||||
array( | array( | ||||
'class' => 'small button button-grey', | 'class' => 'small button button-grey', | ||||
'href' => '/almanac/binding/'.$binding->getID().'/', | 'href' => '/almanac/binding/'.$binding->getID().'/', | ||||
Show All 38 Lines |