- SecurityHeaders 中间件生成随机 nonce,注入 context - BuildPageData/BuildAdminPageData 将 CSPNonce 传递给模板 - 所有 19 个模板文件 <script> 标签添加 nonce 属性 - 移除所有内联事件处理(onclick/onerror),改用事件监听 - 移除所有 javascript:void(0) 链接,改用 # 号 + preventDefault - utils.js 添加全局 avatar 图片加载失败回退处理 - common.js 登出按钮添加 preventDefault - audit.js 关闭弹窗按钮改用事件监听
34 lines
1.2 KiB
HTML
34 lines
1.2 KiB
HTML
{{template "admin/layout/base.html" .}}
|
|
|
|
<div class="admin-page-header">
|
|
<h2>评论管理</h2>
|
|
</div>
|
|
|
|
<div class="admin-toolbar">
|
|
<input type="text" id="commentSearch" class="admin-search-input" placeholder="搜索评论内容、作者或文章标题..." />
|
|
<button id="commentSearchBtn" class="btn btn-secondary">搜索</button>
|
|
<button id="commentClearBtn" class="btn btn-secondary" style="display:none">清除</button>
|
|
</div>
|
|
|
|
<div class="admin-table-wrap" id="commentTableWrap">
|
|
<table class="admin-table">
|
|
<thead>
|
|
<tr>
|
|
<th style="width:60px">ID</th>
|
|
<th style="width:100px">作者</th>
|
|
<th>评论内容</th>
|
|
<th style="width:160px">所属文章</th>
|
|
<th style="width:140px">时间</th>
|
|
<th style="width:100px">操作</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody id="commentTableBody"></tbody>
|
|
</table>
|
|
</div>
|
|
|
|
<div class="admin-pagination" id="commentPagination"></div>
|
|
<div class="admin-loading" id="commentLoading" style="display:none">加载中...</div>
|
|
|
|
{{template "admin/layout/footer.html" .}}
|
|
<script src="/admin/static/js/comments.js?v={{assetV "/admin/static/js/comments.js"}}" nonce="{{.CSPNonce}}"></script>
|