restrict v6

This commit is contained in:
tamakyi
2026-10-18 22:18:21 +08:00
parent d14d26df17
commit bd81398a06
18 changed files with 621 additions and 10 deletions
+72
View File
@@ -0,0 +1,72 @@
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta name="format-detection" content="email=no"/>
<meta name="format-detection" content="date=no"/>
</head>
<body style="margin: 0; padding: 0;" bgcolor="#FFFFFF">
<table width="100%" height="100%" style="min-width: 348px;" border="0" cellspacing="0" cellpadding="0" lang="zh-CN">
<tbody>
<tr height="32" style="height: 32px;">
<td></td>
</tr>
<tr align="center">
<td>
<table border="0" cellspacing="0" cellpadding="0"
style="padding-bottom: 20px;max-width: 516px;min-width: 220px;">
<tbody>
<tr>
<td width="8" style="width: 8px;"></td>
<td>
<div style="border-style: solid; border-width: thin; border-color:#dadce0; border-radius: 8px; padding: 40px 20px;"
align="center">
<div style="font-family: 'Google Sans',Roboto,RobotoDraft,Helvetica,Arial,sans-serif;border-bottom: thin solid #dadce0; color: rgba(0,0,0,0.87); line-height: 32px; padding-bottom: 24px;text-align: center; word-break: break-word;">
<div style="font-size: 24px;">
某箱主收到集中举报
</div>
<div style="font-size: 13px; color: rgba(0,0,0,0.54); margin-top: 6px;">
{{.time}}
</div>
</div>
<div style="font-family: Roboto-Regular,Helvetica,Arial,sans-serif; font-size: 14px; color: rgba(0,0,0,0.87); line-height: 22px; padding-top: 20px; text-align: left;">
<div style="padding: 12px 14px; border-radius: 6px; background-color: #fdecea; border: 1px solid #f5c6cb; margin-bottom: 14px;">
<div><b>箱主:</b>{{.name}}(@{{.domain}})</div>
<div style="margin-top: 4px;"><b>近 24 小时:</b>{{.count24}} 条待处理举报</div>
<div style="margin-top: 4px;"><b>近 7 天:</b>{{.count7d}} 条待处理举报</div>
</div>
<div style="font-size: 13px; color: rgba(0,0,0,0.54);">查看证据:</div>
<div style="font-family: monospace; font-size: 12px; color: #333; background-color: #f7f7f7; padding: 10px 12px; border-radius: 6px; margin-top: 6px; word-break: break-all;">
TamaBox reports --domain {{.domain}}
</div>
<div style="font-size: 13px; color: rgba(0,0,0,0.54); margin-top: 12px;">如需处置:</div>
<div style="font-family: monospace; font-size: 12px; color: #333; background-color: #f7f7f7; padding: 10px 12px; border-radius: 6px; margin-top: 6px; word-break: break-all;">
TamaBox restrict --domain {{.domain}} --level L1 --days 7 --reason "组织挂人"
</div>
<div style="font-size: 12px; color: rgba(0,0,0,0.54); margin-top: 12px;">
这是一封阈值告警,不是自动处置:举报数达到阈值只代表「需要人看一眼」。
请结合 reports 输出判断是偶发摩擦还是组织化挂人,并对互殴情形做双向取证。
</div>
</div>
</div>
<div style="text-align: left;">
<div style="font-family: Roboto-Regular,Helvetica,Arial,sans-serif;color: rgba(0,0,0,0.54);font-size: 11px; line-height: 18px; padding-top: 12px; text-align: center;">
<div>
此邮件由系统自动发送,请勿直接回复。<br/>
{{ .year }} 狼的提问箱
</div>
</div>
</div>
</td>
<td width="8" style="width: 8px;"></td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr height="32" style="height: 32px;">
<td></td>
</tr>
</tbody>
</table>
</body>
</html>
+19
View File
@@ -85,6 +85,25 @@
{{ end }}
</div>
<p class="uk-text-small uk-text-right uk-text-muted">{{t .LangCode "qitem.answeredBy" .PageUser.Name (Date .Question.UpdatedAt "Y-m-d H:i:s")}}</p>
{{ if not .CanDelete }}
<!-- 举报入口:仅对非箱主显示;默认折叠,避免在每条回答下方都堆一个显眼按钮。
理由为固定枚举(不接受自由文本),重复举报服务端幂等处理。 -->
<div class="uk-margin-small-top">
<details>
<summary class="uk-text-small uk-text-muted" style="cursor: pointer;">⚑ {{t .LangCode "report.entry"}}</summary>
<form method="post" action="/_/{{ .PageUser.Domain }}/{{ .Question.ID }}/report" class="uk-margin-small-top uk-flex uk-flex-middle uk-flex-wrap" style="gap: 8px;">
{{ .CSRFTokenHTML }}
<select name="reason" class="uk-select uk-form-small" style="max-width: 200px;">
<option value="harassment">{{t .LangCode "report.reason.harassment"}}</option>
<option value="doxxing">{{t .LangCode "report.reason.doxxing"}}</option>
<option value="divisive">{{t .LangCode "report.reason.divisive"}}</option>
<option value="other">{{t .LangCode "report.reason.other"}}</option>
</select>
<button type="submit" class="uk-button uk-button-default uk-button-small">{{t .LangCode "report.submit"}}</button>
</form>
</details>
</div>
{{ end }}
<!-- 分享此提问(左)与 更新回答(右)一左一右分开;箱主未登录(无更新回答按钮)时分享按钮居中;编辑区在下方由 tbToggleAnswerEditor 控制 -->
<div class="uk-flex uk-flex-middle uk-flex-wrap uk-margin-small-top {{ if not .CanDelete }}uk-flex-center{{ end }}" style="gap: 8px;">
{{ if and (not .Question.IsPrivate) (ne .Question.Answer "") }}
+3
View File
@@ -259,6 +259,9 @@
{{ if not .IsAnswered }}
<span class="uk-label qlist-pill" title="{{t $.LangCode "qlist.unanswered"}}"><span class="tb-short">{{t $.LangCode "qlist.unansweredShort"}}</span><span class="tb-text">{{t $.LangCode "qlist.unanswered"}}</span></span>
{{ end }}
{{ if gt .ReportCount 0 }}
<span class="uk-label uk-label-danger qlist-pill" title="{{t $.LangCode "qlist.reported" .ReportCount}}"><span class="tb-short">{{t $.LangCode "qlist.reportedShort" .ReportCount}}</span><span class="tb-text">{{t $.LangCode "qlist.reported" .ReportCount}}</span></span>
{{ end }}
{{ if .IsRead }}
<span class="uk-label uk-label-success qlist-pill" title="{{t $.LangCode "qlist.read"}}"><span class="tb-short">{{t $.LangCode "qlist.readShort"}}</span><span class="tb-text">{{t $.LangCode "qlist.read"}}</span></span>
{{ else }}