From f3fc248506f937f16b89bc8d3b21845340054399 Mon Sep 17 00:00:00 2001 From: AI-Mozi Date: Sun, 21 Jan 2024 15:56:20 +0100 Subject: [PATCH] add `Delete` and `Delete All` buttons for the rest of db views --- app/db.rb | 2 +- views/db/advisories/index.erb | 5 ++++- views/db/advisories/show.erb | 5 ++++- views/db/asns/index.erb | 5 ++++- views/db/asns/show.erb | 5 ++++- views/db/credentials/index.erb | 5 ++++- views/db/credentials/show.erb | 5 ++++- views/db/email_addresses/index.erb | 5 ++++- views/db/email_addresses/show.erb | 5 ++++- views/db/host_names/index.erb | 5 ++++- views/db/host_names/show.erb | 5 ++++- views/db/ip_addresses/index.erb | 5 ++++- views/db/ip_addresses/show.erb | 5 ++++- views/db/mac_addresses/index.erb | 5 ++++- views/db/mac_addresses/show.erb | 5 ++++- views/db/open_ports/index.erb | 5 ++++- views/db/open_ports/show.erb | 5 ++++- views/db/organizations/show.erb | 5 ++++- views/db/oses/index.erb | 5 ++++- views/db/oses/show.erb | 5 ++++- views/db/passwords/index.erb | 5 ++++- views/db/passwords/show.erb | 5 ++++- views/db/people/index.erb | 5 ++++- views/db/people/show.erb | 5 ++++- views/db/phone_numbers/index.erb | 5 ++++- views/db/phone_numbers/show.erb | 5 ++++- views/db/ports/index.erb | 5 ++++- views/db/ports/show.erb | 5 ++++- views/db/services/index.erb | 5 ++++- views/db/services/show.erb | 5 ++++- views/db/software/index.erb | 5 ++++- views/db/software/show.erb | 5 ++++- views/db/software_vendors/index.erb | 5 ++++- views/db/software_vendors/show.erb | 5 ++++- views/db/street_addresses/index.erb | 7 +++++-- views/db/street_addresses/show.erb | 5 ++++- views/db/url_query_param_names/index.erb | 5 ++++- views/db/url_query_param_names/show.erb | 5 ++++- views/db/url_schemes/index.erb | 5 ++++- views/db/url_schemes/show.erb | 5 ++++- views/db/urls/show.erb | 1 - views/db/user_names/index.erb | 5 ++++- views/db/user_names/show.erb | 5 ++++- views/db/vulns/index.erb | 5 ++++- views/db/vulns/show.erb | 5 ++++- 45 files changed, 174 insertions(+), 46 deletions(-) diff --git a/app/db.rb b/app/db.rb index 474f68e..9ecb8b6 100644 --- a/app/db.rb +++ b/app/db.rb @@ -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, diff --git a/views/db/advisories/index.erb b/views/db/advisories/index.erb index 62a4c04..c4aa437 100644 --- a/views/db/advisories/index.erb +++ b/views/db/advisories/index.erb @@ -7,7 +7,10 @@ <% end %> -

Advisories

+
+

Advisories

+ <%= partial(:delete_all, path: "advisories") %> +
<% @advisories.each do |advisory| %>

<%=h advisory %>

diff --git a/views/db/advisories/show.erb b/views/db/advisories/show.erb index 768f468..091aca4 100644 --- a/views/db/advisories/show.erb +++ b/views/db/advisories/show.erb @@ -8,7 +8,10 @@ <% end %> -

Advisory: <%=h @advisory %>

+
+

Advisory: <%=h @advisory %>

+ <%= partial(:delete, record: @advisory, path: "advisories") %> +
diff --git a/views/db/asns/index.erb b/views/db/asns/index.erb index bd0ac46..d9b28d6 100644 --- a/views/db/asns/index.erb +++ b/views/db/asns/index.erb @@ -7,7 +7,10 @@ <% end %> -

ASNs

+
+

ASNs

+ <%= partial(:delete_all, path: "asns") %> +
<% @asns.each do |asn| %>

<%=h asn %>

diff --git a/views/db/asns/show.erb b/views/db/asns/show.erb index 4d6f8fa..370dba3 100644 --- a/views/db/asns/show.erb +++ b/views/db/asns/show.erb @@ -8,7 +8,10 @@ <% end %> -

ASN: <%=h @asn %>

+
+

