fix(fw): M6.30 收编批5取色+蓝牙P2(audiod glibc-dynamic)+面板蓝牙卡 — 推卡+panel热更

This commit is contained in:
AskaEth committed 2026-09-03 21:44:23 +08:00
1 parent 4ecddb5ea3
commit ef6eca86b1
2 files changed
+36 -4

No files matched your search

+33 -1
View File
@@ -755,6 +755,38 @@
}
return homeCard('WiFi / DNS', '<div class="home-card-grid">' + rows + '</div>');
}
/* 蓝牙状态卡(M6.30):数据来自 overview 的 net.bt(netmgrd status pass-through)。
* 展示:蓝牙开关/已连接/已配对/本机地址/A2DP 编解码·采样率;输出目标(DAC|蓝牙)与音量控制(avrcp/dac)
* 依赖面板后端透传 audiod 的 target/volctl 键——当前 audio_fill 未透传,缺失时优雅降级为「—」(不谎报)。 */
function btCard() {
const nd = homeData && homeData.net;
const ad = homeData && homeData.audio;
let bt = nd && nd.bt;
if (!bt || !isAvail(nd)) return homeCard('蓝牙', homeUnavailable());
if (bt.available === false) return homeCard('蓝牙', '<div class="home-sub">无蓝牙</div>');
const on = !!bt.powered;
const conn = (bt.connected != null) ? bt.connected : 0;
let rows = '';
rows += homeKv('蓝牙', on ? '<span class="home-chip ok">已开启</span>' : '<span class="home-chip warn">已关闭</span>');
rows += homeKv('连接', conn > 0 ? ('<span class="home-chip ok">已连接 ' + esc(conn) + '</span>') : '<span class="home-chip mut">未连接</span>');
rows += homeKv('已配对', bt.paired != null ? esc(bt.paired) : '—');
if (bt.address) rows += homeKv('本机地址', esc(bt.address));
if (conn > 0) {
rows += homeKv('A2DP 编解码', bt.a2dp_codec ? esc(bt.a2dp_codec) : '—');
rows += homeKv('采样率', bt.a2dp_rate ? esc(bt.a2dp_rate) : '—');
} else {
rows += homeKv('A2DP 编解码', '<span class="home-chip mut">—</span>');
}
const target = ad && ad.target != null ? ad.target : null;
const volctl = ad && ad.volctl != null ? ad.volctl : null;
const targetName = target === 'bt' ? '蓝牙' : (target === 'dac' ? 'DAC' : null);
rows += homeKv('输出目标', targetName ? ('<span class="home-chip ' + (target === 'bt' ? 'ok' : 'mut') + '">' + esc(targetName) + '</span>') : '<span class="home-chip mut">—</span>');
rows += homeKv('音量控制', volctl ? esc(volctl) : '—');
if (ad && ad.vol != null && ad.vol >= 0) {
rows += homeKv('音量', esc(ad.vol) + ' %' + (volctl === 'avrcp' ? ' <span class="muted">(AVRCP)</span>' : ''));
}
return homeCard('蓝牙', '<div class="home-card-grid">' + rows + '</div>');
}
function healthCard() {
const ams = homeData && homeData.ams;
const svcd = homeData && homeData.svcd;
@@ -840,7 +872,7 @@
if (!homeData) { body.innerHTML = '<p class="placeholder">加载总览…</p>'; return; }
let h = powerSummaryCard() + eventsBar(); // 摘要条(功耗/事件)置顶
h += '<div class="home-grid">' +
deviceCard() + batteryCard() + audioCard() + netCard() + healthCard() + storageCard() + perfCard() +
deviceCard() + batteryCard() + audioCard() + netCard() + btCard() + healthCard() + storageCard() + perfCard() +
'</div>';
body.innerHTML = h;
const ad = homeData.audio;