Differential D17707 Diff 42599 src/applications/config/controller/PhabricatorConfigClusterNotificationsController.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/config/controller/PhabricatorConfigClusterNotificationsController.php
| Show First 20 Lines • Show All 97 Lines • ▼ Show 20 Lines | foreach ($servers as $server) { | ||||
| new PhutilNumber(idx($details, 'clients.active')), | new PhutilNumber(idx($details, 'clients.active')), | ||||
| new PhutilNumber(idx($details, 'clients.total'))); | new PhutilNumber(idx($details, 'clients.total'))); | ||||
| $stats = pht( | $stats = pht( | ||||
| '%s In / %s Out', | '%s In / %s Out', | ||||
| new PhutilNumber(idx($details, 'messages.in')), | new PhutilNumber(idx($details, 'messages.in')), | ||||
| new PhutilNumber(idx($details, 'messages.out'))); | new PhutilNumber(idx($details, 'messages.out'))); | ||||
| if (idx($details, 'history.size')) { | |||||
| $history = pht( | |||||
| '%s Held / %sms', | |||||
| new PhutilNumber(idx($details, 'history.size')), | |||||
| new PhutilNumber(idx($details, 'history.age'))); | |||||
| } else { | |||||
| $history = pht('No Messages'); | |||||
| } | |||||
| } else { | } else { | ||||
| $uptime = null; | $uptime = null; | ||||
| $clients = null; | $clients = null; | ||||
| $stats = null; | $stats = null; | ||||
| $history = null; | |||||
| } | } | ||||
| $status_view = array( | $status_view = array( | ||||
| id(new PHUIIconView())->setIcon($status_icon), | id(new PHUIIconView())->setIcon($status_icon), | ||||
| ' ', | ' ', | ||||
| $status_label, | $status_label, | ||||
| ); | ); | ||||
| $messages = phutil_implode_html(phutil_tag('br'), $messages); | $messages = phutil_implode_html(phutil_tag('br'), $messages); | ||||
| $rows[] = array( | $rows[] = array( | ||||
| $type_icon, | $type_icon, | ||||
| $server->getProtocol(), | $server->getProtocol(), | ||||
| $server->getHost(), | $server->getHost(), | ||||
| $server->getPort(), | $server->getPort(), | ||||
| $status_view, | $status_view, | ||||
| $uptime, | $uptime, | ||||
| $clients, | $clients, | ||||
| $stats, | $stats, | ||||
| $history, | |||||
| $messages, | $messages, | ||||
| ); | ); | ||||
| } | } | ||||
| $table = id(new AphrontTableView($rows)) | $table = id(new AphrontTableView($rows)) | ||||
| ->setNoDataString( | ->setNoDataString( | ||||
| pht('No notification servers are configured.')) | pht('No notification servers are configured.')) | ||||
| ->setHeaders( | ->setHeaders( | ||||
| array( | array( | ||||
| null, | null, | ||||
| pht('Proto'), | pht('Proto'), | ||||
| pht('Host'), | pht('Host'), | ||||
| pht('Port'), | pht('Port'), | ||||
| pht('Status'), | pht('Status'), | ||||
| pht('Uptime'), | pht('Uptime'), | ||||
| pht('Clients'), | pht('Clients'), | ||||
| pht('Messages'), | pht('Messages'), | ||||
| pht('History'), | |||||
| null, | null, | ||||
| )) | )) | ||||
| ->setColumnClasses( | ->setColumnClasses( | ||||
| array( | array( | ||||
| null, | null, | ||||
| null, | null, | ||||
| null, | null, | ||||
| null, | null, | ||||
| null, | null, | ||||
| null, | null, | ||||
| null, | null, | ||||
| null, | null, | ||||
| null, | |||||
| 'wide', | 'wide', | ||||
| )); | )); | ||||
| return $table; | return $table; | ||||
| } | } | ||||
| } | } | ||||