From e7cf29143331b037b54fc80ce33b5785d47e2677 Mon Sep 17 00:00:00 2001 From: Alexander Myasoedov Date: Mon, 25 Nov 2024 23:43:45 +0200 Subject: [PATCH] feat(AI Red Team Ethical Use Agreement): --- agentic_security/static/index.html | 62 ++++++++++++++++++++++++++++++ agentic_security/static/main.js | 17 ++++++++ 2 files changed, 79 insertions(+) diff --git a/agentic_security/static/index.html b/agentic_security/static/index.html index 9c5489e..1565604 100644 --- a/agentic_security/static/index.html +++ b/agentic_security/static/index.html @@ -68,6 +68,68 @@ +
diff --git a/agentic_security/static/main.js b/agentic_security/static/main.js index abbea52..2e55f55 100644 --- a/agentic_security/static/main.js +++ b/agentic_security/static/main.js @@ -88,6 +88,7 @@ var app = new Vue({ selectedConfig: 0, showModules: false, showLogs: false, + showConsentModal: true, statusDotClass: 'bg-gray-500', // Default status dot class statusText: 'Verified', // Default status text statusClass: 'bg-green-500 text-dark-bg', // Default status class @@ -103,6 +104,13 @@ var app = new Vue({ ], dataConfig: [], }, + created() { + // Check if consent is already given in local storage + const consentGiven = localStorage.getItem('consentGiven'); + if (consentGiven === 'true') { + this.showConsentModal = false; // Don't show the modal if consent was given + } + }, mounted: function () { console.log('Vue app mounted'); this.adjustHeight({ target: document.getElementById('llm-spec') }); @@ -118,6 +126,15 @@ var app = new Vue({ } }, methods: { + acceptConsent() { + this.showConsentModal = false; // Close the modal + localStorage.setItem('consentGiven', 'true'); // Save consent to local storage + }, + declineConsent() { + this.showConsentModal = false; // Close the modal + localStorage.setItem('consentGiven', 'false'); // Save decline to local storage + window.location.href = 'https://www.google.com'; // Redirect to Google + }, updateStatusDot(ok) { if (ok) { this.statusDotClass = 'bg-green-500'; // Green when expanded