Files
Strix/webui/web/js/api/probe.js
T
eduard256 fe93aa329c Integrate probe endpoint into frontend
- Add ProbeAPI client (js/api/probe.js)
- Add reusable modal component (js/ui/modal.js) with overlay, animations
- Call GET /api/v1/probe after Check Address click
- Auto-fill Camera Model with vendor from ARP/OUI lookup
- Show modal on unreachable device with Change IP / Continue Anyway buttons
- Add modal CSS styles matching existing dark theme
2026-03-16 20:05:00 +00:00

25 lines
670 B
JavaScript

export class ProbeAPI {
constructor(baseURL = '') {
this.baseURL = baseURL;
}
/**
* Probe a device at the given IP address.
* Returns device info: reachable status, vendor, hostname, mDNS data.
* @param {string} ip - IP address to probe
* @returns {Promise<Object>} Probe response
*/
async probe(ip) {
const response = await fetch(
`${this.baseURL}api/v1/probe?ip=${encodeURIComponent(ip)}`
);
if (!response.ok) {
const text = await response.text();
throw new Error(text || `HTTP ${response.status}`);
}
return await response.json();
}
}