fix: dual id/name matching for installed + console.error on all catches

This commit is contained in:
2026-07-27 09:31:26 +08:00
parent 1c73ec9db6
commit e3afb2ac9b
6 changed files with 9 additions and 9 deletions
+1 -1
View File
@@ -21,7 +21,7 @@ const Topbar = {
this._statusEl.className = `status-indicator ${wsStatus}`;
this._statusEl.querySelector('.status-text').textContent =
wsStatus === 'connected' ? `已连接 (${status.ws_clients})` : '未连接';
} catch (e) {}
} catch (e) { console.error(e); }
}
};
+1 -1
View File
@@ -42,7 +42,7 @@ const PageDebug = {
if (el) el.innerHTML = data.lines.map(l =>
`<span style="color:${l.includes('ERROR')?'red':l.includes('WARNING')?'#f90':l.includes('INFO')?'#888':'#555'}">${l}</span>`
).join('\n');
} catch (e) {}
} catch (e) { console.error(e); }
});
},
+4 -4
View File
@@ -35,17 +35,17 @@ const PageMarket = {
const data = await res.json();
const items = data.items || [];
let localIds = [];
let localIds = [], localNames = [];
try {
const lr = await fetch('/api/dashboards?category=all');
const ld = await lr.json();
if (Array.isArray(ld)) localIds = ld.map(d => d.id);
if (Array.isArray(ld)) { localIds = ld.map(d => d.id); localNames = ld.map(d => d.name); }
if (isScene) {
const sr = await fetch('/api/scenes');
const sl = await sr.json();
if (Array.isArray(sl)) localIds = localIds.concat(sl.map(s => s.id));
if (Array.isArray(sl)) { localIds = localIds.concat(sl.map(s => s.id)); localNames = localNames.concat(sl.map(s => s.name)); }
}
} catch(e) {}
} catch(e) { console.error('load local:', e); }
if (!items.length) { grid.innerHTML = this._emptyHtml(isScene ? '暂无场景' : '暂无仪表盘'); return; }
grid.innerHTML = items.map(d => {
+1 -1
View File
@@ -20,7 +20,7 @@ const PageRecord = {
const size = f.size > 1048576 ? (f.size/1048576).toFixed(1)+'MB' : (f.size/1024).toFixed(1)+'KB';
return '<div class="glass-card" style="padding:10px 14px;margin-bottom:6px;display:flex;align-items:center;justify-content:space-between;gap:8px;flex-wrap:wrap"><span style="font-size:12px;flex:1;min-width:150px">' + f.name + '</span><span style="font-size:11px;color:var(--text-tertiary)">' + size + '</span><button class="btn btn-sm btn-primary btn-play-rec" data-file="' + f.name + '">播放</button><a class="btn btn-sm btn-secondary" href="/api/recording/' + f.name + '/export" download>导出</a><button class="btn btn-sm btn-danger btn-del-rec" data-file="' + f.name + '">删除</button></div>';
}).join('');
} catch (e) {}
} catch (e) { console.error(e); }
},
_bindEvents() {
+1 -1
View File
@@ -216,7 +216,7 @@ const PageSettings = {
Toast.show('回放已开始', 'success');
});
});
} catch (e) {}
} catch (e) { console.error(e); }
},
_gamePortListHtml(games, cfg) {
+1 -1
View File
@@ -36,7 +36,7 @@ const WS = {
if (msg.type === 'telemetry') {
this._emit('telemetry', msg.data);
}
} catch (e) {}
} catch (e) { console.error(e); }
};
this._ws.onclose = () => {