replace screenshot pipeline and update admin
This commit is contained in:
@@ -6,6 +6,7 @@ import {
|
||||
banIp,
|
||||
banUser,
|
||||
cleanup,
|
||||
clearIpRisk,
|
||||
getBannedIps,
|
||||
getBannedUsers,
|
||||
getDashboard,
|
||||
@@ -381,6 +382,35 @@ async function unbanFromRisk() {
|
||||
}
|
||||
}
|
||||
|
||||
async function clearIpRiskScore() {
|
||||
if (riskResultKind.value !== 'ip') return
|
||||
const ipText = String(riskResult.value?.ip || '').trim()
|
||||
if (!ipText) return
|
||||
|
||||
try {
|
||||
await ElMessageBox.confirm(
|
||||
`确定清除 IP ${ipText} 的风险分吗?\n\n清除风险分不会删除威胁历史,也不会解除封禁。`,
|
||||
'清除风险分',
|
||||
{ confirmButtonText: '清除', cancelButtonText: '取消', type: 'warning' },
|
||||
)
|
||||
} catch {
|
||||
return
|
||||
}
|
||||
|
||||
if (riskLoading.value) return
|
||||
riskLoading.value = true
|
||||
try {
|
||||
await clearIpRisk(ipText)
|
||||
ElMessage.success('IP风险分已清零')
|
||||
} catch {
|
||||
// handled by interceptor
|
||||
} finally {
|
||||
riskLoading.value = false
|
||||
}
|
||||
|
||||
await queryIpRisk()
|
||||
}
|
||||
|
||||
const cleanupLoading = ref(false)
|
||||
|
||||
async function onCleanup() {
|
||||
@@ -613,6 +643,15 @@ onMounted(async () => {
|
||||
<div class="toolbar">
|
||||
<el-button v-if="!riskResult.is_banned" type="primary" plain @click="openBanFromRisk">封禁</el-button>
|
||||
<el-button v-else type="danger" plain @click="unbanFromRisk">解除封禁</el-button>
|
||||
<el-button
|
||||
v-if="riskResultKind === 'ip'"
|
||||
type="warning"
|
||||
plain
|
||||
:loading="riskLoading"
|
||||
@click="clearIpRiskScore"
|
||||
>
|
||||
清除风险分
|
||||
</el-button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user