-
-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
115 additions
and
109 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,10 +27,58 @@ <h2>Manage Samples</h2> | |
</div> | ||
|
||
<!-- Include the samples list template --> | ||
{{template "samples_list.html" .}} | ||
{{template "samples_list" .}} | ||
</div> | ||
|
||
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.min.js"></script> | ||
|
||
</body> | ||
</html> | ||
|
||
|
||
<!-- list of samples, both spam and ham --> | ||
{{define "samples_list"}} | ||
<div class="row" id="samples-list"> | ||
<div class="col-md-6"> | ||
<h4> | ||
Spam Samples ({{.TotalSpamSamples}}) | ||
<a href="/download/spam" class="btn btn-custom-blue btn-sm">Download</a> | ||
</h4> | ||
<ul class="list-group" id="spam-samples-list"> | ||
{{range .SpamSamples}} | ||
<li class="list-group-item d-flex justify-content-between align-items-center"> | ||
<span id="loading-{{.ID}}">{{.Sample}} <img class="htmx-indicator" src="/spinner.svg"/></span> | ||
<form method="POST" hx-post="/delete/spam" hx-target="#samples-list" hx-swap="outerHTML" hx-indicator="#loading-{{.ID}}"> | ||
<input type="hidden" name="msg" value="{{.Sample}}"> | ||
<button type="submit" class="btn btn-sm btn-danger"> | ||
<i class="bi bi-trash"></i> | ||
</button> | ||
</form> | ||
</li> | ||
{{else}} | ||
<li class="list-group-item">No spam samples found</li> | ||
{{end}} | ||
</ul> | ||
</div> | ||
|
||
<div class="col-md-6"> | ||
<h4> | ||
Ham Samples ({{.TotalHamSamples}}) | ||
<a href="/download/ham" class="btn btn-custom-blue btn-sm">Download</a> | ||
</h4> | ||
<ul class="list-group" id="ham-samples-list"> | ||
{{range .HamSamples}} | ||
<li class="list-group-item d-flex justify-content-between align-items-center"> | ||
{{.Sample}} | ||
<form method="POST" hx-post="/delete/ham" hx-target="#samples-list" hx-swap="outerHTML"> | ||
<input type="hidden" name="msg" value="{{.Sample}}"> | ||
<button type="submit" class="btn btn-sm btn-danger"> | ||
<i class="bi bi-trash"></i> | ||
</button> | ||
</form> | ||
</li> | ||
{{else}} | ||
<li class="list-group-item">No ham samples found</li> | ||
{{end}} | ||
</ul> | ||
</div> | ||
</div> | ||
{{end}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,10 +25,51 @@ <h2>Manage Approved Users</h2> | |
</div> | ||
</div> | ||
|
||
<!-- Include the Approved Users List component --> | ||
{{template "users_list.html" .}} | ||
|
||
{{template "users_list" .}} | ||
</div> | ||
|
||
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.min.js"></script> | ||
</body> | ||
</html> | ||
|
||
|
||
<!-- list of users --> | ||
{{define "users_list"}} | ||
<div class="row" id="users-list"> | ||
<div class="col-md-12"> | ||
<div id="error-message"></div> <!-- Error message container --> | ||
<h4>Approved Users ({{.TotalApprovedUsers}})</h4> | ||
<table class="table table-striped"> | ||
<thead class="custom-table-header"> | ||
<tr> | ||
<th>ID</th> | ||
<th>Name</th> | ||
<th>Timestamp</th> | ||
<th></th> <!-- Header for the action column --> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
{{range .ApprovedUsers}} | ||
<tr> | ||
<td>{{.UserID}}</td> | ||
<td>{{.UserName}}</td> | ||
<td>{{.Timestamp.Format "2006-01-02 15:04:05"}}</td> | ||
<td class="text-end"> | ||
<form method="POST" hx-post="/users/delete" hx-target="#users-list" hx-swap="outerHTML" class="d-inline"> | ||
<input type="hidden" name="user_id" value="{{.UserID}}"> | ||
<button type="submit" class="btn btn-danger btn-sm" title="Delete User"> | ||
<i class="bi bi-trash"></i> | ||
</button> | ||
</form> | ||
</td> | ||
</tr> | ||
{{else}} | ||
<tr> | ||
<td colspan="4">No approved users found</td> | ||
</tr> | ||
{{end}} | ||
</tbody> | ||
</table> | ||
</div> | ||
</div> | ||
{{end}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -34,7 +34,21 @@ <h2 class="text-center mb-4">Message Checker</h2> | |
</div> | ||
</div> | ||
|
||
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.min.js"></script> | ||
|
||
</body> | ||
</html> | ||
|
||
{{define "check_results"}} | ||
<div id="result"> | ||
<div id="error-message"></div> <!-- Error message container --> | ||
<div class="alert alert-light" role="alert"> | ||
<div class="alert {{if .Spam}}alert-danger{{else}}alert-success{{end}}"> | ||
<strong>Result:</strong> {{if .Spam}}Spam detected{{else}}No spam detected{{end}} | ||
</div> | ||
{{range .Checks}} | ||
<div class="mb-2 {{if .Spam}}text-danger{{else}}text-success{{end}}"> | ||
<strong>{{.Name}}:</strong> {{.Details}} | ||
</div> | ||
{{end}} | ||
</div> | ||
</div> | ||
{{end}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters