refactor(system-info): reduce to Stripe-style status page
Reduce admin/system-info to a single focused status view: overall status banner, components list from existing health checks, and an environment meta table. Drops the Modules and Permissions tabs — those were dev-diagnostics already available via CLI. - Remove SystemInfoService + its test; wire the action directly to SystemHealthService and build meta inline - Extend SystemHealthService with per-check label + description so the UI speaks in customer terms while the CLI doctor path stays compatible - Rebuild the view on existing app-stats-table + app-empty-state primitives; add a small app-status-banner component for the headline signal - Align help-center nav label and i18n keys (de/en) Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -2,20 +2,44 @@
|
||||
|
||||
use MintyPHP\Buffer;
|
||||
use MintyPHP\Service\Access\OperationsAuthorizationPolicy;
|
||||
use MintyPHP\Service\System\SystemInfoService;
|
||||
use MintyPHP\Service\System\SystemHealthService;
|
||||
use MintyPHP\Support\Guard;
|
||||
|
||||
Guard::requireAbilityOrForbidden(OperationsAuthorizationPolicy::ABILITY_ADMIN_SYSTEM_INFO_VIEW);
|
||||
|
||||
$pageData = app(SystemInfoService::class)->buildPageData();
|
||||
$overview = $pageData['overview'] ?? [];
|
||||
$modules = $pageData['modules'] ?? [];
|
||||
$permissions = $pageData['permissions'] ?? [];
|
||||
$healthChecks = $overview['health_checks'] ?? [];
|
||||
$checks = app(SystemHealthService::class)->runAll();
|
||||
|
||||
Buffer::set('title', t('System Info'));
|
||||
$overall = 'ok';
|
||||
foreach ($checks as $check) {
|
||||
if ($check['status'] === 'fail') {
|
||||
$overall = 'fail';
|
||||
break;
|
||||
}
|
||||
if ($check['status'] === 'warn') {
|
||||
$overall = 'warn';
|
||||
}
|
||||
}
|
||||
|
||||
$environment = 'unknown';
|
||||
if (defined('APP_ENV')) {
|
||||
$environment = (string) constant('APP_ENV');
|
||||
} else {
|
||||
$envVar = getenv('APP_ENV');
|
||||
if (is_string($envVar) && $envVar !== '') {
|
||||
$environment = $envVar;
|
||||
}
|
||||
}
|
||||
|
||||
$meta = [
|
||||
'php_version' => PHP_VERSION,
|
||||
'environment' => $environment,
|
||||
];
|
||||
|
||||
$lastChecked = date('Y-m-d H:i:s');
|
||||
|
||||
Buffer::set('title', t('System status'));
|
||||
|
||||
$breadcrumbs = [
|
||||
['label' => t('Home'), 'path' => 'admin'],
|
||||
['label' => t('System Info')],
|
||||
['label' => t('System status')],
|
||||
];
|
||||
|
||||
Reference in New Issue
Block a user