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

View file

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

View file

@ -37,13 +37,12 @@ final class PhabricatorConfigApplication extends PhabricatorApplication {
public function getRoutes() { public function getRoutes() {
return array( return array(
'/config/' => array( '/config/' => array(
'' => 'PhabricatorConfigListController', '' => 'PhabricatorConfigConsoleController',
'application/' => 'PhabricatorConfigApplicationController', 'application/' => 'PhabricatorConfigApplicationController',
'all/' => 'PhabricatorConfigAllController', 'all/' => 'PhabricatorConfigAllController',
'history/' => 'PhabricatorConfigHistoryController', 'history/' => 'PhabricatorConfigHistoryController',
'edit/(?P<key>[\w\.\-]+)/' => 'PhabricatorConfigEditController', 'edit/(?P<key>[\w\.\-]+)/' => 'PhabricatorConfigEditController',
'group/(?P<key>[^/]+)/' => 'PhabricatorConfigGroupController', 'group/(?P<key>[^/]+)/' => 'PhabricatorConfigGroupController',
'version/' => 'PhabricatorConfigVersionController',
'database/'. 'database/'.
'(?:(?P<ref>[^/]+)/'. '(?:(?P<ref>[^/]+)/'.
'(?:(?P<database>[^/]+)/'. '(?:(?P<database>[^/]+)/'.
@ -71,6 +70,12 @@ final class PhabricatorConfigApplication extends PhabricatorApplication {
'repositories/' => 'PhabricatorConfigClusterRepositoriesController', 'repositories/' => 'PhabricatorConfigClusterRepositoriesController',
'search/' => 'PhabricatorConfigClusterSearchController', '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". "\n\n".
'Leaving your authentication provider configuration unlocked '. 'Leaving your authentication provider configuration unlocked '.
'increases the damage that a compromised administrator account can '. 'increases the damage that a compromised administrator account can '.
'do to your install, by, for example, changing the authentication '. 'do to your install. For example, an attacker who compromises an '.
'provider to a server they control and intercepting usernames and '. 'administrator account can change authentication providers to point '.
'at a server they control and attempt to intercept usernames and '.
'passwords.'. 'passwords.'.
"\n\n". "\n\n".
'To prevent this attack, you should configure your authentication '. 'To prevent this attack, you should configure authentication, and '.
'providers, and then lock the configuration by doing `%s` '. 'then lock the configuration by running "bin/auth lock" from the '.
'from the command line. This will prevent changing the '. 'command line. This will prevent changing the authentication config '.
'authentication provider config without first doing `%s`.', 'without first running "bin/auth unlock".');
'bin/auth lock',
'bin/auth unlock');
$this $this
->newIssue('auth.config-unlocked') ->newIssue('auth.config-unlocked')
->setShortName(pht('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) ->setMessage($message)
->addRelatedPhabricatorConfig('auth.lock-config') ->addRelatedPhabricatorConfig('auth.lock-config')
->addCommand( ->addCommand(

View file

@ -58,8 +58,7 @@ final class PhabricatorSecuritySetupCheck extends PhabricatorSetupCheck {
->setName(pht('Alternate File Domain Not Configured')) ->setName(pht('Alternate File Domain Not Configured'))
->setSummary( ->setSummary(
pht( pht(
'Increase security (and improve performance) by configuring '. 'Improve security by configuring an alternate file domain.'))
'a CDN or alternate file domain.'))
->setMessage( ->setMessage(
pht( pht(
'Phabricator is currently configured to serve user uploads '. '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 <?php
final class PhabricatorConfigVersionController final class PhabricatorConfigConsoleController
extends PhabricatorConfigController { extends PhabricatorConfigController {
public function handleRequest(AphrontRequest $request) { public function handleRequest(AphrontRequest $request) {
$viewer = $request->getViewer(); $viewer = $request->getViewer();
$title = pht('Version Information'); $menu = id(new PHUIObjectItemListView())
$versions = $this->renderModuleStatus($viewer); ->setViewer($viewer)
->setBig(true);
$nav = $this->buildSideNavView(); $menu->addItem(
$nav->selectFilter('version/'); id(new PHUIObjectItemView())
$header = $this->buildHeaderView($title); ->setHeader(pht('Settings'))
->setHref($this->getApplicationURI('settings/'))
->setImageIcon('fa-wrench')
->setClickable(true)
->addAttribute(
pht(
'Review and modify configuration settings.')));
$view = $this->buildConfigBoxView( $menu->addItem(
pht('Installed Versions'), id(new PHUIObjectItemView())
$versions); ->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() $crumbs = $this->buildApplicationCrumbs()
->addTextCrumb($title) ->addTextCrumb(pht('Console'))
->setBorder(true); ->setBorder(true);
$content = id(new PHUITwoColumnView()) $box = id(new PHUIObjectBoxView())
->setHeader($header) ->setHeaderText(pht('Phabricator Configuation'))
->setFooter($view); ->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() return $this->newPage()
->setTitle($title) ->setTitle(pht('Phabricator Configuation'))
->setCrumbs($crumbs) ->setCrumbs($crumbs)
->setNavigation($nav) ->appendChild($view);
->appendChild($content);
} }
public function renderModuleStatus($viewer) { public function newLibraryVersionTable() {
$viewer = $this->getViewer();
$versions = $this->loadVersions($viewer); $versions = $this->loadVersions($viewer);
$version_property_list = id(new PHUIPropertyListView()); $rows = array();
foreach ($versions as $name => $info) { foreach ($versions as $name => $info) {
$version = $info['version']; $branchpoint = $info['branchpoint'];
if (strlen($branchpoint)) {
if ($info['branchpoint']) { $branchpoint = substr($branchpoint, 0, 12);
$display = pht(
'%s (branched from %s on %s)',
$version,
$info['branchpoint'],
$info['upstream']);
} else { } else {
$display = $version; $branchpoint = null;
} }
$version_property_list->addProperty($name, $display); $version = $info['hash'];
} if (strlen($version)) {
$version = substr($version, 0, 12);
$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');
} else { } else {
$version = $binary->getBinaryVersion(); $version = pht('Unknown');
$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_property_list->addProperty(
$binary->getBinaryName(), $epoch = $info['epoch'];
$binary_info); 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) { private function loadVersions(PhabricatorUser $viewer) {
@ -207,13 +254,14 @@ final class PhabricatorConfigVersionController
list($err, $stdout) = $future->resolve(); list($err, $stdout) = $future->resolve();
if (!$err) { if (!$err) {
list($hash, $epoch) = explode(' ', $stdout); list($hash, $epoch) = explode(' ', $stdout);
$version = pht('%s (%s)', $hash, phabricator_date($epoch, $viewer));
} else { } else {
$version = pht('Unknown'); $hash = null;
$epoch = null;
} }
$result = array( $result = array(
'version' => $version, 'hash' => $hash,
'epoch' => $epoch,
'upstream' => null, 'upstream' => null,
'branchpoint' => null, 'branchpoint' => null,
); );
@ -239,4 +287,51 @@ final class PhabricatorConfigVersionController
return $results; 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; 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) { public function buildHeaderView($text, $action = null) {
$viewer = $this->getViewer(); $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) { public function handleRequest(AphrontRequest $request) {
$viewer = $request->getViewer(); $viewer = $request->getViewer();
$nav = $this->buildSideNavView();
$nav->selectFilter('issue/');
$engine = new PhabricatorSetupEngine(); $engine = new PhabricatorSetupEngine();
$response = $engine->execute(); $response = $engine->execute();
if ($response) { if ($response) {
@ -34,7 +31,6 @@ final class PhabricatorConfigIssueListController
'fa-question-circle'); 'fa-question-circle');
$title = pht('Setup Issues'); $title = pht('Setup Issues');
$header = $this->buildHeaderView($title);
if (!$issues) { if (!$issues) {
$issue_list = id(new PHUIInfoView()) $issue_list = id(new PHUIInfoView())
@ -50,21 +46,24 @@ final class PhabricatorConfigIssueListController
$other, $other,
); );
$issue_list = $this->buildConfigBoxView(pht('Issues'), $issue_list); $issue_list = $this->buildConfigBoxView(
pht('Unresolved Setup Issues'),
$issue_list);
} }
$crumbs = $this->buildApplicationCrumbs() $crumbs = $this->buildApplicationCrumbs()
->addTextCrumb($title) ->addTextCrumb($title)
->setBorder(true); ->setBorder(true);
$launcher_view = id(new PHUILauncherView())
->appendChild($issue_list);
$content = id(new PHUITwoColumnView()) $content = id(new PHUITwoColumnView())
->setHeader($header) ->setFooter($launcher_view);
->setFooter($issue_list);
return $this->newPage() return $this->newPage()
->setTitle($title) ->setTitle($title)
->setCrumbs($crumbs) ->setCrumbs($crumbs)
->setNavigation($nav)
->appendChild($content); ->appendChild($content);
} }
@ -76,27 +75,30 @@ final class PhabricatorConfigIssueListController
$items = 0; $items = 0;
foreach ($issues as $issue) { foreach ($issues as $issue) {
if ($issue->getGroup() == $group) { if ($issue->getGroup() != $group) {
$items++; continue;
$href = $this->getApplicationURI('/issue/'.$issue->getIssueKey().'/'); }
$item = id(new PHUIObjectItemView())
->setHeader($issue->getName()) $items++;
->setHref($href) $href = $this->getApplicationURI('/issue/'.$issue->getIssueKey().'/');
->addAttribute($issue->getSummary()); $item = id(new PHUIObjectItemView())
if (!$issue->getIsIgnored()) { ->setHeader($issue->getName())
$icon = id(new PHUIIconView()) ->setHref($href)
->setIcon($fonticon) ->setClickable(true)
->setBackground('bg-sky'); ->addAttribute($issue->getSummary());
$item->setImageIcon($icon); if (!$issue->getIsIgnored()) {
$list->addItem($item); $icon = id(new PHUIIconView())
} else { ->setIcon($fonticon)
$icon = id(new PHUIIconView()) ->setBackground('bg-sky');
->setIcon('fa-eye-slash') $item->setImageIcon($icon);
->setBackground('bg-grey'); $list->addItem($item);
$item->setDisabled(true); } else {
$item->setImageIcon($icon); $icon = id(new PHUIIconView())
$ignored_items[] = $item; ->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(); $issues = $engine->getIssues();
$nav = $this->buildSideNavView();
$nav->selectFilter('issue/');
if (empty($issues[$issue_key])) { if (empty($issues[$issue_key])) {
$content = id(new PHUIInfoView()) $content = id(new PHUIInfoView())
->setSeverity(PHUIInfoView::SEVERITY_NOTICE) ->setSeverity(PHUIInfoView::SEVERITY_NOTICE)
@ -36,23 +33,21 @@ final class PhabricatorConfigIssueViewController
$title = $issue->getShortName(); $title = $issue->getShortName();
} }
$header = $this->buildHeaderView($title);
$crumbs = $this $crumbs = $this
->buildApplicationCrumbs() ->buildApplicationCrumbs()
->setBorder(true)
->addTextCrumb(pht('Setup Issues'), $this->getApplicationURI('issue/')) ->addTextCrumb(pht('Setup Issues'), $this->getApplicationURI('issue/'))
->addTextCrumb($title, $request->getRequestURI()) ->addTextCrumb($title, $request->getRequestURI())
->setBorder(true); ->setBorder(true);
$launcher_view = id(new PHUILauncherView())
->appendChild($content);
$content = id(new PHUITwoColumnView()) $content = id(new PHUITwoColumnView())
->setHeader($header) ->setFooter($launcher_view);
->setFooter($content);
return $this->newPage() return $this->newPage()
->setTitle($title) ->setTitle($title)
->setCrumbs($crumbs) ->setCrumbs($crumbs)
->setNavigation($nav)
->appendChild($content); ->appendChild($content);
} }

View file

@ -1,7 +1,7 @@
<?php <?php
final class PhabricatorConfigEditController final class PhabricatorConfigEditController
extends PhabricatorConfigController { extends PhabricatorConfigSettingsController {
public function handleRequest(AphrontRequest $request) { public function handleRequest(AphrontRequest $request) {
$viewer = $request->getViewer(); $viewer = $request->getViewer();
@ -30,11 +30,9 @@ final class PhabricatorConfigEditController
->setDefault(null) ->setDefault(null)
->setDescription($desc); ->setDescription($desc);
$group = null; $group = null;
$group_uri = $this->getApplicationURI();
} else { } else {
$option = $options[$key]; $option = $options[$key];
$group = $option->getGroup(); $group = $option->getGroup();
$group_uri = $this->getApplicationURI('group/'.$group->getKey().'/');
} }
$issue = $request->getStr('issue'); $issue = $request->getStr('issue');
@ -42,7 +40,7 @@ final class PhabricatorConfigEditController
// If the user came here from an open setup issue, send them back. // If the user came here from an open setup issue, send them back.
$done_uri = $this->getApplicationURI('issue/'.$issue.'/'); $done_uri = $this->getApplicationURI('issue/'.$issue.'/');
} else { } else {
$done_uri = $group_uri; $done_uri = $this->getApplicationURI('settings/');
} }
// Check if the config key is already stored in the database. // Check if the config key is already stored in the database.
@ -205,23 +203,10 @@ final class PhabricatorConfigEditController
$title = $key; $title = $key;
$box_header = array(); $box_header = array();
if ($group) {
$box_header[] = phutil_tag(
'a',
array(
'href' => $group_uri,
),
$group->getName());
$box_header[] = " \xC2\xBB ";
}
$box_header[] = $key; $box_header[] = $key;
$crumbs = $this->buildApplicationCrumbs(); $crumbs = $this->newCrumbs()
if ($group) { ->addTextCrumb($key, '/config/edit/'.$key);
$crumbs->addTextCrumb($group->getName(), $group_uri);
}
$crumbs->addTextCrumb($key, '/config/edit/'.$key);
$crumbs->setBorder(true);
$form_box = $this->buildConfigBoxView($box_header, $form, $tag); $form_box = $this->buildConfigBoxView($box_header, $form, $tag);
@ -230,9 +215,6 @@ final class PhabricatorConfigEditController
new PhabricatorConfigTransactionQuery()); new PhabricatorConfigTransactionQuery());
$timeline->setShouldTerminate(true); $timeline->setShouldTerminate(true);
$nav = $this->buildSideNavView();
$nav->selectFilter($group_uri);
$header = $this->buildHeaderView($title); $header = $this->buildHeaderView($title);
$view = id(new PHUITwoColumnView()) $view = id(new PHUITwoColumnView())
@ -249,7 +231,6 @@ final class PhabricatorConfigEditController
return $this->newPage() return $this->newPage()
->setTitle($title) ->setTitle($title)
->setCrumbs($crumbs) ->setCrumbs($crumbs)
->setNavigation($nav)
->appendChild($view); ->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 <?php
final class PhabricatorConfigHistoryController final class PhabricatorConfigSettingsHistoryController
extends PhabricatorConfigController { extends PhabricatorConfigSettingsController {
public function handleRequest(AphrontRequest $request) { public function handleRequest(AphrontRequest $request) {
$viewer = $request->getViewer(); $viewer = $request->getViewer();
@ -27,12 +27,10 @@ final class PhabricatorConfigHistoryController
$title = pht('Settings History'); $title = pht('Settings History');
$header = $this->buildHeaderView($title); $header = $this->buildHeaderView($title);
$nav = $this->buildSideNavView(); $nav = $this->newNavigation('history');
$nav->selectFilter('history/');
$crumbs = $this->buildApplicationCrumbs() $crumbs = $this->newCrumbs()
->addTextCrumb($title) ->addTextCrumb($title);
->setBorder(true);
$content = id(new PHUITwoColumnView()) $content = id(new PHUITwoColumnView())
->setHeader($header) ->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') $this->newIssue('aphlict.connect')
->setShortName(pht('Notification Server Down')) ->setShortName(pht('Notification Server Down'))
->setName(pht('Unable to Connect to Notification Server')) ->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) ->setMessage($message)
->addRelatedPhabricatorConfig('notification.servers') ->addRelatedPhabricatorConfig('notification.servers')
->addCommand( ->addCommand(