Skip to content

Commit

Permalink
Create stats.html
Browse files Browse the repository at this point in the history
  • Loading branch information
maty7253 authored Jan 4, 2025
1 parent 8ab6cc6 commit aad4c61
Showing 1 changed file with 62 additions and 0 deletions.
62 changes: 62 additions & 0 deletions templates/stats.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>URL Shortener - Statistics</title>
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/tailwind.min.css" rel="stylesheet">
</head>
<body class="bg-gray-100 min-h-screen py-12 px-4 sm:px-6 lg:px-8">
<div class="max-w-7xl mx-auto">
<div class="bg-white rounded-lg shadow-md p-6">
<div class="flex justify-between items-center mb-6">
<h1 class="text-2xl font-bold">URL Statistics</h1>
<a href="{{ url_for('index') }}" class="text-blue-600 hover:text-blue-500">
Back to Home
</a>
</div>

<div class="overflow-x-auto">
<table class="min-w-full divide-y divide-gray-200">
<thead class="bg-gray-50">
<tr>
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">
Short URL
</th>
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">
Original URL
</th>
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">
Created At
</th>
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">
Clicks
</th>
</tr>
</thead>
<tbody class="bg-white divide-y divide-gray-200">
{% for url in urls %}
<tr>
<td class="px-6 py-4 whitespace-nowrap text-sm text-blue-600">
<a href="{{ url_for('redirect_to_url', short_code=url[0]) }}" target="_blank">
{{ url[0] }}
</a>
</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500 truncate max-w-xs">
{{ url[1] }}
</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">
{{ url[2] }}
</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">
{{ url[3] }}
</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</div>
</div>
</body>
</html>

0 comments on commit aad4c61

Please sign in to comment.