Mdwasim2505's picture
pages redirection are not working make it working give mock datas and create admin login and password for it to see admin page
a882b64 verified
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Dashboard | CyberGuardian</title>
<link rel="icon" type="image/x-icon" href="/static/favicon.ico">
<script src="https://cdn.tailwindcss.com"></script>
<script src="https://unpkg.com/feather-icons"></script>
</head>
<body class="bg-gray-50">
<nav class="bg-blue-600 text-white shadow-lg">
<div class="max-w-6xl mx-auto px-4">
<div class="flex justify-between h-16">
<div class="flex items-center">
<i data-feather="shield" class="mr-2"></i>
<span class="font-semibold text-xl">CyberGuardian</span>
</div>
<div class="hidden md:flex items-center space-x-4">
<a href="/dashboard" class="px-3 py-2 bg-blue-700 rounded-md font-medium">Dashboard</a>
<a href="/about" class="px-3 py-2 hover:bg-blue-700 rounded-md">About</a>
<a href="/logout" class="px-3 py-2 hover:bg-blue-700 rounded-md flex items-center">
<i data-feather="log-out" class="mr-1"></i> Logout
</a>
</div>
<div class="md:hidden flex items-center">
<button class="mobile-menu-button">
<i data-feather="menu"></i>
</button>
</div>
</div>
</div>
</nav>
<div class="max-w-6xl mx-auto px-4 py-8">
<div class="mb-8 flex justify-between items-center">
<h1 class="text-2xl font-bold text-gray-800">Welcome back, admin!</h1>
<div class="flex items-center space-x-2">
<span class="text-sm text-gray-600">Last login: Just now</span>
</div>
</div>
<div class="grid grid-cols-1 lg:grid-cols-3 gap-8">
<div class="lg:col-span-2 space-y-6">
<div class="bg-white rounded-lg shadow-md p-6">
<h2 class="text-xl font-semibold mb-4">Analyze Text for Toxicity</h2>
<form id="analyzeForm" action="/analyze" method="POST">
<div class="mb-4">
<label for="text" class="block text-gray-700 text-sm font-medium mb-2">Enter text to analyze</label>
<textarea id="text" name="text" rows="5" required
class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500"></textarea>
</div>
<button type="submit"
class="bg-blue-600 hover:bg-blue-700 text-white font-medium py-2 px-4 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 transition duration-300">
Analyze Text
</button>
</form>
</div>
{% if result %}
<div class="bg-white rounded-lg shadow-md p-6">
<h2 class="text-xl font-semibold mb-4">Analysis Result</h2>
<div class="space-y-4">
<div>
<h3 class="font-medium text-gray-700">Text Analyzed:</h3>
<p class="text-gray-600 bg-gray-50 p-3 rounded-md">{{ result.text }}</p>
</div>
<div>
<h3 class="font-medium text-gray-700">Result:</h3>
{% if result.category == "Offensive" %}
<div class="flex items-center bg-red-50 p-3 rounded-md">
<div class="w-3 h-3 bg-red-500 rounded-full mr-2"></div>
<span class="font-medium text-red-700">Offensive Content</span>
<span class="ml-auto text-gray-600">{{ result.confidence }}% confidence</span>
</div>
{% elif result.category == "Hate" %}
<div class="flex items-center bg-red-50 p-3 rounded-md">
<div class="w-3 h-3 bg-red-700 rounded-full mr-2"></div>
<span class="font-medium text-red-800">Hate Speech</span>
<span class="ml-auto text-gray-600">{{ result.confidence }}% confidence</span>
</div>
{% else %}
<div class="flex items-center bg-green-50 p-3 rounded-md">
<div class="w-3 h-3 bg-green-500 rounded-full mr-2"></div>
<span class="font-medium text-green-700">Normal Content</span>
<span class="ml-auto text-gray-600">{{ result.confidence }}% confidence</span>
</div>
{% endif %}
</div>
</div>
</div>
{% endif %}
</div>
<div class="space-y-6">
<div class="bg-white rounded-lg shadow-md p-6">
<h2 class="text-xl font-semibold mb-4">Analysis History</h2>
<div class="space-y-4">
<div class="border-b border-gray-200 pb-4 last:border-0 last:pb-0">
<p class="text-sm text-gray-500 mb-1">2023-06-15 14:30:22</p>
<p class="text-gray-700 mb-2 line-clamp-2">This is a test message to check the system.</p>
<span class="inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium bg-green-100 text-green-800">
Normal
</span>
</div>
<div class="border-b border-gray-200 pb-4 last:border-0 last:pb-0">
<p class="text-sm text-gray-500 mb-1">2023-06-14 09:15:45</p>
<p class="text-gray-700 mb-2 line-clamp-2">I hate this stupid website!</p>
<span class="inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium bg-red-100 text-red-800">
Offensive
</span>
</div>
<div class="border-b border-gray-200 pb-4 last:border-0 last:pb-0">
<p class="text-sm text-gray-500 mb-1">2023-06-13 16:22:10</p>
<p class="text-gray-700 mb-2 line-clamp-2">Let's all go to the park tomorrow!</p>
<span class="inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium bg-green-100 text-green-800">
Normal
</span>
</div>
</div>
</div>
<div class="bg-white rounded-lg shadow-md p-6">
<h2 class="text-xl font-semibold mb-4">Quick Stats</h2>
<div class="grid grid-cols-2 gap-4">
<div class="bg-blue-50 p-4 rounded-md">
<p class="text-sm text-blue-600 font-medium">Total Analyses</p>
<p class="text-2xl font-bold text-blue-800">24</p>
</div>
<div class="bg-red-50 p-4 rounded-md">
<p class="text-sm text-red-600 font-medium">Flagged Content</p>
<p class="text-2xl font-bold text-red-800">5</p>
</div>
</div>
</div>
</div>
</div>
</div>
<footer class="bg-gray-100 border-t mt-12">
<div class="max-w-6xl mx-auto px-4 py-8">
<div class="md:flex md:justify-between">
<div class="mb-8 md:mb-0">
<h2 class="text-lg font-semibold text-gray-900 mb-4">CyberGuardian</h2>
<p class="text-gray-600 max-w-xs">Making online spaces safer with AI-powered toxicity detection.</p>
</div>
<div class="grid grid-cols-2 gap-8 sm:grid-cols-3">
<div>
<h3 class="text-sm font-semibold text-gray-900 tracking-wider uppercase mb-4">Resources</h3>
<ul class="space-y-2">
<li><a href="/about" class="text-gray-600 hover:text-blue-600">About</a></li>
<li><a href="/privacy" class="text-gray-600 hover:text-blue-600">Privacy</a></li>
</ul>
</div>
</div>
</div>
<div class="mt-8 pt-8 border-t border-gray-200">
<p class="text-base text-gray-500">
&copy; 2023 CyberGuardian. All rights reserved.
</p>
</div>
</div>
</footer>
<script>feather.replace();</script>
</body>
</html>