页面新å新增展示上传人

This commit is contained in:
luke 2025-06-20 01:37:28 +08:00
parent 89c229fd28
commit e0e87c09b9
2 changed files with 5 additions and 1 deletions

View File

@ -179,6 +179,7 @@ document.addEventListener("DOMContentLoaded", async () => {
const filename = doc.filename || doc.title || "未知文件"; const filename = doc.filename || doc.title || "未知文件";
const filepath = doc.filepath?.replace(/^import-data\//, "").replace(/\.md$/, ".html") || ""; const filepath = doc.filepath?.replace(/^import-data\//, "").replace(/\.md$/, ".html") || "";
const mtime = doc.mtime ? formatLocalTime(doc.mtime) : ""; // 格式化时间 const mtime = doc.mtime ? formatLocalTime(doc.mtime) : ""; // 格式化时间
const uploader = doc.uploader ? doc.uploader : "管理员";
const link = document.createElement("a"); const link = document.createElement("a");
link.href = doc.url ? doc.url : `${fileBaseUrl}/${filepath || filename}`; link.href = doc.url ? doc.url : `${fileBaseUrl}/${filepath || filename}`;
link.target = "_blank"; link.target = "_blank";
@ -194,6 +195,7 @@ document.addEventListener("DOMContentLoaded", async () => {
metaRow.innerHTML = ` metaRow.innerHTML = `
<span class="es-filepath" title="${filepath}">${filepath}</span> <span class="es-filepath" title="${filepath}">${filepath}</span>
<span class="es-updatetime">${mtime ? "更新时间:" + mtime : ""}</span> <span class="es-updatetime">${mtime ? "更新时间:" + mtime : ""}</span>
<span class="es-uploader">${mtime ? "上传人:" + uploader : ""}</span>
`; `;
li.appendChild(link); li.appendChild(link);

View File

@ -118,4 +118,6 @@
.es-updatetime { .es-updatetime {
margin-left: 10px; margin-left: 10px;
} }
.es-uploader {
margin-left: 10px;
}