first commit

This commit is contained in:
ghostersk
2024-03-29 12:48:27 +00:00
committed by GitHub
parent dd6c056810
commit 58d6218bc2
18 changed files with 25473 additions and 0 deletions
+71
View File
@@ -0,0 +1,71 @@
<!DOCTYPE html>
<html lang="en" data-bs-theme="dark" class="fullbody">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="{{ url_for('static', filename='tables/bootstrap.min.css')}}">
<link rel="stylesheet" href="{{ url_for('static', filename='tables/bootstrap5.css')}}">
<link rel="shortcut icon" href="#">
<title>Blocked Site</title>
</head>
<style>
body, html {
height: 100%;
margin: 0;
display: flex;
justify-content: center;
align-items: flex-start; /* Align items at the start of the cross axis */
}
.container {
width: 100%;
height: 60%; /* adjust height level, 100% is in middle */
display: flex;
justify-content: center;
align-items: center;
}
.centered-div {
width: auto; /* Set your desired width */
height: auto; /* Set your desired height */
background-color:rgb(4, 64, 99);
text-align: center;
padding: 20px;
border-radius: 10px;
box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.1); /* Optional: Add shadow for better visual */
}
.left_align {text-align: left; padding:10px;}
.left_ul {padding:10px !important;}
.warning {background:red;text-align: center; border-radius: 10px;}
.s_table, table, th, td, tr { border: 2px solid;padding: 10px; border-collapse: collapse;}
</style>
<body class="fullbody">
<div class="container">
<div class="centered-div">
{% if records %}
<h1 class='warning'>
<b>Website {{ records.root_domain }} blocked</b>
</h1>
<div class="container">
<table class="left_align s_table">
<tr>
<th>Method</th>
<td>{{records.method}}</td>
</tr>
<tr>
<th>URL</th>
<td>{{records.url}}</td>
</tr>
</table>
</div>
<p>
<a href="{{ url_for('show_query') }}"> Show History ...</a>
</p>
{% endif %}
</div>
<p>
</p>
</div>
</body>
</html>
+70
View File
@@ -0,0 +1,70 @@
<!DOCTYPE html>
<html lang="en" data-bs-theme="dark">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="{{ url_for('static', filename='tables/bootstrap.min.css')}}">
<link rel="stylesheet" href="{{ url_for('static', filename='tables/bootstrap5.css')}}">
<link rel="shortcut icon" href="#">
<script src="{{ url_for('static', filename='tables/jquery.js')}}" type="text/javascript"></script>
<script src="{{ url_for('static', filename='tables/dataTables.js')}}" type="text/javascript"></script>
<script src="{{ url_for('static', filename='tables/dataTables.bootstrap5.js')}}" type="text/javascript"></script>
<script src="{{ url_for('static', filename='tables/bootstrap.bundle.min.js')}}" type="text/javascript"></script>
<title>List of blocked sites</title>
</head>
<style>
.out_mid {position: absolute;width: auto; height: auto;top:40%;left: 30%;text-align: center;}
</style>
<body>
{% if records %}
<div class="container">
<table border="1" id="datatable1" class="table table-striped" style="width:100%">
<thead>
<tr>
{# <th>ID</th> #}
<th>Timestamp</th>
<th>Method</th>
<th>URL</th>
<th>Root Domain</th>
</tr>
</thead>
<tbody>
{% for log in records %}
<tr>
{# <td>{{log.id}}</td> #}
<td>{{log.timestamp.strftime('%d-%m-%Y %H:%M:%S')}}</td>
<td>{{log.method}}</td>
<td>{{log.url}}</td>
<td>{{log.root_domain}}</td>
</tr>
{% endfor %}
</tbody>
</table>
<div><br></br>
<!-- Add a button to trigger the deletion of records -->
<form id="deleteForm" action="{{ url_for('delete_records') }}" method="post">
<!-- Button to trigger the confirmation dialog -->
<button type="button" class="btn btn-danger" onclick="confirmDelete()">Delete All Records</button>
</form>
</div>
</div>
{% else %}
<div class="out_mid">
<h2> <b>No data recorded yet.</b></h2>
</div>
{% endif %}
<script>
new DataTable('#datatable1');
// Function to display the confirmation dialog
function confirmDelete() {
// Show the confirmation dialog
if (confirm("Are you sure you want to delete all records?")) {
// If user confirms, submit the form
document.getElementById("deleteForm").submit();
}
}
</script>
</body>
</html>