- 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
37 lines
877 B
PHP
Executable File
37 lines
877 B
PHP
Executable File
#!/usr/bin/env php
|
|
<?php
|
|
/**
|
|
* Test script to verify NetBox API connectivity
|
|
*/
|
|
|
|
// Include the necessary configuration
|
|
require __DIR__ . '/config.php';
|
|
|
|
try {
|
|
// Create a NetBox client
|
|
$netboxClient = getNetBoxClient();
|
|
|
|
echo "Testing connection to NetBox at 192.168.1.144...\n";
|
|
|
|
// Test basic connectivity by fetching sites
|
|
$sites = $netboxClient->getSites();
|
|
|
|
echo "✓ Successfully connected to NetBox API\n";
|
|
echo "Available sites:\n";
|
|
|
|
if (!empty($sites['results'])) {
|
|
foreach ($sites['results'] as $site) {
|
|
echo " - {$site['name']} (ID: {$site['id']})\n";
|
|
}
|
|
} else {
|
|
echo " No sites found\n";
|
|
}
|
|
|
|
echo "✓ NetBox API integration is working\n";
|
|
|
|
} catch (Exception $e) {
|
|
echo "✗ NetBox API connection failed: " . $e->getMessage() . "\n";
|
|
exit(1);
|
|
}
|
|
|
|
?>
|