Differential D18526 Diff 44493 src/applications/conduit/settings/PhabricatorConduitTokensSettingsPanel.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/conduit/settings/PhabricatorConduitTokensSettingsPanel.php
Show First 20 Lines • Show All 82 Lines • ▼ Show 20 Lines | $table->setColumnClasses( | ||||
'wide pri', | 'wide pri', | ||||
'', | '', | ||||
'right', | 'right', | ||||
'right', | 'right', | ||||
'action', | 'action', | ||||
)); | )); | ||||
$generate_button = id(new PHUIButtonView()) | $generate_button = id(new PHUIButtonView()) | ||||
->setText(pht('Generate API Token')) | ->setText(pht('Generate Token')) | ||||
->setHref('/conduit/token/edit/?objectPHID='.$user->getPHID()) | ->setHref('/conduit/token/edit/?objectPHID='.$user->getPHID()) | ||||
->setTag('a') | ->setTag('a') | ||||
->setWorkflow(true) | ->setWorkflow(true) | ||||
->setIcon('fa-plus'); | ->setIcon('fa-plus'); | ||||
$terminate_button = id(new PHUIButtonView()) | $terminate_button = id(new PHUIButtonView()) | ||||
->setText(pht('Terminate All Tokens')) | ->setText(pht('Terminate Tokens')) | ||||
->setHref('/conduit/token/terminate/?objectPHID='.$user->getPHID()) | ->setHref('/conduit/token/terminate/?objectPHID='.$user->getPHID()) | ||||
->setTag('a') | ->setTag('a') | ||||
->setWorkflow(true) | ->setWorkflow(true) | ||||
->setIcon('fa-exclamation-triangle'); | ->setIcon('fa-exclamation-triangle') | ||||
->setColor(PHUIButtonView::RED); | |||||
$header = id(new PHUIHeaderView()) | $header = id(new PHUIHeaderView()) | ||||
->setHeader(pht('Active API Tokens')) | ->setHeader(pht('Active API Tokens')) | ||||
->addActionLink($generate_button) | ->addActionLink($generate_button) | ||||
->addActionLink($terminate_button); | ->addActionLink($terminate_button); | ||||
$panel = id(new PHUIObjectBoxView()) | $panel = id(new PHUIObjectBoxView()) | ||||
->setHeader($header) | ->setHeader($header) | ||||
->setBackground(PHUIObjectBoxView::BLUE_PROPERTY) | ->setBackground(PHUIObjectBoxView::WHITE_CONFIG) | ||||
->setTable($table); | ->appendChild($table); | ||||
return $panel; | return $panel; | ||||
} | } | ||||
} | } |