This commit is contained in:
2025-08-29 21:16:19 +08:00
parent 61e7ffc03b
commit 79156aa8ae
4 changed files with 119 additions and 77 deletions
+14
View File
@@ -101,6 +101,7 @@
{{ (scope.row.nsfwScore * 100).toFixed(1) }}%
</el-tag>
<div class="nsfw-threshold">阈值: {{ (scope.row.nsfwThreshold * 100).toFixed(0) }}%</div>
<div v-if="scope.row.nsfwDetections" class="nsfw-threshold">{{ formatNsfwDetections(scope.row.nsfwDetections) }}</div>
</div>
<span v-else class="muted">-</span>
</template>
@@ -316,6 +317,19 @@ export default {
} catch (e) {
return ''
}
},
formatNsfwDetections(detectionsJson) {
if (!detectionsJson) return ''
try {
const detections = JSON.parse(detectionsJson)
if (!Array.isArray(detections) || detections.length === 0) return ''
return detections.map(d => {
const className = d.class.replace(/_/g, ' ').toLowerCase()
return `${className}: ${(d.score * 100).toFixed(0)}%`
}).join(', ')
} catch (e) {
return ''
}
}
}
}