Page MenuHomePhabricator

D15800.id38060.diff
No OneTemporary

D15800.id38060.diff

diff --git a/src/applications/diffusion/management/DiffusionRepositoryClusterManagementPanel.php b/src/applications/diffusion/management/DiffusionRepositoryClusterManagementPanel.php
--- a/src/applications/diffusion/management/DiffusionRepositoryClusterManagementPanel.php
+++ b/src/applications/diffusion/management/DiffusionRepositoryClusterManagementPanel.php
@@ -6,7 +6,7 @@
const PANELKEY = 'cluster';
public function getManagementPanelLabel() {
- return pht('Cluster Configuration');
+ return pht('Storage');
}
public function getManagementPanelOrder() {
@@ -14,6 +14,45 @@
}
public function buildManagementPanelContent() {
+ return array(
+ $this->buildStorageStatusPanel(),
+ $this->buildClusterStatusPanel(),
+ );
+ }
+
+ private function buildStorageStatusPanel() {
+ $repository = $this->getRepository();
+ $viewer = $this->getViewer();
+
+ $view = id(new PHUIPropertyListView())
+ ->setViewer($viewer);
+
+ if ($repository->usesLocalWorkingCopy()) {
+ $storage_path = $repository->getHumanReadableDetail('local-path');
+ } else {
+ $storage_path = phutil_tag('em', array(), pht('No Local Working Copy'));
+ }
+
+ $service_phid = $repository->getAlmanacServicePHID();
+ if ($service_phid) {
+ $storage_service = $viewer->renderHandle($service_phid);
+ } else {
+ $storage_service = phutil_tag('em', array(), pht('Local'));
+ }
+
+ $view->addProperty(pht('Storage Path'), $storage_path);
+ $view->addProperty(pht('Storage Cluster'), $storage_service);
+
+ $header = id(new PHUIHeaderView())
+ ->setHeader(pht('Storage'));
+
+ return id(new PHUIObjectBoxView())
+ ->setHeader($header)
+ ->setBackground(PHUIObjectBoxView::BLUE_PROPERTY)
+ ->addPropertyList($view);
+ }
+
+ private function buildClusterStatusPanel() {
$repository = $this->getRepository();
$viewer = $this->getViewer();
@@ -175,18 +214,6 @@
->setTag('a')
->setText(pht('Documentation')));
- if ($service) {
- $header->setSubheader(
- pht(
- 'This repository is hosted on %s.',
- phutil_tag(
- 'a',
- array(
- 'href' => $service->getURI(),
- ),
- $service->getName())));
- }
-
return id(new PHUIObjectBoxView())
->setHeader($header)
->setBackground(PHUIObjectBoxView::BLUE_PROPERTY)

File Metadata

Mime Type
text/plain
Expires
Mon, Apr 14, 12:23 AM (3 d, 6 h ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7706961
Default Alt Text
D15800.id38060.diff (2 KB)

Event Timeline