Upload files to "/"
This commit is contained in:
@@ -279,6 +279,46 @@ const char serial_terminal_html[] PROGMEM = R"rawliteral(
|
||||
font-size: 0.8em;
|
||||
}
|
||||
}
|
||||
|
||||
/* 파일 형식 선택 라디오 버튼 스타일 */
|
||||
.format-selector {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 15px;
|
||||
background: #f8f9fa;
|
||||
padding: 10px 15px;
|
||||
border-radius: 8px;
|
||||
border: 2px solid #667eea;
|
||||
margin-bottom: 15px;
|
||||
}
|
||||
|
||||
.format-selector label {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 5px;
|
||||
cursor: pointer;
|
||||
font-weight: 600;
|
||||
color: #2c3e50;
|
||||
font-size: 0.95em;
|
||||
transition: all 0.3s;
|
||||
}
|
||||
|
||||
.format-selector label:hover {
|
||||
color: #667eea;
|
||||
}
|
||||
|
||||
.format-selector input[type="radio"] {
|
||||
width: 18px;
|
||||
height: 18px;
|
||||
cursor: pointer;
|
||||
accent-color: #667eea;
|
||||
}
|
||||
|
||||
.format-info {
|
||||
font-size: 0.8em;
|
||||
color: #7f8c8d;
|
||||
margin-left: 5px;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
@@ -361,6 +401,21 @@ const char serial_terminal_html[] PROGMEM = R"rawliteral(
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Serial 로깅 형식 선택 -->
|
||||
<div class="format-selector">
|
||||
<label style="font-weight: 700; color: #2c3e50;">📁 Log File Format:</label>
|
||||
<label>
|
||||
<input type="radio" name="serial-format" value="csv" checked>
|
||||
<span>📄 CSV</span>
|
||||
<span class="format-info">(Text - Easy to Read)</span>
|
||||
</label>
|
||||
<label>
|
||||
<input type="radio" name="serial-format" value="bin">
|
||||
<span>📦 BIN</span>
|
||||
<span class="format-info">(Binary - Fast)</span>
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<!-- 버튼 그룹 -->
|
||||
<div class="btn-group" style="margin-bottom: 20px;">
|
||||
<button class="btn btn-primary" onclick="applySerialConfig()">Apply Settings</button>
|
||||
@@ -484,18 +539,35 @@ const char serial_terminal_html[] PROGMEM = R"rawliteral(
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function toggleSerialLogging() {
|
||||
if (ws && ws.readyState === WebSocket.OPEN) {
|
||||
if (serialLogging) {
|
||||
// 로깅 중지
|
||||
ws.send(JSON.stringify({cmd: 'stopSerialLogging'}));
|
||||
} else {
|
||||
ws.send(JSON.stringify({cmd: 'startSerialLogging'}));
|
||||
// 선택된 형식 가져오기
|
||||
let serialFormat = 'csv'; // 기본값
|
||||
const formatRadios = document.getElementsByName('serial-format');
|
||||
for (const radio of formatRadios) {
|
||||
if (radio.checked) {
|
||||
serialFormat = radio.value;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// 로깅 시작 명령 전송
|
||||
ws.send(JSON.stringify({
|
||||
cmd: 'startSerialLogging',
|
||||
format: serialFormat
|
||||
}));
|
||||
|
||||
console.log('Start serial logging: format=' + serialFormat);
|
||||
}
|
||||
serialLogging = !serialLogging;
|
||||
updateLoggingUI();
|
||||
}
|
||||
}
|
||||
|
||||
function updateLoggingUI() {
|
||||
const btn = document.getElementById('log-btn');
|
||||
const indicator = btn.querySelector('.status-indicator');
|
||||
|
||||
Reference in New Issue
Block a user