feat(web): home media grid 2-up mobile / 3-up PC, 6 items, drop folder panel
This commit is contained in:
1 parent
b9c77ab7b8
commit
14a4cab48b
5 files changed
+8
-47
No files matched your search
@@ -43,29 +43,12 @@ function growthCard(item, index) {
|
||||
});
|
||||
}
|
||||
|
||||
function capacity(folders) {
|
||||
if (!folders.length) return "";
|
||||
return `<section class="panel capacity-panel">
|
||||
${sectionHeader("历史收藏夹")}
|
||||
<p class="section-note">系统已不再同步收藏夹;下列统计仅保留历史来源。</p>
|
||||
${folders.map((folder) => `
|
||||
<div class="capacity-row">
|
||||
<div class="capacity-label">
|
||||
<span>${escapeHtml(folder.title || String(folder.year))}</span>
|
||||
<strong>${formatCount(folder.media_count)} / ${formatCount(folder.capacity)}</strong>
|
||||
</div>
|
||||
<div class="capacity-track"><span style="width:${Math.min(100, folder.ratio * 100)}%"
|
||||
class="${folder.warning ? "warning" : ""}"></span></div>
|
||||
</div>`).join("")}
|
||||
</section>`;
|
||||
}
|
||||
|
||||
export async function renderHome(root) {
|
||||
const [overview, published, heat, growth] = await Promise.all([
|
||||
api("/api/overview"),
|
||||
api("/api/videos", { sort: "published", within_days: 14, limit: 5 }),
|
||||
api("/api/videos", { sort: "heat", limit: 5 }),
|
||||
api("/api/videos", { sort: "growth", growth_days: 7, limit: 5 }),
|
||||
api("/api/videos", { sort: "published", within_days: 14, limit: 6 }),
|
||||
api("/api/videos", { sort: "heat", limit: 6 }),
|
||||
api("/api/videos", { sort: "growth", growth_days: 7, limit: 6 }),
|
||||
]);
|
||||
|
||||
const pending = overview.counts.candidates_pending || 0;
|
||||
@@ -136,8 +119,6 @@ export async function renderHome(root) {
|
||||
${heatGrid(heat.items)}
|
||||
</section>
|
||||
|
||||
${capacity(overview.folders || [])}
|
||||
|
||||
<section class="panel status-panel">
|
||||
${sectionHeader("采集状态")}
|
||||
<div class="status-grid">
|
||||
|
||||
Reference in new issue
Block a user