ASN: <%=h @asn %>

+ <%= partial(:delete, record: @asn, path: "asns") %> +
diff --git a/views/db/credentials/index.erb b/views/db/credentials/index.erb index 04df421..4345197 100644 --- a/views/db/credentials/index.erb +++ b/views/db/credentials/index.erb @@ -7,7 +7,10 @@ <% end %> -

Credentials

+
+

Credentials

+ <%= partial(:delete_all, path: "credentials") %> +
<% @credentials.each do |credential| %>

<%=h credential %>

diff --git a/views/db/credentials/show.erb b/views/db/credentials/show.erb index 582dd4f..659a0be 100644 --- a/views/db/credentials/show.erb +++ b/views/db/credentials/show.erb @@ -8,7 +8,10 @@ <% end %> -

Credential: <%=h @password %>

+
+

Credential: <%=h @password %>

+ <%= partial(:delete, record: @password, path: "passwords") %> +
diff --git a/views/db/email_addresses/index.erb b/views/db/email_addresses/index.erb index 3720082..9c47738 100644 --- a/views/db/email_addresses/index.erb +++ b/views/db/email_addresses/index.erb @@ -7,7 +7,10 @@ <% end %> -

Email Addresses

+
+

Email Addresses

+ <%= partial(:delete_all, path: "email_addresses") %> +
<% @email_addresses.each do |email_address| %>

<%=h email_address %>

diff --git a/views/db/email_addresses/show.erb b/views/db/email_addresses/show.erb index 3e2a1e5..d582c17 100644 --- a/views/db/email_addresses/show.erb +++ b/views/db/email_addresses/show.erb @@ -8,7 +8,10 @@ <% end %> -

Email Address: <%=h @email_address %>

+
+

Email Address: <%=h @email_address %>

+ <%= partial(:delete, record: @email_address, path: "email_addresses") %> +
diff --git a/views/db/host_names/index.erb b/views/db/host_names/index.erb index f683f71..15d04ce 100644 --- a/views/db/host_names/index.erb +++ b/views/db/host_names/index.erb @@ -7,7 +7,10 @@ <% end %> -

Host names

+
+

Host names

+ <%= partial(:delete_all, path: "host_names") %> +
<% @host_names.each do |host_name| %>

<%=h host_name %>

diff --git a/views/db/host_names/show.erb b/views/db/host_names/show.erb index 7bd1aa9..22519b0 100644 --- a/views/db/host_names/show.erb +++ b/views/db/host_names/show.erb @@ -8,7 +8,10 @@ <% end %> -

Host Name: <%=h @host_name %>

+
+

Host Name: <%=h @host_name %>

+ <%= partial(:delete, record: @host_name, path: "host_names") %> +
diff --git a/views/db/ip_addresses/index.erb b/views/db/ip_addresses/index.erb index 38a29e5..8a5912d 100644 --- a/views/db/ip_addresses/index.erb +++ b/views/db/ip_addresses/index.erb @@ -7,7 +7,10 @@ <% end %> -

IP Addresses

+
+

IP Addresses

+ <%= partial(:delete_all, path: "ip_addresses") %> +
<% @ip_addresses.each do |ip_address| %>

<%=h ip_address %>

diff --git a/views/db/ip_addresses/show.erb b/views/db/ip_addresses/show.erb index 143d4fe..758a7ab 100644 --- a/views/db/ip_addresses/show.erb +++ b/views/db/ip_addresses/show.erb @@ -8,7 +8,10 @@ <% end %> -

IP Address: <%=h @ip_address %>

+
+

IP Address: <%=h @ip_address %>

+ <%= partial(:delete, record: @ip_address, path: "ip_addresses") %> +
diff --git a/views/db/mac_addresses/index.erb b/views/db/mac_addresses/index.erb index 284475b..bd664e3 100644 --- a/views/db/mac_addresses/index.erb +++ b/views/db/mac_addresses/index.erb @@ -7,7 +7,10 @@ <% end %> -

MAC Addresses

+
+

MAC Addresses

+ <%= partial(:delete_all, path: "mac_addresses") %> +
<% @mac_addresses.each do |mac_address| %>

<%=h mac_address %>

diff --git a/views/db/mac_addresses/show.erb b/views/db/mac_addresses/show.erb index e5ccea2..5a7fdd8 100644 --- a/views/db/mac_addresses/show.erb +++ b/views/db/mac_addresses/show.erb @@ -8,7 +8,10 @@ <% end %> -

