Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions chat.js
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,12 @@ function appendAnalysisReport(report) {
if (!historyDiv) return;

const classification = report.classification || 'safe';
const confidence = report.confidence ?? 0;

const threatConfidence =
classification === 'safe'
? 0
: confidence;
const categories = {
phishing: '🎣 Phishing / Credential Theft',
fake_job: '💼 Fake Job Offer',
Expand All @@ -197,10 +202,10 @@ function appendAnalysisReport(report) {
<div class="report-score-section">
<div class="report-score-labels">
<span>Threat Confidence</span>
<span>${report.confidence || 0}%</span>
<span>${threatConfidence}%</span>
</div>
<div class="report-progress-track">
<div class="report-progress-bar classification-${classification}" style="width:${report.confidence || 0}%"></div>
<div class="report-progress-bar classification-${classification}" style="width:${threatConfidence}%"></div>
</div>
</div>
<div class="report-advice-box classification-${classification}">
Expand Down