feat: check-update diff report and list refresh
This commit is contained in:
@@ -234,9 +234,13 @@ function setupCheckUpdate(page) {
|
||||
item.onclick = () => {
|
||||
state.textContent = '检查中…';
|
||||
bridge.call('refreshManifest').then(result => {
|
||||
let n = 0;
|
||||
try { n = JSON.parse(result).count || 0; } catch (e) {}
|
||||
state.textContent = n > 0 ? '已更新 ' + n + ' 个 ›' : '无更新 ›';
|
||||
let r = { added: 0, removed: 0, changed: 0 };
|
||||
try { r = JSON.parse(result); } catch (e) {}
|
||||
const parts = [];
|
||||
if (r.added > 0) parts.push('新增 ' + r.added);
|
||||
if (r.removed > 0) parts.push('移除 ' + r.removed);
|
||||
if (r.changed > 0) parts.push('更新 ' + r.changed);
|
||||
state.textContent = parts.length ? parts.join(',') + ' ›' : '无更新 ›';
|
||||
}).catch(() => {
|
||||
state.textContent = '失败 ›';
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user