feat: 工具Tab新增应用版本管理(按包名并发查询所有设备安装版本)+ 文档同步更新(README/API/ARCHITECTURE/DEPLOY:工具Tab各工具、条件判断if_el+OCR、STF设备管理、.env密钥配置)
This commit is contained in:
@@ -350,6 +350,32 @@ function toggleClipDevice(cb){
|
||||
else _clipSelected.delete(cb.value);
|
||||
}
|
||||
|
||||
// ================== 工具:应用版本管理 ==================
|
||||
async function queryAppVers(){
|
||||
const pkg = document.getElementById('appver-pkg').value.trim();
|
||||
if(!pkg){showToast('请输入包名','error');return;}
|
||||
const btn = document.querySelector('#tools-sub-appver .btn-primary');
|
||||
btn.disabled = true; const old = btn.textContent; btn.textContent = '查询中...';
|
||||
try{
|
||||
const r = await apiPost('/api/tools/appver', {pkg});
|
||||
if(!r || !r.ok){showToast('查询失败: '+(r&&r.error||''),'error');return;}
|
||||
const rows = Object.entries(r.results||{}).map(([serial,v])=>{
|
||||
if(v.error)return '<tr><td style="font-family:monospace">'+esc(serial)+'</td>'+
|
||||
'<td><span class="label label-warning">查询失败</span></td><td colspan="2">'+esc(v.error)+'</td></tr>';
|
||||
if(v.installed)return '<tr><td style="font-family:monospace">'+esc(serial)+'</td>'+
|
||||
'<td><span class="label label-success">已安装</span></td>'+
|
||||
'<td>'+esc(v.version_name||'')+'</td><td style="font-family:monospace">'+esc(v.version_code||'')+'</td></tr>';
|
||||
return '<tr><td style="font-family:monospace">'+esc(serial)+'</td>'+
|
||||
'<td><span class="label label-default">未安装</span></td><td>-</td><td>-</td></tr>';
|
||||
}).join('');
|
||||
document.getElementById('tb-appver').innerHTML = rows || '<tr><td colspan="4" class="empty">无可用设备</td></tr>';
|
||||
document.getElementById('appver-status').textContent = '共 '+(r.total||0)+' 台设备'+(r.fail?','+r.fail+' 台查询失败':'');
|
||||
if(r.fail)showToast(r.fail+' 台设备查询失败,详见表格','error');
|
||||
} finally {
|
||||
btn.disabled = false; btn.textContent = old;
|
||||
}
|
||||
}
|
||||
|
||||
// ================== 工具:STF 设备管理 ==================
|
||||
async function loadStfDevMgmt(){
|
||||
const status = document.getElementById('stfdev-status');
|
||||
|
||||
Reference in New Issue
Block a user