🎨 数据快照 - 本地快照显示文件类型 https://github.com/siyuan-note/siyuan/issues/6870

This commit is contained in:
Liang Ding 2022-12-14 14:47:15 +08:00
parent fc8d451e7c
commit 26a11dc3d0
No known key found for this signature in database
GPG key ID: 136F30F901A2231D
4 changed files with 68 additions and 4 deletions

View file

@ -86,7 +86,7 @@ const renderRepoItem = (response: IWebSocketData, element: Element, type: string
<span class="b3-list-item__action b3-tooltips b3-tooltips__w" data-type="rollback" aria-label="${window.siyuan.languages.rollback}"><svg><use xlink:href="#iconUndo"></use></svg></span>`;
}
let repoHTML = "";
response.data.snapshots.forEach((item: { memo: string, id: string, hCreated: string, count: number, hSize: string, tag: string }) => {
response.data.snapshots.forEach((item: { memo: string, id: string, hCreated: string, count: number, hSize: string, tag: string, typesCount: { type: string, count: number }[] }) => {
if (isMobile()) {
repoHTML += `<li class="b3-list-item b3-list-item--two">
<div class="b3-list-item__first">
@ -111,6 +111,11 @@ const renderRepoItem = (response: IWebSocketData, element: Element, type: string
<span class="ft__smaller ft__on-surface">${item.hCreated}</span>
<span class="b3-list-item__meta">${window.siyuan.languages.fileSize} ${item.hSize}</span>
<span class="b3-list-item__meta">${window.siyuan.languages.fileCount} ${item.count}</span>
<span class="b3-list-item__meta">
${item.typesCount.map((type: { type: string, count: number }) => {
return `${type.type} ${type.count}`;
}).join(" ")}
</span>
</div>
</div>
${actionHTML}