feat: 完成 issue #154 知识库管理页补充本地上传文档移除(模板资产只读保护)
This commit is contained in:
@@ -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);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user