MAC Address: <%=h @mac_address %>

+
+

MAC Address: <%=h @mac_address %>

+ <%= partial(:delete, record: @mac_address, path: "mac_addresses") %> +
diff --git a/views/db/open_ports/index.erb b/views/db/open_ports/index.erb index 101d59f..7dce89b 100644 --- a/views/db/open_ports/index.erb +++ b/views/db/open_ports/index.erb @@ -7,7 +7,10 @@ <% end %> -

Open Ports

+
+

Open Ports

+ <%= partial(:delete_all, path: "open_ports") %> +
<% @open_ports.each do |open_port| %>

<%=h open_port %>

diff --git a/views/db/open_ports/show.erb b/views/db/open_ports/show.erb index 6801d0b..f8dfd29 100644 --- a/views/db/open_ports/show.erb +++ b/views/db/open_ports/show.erb @@ -8,7 +8,10 @@ <% end %> -

Open Port: <%=h @open_port %>

+
+

Open Port: <%=h @open_port %>

+ <%= partial(:delete, record: @open_port, path: "open_ports") %> +
diff --git a/views/db/organizations/show.erb b/views/db/organizations/show.erb index 300f28c..40854ce 100644 --- a/views/db/organizations/show.erb +++ b/views/db/organizations/show.erb @@ -8,7 +8,10 @@ <% end %> -

Organization: <%=h @organization %>

+
+

Organization: <%=h @organization %>

+ <%= partial(:delete, record: @organization, path: "organizations") %> +
diff --git a/views/db/oses/index.erb b/views/db/oses/index.erb index fc357d1..5d8a978 100644 --- a/views/db/oses/index.erb +++ b/views/db/oses/index.erb @@ -7,7 +7,10 @@ <% end %> -

OSes

+
+

OSes

+ <%= partial(:delete_all, path: "oses") %> +
<% @oses.each do |os| %>

<%=h os %>

diff --git a/views/db/oses/show.erb b/views/db/oses/show.erb index b11c01f..40307e6 100644 --- a/views/db/oses/show.erb +++ b/views/db/oses/show.erb @@ -8,7 +8,10 @@ <% end %> -

OS: <%=h @os %>

+
+

OS: <%=h @os %>

+ <%= partial(:delete, record: @os, path: "oses") %> +
diff --git a/views/db/passwords/index.erb b/views/db/passwords/index.erb index 44466d7..3504286 100644 --- a/views/db/passwords/index.erb +++ b/views/db/passwords/index.erb @@ -7,7 +7,10 @@ <% end %> -

Passwords

+
+

Passwords

+ <%= partial(:delete_all, path: "passwords") %> +
<% @passwords.each do |password| %>

<%=h password %>

diff --git a/views/db/passwords/show.erb b/views/db/passwords/show.erb index 6f57785..a7fb843 100644 --- a/views/db/passwords/show.erb +++ b/views/db/passwords/show.erb @@ -8,7 +8,10 @@ <% end %> -

Password: <%=h @password %>

+
+

Password: <%=h @password %>

+ <%= partial(:delete, record: @password, path: "passwords") %> +
diff --git a/views/db/people/index.erb b/views/db/people/index.erb index e8671c5..acd49e6 100644 --- a/views/db/people/index.erb +++ b/views/db/people/index.erb @@ -7,7 +7,10 @@ <% end %> -

People

+
+

People

+ <%= partial(:delete_all, path: "people") %> +
<% @people.each do |person| %>

<%=h person %>

diff --git a/views/db/people/show.erb b/views/db/people/show.erb index 5f3bdec..c29c538 100644 --- a/views/db/people/show.erb +++ b/views/db/people/show.erb @@ -8,7 +8,10 @@ <% end %> -

Person: <%=h @person %>

+
+

Person: <%=h @person %>

+ <%= partial(:delete, record: @person, path: "people") %> +
diff --git a/views/db/phone_numbers/index.erb b/views/db/phone_numbers/index.erb index 4862f16..414ee3d 100644 --- a/views/db/phone_numbers/index.erb +++ b/views/db/phone_numbers/index.erb @@ -7,7 +7,10 @@ <% end %> -

Phone Numbers

+
+

Phone Numbers

+ <%= partial(:delete_all, path: "phone_numbers") %> +
<% @phone_numbers.each do |phone_number| %>

<%=h phone_number %>

