Files
server-manager/public/index.php
Agent 88f3c1f964 refactor: extract inline CSS/JS from views into separate asset files (20+ files)
Phase A — HTML removed from PHP files:
- RateLimitMiddleware.php: heredoc moved to views/errors/429.php
- public/index.php: inline HTML replaced with View::error()
- AuthMiddleware.php: <script> redirect replaced with <meta refresh>

Phase B — Inline CSS/JS extracted from views:
- CSS: landing.css (459 lines), legal.css (shared by terms+privacy)
- JS: 17 new files extracted from ~20 view files
  - main.js (layout sidebar + notifications)
  - dashboard-chart.js, server-show.js, server-services.js
  - nginx-manager.js, database-manager.js
  - terminal.js, team-show.js, team-index.js
  - server-list.js, server-permissions.js (shared by edit+create)
  - server-ssl.js, server-processes.js, system-users.js
  - admin-users.js, audit-log.js, admin-notifications.js, admin-security.js
  - notifications.js

Total: -3264 lines from views, +288 lines in new assets
2026-06-14 08:04:01 -04:00

32 lines
700 B
PHP
Executable File

<?php
declare(strict_types=1);
if (PHP_VERSION_ID < 80300) {
http_response_code(500);
die('ServerManager requires PHP 8.3 or higher.');
}
if (!file_exists(dirname(__DIR__) . '/vendor/autoload.php')) {
http_response_code(500);
die('Dependencies not installed. Run: composer install');
}
require_once dirname(__DIR__) . '/vendor/autoload.php';
use ServerManager\Core\App;
try {
$app = App::getInstance();
$app->boot(dirname(__DIR__));
$app->run();
} catch (\Throwable $e) {
http_response_code(500);
if (isset($app)) {
$app->getView()->error(500);
}
echo '<h1>500 Internal Server Error</h1>';
echo '<p>An unexpected error occurred.</p>';
}