Differential D20931 Diff 49948 src/applications/config/controller/services/PhabricatorConfigCacheController.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/config/controller/services/PhabricatorConfigCacheController.php
- This file was moved from src/applications/config/controller/PhabricatorConfigCacheController.php.
<?php | <?php | ||||
final class PhabricatorConfigCacheController | final class PhabricatorConfigCacheController | ||||
extends PhabricatorConfigController { | extends PhabricatorConfigServicesController { | ||||
public function handleRequest(AphrontRequest $request) { | public function handleRequest(AphrontRequest $request) { | ||||
$viewer = $this->getViewer(); | $viewer = $this->getViewer(); | ||||
$nav = $this->buildSideNavView(); | |||||
$nav->selectFilter('cache/'); | |||||
$purge_button = id(new PHUIButtonView()) | $purge_button = id(new PHUIButtonView()) | ||||
->setText(pht('Purge Caches')) | ->setText(pht('Purge Caches')) | ||||
->setHref('/config/cache/purge/') | ->setHref('/config/cache/purge/') | ||||
->setTag('a') | ->setTag('a') | ||||
->setWorkflow(true) | ->setWorkflow(true) | ||||
->setIcon('fa-exclamation-triangle'); | ->setIcon('fa-exclamation-triangle'); | ||||
$title = pht('Cache Status'); | $title = pht('Cache Status'); | ||||
$header = $this->buildHeaderView($title, $purge_button); | $header = $this->buildHeaderView($title, $purge_button); | ||||
$code_box = $this->renderCodeBox(); | $code_box = $this->renderCodeBox(); | ||||
$data_box = $this->renderDataBox(); | $data_box = $this->renderDataBox(); | ||||
$page = array( | $page = array( | ||||
$code_box, | $code_box, | ||||
$data_box, | $data_box, | ||||
); | ); | ||||
$crumbs = $this->buildApplicationCrumbs() | $crumbs = $this->newCrumbs() | ||||
->addTextCrumb($title) | ->addTextCrumb($title); | ||||
->setBorder(true); | |||||
$content = id(new PHUITwoColumnView()) | $content = id(new PHUITwoColumnView()) | ||||
->setHeader($header) | ->setHeader($header) | ||||
->setFooter($page); | ->setFooter($page); | ||||
$nav = $this->newNavigation('cache'); | |||||
return $this->newPage() | return $this->newPage() | ||||
->setTitle($title) | ->setTitle($title) | ||||
->setCrumbs($crumbs) | ->setCrumbs($crumbs) | ||||
->setNavigation($nav) | ->setNavigation($nav) | ||||
->appendChild($content); | ->appendChild($content); | ||||
} | } | ||||
private function renderCodeBox() { | private function renderCodeBox() { | ||||
▲ Show 20 Lines • Show All 41 Lines • ▼ Show 20 Lines | if ($cache->getName() !== null) { | ||||
->setColumnClasses( | ->setColumnClasses( | ||||
array( | array( | ||||
'wide', | 'wide', | ||||
'n', | 'n', | ||||
'n', | 'n', | ||||
'n', | 'n', | ||||
'n', | 'n', | ||||
)); | )); | ||||
$table = $this->buildConfigBoxView(pht('Cache Storage'), $table); | |||||
} | } | ||||
$properties = $this->buildConfigBoxView(pht('Data Cache'), $properties); | $properties = $this->buildConfigBoxView(pht('Data Cache'), $properties); | ||||
$table = $this->buildConfigBoxView(pht('Cache Storage'), $table); | |||||
return array($properties, $table); | return array($properties, $table); | ||||
} | } | ||||
private function renderCommonProperties( | private function renderCommonProperties( | ||||
PHUIPropertyListView $properties, | PHUIPropertyListView $properties, | ||||
PhabricatorCacheSpec $cache) { | PhabricatorCacheSpec $cache) { | ||||
if ($cache->getName() !== null) { | if ($cache->getName() !== null) { | ||||
▲ Show 20 Lines • Show All 70 Lines • Show Last 20 Lines |