feat: 完成 issue #154 知识库管理页补充本地上传文档移除(模板资产只读保护)

This commit is contained in:
2026-08-05 10:41:48 +08:00
parent d181b4bfc8
commit 21d3654616
+12
View File
@@ -186,6 +186,18 @@ function renderKb() {
});
};
ops.appendChild(view);
// issue #154:仅本地上传的文档可移除(模板资产只读,引用溯源不可破坏)
if ((d.source || "").indexOf("upload/") === 0) {
var del = el("button", null, "移除");
del.style.marginLeft = "6px";
del.onclick = function () {
if (!confirm("移除文档「" + d.title + "」的本地索引?")) return;
save(KB_KEY, getKbDocs().filter(function (x) { return x.source !== d.source; }));
audit("delete", "kb_doc", d.source + " 移除本地索引");
renderKb();
};
ops.appendChild(del);
}
tr.appendChild(ops);
tbody.appendChild(tr);
});