Skip to content

Commit

Permalink
Add Delete and Delete All buttons for the rest of db views (#96)
Browse files Browse the repository at this point in the history
  • Loading branch information
AI-Mozi authored Jan 22, 2024
1 parent 7ce63b6 commit b197de2
Show file tree
Hide file tree
Showing 45 changed files with 174 additions and 46 deletions.
2 changes: 1 addition & 1 deletion app/db.rb
Original file line number Diff line number Diff line change
Expand Up @@ -510,7 +510,7 @@ class App < Sinatra::Base
passwords: Ronin::DB::Password,
credentials: Ronin::DB::Credential,
advisories: Ronin::DB::Advisory,
softwares: Ronin::DB::Software,
software: Ronin::DB::Software,
software_vendors: Ronin::DB::SoftwareVendor,
oses: Ronin::DB::OS,
vulns: Ronin::DB::WebVuln,
Expand Down
5 changes: 4 additions & 1 deletion views/db/advisories/index.erb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@
</nav>
<% end %>

<h1>Advisories</h1>
<div class="is-flex is-justify-content-space-between">
<h1>Advisories</h1>
<%= partial(:delete_all, path: "advisories") %>
</div>

<% @advisories.each do |advisory| %>
<p><a href="/db/advisories/<%=h advisory.id %>"><%=h advisory %></a></p>
Expand Down
5 changes: 4 additions & 1 deletion views/db/advisories/show.erb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@
</nav>
<% end %>

<h1>Advisory: <%=h @advisory %></h1>
<div class="is-flex is-justify-content-space-between">
<h1>Advisory: <%=h @advisory %></h1>
<%= partial(:delete, record: @advisory, path: "advisories") %>
</div>

<table class="table">
<tbody>
Expand Down
5 changes: 4 additions & 1 deletion views/db/asns/index.erb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@
</nav>
<% end %>

<h1>ASNs</h1>
<div class="is-flex is-justify-content-space-between">
<h1>ASNs</h1>
<%= partial(:delete_all, path: "asns") %>
</div>

<% @asns.each do |asn| %>
<p><a href="/db/asns/<%=h asn.id %>"><%=h asn %></a></p>
Expand Down
5 changes: 4 additions & 1 deletion views/db/asns/show.erb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@
</nav>
<% end %>

<h1>ASN: <%=h @asn %></h1>
<div class="is-flex is-justify-content-space-between">
<h1>ASN: <%=h @asn %></h1>
<%= partial(:delete, record: @asn, path: "asns") %>
</div>

<table class="table">
<tbody>
Expand Down
5 changes: 4 additions & 1 deletion views/db/credentials/index.erb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@
</nav>
<% end %>

<h1>Credentials</h1>
<div class="is-flex is-justify-content-space-between">
<h1>Credentials</h1>
<%= partial(:delete_all, path: "credentials") %>
</div>

<% @credentials.each do |credential| %>
<p><a href="/db/credentials/<%=h credential.id %>"><%=h credential %></a></p>
Expand Down
5 changes: 4 additions & 1 deletion views/db/credentials/show.erb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@
</nav>
<% end %>

<h1>Credential: <%=h @password %></h1>
<div class="is-flex is-justify-content-space-between">
<h1>Credential: <%=h @password %></h1>
<%= partial(:delete, record: @password, path: "credentials") %>
</div>

<table class="table">
<tbody>
Expand Down
5 changes: 4 additions & 1 deletion views/db/email_addresses/index.erb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@
</nav>
<% end %>

<h1>Email Addresses</h1>
<div class="is-flex is-justify-content-space-between">
<h1>Email Addresses</h1>
<%= partial(:delete_all, path: "email_addresses") %>
</div>

<% @email_addresses.each do |email_address| %>
<p><a href="/db/email_addresses/<%=h email_address.id %>"><%=h email_address %></a></p>
Expand Down
5 changes: 4 additions & 1 deletion views/db/email_addresses/show.erb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@
</nav>
<% end %>

<h1>Email Address: <%=h @email_address %></h1>
<div class="is-flex is-justify-content-space-between">
<h1>Email Address: <%=h @email_address %></h1>
<%= partial(:delete, record: @email_address, path: "email_addresses") %>
</div>

<table class="table">
<tbody>
Expand Down
5 changes: 4 additions & 1 deletion views/db/host_names/index.erb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@
</nav>
<% end %>

<h1>Host names</h1>
<div class="is-flex is-justify-content-space-between">
<h1>Host names</h1>
<%= partial(:delete_all, path: "host_names") %>
</div>

<% @host_names.each do |host_name| %>
<p><a href="/db/host_names/<%=h host_name.id %>"><%=h host_name %></a></p>
Expand Down
5 changes: 4 additions & 1 deletion views/db/host_names/show.erb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@
</nav>
<% end %>

<h1>Host Name: <%=h @host_name %></h1>
<div class="is-flex is-justify-content-space-between">
<h1>Host Name: <%=h @host_name %></h1>
<%= partial(:delete, record: @host_name, path: "host_names") %>
</div>

<table class="table">
<tbody>
Expand Down
5 changes: 4 additions & 1 deletion views/db/ip_addresses/index.erb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@
</nav>
<% end %>

<h1>IP Addresses</h1>
<div class="is-flex is-justify-content-space-between">
<h1>IP Addresses</h1>
<%= partial(:delete_all, path: "ip_addresses") %>
</div>

<% @ip_addresses.each do |ip_address| %>
<p><a href="/db/ip_addresses/<%=h ip_address.id %>"><%=h ip_address %></a></p>
Expand Down
5 changes: 4 additions & 1 deletion views/db/ip_addresses/show.erb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@
</nav>
<% end %>

<h1>IP Address: <%=h @ip_address %></h1>
<div class="is-flex is-justify-content-space-between">
<h1>IP Address: <%=h @ip_address %></h1>
<%= partial(:delete, record: @ip_address, path: "ip_addresses") %>
</div>

<table class="table">
<tbody>
Expand Down
5 changes: 4 additions & 1 deletion views/db/mac_addresses/index.erb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@
</nav>
<% end %>

<h1>MAC Addresses</h1>
<div class="is-flex is-justify-content-space-between">
<h1>MAC Addresses</h1>
<%= partial(:delete_all, path: "mac_addresses") %>
</div>

<% @mac_addresses.each do |mac_address| %>
<p><a href="/db/mac_addresses/<%=h mac_address.id %>"><%=h mac_address %></a></p>
Expand Down
5 changes: 4 additions & 1 deletion views/db/mac_addresses/show.erb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@
</nav>
<% end %>

<h1>MAC Address: <%=h @mac_address %></h1>
<div class="is-flex is-justify-content-space-between">
<h1>MAC Address: <%=h @mac_address %></h1>
<%= partial(:delete, record: @mac_address, path: "mac_addresses") %>
</div>

<table class="table">
<tbody>
Expand Down
5 changes: 4 additions & 1 deletion views/db/open_ports/index.erb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@
</nav>
<% end %>

<h1>Open Ports</h1>
<div class="is-flex is-justify-content-space-between">
<h1>Open Ports</h1>
<%= partial(:delete_all, path: "open_ports") %>
</div>

<% @open_ports.each do |open_port| %>
<p><a href="/db/open_ports/<%=h open_port.id %>"><%=h open_port %></a></p>
Expand Down
5 changes: 4 additions & 1 deletion views/db/open_ports/show.erb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@
</nav>
<% end %>

<h3>Open Port: <%=h @open_port %></h3>
<div class="is-flex is-justify-content-space-between">
<h1>Open Port: <%=h @open_port %></h1>
<%= partial(:delete, record: @open_port, path: "open_ports") %>
</div>

<table class="table">
<tbody>
Expand Down
5 changes: 4 additions & 1 deletion views/db/organizations/show.erb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@
</nav>
<% end %>

<h1>Organization: <%=h @organization %></h1>
<div class="is-flex is-justify-content-space-between">
<h1>Organization: <%=h @organization %></h1>
<%= partial(:delete, record: @organization, path: "organizations") %>
</div>

<table class="table">
<tbody>
Expand Down
5 changes: 4 additions & 1 deletion views/db/oses/index.erb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@
</nav>
<% end %>

<h1>OSes</h1>
<div class="is-flex is-justify-content-space-between">
<h1>OSes</h1>
<%= partial(:delete_all, path: "oses") %>
</div>

<% @oses.each do |os| %>
<p><a href="/db/oses/<%=h os.id %>"><%=h os %></a></p>
Expand Down
5 changes: 4 additions & 1 deletion views/db/oses/show.erb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@
</nav>
<% end %>

<h1>OS: <%=h @os %></h1>
<div class="is-flex is-justify-content-space-between">
<h1>OS: <%=h @os %></h1>
<%= partial(:delete, record: @os, path: "oses") %>
</div>

<table class="table">
<tbody>
Expand Down
5 changes: 4 additions & 1 deletion views/db/passwords/index.erb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@
</nav>
<% end %>

<h1>Passwords</h1>
<div class="is-flex is-justify-content-space-between">
<h1>Passwords</h1>
<%= partial(:delete_all, path: "passwords") %>
</div>

<% @passwords.each do |password| %>
<p><a href="/db/passwords/<%=h password.id %>"><%=h password %></a></p>
Expand Down
5 changes: 4 additions & 1 deletion views/db/passwords/show.erb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@
</nav>
<% end %>

<h1>Password: <%=h @password %></h1>
<div class="is-flex is-justify-content-space-between">
<h1>Password: <%=h @password %></h1>
<%= partial(:delete, record: @password, path: "passwords") %>
</div>

<table class="table">
<tbody>
Expand Down
5 changes: 4 additions & 1 deletion views/db/people/index.erb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@
</nav>
<% end %>

<h1>People</h1>
<div class="is-flex is-justify-content-space-between">
<h1>People</h1>
<%= partial(:delete_all, path: "people") %>
</div>

<% @people.each do |person| %>
<p><a href="/db/people/<%=h person.id %>"><%=h person %></a></p>
Expand Down
5 changes: 4 additions & 1 deletion views/db/people/show.erb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@
</nav>
<% end %>

<h1>Person: <%=h @person %></h1>
<div class="is-flex is-justify-content-space-between">
<h1>Person: <%=h @person %></h1>
<%= partial(:delete, record: @person, path: "people") %>
</div>

<table class="table">
<tbody>
Expand Down
5 changes: 4 additions & 1 deletion views/db/phone_numbers/index.erb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@
</nav>
<% end %>

<h1>Phone Numbers</h1>
<div class="is-flex is-justify-content-space-between">
<h1>Phone Numbers</h1>
<%= partial(:delete_all, path: "phone_numbers") %>
</div>

<% @phone_numbers.each do |phone_number| %>
<p><a href="/db/phone_numbers/<%=h phone_number.id %>"><%=h phone_number %></a></p>
Expand Down
5 changes: 4 additions & 1 deletion views/db/phone_numbers/show.erb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@
</nav>
<% end %>

<h1>Phone Number: <%=h @phone_number %></h1>
<div class="is-flex is-justify-content-space-between">
<h1>Phone Number: <%=h @phone_number %></h1>
<%= partial(:delete, record: @phone_number, path: "phone_numbers") %>
</div>

<table class="table">
<tbody>
Expand Down
5 changes: 4 additions & 1 deletion views/db/ports/index.erb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@
</nav>
<% end %>

<h1>Ports</h1>
<div class="is-flex is-justify-content-space-between">
<h1>Ports</h1>
<%= partial(:delete_all, path: "ports") %>
</div>

<% @ports.each do |port| %>
<p><a href="/db/ports/<%=h port.id %>"><%=h port %></a></p>
Expand Down
5 changes: 4 additions & 1 deletion views/db/ports/show.erb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@
</nav>
<% end %>

<h1>Port: <%=h @port %></h1>
<div class="is-flex is-justify-content-space-between">
<h1>Port: <%=h @port %></h1>
<%= partial(:delete, record: @port, path: "ports") %>
</div>

<table class="table">
<tbody>
Expand Down
5 changes: 4 additions & 1 deletion views/db/services/index.erb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@
</nav>
<% end %>

<h1>Services</h1>
<div class="is-flex is-justify-content-space-between">
<h1>Services</h1>
<%= partial(:delete_all, path: "services") %>
</div>

<% @services.each do |service| %>
<p><a href="/db/services/<%=h service.id %>"><%=h service %></a></p>
Expand Down
5 changes: 4 additions & 1 deletion views/db/services/show.erb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@
</nav>
<% end %>

<h1>Service: <%=h @service %></h1>
<div class="is-flex is-justify-content-space-between">
<h1>Service: <%=h @service %></h1>
<%= partial(:delete, record: @service, path: "services") %>
</div>

<table class="table">
<tbody>
Expand Down
5 changes: 4 additions & 1 deletion views/db/software/index.erb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@
</nav>
<% end %>

<h1>Software</h1>
<div class="is-flex is-justify-content-space-between">
<h1>Software</h1>
<%= partial(:delete_all, path: "software") %>
</div>

<% @software.each do |software| %>
<p><a href="/db/software/<%=h software.id %>"><%=h software %></a></p>
Expand Down
5 changes: 4 additions & 1 deletion views/db/software/show.erb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@
</nav>
<% end %>

<h1>Software: <%=h @software %></h1>
<div class="is-flex is-justify-content-space-between">
<h1>Software: <%=h @software %></h1>
<%= partial(:delete, record: @software, path: "software") %>
</div>

<table class="table">
<tbody>
Expand Down
5 changes: 4 additions & 1 deletion views/db/software_vendors/index.erb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@
</nav>
<% end %>

<h1>Software Vendors</h1>
<div class="is-flex is-justify-content-space-between">
<h1>Software Vendors</h1>
<%= partial(:delete_all, path: "software_vendors") %>
</div>

<% @software_vendors.each do |software_vendor| %>
<p><a href="/db/software_vendors/<%=h software_vendor.id %>"><%=h software_vendor %></a></p>
Expand Down
Loading

0 comments on commit b197de2

Please sign in to comment.