1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-29 10:12:41 +01:00

Give "Config" a full-width, hierarchical layout

Summary:
Depends on D20933. Ref T13362. This reorganizes Config a bit and attempts to simplify it.

Subsections are now in a landing page console and groupings have been removed. We "only" have 75 values you can edit from the web UI nowadays, which is still a lot, but less overwhelming than it was in the past. And the trend is generally downward, as config is removed/simplified or moved into application settings.

This also gets rid of the "gigantic blobs of JSON in the UI".

Test Plan: Browsed all Config sections.

Maniphest Tasks: T13362

Differential Revision: https://secure.phabricator.com/D20934
This commit is contained in:
epriestley 2019-11-30 11:23:34 -08:00
parent 26c2a1ba68
commit 530145ba3b
22 changed files with 401 additions and 496 deletions

View file

@ -2799,9 +2799,7 @@ phutil_register_library_map(array(
'PhabricatorConduitTokenQuery' => 'applications/conduit/query/PhabricatorConduitTokenQuery.php',
'PhabricatorConduitTokenTerminateController' => 'applications/conduit/controller/PhabricatorConduitTokenTerminateController.php',
'PhabricatorConduitTokensSettingsPanel' => 'applications/conduit/settings/PhabricatorConduitTokensSettingsPanel.php',
'PhabricatorConfigAllController' => 'applications/config/controller/PhabricatorConfigAllController.php',
'PhabricatorConfigApplication' => 'applications/config/application/PhabricatorConfigApplication.php',
'PhabricatorConfigApplicationController' => 'applications/config/controller/PhabricatorConfigApplicationController.php',
'PhabricatorConfigCacheController' => 'applications/config/controller/services/PhabricatorConfigCacheController.php',
'PhabricatorConfigClusterDatabasesController' => 'applications/config/controller/services/PhabricatorConfigClusterDatabasesController.php',
'PhabricatorConfigClusterNotificationsController' => 'applications/config/controller/services/PhabricatorConfigClusterNotificationsController.php',
@ -2810,6 +2808,7 @@ phutil_register_library_map(array(
'PhabricatorConfigCollectorsModule' => 'applications/config/module/PhabricatorConfigCollectorsModule.php',
'PhabricatorConfigColumnSchema' => 'applications/config/schema/PhabricatorConfigColumnSchema.php',
'PhabricatorConfigConfigPHIDType' => 'applications/config/phid/PhabricatorConfigConfigPHIDType.php',
'PhabricatorConfigConsoleController' => 'applications/config/controller/PhabricatorConfigConsoleController.php',
'PhabricatorConfigConstants' => 'applications/config/constants/PhabricatorConfigConstants.php',
'PhabricatorConfigController' => 'applications/config/controller/PhabricatorConfigController.php',
'PhabricatorConfigCoreSchemaSpec' => 'applications/config/schema/PhabricatorConfigCoreSchemaSpec.php',
@ -2821,24 +2820,21 @@ phutil_register_library_map(array(
'PhabricatorConfigDefaultSource' => 'infrastructure/env/PhabricatorConfigDefaultSource.php',
'PhabricatorConfigDictionarySource' => 'infrastructure/env/PhabricatorConfigDictionarySource.php',
'PhabricatorConfigEdgeModule' => 'applications/config/module/PhabricatorConfigEdgeModule.php',
'PhabricatorConfigEditController' => 'applications/config/controller/PhabricatorConfigEditController.php',
'PhabricatorConfigEditController' => 'applications/config/controller/settings/PhabricatorConfigEditController.php',
'PhabricatorConfigEditor' => 'applications/config/editor/PhabricatorConfigEditor.php',
'PhabricatorConfigEntry' => 'applications/config/storage/PhabricatorConfigEntry.php',
'PhabricatorConfigEntryDAO' => 'applications/config/storage/PhabricatorConfigEntryDAO.php',
'PhabricatorConfigEntryQuery' => 'applications/config/query/PhabricatorConfigEntryQuery.php',
'PhabricatorConfigFileSource' => 'infrastructure/env/PhabricatorConfigFileSource.php',
'PhabricatorConfigGroupConstants' => 'applications/config/constants/PhabricatorConfigGroupConstants.php',
'PhabricatorConfigGroupController' => 'applications/config/controller/PhabricatorConfigGroupController.php',
'PhabricatorConfigHTTPParameterTypesModule' => 'applications/config/module/PhabricatorConfigHTTPParameterTypesModule.php',
'PhabricatorConfigHistoryController' => 'applications/config/controller/PhabricatorConfigHistoryController.php',
'PhabricatorConfigIgnoreController' => 'applications/config/controller/PhabricatorConfigIgnoreController.php',
'PhabricatorConfigIssueListController' => 'applications/config/controller/PhabricatorConfigIssueListController.php',
'PhabricatorConfigIssuePanelController' => 'applications/config/controller/PhabricatorConfigIssuePanelController.php',
'PhabricatorConfigIssueViewController' => 'applications/config/controller/PhabricatorConfigIssueViewController.php',
'PhabricatorConfigIgnoreController' => 'applications/config/controller/issue/PhabricatorConfigIgnoreController.php',
'PhabricatorConfigIssueListController' => 'applications/config/controller/issue/PhabricatorConfigIssueListController.php',
'PhabricatorConfigIssuePanelController' => 'applications/config/controller/issue/PhabricatorConfigIssuePanelController.php',
'PhabricatorConfigIssueViewController' => 'applications/config/controller/issue/PhabricatorConfigIssueViewController.php',
'PhabricatorConfigJSON' => 'applications/config/json/PhabricatorConfigJSON.php',
'PhabricatorConfigJSONOptionType' => 'applications/config/custom/PhabricatorConfigJSONOptionType.php',
'PhabricatorConfigKeySchema' => 'applications/config/schema/PhabricatorConfigKeySchema.php',
'PhabricatorConfigListController' => 'applications/config/controller/PhabricatorConfigListController.php',
'PhabricatorConfigLocalSource' => 'infrastructure/env/PhabricatorConfigLocalSource.php',
'PhabricatorConfigManagementDeleteWorkflow' => 'applications/config/management/PhabricatorConfigManagementDeleteWorkflow.php',
'PhabricatorConfigManagementDoneWorkflow' => 'applications/config/management/PhabricatorConfigManagementDoneWorkflow.php',
@ -2849,12 +2845,12 @@ phutil_register_library_map(array(
'PhabricatorConfigManagementWorkflow' => 'applications/config/management/PhabricatorConfigManagementWorkflow.php',
'PhabricatorConfigManualActivity' => 'applications/config/storage/PhabricatorConfigManualActivity.php',
'PhabricatorConfigModule' => 'applications/config/module/PhabricatorConfigModule.php',
'PhabricatorConfigModuleController' => 'applications/config/controller/PhabricatorConfigModuleController.php',
'PhabricatorConfigModuleController' => 'applications/config/controller/module/PhabricatorConfigModuleController.php',
'PhabricatorConfigOption' => 'applications/config/option/PhabricatorConfigOption.php',
'PhabricatorConfigOptionType' => 'applications/config/custom/PhabricatorConfigOptionType.php',
'PhabricatorConfigPHIDModule' => 'applications/config/module/PhabricatorConfigPHIDModule.php',
'PhabricatorConfigProxySource' => 'infrastructure/env/PhabricatorConfigProxySource.php',
'PhabricatorConfigPurgeCacheController' => 'applications/config/controller/PhabricatorConfigPurgeCacheController.php',
'PhabricatorConfigPurgeCacheController' => 'applications/config/controller/services/PhabricatorConfigPurgeCacheController.php',
'PhabricatorConfigRegexOptionType' => 'applications/config/custom/PhabricatorConfigRegexOptionType.php',
'PhabricatorConfigRemarkupRule' => 'infrastructure/markup/rule/PhabricatorConfigRemarkupRule.php',
'PhabricatorConfigRequestExceptionHandlerModule' => 'applications/config/module/PhabricatorConfigRequestExceptionHandlerModule.php',
@ -2863,6 +2859,9 @@ phutil_register_library_map(array(
'PhabricatorConfigSchemaSpec' => 'applications/config/schema/PhabricatorConfigSchemaSpec.php',
'PhabricatorConfigServerSchema' => 'applications/config/schema/PhabricatorConfigServerSchema.php',
'PhabricatorConfigServicesController' => 'applications/config/controller/services/PhabricatorConfigServicesController.php',
'PhabricatorConfigSettingsController' => 'applications/config/controller/settings/PhabricatorConfigSettingsController.php',
'PhabricatorConfigSettingsHistoryController' => 'applications/config/controller/settings/PhabricatorConfigSettingsHistoryController.php',
'PhabricatorConfigSettingsListController' => 'applications/config/controller/settings/PhabricatorConfigSettingsListController.php',
'PhabricatorConfigSetupCheckModule' => 'applications/config/module/PhabricatorConfigSetupCheckModule.php',
'PhabricatorConfigSiteModule' => 'applications/config/module/PhabricatorConfigSiteModule.php',
'PhabricatorConfigSiteSource' => 'infrastructure/env/PhabricatorConfigSiteSource.php',
@ -2874,7 +2873,6 @@ phutil_register_library_map(array(
'PhabricatorConfigTransactionQuery' => 'applications/config/query/PhabricatorConfigTransactionQuery.php',
'PhabricatorConfigType' => 'applications/config/type/PhabricatorConfigType.php',
'PhabricatorConfigValidationException' => 'applications/config/exception/PhabricatorConfigValidationException.php',
'PhabricatorConfigVersionController' => 'applications/config/controller/PhabricatorConfigVersionController.php',
'PhabricatorConpherenceApplication' => 'applications/conpherence/application/PhabricatorConpherenceApplication.php',
'PhabricatorConpherenceColumnMinimizeSetting' => 'applications/settings/setting/PhabricatorConpherenceColumnMinimizeSetting.php',
'PhabricatorConpherenceColumnVisibleSetting' => 'applications/settings/setting/PhabricatorConpherenceColumnVisibleSetting.php',
@ -9134,9 +9132,7 @@ phutil_register_library_map(array(
'PhabricatorConduitTokenQuery' => 'PhabricatorCursorPagedPolicyAwareQuery',
'PhabricatorConduitTokenTerminateController' => 'PhabricatorConduitController',
'PhabricatorConduitTokensSettingsPanel' => 'PhabricatorSettingsPanel',
'PhabricatorConfigAllController' => 'PhabricatorConfigController',
'PhabricatorConfigApplication' => 'PhabricatorApplication',
'PhabricatorConfigApplicationController' => 'PhabricatorConfigController',
'PhabricatorConfigCacheController' => 'PhabricatorConfigServicesController',
'PhabricatorConfigClusterDatabasesController' => 'PhabricatorConfigServicesController',
'PhabricatorConfigClusterNotificationsController' => 'PhabricatorConfigServicesController',
@ -9145,6 +9141,7 @@ phutil_register_library_map(array(
'PhabricatorConfigCollectorsModule' => 'PhabricatorConfigModule',
'PhabricatorConfigColumnSchema' => 'PhabricatorConfigStorageSchema',
'PhabricatorConfigConfigPHIDType' => 'PhabricatorPHIDType',
'PhabricatorConfigConsoleController' => 'PhabricatorConfigController',
'PhabricatorConfigConstants' => 'Phobject',
'PhabricatorConfigController' => 'PhabricatorController',
'PhabricatorConfigCoreSchemaSpec' => 'PhabricatorConfigSchemaSpec',
@ -9156,7 +9153,7 @@ phutil_register_library_map(array(
'PhabricatorConfigDefaultSource' => 'PhabricatorConfigProxySource',
'PhabricatorConfigDictionarySource' => 'PhabricatorConfigSource',
'PhabricatorConfigEdgeModule' => 'PhabricatorConfigModule',
'PhabricatorConfigEditController' => 'PhabricatorConfigController',
'PhabricatorConfigEditController' => 'PhabricatorConfigSettingsController',
'PhabricatorConfigEditor' => 'PhabricatorApplicationTransactionEditor',
'PhabricatorConfigEntry' => array(
'PhabricatorConfigEntryDAO',
@ -9167,9 +9164,7 @@ phutil_register_library_map(array(
'PhabricatorConfigEntryQuery' => 'PhabricatorCursorPagedPolicyAwareQuery',
'PhabricatorConfigFileSource' => 'PhabricatorConfigProxySource',
'PhabricatorConfigGroupConstants' => 'PhabricatorConfigConstants',
'PhabricatorConfigGroupController' => 'PhabricatorConfigController',
'PhabricatorConfigHTTPParameterTypesModule' => 'PhabricatorConfigModule',
'PhabricatorConfigHistoryController' => 'PhabricatorConfigController',
'PhabricatorConfigIgnoreController' => 'PhabricatorConfigController',
'PhabricatorConfigIssueListController' => 'PhabricatorConfigController',
'PhabricatorConfigIssuePanelController' => 'PhabricatorConfigController',
@ -9177,7 +9172,6 @@ phutil_register_library_map(array(
'PhabricatorConfigJSON' => 'Phobject',
'PhabricatorConfigJSONOptionType' => 'PhabricatorConfigOptionType',
'PhabricatorConfigKeySchema' => 'PhabricatorConfigStorageSchema',
'PhabricatorConfigListController' => 'PhabricatorConfigController',
'PhabricatorConfigLocalSource' => 'PhabricatorConfigProxySource',
'PhabricatorConfigManagementDeleteWorkflow' => 'PhabricatorConfigManagementWorkflow',
'PhabricatorConfigManagementDoneWorkflow' => 'PhabricatorConfigManagementWorkflow',
@ -9202,6 +9196,9 @@ phutil_register_library_map(array(
'PhabricatorConfigSchemaSpec' => 'Phobject',
'PhabricatorConfigServerSchema' => 'PhabricatorConfigStorageSchema',
'PhabricatorConfigServicesController' => 'PhabricatorConfigController',
'PhabricatorConfigSettingsController' => 'PhabricatorConfigController',
'PhabricatorConfigSettingsHistoryController' => 'PhabricatorConfigSettingsController',
'PhabricatorConfigSettingsListController' => 'PhabricatorConfigSettingsController',
'PhabricatorConfigSetupCheckModule' => 'PhabricatorConfigModule',
'PhabricatorConfigSiteModule' => 'PhabricatorConfigModule',
'PhabricatorConfigSiteSource' => 'PhabricatorConfigProxySource',
@ -9213,7 +9210,6 @@ phutil_register_library_map(array(
'PhabricatorConfigTransactionQuery' => 'PhabricatorApplicationTransactionQuery',
'PhabricatorConfigType' => 'Phobject',
'PhabricatorConfigValidationException' => 'Exception',
'PhabricatorConfigVersionController' => 'PhabricatorConfigController',
'PhabricatorConpherenceApplication' => 'PhabricatorApplication',
'PhabricatorConpherenceColumnMinimizeSetting' => 'PhabricatorInternalSetting',
'PhabricatorConpherenceColumnVisibleSetting' => 'PhabricatorInternalSetting',

View file

@ -10,7 +10,7 @@ final class AlmanacConsoleController extends AlmanacController {
$viewer = $request->getViewer();
$menu = id(new PHUIObjectItemListView())
->setUser($viewer)
->setViewer($viewer)
->setBig(true);
$menu->addItem(
@ -84,7 +84,6 @@ final class AlmanacConsoleController extends AlmanacController {
->setTitle(pht('Almanac Console'))
->setCrumbs($crumbs)
->appendChild($view);
}
}

View file

@ -37,13 +37,12 @@ final class PhabricatorConfigApplication extends PhabricatorApplication {
public function getRoutes() {
return array(
'/config/' => array(
'' => 'PhabricatorConfigListController',
'' => 'PhabricatorConfigConsoleController',
'application/' => 'PhabricatorConfigApplicationController',
'all/' => 'PhabricatorConfigAllController',
'history/' => 'PhabricatorConfigHistoryController',
'edit/(?P<key>[\w\.\-]+)/' => 'PhabricatorConfigEditController',
'group/(?P<key>[^/]+)/' => 'PhabricatorConfigGroupController',
'version/' => 'PhabricatorConfigVersionController',
'database/'.
'(?:(?P<ref>[^/]+)/'.
'(?:(?P<database>[^/]+)/'.
@ -71,6 +70,12 @@ final class PhabricatorConfigApplication extends PhabricatorApplication {
'repositories/' => 'PhabricatorConfigClusterRepositoriesController',
'search/' => 'PhabricatorConfigClusterSearchController',
),
'settings/' => array(
'' => 'PhabricatorConfigSettingsListController',
'(?P<filter>advanced|all)/'
=> 'PhabricatorConfigSettingsListController',
'history/' => 'PhabricatorConfigSettingsHistoryController',
),
),
);
}

View file

@ -53,20 +53,23 @@ final class PhabricatorAuthSetupCheck extends PhabricatorSetupCheck {
"\n\n".
'Leaving your authentication provider configuration unlocked '.
'increases the damage that a compromised administrator account can '.
'do to your install, by, for example, changing the authentication '.
'provider to a server they control and intercepting usernames and '.
'do to your install. For example, an attacker who compromises an '.
'administrator account can change authentication providers to point '.
'at a server they control and attempt to intercept usernames and '.
'passwords.'.
"\n\n".
'To prevent this attack, you should configure your authentication '.
'providers, and then lock the configuration by doing `%s` '.
'from the command line. This will prevent changing the '.
'authentication provider config without first doing `%s`.',
'bin/auth lock',
'bin/auth unlock');
'To prevent this attack, you should configure authentication, and '.
'then lock the configuration by running "bin/auth lock" from the '.
'command line. This will prevent changing the authentication config '.
'without first running "bin/auth unlock".');
$this
->newIssue('auth.config-unlocked')
->setShortName(pht('Auth Config Unlocked'))
->setName(pht('Authenticaton Provider Configuration Unlocked'))
->setName(pht('Authenticaton Configuration Unlocked'))
->setSummary(
pht(
'Authentication configuration is currently unlocked. Once you '.
'finish configuring authentication, you should lock it.'))
->setMessage($message)
->addRelatedPhabricatorConfig('auth.lock-config')
->addCommand(

View file

@ -58,8 +58,7 @@ final class PhabricatorSecuritySetupCheck extends PhabricatorSetupCheck {
->setName(pht('Alternate File Domain Not Configured'))
->setSummary(
pht(
'Increase security (and improve performance) by configuring '.
'a CDN or alternate file domain.'))
'Improve security by configuring an alternate file domain.'))
->setMessage(
pht(
'Phabricator is currently configured to serve user uploads '.

View file

@ -1,77 +0,0 @@
<?php
final class PhabricatorConfigAllController
extends PhabricatorConfigController {
public function handleRequest(AphrontRequest $request) {
$viewer = $request->getViewer();
$db_values = id(new PhabricatorConfigEntry())
->loadAllWhere('namespace = %s', 'default');
$db_values = mpull($db_values, null, 'getConfigKey');
$rows = array();
$options = PhabricatorApplicationConfigOptions::loadAllOptions();
ksort($options);
foreach ($options as $option) {
$key = $option->getKey();
if ($option->getHidden()) {
$value = phutil_tag('em', array(), pht('Hidden'));
} else {
$value = PhabricatorEnv::getEnvConfig($key);
$value = PhabricatorConfigJSON::prettyPrintJSON($value);
}
$db_value = idx($db_values, $key);
$rows[] = array(
phutil_tag(
'a',
array(
'href' => $this->getApplicationURI('edit/'.$key.'/'),
),
$key),
$value,
$db_value && !$db_value->getIsDeleted() ? pht('Customized') : '',
);
}
$table = id(new AphrontTableView($rows))
->setColumnClasses(
array(
'',
'wide',
))
->setHeaders(
array(
pht('Key'),
pht('Value'),
pht('Customized'),
));
$title = pht('Current Settings');
$header = $this->buildHeaderView($title);
$nav = $this->buildSideNavView();
$nav->selectFilter('all/');
$view = $this->buildConfigBoxView(
pht('All Settings'),
$table);
$crumbs = $this->buildApplicationCrumbs()
->addTextCrumb($title)
->setBorder(true);
$content = id(new PHUITwoColumnView())
->setHeader($header)
->setFooter($view);
return $this->newPage()
->setTitle($title)
->setCrumbs($crumbs)
->setNavigation($nav)
->appendChild($content);
}
}

View file

@ -1,57 +0,0 @@
<?php
final class PhabricatorConfigApplicationController
extends PhabricatorConfigController {
public function handleRequest(AphrontRequest $request) {
$viewer = $request->getViewer();
$nav = $this->buildSideNavView();
$nav->selectFilter('application/');
$groups = PhabricatorApplicationConfigOptions::loadAll();
$apps_list = $this->buildConfigOptionsList($groups, 'apps');
$apps_list = $this->buildConfigBoxView(pht('Applications'), $apps_list);
$title = pht('Application Settings');
$header = $this->buildHeaderView($title);
$content = id(new PHUITwoColumnView())
->setHeader($header)
->setFooter($apps_list);
$crumbs = $this->buildApplicationCrumbs()
->addTextCrumb($title)
->setBorder(true);
return $this->newPage()
->setTitle($title)
->setCrumbs($crumbs)
->setNavigation($nav)
->appendChild($content);
}
private function buildConfigOptionsList(array $groups, $type) {
assert_instances_of($groups, 'PhabricatorApplicationConfigOptions');
$list = new PHUIObjectItemListView();
$list->setBig(true);
$groups = msort($groups, 'getName');
foreach ($groups as $group) {
if ($group->getGroup() == $type) {
$icon = id(new PHUIIconView())
->setIcon($group->getIcon())
->setBackground('bg-violet');
$item = id(new PHUIObjectItemView())
->setHeader($group->getName())
->setHref('/config/group/'.$group->getKey().'/')
->addAttribute($group->getDescription())
->setImageIcon($icon);
$list->addItem($item);
}
}
return $list;
}
}

View file

@ -1,92 +1,139 @@
<?php
final class PhabricatorConfigVersionController
final class PhabricatorConfigConsoleController
extends PhabricatorConfigController {
public function handleRequest(AphrontRequest $request) {
$viewer = $request->getViewer();
$title = pht('Version Information');
$versions = $this->renderModuleStatus($viewer);
$menu = id(new PHUIObjectItemListView())
->setViewer($viewer)
->setBig(true);
$nav = $this->buildSideNavView();
$nav->selectFilter('version/');
$header = $this->buildHeaderView($title);
$menu->addItem(
id(new PHUIObjectItemView())
->setHeader(pht('Settings'))
->setHref($this->getApplicationURI('settings/'))
->setImageIcon('fa-wrench')
->setClickable(true)
->addAttribute(
pht(
'Review and modify configuration settings.')));
$view = $this->buildConfigBoxView(
pht('Installed Versions'),
$versions);
$menu->addItem(
id(new PHUIObjectItemView())
->setHeader(pht('Setup Issues'))
->setHref($this->getApplicationURI('issue/'))
->setImageIcon('fa-exclamation-triangle')
->setClickable(true)
->addAttribute(
pht(
'Show unresolved issues with setup and configuration.')));
$menu->addItem(
id(new PHUIObjectItemView())
->setHeader(pht('Services'))
->setHref($this->getApplicationURI('cluster/databases/'))
->setImageIcon('fa-server')
->setClickable(true)
->addAttribute(
pht(
'View status information for databases, caches, repositories, '.
'and other services.')));
$menu->addItem(
id(new PHUIObjectItemView())
->setHeader(pht('Extensions/Modules'))
->setHref($this->getApplicationURI('module/'))
->setImageIcon('fa-gear')
->setClickable(true)
->addAttribute(
pht(
'Show installed extensions and modules.')));
$crumbs = $this->buildApplicationCrumbs()
->addTextCrumb($title)
->addTextCrumb(pht('Console'))
->setBorder(true);
$content = id(new PHUITwoColumnView())
->setHeader($header)
->setFooter($view);
$box = id(new PHUIObjectBoxView())
->setHeaderText(pht('Phabricator Configuation'))
->setBackground(PHUIObjectBoxView::WHITE_CONFIG)
->setObjectList($menu);
$versions = $this->newLibraryVersionTable($viewer);
$binary_versions = $this->newBinaryVersionTable();
$launcher_view = id(new PHUILauncherView())
->appendChild($box)
->appendChild($versions)
->appendChild($binary_versions);
$view = id(new PHUITwoColumnView())
->setFooter($launcher_view);
return $this->newPage()
->setTitle($title)
->setTitle(pht('Phabricator Configuation'))
->setCrumbs($crumbs)
->setNavigation($nav)
->appendChild($content);
->appendChild($view);
}
public function renderModuleStatus($viewer) {
public function newLibraryVersionTable() {
$viewer = $this->getViewer();
$versions = $this->loadVersions($viewer);
$version_property_list = id(new PHUIPropertyListView());
$rows = array();
foreach ($versions as $name => $info) {
$version = $info['version'];
if ($info['branchpoint']) {
$display = pht(
'%s (branched from %s on %s)',
$version,
$info['branchpoint'],
$info['upstream']);
$branchpoint = $info['branchpoint'];
if (strlen($branchpoint)) {
$branchpoint = substr($branchpoint, 0, 12);
} else {
$display = $version;
$branchpoint = null;
}
$version_property_list->addProperty($name, $display);
}
$phabricator_root = dirname(phutil_get_library_root('phabricator'));
$version_path = $phabricator_root.'/conf/local/VERSION';
if (Filesystem::pathExists($version_path)) {
$version_from_file = Filesystem::readFile($version_path);
$version_property_list->addProperty(
pht('Local Version'),
$version_from_file);
}
$version_property_list->addProperty('php', phpversion());
$binaries = PhutilBinaryAnalyzer::getAllBinaries();
foreach ($binaries as $binary) {
if (!$binary->isBinaryAvailable()) {
$binary_info = pht('Not Available');
$version = $info['hash'];
if (strlen($version)) {
$version = substr($version, 0, 12);
} else {
$version = $binary->getBinaryVersion();
$path = $binary->getBinaryPath();
if ($path === null && $version === null) {
$binary_info = pht('-');
} else if ($path === null) {
$binary_info = $version;
} else if ($version === null) {
$binary_info = pht('- at %s', $path);
} else {
$binary_info = pht('%s at %s', $version, $path);
}
$version = pht('Unknown');
}
$version_property_list->addProperty(
$binary->getBinaryName(),
$binary_info);
$epoch = $info['epoch'];
if ($epoch) {
$epoch = phabricator_date($epoch, $viewer);
} else {
$epoch = null;
}
$rows[] = array(
$name,
$version,
$epoch,
$branchpoint,
);
}
return $version_property_list;
$table_view = id(new AphrontTableView($rows))
->setHeaders(
array(
pht('Library'),
pht('Version'),
pht('Date'),
pht('Branchpoint'),
))
->setColumnClasses(
array(
'pri',
null,
null,
'wide',
));
return id(new PHUIObjectBoxView())
->setHeaderText(pht('Phabricator Version Information'))
->setBackground(PHUIObjectBoxView::BLUE_PROPERTY)
->appendChild($table_view);
}
private function loadVersions(PhabricatorUser $viewer) {
@ -207,13 +254,14 @@ final class PhabricatorConfigVersionController
list($err, $stdout) = $future->resolve();
if (!$err) {
list($hash, $epoch) = explode(' ', $stdout);
$version = pht('%s (%s)', $hash, phabricator_date($epoch, $viewer));
} else {
$version = pht('Unknown');
$hash = null;
$epoch = null;
}
$result = array(
'version' => $version,
'hash' => $hash,
'epoch' => $epoch,
'upstream' => null,
'branchpoint' => null,
);
@ -239,4 +287,51 @@ final class PhabricatorConfigVersionController
return $results;
}
private function newBinaryVersionTable() {
$rows = array();
$rows[] = array(
'php',
phpversion(),
php_sapi_name(),
);
$binaries = PhutilBinaryAnalyzer::getAllBinaries();
foreach ($binaries as $binary) {
if (!$binary->isBinaryAvailable()) {
$binary_version = pht('Not Available');
$binary_path = null;
} else {
$binary_version = $binary->getBinaryVersion();
$binary_path = $binary->getBinaryPath();
}
$rows[] = array(
$binary->getBinaryName(),
$binary_version,
$binary_path,
);
}
$table_view = id(new AphrontTableView($rows))
->setHeaders(
array(
pht('Binary'),
pht('Version'),
pht('Path'),
))
->setColumnClasses(
array(
'pri',
null,
'wide',
));
return id(new PHUIObjectBoxView())
->setHeaderText(pht('Other Version Information'))
->setBackground(PHUIObjectBoxView::BLUE_PROPERTY)
->appendChild($table_view);
}
}

View file

@ -6,33 +6,6 @@ abstract class PhabricatorConfigController extends PhabricatorController {
return true;
}
public function buildSideNavView($filter = null, $for_app = false) {
$guide_href = new PhutilURI('/guides/');
$nav = new AphrontSideNavFilterView();
$nav->setBaseURI(new PhutilURI($this->getApplicationURI()));
$nav->addFilter('/',
pht('Core Settings'), null, 'fa-gear');
$nav->addFilter('application/',
pht('Application Settings'), null, 'fa-globe');
$nav->addFilter('history/',
pht('Settings History'), null, 'fa-history');
$nav->addFilter('version/',
pht('Version Information'), null, 'fa-download');
$nav->addFilter('all/',
pht('All Settings'), null, 'fa-list-ul');
$nav->addLabel(pht('Setup'));
$nav->addFilter('issue/',
pht('Setup Issues'), null, 'fa-warning');
$nav->addFilter(null,
pht('Installation Guide'), $guide_href, 'fa-book');
return $nav;
}
public function buildApplicationMenu() {
return $this->buildSideNavView(null, true)->getMenu();
}
public function buildHeaderView($text, $action = null) {
$viewer = $this->getViewer();

View file

@ -1,112 +0,0 @@
<?php
final class PhabricatorConfigGroupController
extends PhabricatorConfigController {
public function handleRequest(AphrontRequest $request) {
$viewer = $request->getViewer();
$group_key = $request->getURIData('key');
$groups = PhabricatorApplicationConfigOptions::loadAll();
$options = idx($groups, $group_key);
if (!$options) {
return new Aphront404Response();
}
$group_uri = PhabricatorConfigGroupConstants::getGroupFullURI(
$options->getGroup());
$group_name = PhabricatorConfigGroupConstants::getGroupShortName(
$options->getGroup());
$nav = $this->buildSideNavView();
$nav->selectFilter($group_uri);
$title = pht('%s Configuration', $options->getName());
$header = $this->buildHeaderView($title);
$list = $this->buildOptionList($options->getOptions());
$group_url = phutil_tag('a', array('href' => $group_uri), $group_name);
$box_header = pht("%s \xC2\xBB %s", $group_url, $options->getName());
$view = $this->buildConfigBoxView($box_header, $list);
$crumbs = $this->buildApplicationCrumbs()
->addTextCrumb($group_name, $group_uri)
->addTextCrumb($options->getName())
->setBorder(true);
$content = id(new PHUITwoColumnView())
->setHeader($header)
->setFooter($view);
return $this->newPage()
->setTitle($title)
->setCrumbs($crumbs)
->setNavigation($nav)
->appendChild($content);
}
private function buildOptionList(array $options) {
assert_instances_of($options, 'PhabricatorConfigOption');
require_celerity_resource('config-options-css');
$db_values = array();
if ($options) {
$db_values = id(new PhabricatorConfigEntry())->loadAllWhere(
'configKey IN (%Ls) AND namespace = %s',
mpull($options, 'getKey'),
'default');
$db_values = mpull($db_values, null, 'getConfigKey');
}
$list = new PHUIObjectItemListView();
$list->setBig(true);
foreach ($options as $option) {
$summary = $option->getSummary();
$item = id(new PHUIObjectItemView())
->setHeader($option->getKey())
->setHref('/config/edit/'.$option->getKey().'/')
->addAttribute($summary);
$color = null;
$db_value = idx($db_values, $option->getKey());
if ($db_value && !$db_value->getIsDeleted()) {
$item->setEffect('visited');
$color = 'violet';
}
if ($option->getHidden()) {
$item->setStatusIcon('fa-eye-slash grey', pht('Hidden'));
$item->setDisabled(true);
} else if ($option->getLocked()) {
$item->setStatusIcon('fa-lock '.$color, pht('Locked'));
} else if ($color) {
$item->setStatusIcon('fa-pencil '.$color, pht('Editable'));
} else {
$item->setStatusIcon('fa-pencil-square-o '.$color, pht('Editable'));
}
if (!$option->getHidden()) {
$current_value = PhabricatorEnv::getEnvConfig($option->getKey());
$current_value = PhabricatorConfigJSON::prettyPrintJSON(
$current_value);
$current_value = phutil_tag(
'div',
array(
'class' => 'config-options-current-value '.$color,
),
array(
$current_value,
));
$item->setSideColumn($current_value);
}
$list->addItem($item);
}
return $list;
}
}

View file

@ -1,57 +0,0 @@
<?php
final class PhabricatorConfigListController
extends PhabricatorConfigController {
public function handleRequest(AphrontRequest $request) {
$viewer = $request->getViewer();
$nav = $this->buildSideNavView();
$nav->selectFilter('/');
$groups = PhabricatorApplicationConfigOptions::loadAll();
$core_list = $this->buildConfigOptionsList($groups, 'core');
$core_list = $this->buildConfigBoxView(pht('Core'), $core_list);
$title = pht('Core Settings');
$header = $this->buildHeaderView($title);
$crumbs = $this->buildApplicationCrumbs()
->addTextCrumb($title)
->setBorder(true);
$content = id(new PHUITwoColumnView())
->setHeader($header)
->setFooter($core_list);
return $this->newPage()
->setTitle($title)
->setCrumbs($crumbs)
->setNavigation($nav)
->appendChild($content);
}
private function buildConfigOptionsList(array $groups, $type) {
assert_instances_of($groups, 'PhabricatorApplicationConfigOptions');
$list = new PHUIObjectItemListView();
$list->setBig(true);
$groups = msort($groups, 'getName');
foreach ($groups as $group) {
if ($group->getGroup() == $type) {
$icon = id(new PHUIIconView())
->setIcon($group->getIcon())
->setBackground('bg-blue');
$item = id(new PHUIObjectItemView())
->setHeader($group->getName())
->setHref('/config/group/'.$group->getKey().'/')
->addAttribute($group->getDescription())
->setImageIcon($icon);
$list->addItem($item);
}
}
return $list;
}
}

View file

@ -6,9 +6,6 @@ final class PhabricatorConfigIssueListController
public function handleRequest(AphrontRequest $request) {
$viewer = $request->getViewer();
$nav = $this->buildSideNavView();
$nav->selectFilter('issue/');
$engine = new PhabricatorSetupEngine();
$response = $engine->execute();
if ($response) {
@ -34,7 +31,6 @@ final class PhabricatorConfigIssueListController
'fa-question-circle');
$title = pht('Setup Issues');
$header = $this->buildHeaderView($title);
if (!$issues) {
$issue_list = id(new PHUIInfoView())
@ -50,21 +46,24 @@ final class PhabricatorConfigIssueListController
$other,
);
$issue_list = $this->buildConfigBoxView(pht('Issues'), $issue_list);
$issue_list = $this->buildConfigBoxView(
pht('Unresolved Setup Issues'),
$issue_list);
}
$crumbs = $this->buildApplicationCrumbs()
->addTextCrumb($title)
->setBorder(true);
$launcher_view = id(new PHUILauncherView())
->appendChild($issue_list);
$content = id(new PHUITwoColumnView())
->setHeader($header)
->setFooter($issue_list);
->setFooter($launcher_view);
return $this->newPage()
->setTitle($title)
->setCrumbs($crumbs)
->setNavigation($nav)
->appendChild($content);
}
@ -76,27 +75,30 @@ final class PhabricatorConfigIssueListController
$items = 0;
foreach ($issues as $issue) {
if ($issue->getGroup() == $group) {
$items++;
$href = $this->getApplicationURI('/issue/'.$issue->getIssueKey().'/');
$item = id(new PHUIObjectItemView())
->setHeader($issue->getName())
->setHref($href)
->addAttribute($issue->getSummary());
if (!$issue->getIsIgnored()) {
$icon = id(new PHUIIconView())
->setIcon($fonticon)
->setBackground('bg-sky');
$item->setImageIcon($icon);
$list->addItem($item);
} else {
$icon = id(new PHUIIconView())
->setIcon('fa-eye-slash')
->setBackground('bg-grey');
$item->setDisabled(true);
$item->setImageIcon($icon);
$ignored_items[] = $item;
}
if ($issue->getGroup() != $group) {
continue;
}
$items++;
$href = $this->getApplicationURI('/issue/'.$issue->getIssueKey().'/');
$item = id(new PHUIObjectItemView())
->setHeader($issue->getName())
->setHref($href)
->setClickable(true)
->addAttribute($issue->getSummary());
if (!$issue->getIsIgnored()) {
$icon = id(new PHUIIconView())
->setIcon($fonticon)
->setBackground('bg-sky');
$item->setImageIcon($icon);
$list->addItem($item);
} else {
$icon = id(new PHUIIconView())
->setIcon('fa-eye-slash')
->setBackground('bg-grey');
$item->setDisabled(true);
$item->setImageIcon($icon);
$ignored_items[] = $item;
}
}

View file

@ -14,9 +14,6 @@ final class PhabricatorConfigIssueViewController
}
$issues = $engine->getIssues();
$nav = $this->buildSideNavView();
$nav->selectFilter('issue/');
if (empty($issues[$issue_key])) {
$content = id(new PHUIInfoView())
->setSeverity(PHUIInfoView::SEVERITY_NOTICE)
@ -36,23 +33,21 @@ final class PhabricatorConfigIssueViewController
$title = $issue->getShortName();
}
$header = $this->buildHeaderView($title);
$crumbs = $this
->buildApplicationCrumbs()
->setBorder(true)
->addTextCrumb(pht('Setup Issues'), $this->getApplicationURI('issue/'))
->addTextCrumb($title, $request->getRequestURI())
->setBorder(true);
$launcher_view = id(new PHUILauncherView())
->appendChild($content);
$content = id(new PHUITwoColumnView())
->setHeader($header)
->setFooter($content);
->setFooter($launcher_view);
return $this->newPage()
->setTitle($title)
->setCrumbs($crumbs)
->setNavigation($nav)
->appendChild($content);
}

View file

@ -1,7 +1,7 @@
<?php
final class PhabricatorConfigEditController
extends PhabricatorConfigController {
extends PhabricatorConfigSettingsController {
public function handleRequest(AphrontRequest $request) {
$viewer = $request->getViewer();
@ -30,11 +30,9 @@ final class PhabricatorConfigEditController
->setDefault(null)
->setDescription($desc);
$group = null;
$group_uri = $this->getApplicationURI();
} else {
$option = $options[$key];
$group = $option->getGroup();
$group_uri = $this->getApplicationURI('group/'.$group->getKey().'/');
}
$issue = $request->getStr('issue');
@ -42,7 +40,7 @@ final class PhabricatorConfigEditController
// If the user came here from an open setup issue, send them back.
$done_uri = $this->getApplicationURI('issue/'.$issue.'/');
} else {
$done_uri = $group_uri;
$done_uri = $this->getApplicationURI('settings/');
}
// Check if the config key is already stored in the database.
@ -205,23 +203,10 @@ final class PhabricatorConfigEditController
$title = $key;
$box_header = array();
if ($group) {
$box_header[] = phutil_tag(
'a',
array(
'href' => $group_uri,
),
$group->getName());
$box_header[] = " \xC2\xBB ";
}
$box_header[] = $key;
$crumbs = $this->buildApplicationCrumbs();
if ($group) {
$crumbs->addTextCrumb($group->getName(), $group_uri);
}
$crumbs->addTextCrumb($key, '/config/edit/'.$key);
$crumbs->setBorder(true);
$crumbs = $this->newCrumbs()
->addTextCrumb($key, '/config/edit/'.$key);
$form_box = $this->buildConfigBoxView($box_header, $form, $tag);
@ -230,9 +215,6 @@ final class PhabricatorConfigEditController
new PhabricatorConfigTransactionQuery());
$timeline->setShouldTerminate(true);
$nav = $this->buildSideNavView();
$nav->selectFilter($group_uri);
$header = $this->buildHeaderView($title);
$view = id(new PHUITwoColumnView())
@ -249,7 +231,6 @@ final class PhabricatorConfigEditController
return $this->newPage()
->setTitle($title)
->setCrumbs($crumbs)
->setNavigation($nav)
->appendChild($view);
}

View file

@ -0,0 +1,51 @@
<?php
abstract class PhabricatorConfigSettingsController
extends PhabricatorConfigController {
public function newNavigation($select_filter) {
$settings_uri = $this->getApplicationURI('settings/');
$nav = id(new AphrontSideNavFilterView())
->setBaseURI(new PhutilURI($settings_uri));
$nav->addLabel(pht('Configuration'));
$nav->newLink('settings')
->setName(pht('Core Settings'))
->setIcon('fa-wrench')
->setHref($settings_uri);
$nav->newLink('advanced')
->setName(pht('Advanced Settings'))
->setIcon('fa-cogs')
->setHref(urisprintf('%s%s/', $settings_uri, 'advanced'));
$nav->newLink('all')
->setName(pht('All Settings'))
->setIcon('fa-list')
->setHref(urisprintf('%s%s/', $settings_uri, 'all'));
$nav->addLabel(pht('History'));
$nav->newLink('history')
->setName(pht('View History'))
->setIcon('fa-history')
->setHref(urisprintf('%s%s/', $settings_uri, 'history'));
if ($select_filter) {
$nav->selectFilter($select_filter);
}
return $nav;
}
public function newCrumbs() {
$settings_uri = $this->getApplicationURI('settings/');
return $this->buildApplicationCrumbs()
->addTextCrumb(pht('Settings'), $settings_uri)
->setBorder(true);
}
}

View file

@ -1,7 +1,7 @@
<?php
final class PhabricatorConfigHistoryController
extends PhabricatorConfigController {
final class PhabricatorConfigSettingsHistoryController
extends PhabricatorConfigSettingsController {
public function handleRequest(AphrontRequest $request) {
$viewer = $request->getViewer();
@ -27,12 +27,10 @@ final class PhabricatorConfigHistoryController
$title = pht('Settings History');
$header = $this->buildHeaderView($title);
$nav = $this->buildSideNavView();
$nav->selectFilter('history/');
$nav = $this->newNavigation('history');
$crumbs = $this->buildApplicationCrumbs()
->addTextCrumb($title)
->setBorder(true);
$crumbs = $this->newCrumbs()
->addTextCrumb($title);
$content = id(new PHUITwoColumnView())
->setHeader($header)

View file

@ -0,0 +1,107 @@
<?php
final class PhabricatorConfigSettingsListController
extends PhabricatorConfigSettingsController {
public function handleRequest(AphrontRequest $request) {
$viewer = $request->getViewer();
$filter = $request->getURIData('filter');
if (!strlen($filter)) {
$filter = 'settings';
}
$is_core = ($filter === 'settings');
$is_advanced = ($filter === 'advanced');
$is_all = ($filter === 'all');
$show_core = ($is_core || $is_all);
$show_advanced = ($is_advanced || $is_all);
if ($is_core) {
$title = pht('Core Settings');
} else if ($is_advanced) {
$title = pht('Advanced Settings');
} else {
$title = pht('All Settings');
}
$db_values = id(new PhabricatorConfigEntry())
->loadAllWhere('namespace = %s', 'default');
$db_values = mpull($db_values, null, 'getConfigKey');
$list = id(new PHUIObjectItemListView())
->setBig(true)
->setFlush(true);
$rows = array();
$options = PhabricatorApplicationConfigOptions::loadAllOptions();
ksort($options);
foreach ($options as $option) {
$key = $option->getKey();
$is_advanced = (bool)$option->getLocked();
if ($is_advanced && !$show_advanced) {
continue;
}
if (!$is_advanced && !$show_core) {
continue;
}
$db_value = idx($db_values, $key);
$item = $this->newConfigOptionView($option, $db_value);
$list->addItem($item);
}
$header = $this->buildHeaderView($title);
$crumbs = $this->newCrumbs()
->addTextCrumb($title);
$content = id(new PHUITwoColumnView())
->setHeader($header)
->setFooter($list);
$nav = $this->newNavigation($filter);
return $this->newPage()
->setTitle($title)
->setCrumbs($crumbs)
->setNavigation($nav)
->appendChild($content);
}
private function newConfigOptionView(
PhabricatorConfigOption $option,
PhabricatorConfigEntry $stored_value = null) {
$summary = $option->getSummary();
$item = id(new PHUIObjectItemView())
->setHeader($option->getKey())
->setClickable(true)
->setHref('/config/edit/'.$option->getKey().'/')
->addAttribute($summary);
$color = null;
if ($stored_value && !$stored_value->getIsDeleted()) {
$item->setEffect('visited');
$color = 'violet';
}
if ($option->getHidden()) {
$item->setStatusIcon('fa-eye-slash', pht('Hidden'));
} else if ($option->getLocked()) {
$item->setStatusIcon('fa-lock '.$color, pht('Locked'));
} else if ($color) {
$item->setStatusIcon('fa-pencil '.$color, pht('Editable'));
} else {
$item->setStatusIcon('fa-circle-o grey', pht('Default'));
}
return $item;
}
}

View file

@ -24,6 +24,10 @@ final class PhabricatorAphlictSetupCheck extends PhabricatorSetupCheck {
$this->newIssue('aphlict.connect')
->setShortName(pht('Notification Server Down'))
->setName(pht('Unable to Connect to Notification Server'))
->setSummary(
pht(
'Phabricator is configured to use a notification server, '.
'but is not able to connect to it.'))
->setMessage($message)
->addRelatedPhabricatorConfig('notification.servers')
->addCommand(