feat: download icon on webapp cards for auto-install
This commit is contained in:
@@ -483,6 +483,33 @@ body {
|
||||
color: var(--text-dim);
|
||||
}
|
||||
|
||||
/* 下载离线包图标(右下角,云端有离线包时显示) */
|
||||
/* Download-offline-package icon (bottom-right, shown when cloud has a package) */
|
||||
.wcell-dl {
|
||||
position: absolute;
|
||||
bottom: 6px;
|
||||
right: 6px;
|
||||
width: 26px;
|
||||
height: 26px;
|
||||
border-radius: 999px;
|
||||
background: var(--glass-bg);
|
||||
border: 1px solid var(--glass-border);
|
||||
color: var(--accent);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.wcell-dl svg {
|
||||
width: 14px;
|
||||
height: 14px;
|
||||
}
|
||||
|
||||
.wcell-dl:active {
|
||||
opacity: 0.6;
|
||||
}
|
||||
|
||||
/* webAPP 顶栏:浮层玻璃条 + 标签面板 */
|
||||
/* webapp topbar: floating glass bar + tab panel */
|
||||
/* 前台有 webapp 时隐藏 webapp 列表内容,避免半透明顶栏透出列表控件 */
|
||||
|
||||
@@ -29,6 +29,19 @@ window.loadWebAppList = async function () {
|
||||
tag.className = 'tag';
|
||||
tag.textContent = a.offline ? '离线' : '在线';
|
||||
btn.append(img, lbl, tag);
|
||||
// 云端有离线包 → 加下载图标(点击自动拉取安装)
|
||||
// Cloud has an offline package -> add a download icon (tap to auto-install)
|
||||
if (a.offline) {
|
||||
const dl = document.createElement('span');
|
||||
dl.className = 'wcell-dl';
|
||||
dl.title = '下载离线包';
|
||||
dl.innerHTML = '<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M12 3v12"/><path d="M7 10l5 5 5-5"/><path d="M5 21h14"/></svg>';
|
||||
dl.onclick = (e) => {
|
||||
e.stopPropagation();
|
||||
bridge.call('updateOfflinePackage', a.id).then(() => refreshList()).catch(() => {});
|
||||
};
|
||||
btn.appendChild(dl);
|
||||
}
|
||||
btn.onclick = () => bridge.call('openWebApp', btn.dataset.id);
|
||||
setupLongPress(btn, a);
|
||||
grid.appendChild(btn);
|
||||
|
||||
Reference in New Issue
Block a user