diff --git a/views/db/phone_numbers/show.erb b/views/db/phone_numbers/show.erb index 6bd6560..cf7e01a 100644 --- a/views/db/phone_numbers/show.erb +++ b/views/db/phone_numbers/show.erb @@ -8,7 +8,10 @@ <% end %> -

Phone Number: <%=h @phone_number %>

+
+

Phone Number: <%=h @phone_number %>

+ <%= partial(:delete, record: @phone_number, path: "phone_numbers") %> +
diff --git a/views/db/ports/index.erb b/views/db/ports/index.erb index 3fb137b..8811745 100644 --- a/views/db/ports/index.erb +++ b/views/db/ports/index.erb @@ -7,7 +7,10 @@ <% end %> -

Ports

+
+

Ports

+ <%= partial(:delete_all, path: "ports") %> +
<% @ports.each do |port| %>

<%=h port %>

diff --git a/views/db/ports/show.erb b/views/db/ports/show.erb index f8cafe7..5ff25ee 100644 --- a/views/db/ports/show.erb +++ b/views/db/ports/show.erb @@ -8,7 +8,10 @@ <% end %> -

Port: <%=h @port %>

+
+

Port: <%=h @port %>

+ <%= partial(:delete, record: @port, path: "ports") %> +
diff --git a/views/db/services/index.erb b/views/db/services/index.erb index ebaf4b2..859492b 100644 --- a/views/db/services/index.erb +++ b/views/db/services/index.erb @@ -7,7 +7,10 @@ <% end %> -

Services

+
+

Services

+ <%= partial(:delete_all, path: "services") %> +
<% @services.each do |service| %>

<%=h service %>

diff --git a/views/db/services/show.erb b/views/db/services/show.erb index 4598362..260bf4a 100644 --- a/views/db/services/show.erb +++ b/views/db/services/show.erb @@ -8,7 +8,10 @@ <% end %> -

Service: <%=h @service %>

+
+

Service: <%=h @service %>

+ <%= partial(:delete, record: @service, path: "services") %> +
diff --git a/views/db/software/index.erb b/views/db/software/index.erb index 397cd3c..3fb2f96 100644 --- a/views/db/software/index.erb +++ b/views/db/software/index.erb @@ -7,7 +7,10 @@ <% end %> -

Software

+
+

Software

+ <%= partial(:delete_all, path: "software") %> +
<% @software.each do |software| %>

<%=h software %>

diff --git a/views/db/software/show.erb b/views/db/software/show.erb index aa24477..0a07f90 100644 --- a/views/db/software/show.erb +++ b/views/db/software/show.erb @@ -8,7 +8,10 @@ <% end %> -

Software: <%=h @software %>

+
+

Software: <%=h @software %>

+ <%= partial(:delete, record: @software, path: "software") %> +
diff --git a/views/db/software_vendors/index.erb b/views/db/software_vendors/index.erb index 9a0df9d..014a4b7 100644 --- a/views/db/software_vendors/index.erb +++ b/views/db/software_vendors/index.erb @@ -7,7 +7,10 @@ <% end %> -

Software Vendors

+
+

Software Vendors

+ <%= partial(:delete_all, path: "software_vendors") %> +
<% @software_vendors.each do |software_vendor| %>

<%=h software_vendor %>

diff --git a/views/db/software_vendors/show.erb b/views/db/software_vendors/show.erb index a78c9ca..816b13b 100644 --- a/views/db/software_vendors/show.erb +++ b/views/db/software_vendors/show.erb @@ -8,7 +8,10 @@ <% end %> -

Software Vendor: <%=h @software_vendor %>

+
+

Software Vendor: <%=h @software_vendor %>

+ <%= partial(:delete, record: @software_vendor, path: "software_vendors") %> +
diff --git a/views/db/street_addresses/index.erb b/views/db/street_addresses/index.erb index 375d6bf..a2d2635 100644 --- a/views/db/street_addresses/index.erb +++ b/views/db/street_addresses/index.erb @@ -6,8 +6,11 @@ <% end %> - -

Street Addresses

+ +
+

Street Addresses

+ <%= partial(:delete_all, path: "street_addresses") %> +
<% @street_addresses.each do |street_address| %>

<%=h street_address %>

diff --git a/views/db/street_addresses/show.erb b/views/db/street_addresses/show.erb index 0c0aac2..2edef69 100644 --- a/views/db/street_addresses/show.erb +++ b/views/db/street_addresses/show.erb @@ -8,7 +8,10 @@ <% end %> -

