- Organized 252 files across project - Root directory: 187 → 2 files (98.9% reduction) - Moved configuration guides to docs/04-configuration/ - Moved troubleshooting guides to docs/09-troubleshooting/ - Moved quick start guides to docs/01-getting-started/ - Moved reports to reports/ directory - Archived temporary files - Generated comprehensive reports and documentation - Created maintenance scripts and guides All files organized according to established standards.
43 lines
1.2 KiB
JavaScript
Executable File
43 lines
1.2 KiB
JavaScript
Executable File
#!/usr/bin/env node
|
|
/**
|
|
* Query Omada Controller for device with specific IP address
|
|
*/
|
|
|
|
// Try to load from omada-api if available
|
|
let OmadaClient, DevicesService;
|
|
try {
|
|
const omadaApi = await import('./omada-api/dist/index.js');
|
|
OmadaClient = omadaApi.OmadaClient;
|
|
DevicesService = omadaApi.DevicesService;
|
|
} catch (e) {
|
|
console.log('Omada API not available, will use direct HTTP query');
|
|
}
|
|
|
|
// Try common Omada controller IPs
|
|
const omadaIPs = ['192.168.11.8', '192.168.11.20', '192.168.11.103'];
|
|
const targetIP = '192.168.11.14';
|
|
|
|
console.log(`=== Searching Omada Controller for device with IP ${targetIP} ===\n`);
|
|
|
|
for (const ip of omadaIPs) {
|
|
console.log(`Trying Omada controller at ${ip}...`);
|
|
try {
|
|
const response = await fetch(`https://${ip}:8043`, {
|
|
method: 'GET',
|
|
rejectUnauthorized: false
|
|
});
|
|
if (response.ok) {
|
|
console.log(` ✓ Omada controller found at ${ip}`);
|
|
console.log(` Note: Full device query requires authentication`);
|
|
break;
|
|
}
|
|
} catch (e) {
|
|
console.log(` ✗ Not accessible: ${e.message}`);
|
|
}
|
|
}
|
|
|
|
console.log('\nTo query devices, you need:');
|
|
console.log(' 1. Omada controller URL');
|
|
console.log(' 2. Admin credentials');
|
|
console.log(' 3. Run: node query-omada-devices.js');
|