can logging 멈춤 해결, 파일 정상 로깅

This commit is contained in:
2025-12-10 21:48:18 +00:00
parent f4a41a0414
commit 2d7368679d
2 changed files with 125 additions and 39 deletions

17
index.h
View File

@@ -26,7 +26,7 @@ const char index_html[] PROGMEM = R"rawliteral(
}
.header {
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
color: #666;
color: white;
padding: 20px;
text-align: center;
}
@@ -883,7 +883,7 @@ const char index_html[] PROGMEM = R"rawliteral(
const modeNames = {0: 'NORMAL (TX/RX+ACK)', 1: 'LISTEN-ONLY (RX)', 2: 'LOOPBACK', 3: 'TRANSMIT-ONLY (TX)'};
let currentLoggingFile = '';
let commentingFile = '';
let hasInitialSync = false;
// hasInitialSync 제거 - 매번 자동 동기화
function updateCurrentTime() {
const now = new Date();
@@ -943,11 +943,18 @@ const char index_html[] PROGMEM = R"rawliteral(
document.getElementById('sync-status').textContent = '';
document.getElementById('sync-status').style.color = '#38ef7d';
if (!hasInitialSync) {
// ⭐⭐⭐ 자동 시간 동기화 (1분에 1회로 제한)
const now = Date.now();
const lastSync = parseInt(localStorage.getItem('lastTimeSync') || '0');
if (now - lastSync > 60000) { // 1분 이상 경과
setTimeout(function() {
syncTimeFromPhone();
hasInitialSync = true;
}, 500);
localStorage.setItem('lastTimeSync', now.toString());
console.log('Auto time sync on connect');
}, 100);
} else {
console.log('Skipping time sync (last sync was recent)');
}
// ⭐ WebSocket 연결되면 즉시 파일 목록 요청