디바이스 ID: ${data.deviceId}
온도: ${data.temperature}°C
습도: ${data.humidity}%
위도: ${data.latitude}
경도: ${data.longitude}
수신 시간: ${new Date(data.receivedTime).toLocaleString()}
`;
}
async loadDeviceList() {
try {
const response = await fetch('/api/devices');
if (response.ok) {
const devices = await response.json();
this.displayDeviceList(devices);
}
} catch (error) {
console.error('Error loading device list:', error);
}
}
displayDeviceList(devices) {
const container = document.getElementById('deviceList');
const table = `