- Split single-page into 3 pages: - index.php: product catalog with VM size cards - create.php: order form (name, domain, description) - requests.php: request history with pagination - Rewrite NetBox integration to create Virtual Machines (/virtualization/virtual-machines/) instead of DCIM devices - Add netbox_integration/netbox_api.php: NetBoxClient with createVirtualMachine(), findCluster(), findTag(), getList() - Generate new sleek product-card images (420x280) with aligned spec boxes (vcpus/ram/disk) - Add webshop CSS: product cards, nav links, hero section, order layout, responsive grid - Update redirects: send.php -> requests.php, cancel.php -> requests.php - Update E2E test for new page structure - Add .gitignore, deploy-local.sh, setup_database.sql to repo
28 lines
651 B
PHP
Executable File
28 lines
651 B
PHP
Executable File
<?php
|
|
declare(strict_types=1);
|
|
|
|
header('Content-Type: application/json; charset=utf-8');
|
|
|
|
$response = [
|
|
'status' => 'ok',
|
|
'php_version' => PHP_VERSION,
|
|
'database' => 'connected',
|
|
'timestamp' => date(DATE_ATOM),
|
|
];
|
|
|
|
try {
|
|
require __DIR__ . '/config.php';
|
|
db()->query('SELECT 1')->fetch();
|
|
http_response_code(200);
|
|
} catch (Throwable $e) {
|
|
http_response_code(500);
|
|
$response = [
|
|
'status' => 'error',
|
|
'database' => 'unavailable',
|
|
'message' => $e->getMessage(),
|
|
'timestamp' => date(DATE_ATOM),
|
|
];
|
|
}
|
|
|
|
echo json_encode($response, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES) . PHP_EOL;
|