Files
veripath/web/assets/js/main.js
T

37 lines
1.7 KiB
JavaScript

document.addEventListener('DOMContentLoaded', () => {
// Evidence Governance Toggle Logic
const approveBtn = document.getElementById('approve-btn');
const rejectBtn = document.getElementById('reject-btn');
const agentBadge = document.getElementById('agent-badge');
const finalBadge = document.getElementById('final-badge');
const statusText = document.getElementById('review-status');
if (approveBtn && rejectBtn) {
// Human Approves the Finding
approveBtn.addEventListener('click', () => {
agentBadge.className = 'badge-tier2 line-through opacity-50';
finalBadge.className = 'badge-tier1';
finalBadge.textContent = 'Tier 1 Verified (Human Approved)';
statusText.textContent = 'SUCCESS: Finding verified by human analyst. Promoted to Tier 1.';
statusText.className = 'text-green-400 text-sm mb-6 font-mono font-bold';
disableButtons();
});
// Human Rejects the Finding (Triggers the Fallback Protocol)
rejectBtn.addEventListener('click', () => {
agentBadge.className = 'badge-tier2';
finalBadge.className = 'badge-tier2';
finalBadge.textContent = 'Tier 2: Indicative (Fallback Applied)';
statusText.textContent = 'FALLBACK: Tier 1 rejected. Defaulted to Tier 2 as per governance protocol.';
statusText.className = 'text-yellow-400 text-sm mb-6 font-mono font-bold';
disableButtons();
});
}
function disableButtons() {
approveBtn.disabled = true;
rejectBtn.disabled = true;
approveBtn.classList.add('opacity-50', 'cursor-not-allowed');
rejectBtn.classList.add('opacity-50', 'cursor-not-allowed');
}
});