Fix issues from code review
- Fix project root path in test_webgui.py - Remove debug console.log from loadConfig in app.js - Remove duplicate screenshot button event listener in app.js - Fix redundant directory changes in startup batch script - Add trailing newlines to files
This commit is contained in:
1 parent
7eb72bd00e
commit
8368f1f3b7
4 files changed
+3
-37
No files matched your search
@@ -623,15 +623,11 @@ function collectConfigFromUI() {
|
||||
}
|
||||
|
||||
async function loadConfig() {
|
||||
console.log('[DEBUG] loadConfig called');
|
||||
try {
|
||||
const cfg = await apiGet("/api/config");
|
||||
console.log('[DEBUG] Config loaded:', Object.keys(cfg).length, 'keys');
|
||||
applyConfigToUI(cfg);
|
||||
console.log('[DEBUG] Config applied to UI');
|
||||
appendLog(["[WEB] 配置已加载"]);
|
||||
} catch (e) {
|
||||
console.error('[DEBUG] loadConfig error:', e);
|
||||
appendLog(["[WEB] 配置加载失败: " + e.message]);
|
||||
}
|
||||
}
|
||||
@@ -1173,28 +1169,6 @@ window.addEventListener("DOMContentLoaded", async () => {
|
||||
$("btnStart").addEventListener("click", async () => { await startRun(); });
|
||||
$("btnStop").addEventListener("click", async () => { await stopRun(); });
|
||||
|
||||
// 截图按钮
|
||||
$("btnScreenshot").addEventListener("click", async () => {
|
||||
const deviceId = $("device").value || "";
|
||||
if (!deviceId) {
|
||||
appendLog(["[截图] 请先选择设备"]);
|
||||
return;
|
||||
}
|
||||
try {
|
||||
appendLog(["[截图] 正在截图..."]);
|
||||
const result = await apiPost("/api/screenshot", { device_id: deviceId });
|
||||
if (result.ok) {
|
||||
appendLog(["[截图] 截图成功,已保存到 pic/screenshot.png"]);
|
||||
// 刷新截图显示
|
||||
pollShot();
|
||||
} else {
|
||||
appendLog([`[截图] 截图失败: ${result.error || "未知错误"}`]);
|
||||
}
|
||||
} catch (e) {
|
||||
appendLog([`[截图] 截图失败: ${e?.message || e}`]);
|
||||
}
|
||||
});
|
||||
|
||||
// 截图按钮
|
||||
$("btnScreenshot").addEventListener("click", async () => {
|
||||
const deviceId = $("device").value || "";
|
||||
|
||||
+1
-1
@@ -65,4 +65,4 @@
|
||||
testConfig();
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
</html>
|
||||
Reference in new issue
Block a user