Street Address: <%=h @street_address %>

+
+

Street Address: <%=h @street_address %>

+ <%= partial(:delete, record: @street_address, path: "street_addresses") %> +
diff --git a/views/db/url_query_param_names/index.erb b/views/db/url_query_param_names/index.erb index 2560b8b..01d97f5 100644 --- a/views/db/url_query_param_names/index.erb +++ b/views/db/url_query_param_names/index.erb @@ -7,7 +7,10 @@ <% end %> -

URL Query Param Names

+
+

URL Query Param Names

+ <%= partial(:delete_all, path: "url_query_param_names") %> +
<% @url_query_param_names.each do |url_query_param_name| %>

<%=h url_query_param_name %>

diff --git a/views/db/url_query_param_names/show.erb b/views/db/url_query_param_names/show.erb index c67952f..ddfb749 100644 --- a/views/db/url_query_param_names/show.erb +++ b/views/db/url_query_param_names/show.erb @@ -8,7 +8,10 @@ <% end %> -

URL Query Param Name: <%=h @url_query_param_name %>

+
+

URL Query Param Name: <%=h @url_query_param_name %>

+ <%= partial(:delete, record: @url_query_param_name, path: "url_query_param_names") %> +
diff --git a/views/db/url_schemes/index.erb b/views/db/url_schemes/index.erb index 680c8f2..d8f7b57 100644 --- a/views/db/url_schemes/index.erb +++ b/views/db/url_schemes/index.erb @@ -7,7 +7,10 @@ <% end %> -

URL Schemes

+
+

URL Schemes

+ <%= partial(:delete_all, path: "url_schemes") %> +
<% @url_schemes.each do |url_scheme| %>

<%=h url_scheme %>

diff --git a/views/db/url_schemes/show.erb b/views/db/url_schemes/show.erb index 9c8d0dd..05b689a 100644 --- a/views/db/url_schemes/show.erb +++ b/views/db/url_schemes/show.erb @@ -8,7 +8,10 @@ <% end %> -

URL Scheme: <%=h @url_scheme %>

+
+

URL Scheme: <%=h @url_scheme %>

+ <%= partial(:delete, record: @url_scheme, path: "url_schemes") %> +
diff --git a/views/db/urls/show.erb b/views/db/urls/show.erb index 516bcf0..333c30d 100644 --- a/views/db/urls/show.erb +++ b/views/db/urls/show.erb @@ -8,7 +8,6 @@ <% end %> -

URL: <%=h @url %>

<%= partial(:delete, record: @url, path: "urls") %> diff --git a/views/db/user_names/index.erb b/views/db/user_names/index.erb index 3386f13..f32da35 100644 --- a/views/db/user_names/index.erb +++ b/views/db/user_names/index.erb @@ -7,7 +7,10 @@ <% end %> -

User Names

+
+

User Names

+ <%= partial(:delete_all, path: "user_names") %> +
<% @user_names.each do |user_name| %>

<%=h user_name %>

diff --git a/views/db/user_names/show.erb b/views/db/user_names/show.erb index 5c2b12b..5789139 100644 --- a/views/db/user_names/show.erb +++ b/views/db/user_names/show.erb @@ -8,7 +8,10 @@ <% end %> -

User Name: <%=h @user_name %>

+
+

User Name: <%=h @user_name %>

+ <%= partial(:delete, record: @user_name, path: "user_names") %> +
diff --git a/views/db/vulns/index.erb b/views/db/vulns/index.erb index 7ab83be..8962fed 100644 --- a/views/db/vulns/index.erb +++ b/views/db/vulns/index.erb @@ -7,7 +7,10 @@ <% end %> -

Vulnerabilities

+
+

Vulnerabilities

+ <%= partial(:delete_all, path: "vulns") %> +
<% @vulns.each do |vuln| %>

<%=h vuln.url %>

diff --git a/views/db/vulns/show.erb b/views/db/vulns/show.erb index 5584be9..eabc3a1 100644 --- a/views/db/vulns/show.erb +++ b/views/db/vulns/show.erb @@ -8,7 +8,10 @@ <% end %> -

Vulnerability: <%=h @vuln.url %>

+
+

Vulnerability: <%=h @vuln.url %>

+ <%= partial(:delete, record: @vuln, path: "vulns") %> +