feat(edit): P2 条目就地编辑 + P3 备份/审计/改密

- 迁移 v17:entry.updated_at(乐观锁)+ audit 表
- GET/PATCH /api/items/{key}:字段编辑、标签替换、409 冲突、400 校验
- 详情页 [编辑] → Drawer 表单(标题/简介/标签/评价/正文/封面/跳转),保存后局部刷新
- GET /api/backup:VACUUM INTO 一致性快照,附件下载
- /admin 系统 Tab:修改密码(清空会话)、下载备份
- 审计:item.update / settings.update
- 测试 46 passed(entries 4 例)
- 文档:ADMIN-PLAN P2/P3 记录、README
This commit is contained in:
stash
2026-10-29 12:59:21 +08:00
parent 9ae5a455c5
commit 8f688885ed
12 changed files with 865 additions and 12 deletions
@@ -15,6 +15,7 @@ type ArticleDetailViewProps = {
categoryId: string
categoryTitle: string
onNavigate: (href: string) => void
onEdit: () => void
}
export function ArticleDetailView({
@@ -22,6 +23,7 @@ export function ArticleDetailView({
categoryId,
categoryTitle,
onNavigate,
onEdit,
}: ArticleDetailViewProps) {
const meta = article.meta ?? ['2 年前', categoryTitle]
const crumbs = [
@@ -39,7 +41,7 @@ export function ArticleDetailView({
<header className="article-head">
<Title level={1} as="h2" className="article-heading">
{article.title}
<button type="button" className="item-edit" disabled title="编辑功能待接入">
<button type="button" className="item-edit" title="编辑文章" onClick={onEdit}>
[编辑]
</button>
</Title>