Page MenuHomePhabricator

D18230.diff
No OneTemporary

D18230.diff

diff --git a/src/applications/search/applicationpanel/PhabricatorSearchApplicationStorageEnginePanel.php b/src/applications/search/applicationpanel/PhabricatorSearchApplicationStorageEnginePanel.php
--- a/src/applications/search/applicationpanel/PhabricatorSearchApplicationStorageEnginePanel.php
+++ b/src/applications/search/applicationpanel/PhabricatorSearchApplicationStorageEnginePanel.php
@@ -16,54 +16,61 @@
$viewer = $this->getViewer();
$application = $this->getApplication();
- $active_engine = PhabricatorFulltextStorageEngine::loadEngine();
- $engines = PhabricatorFulltextStorageEngine::loadAllEngines();
+ $services = PhabricatorSearchService::getAllServices();
$rows = array();
$rowc = array();
- foreach ($engines as $key => $engine) {
+ foreach ($services as $key => $service) {
try {
- $index_exists = $engine->indexExists() ? pht('Yes') : pht('No');
+ $name = $service->getDisplayName();
} catch (Exception $ex) {
- $index_exists = pht('N/A');
+ $name = phutil_tag('em', array(), pht('Error'));
}
try {
- $index_is_sane = $engine->indexIsSane() ? pht('Yes') : pht('No');
+ $can_read = $service->isReadable() ? pht('Yes') : pht('No');
} catch (Exception $ex) {
- $index_is_sane = pht('N/A');
+ $can_read = pht('N/A');
}
- if ($engine == $active_engine) {
- $rowc[] = 'highlighted';
- } else {
- $rowc[] = null;
+ try {
+ $can_write = $service->isWritable() ? pht('Yes') : pht('No');
+ } catch (Exception $ex) {
+ $can_write = pht('N/A');
}
$rows[] = array(
- $key,
- get_class($engine),
- $index_exists,
- $index_is_sane,
+ $name,
+ $can_read,
+ $can_write,
);
}
+ $instructions = pht(
+ 'To configure the search engines, edit [[ %s | `%s` ]] configuration. '.
+ 'See **[[ %s | %s ]]** for documentation.',
+ '/config/edit/cluster.search/',
+ 'cluster.search',
+ PhabricatorEnv::getDoclink('Cluster: Search'),
+ pht('Cluster: Search'));
+
+
$table = id(new AphrontTableView($rows))
->setNoDataString(pht('No search engines available.'))
+ ->setNotice(new PHUIRemarkupView($viewer, $instructions))
->setHeaders(
array(
- pht('Key'),
- pht('Class'),
- pht('Index Exists'),
- pht('Index Is Sane'),
+ pht('Engine Name'),
+ pht('Writable'),
+ pht('Readable'),
))
->setRowClasses($rowc)
->setColumnClasses(
array(
- '',
'wide',
'',
+ '',
));
$box = id(new PHUIObjectBoxView())

File Metadata

Mime Type
text/plain
Expires
Fri, Nov 15, 1:00 AM (1 d, 21 h ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6744357
Default Alt Text
D18230.diff (2 KB)

Event Timeline