mirror of
https://github.com/neocities/neocities.git
synced 2025-08-05 01:01:30 +02:00
site inspector, hotlinking page
This commit is contained in:
parent
71fabef58f
commit
d86f614248
3 changed files with 108 additions and 0 deletions
57
views/admin/site.erb
Normal file
57
views/admin/site.erb
Normal file
|
@ -0,0 +1,57 @@
|
|||
<div class="header-Outro">
|
||||
<div class="row content single-Col">
|
||||
<h1>Site Inspector</h1>
|
||||
<h2 class="subtitle"><%= @site.username %></h2>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="content misc-page single-Col txt-Center" style="padding-top: 20px;">
|
||||
|
||||
<h3>Site Pages</h3>
|
||||
|
||||
<table>
|
||||
<% @site.site_files_dataset.where(path: /\.html/).all.each do |site_file| %>
|
||||
<tr style="outline: thin solid black;">
|
||||
<td><img src="<%= @site.screenshot_url(site_file.path, '210x158') %>"></td>
|
||||
<td>
|
||||
<p><strong><%= site_file.path %></strong></p>
|
||||
<% if !site_file.classifier.blank? %>
|
||||
<p>
|
||||
<% if site_file.classifier == 'ham' %>
|
||||
<span style="color: green"><%= site_file.classifier %></span>
|
||||
<% else %>
|
||||
<span style="color: red"><strong><%= site_file.classifier %></strong></span>
|
||||
<% end %>
|
||||
</p>
|
||||
<% else %>
|
||||
<p>Not Classified</p>
|
||||
<% end %>
|
||||
|
||||
<form action="/admin/site_files/train" target="_blank" method="POST">
|
||||
<%== csrf_token_input_html %>
|
||||
<input type="hidden" name="site_id" value="<%= @site.id %>">
|
||||
<input type="hidden" name="path" value="<%= site_file.path %>">
|
||||
<input type="hidden" name="classifier" value="ham">
|
||||
<button>Ham</button>
|
||||
</form>
|
||||
|
||||
<form action="/admin/site_files/train" target="_blank" method="POST" onsubmit="return confirm('Confirm spam train of <%= "#{@site.username}/#{site_file.path}" %>');">
|
||||
<%== csrf_token_input_html %>
|
||||
<input type="hidden" name="site_id" value="<%= @site.id %>">
|
||||
<input type="hidden" name="path" value="<%= site_file.path %>">
|
||||
<input type="hidden" name="classifier" value="spam">
|
||||
<button>Spam</button>
|
||||
</form>
|
||||
|
||||
<form action="/admin/site_files/train" target="_blank" method="POST" onsubmit="return confirm('Confirm phishing train of <%= "#{@site.username}/#{site_file.path}" %>');">
|
||||
<%== csrf_token_input_html %>
|
||||
<input type="hidden" name="site_id" value="<%= @site.id %>">
|
||||
<input type="hidden" name="path" value="<%= site_file.path %>">
|
||||
<input type="hidden" name="classifier" value="phishing">
|
||||
<button>Phishing</button>
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</table>
|
||||
</div>
|
Loading…
Add table
Add a link
Reference in a new issue