-
Notifications
You must be signed in to change notification settings - Fork 5
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
1 parent
771a836
commit 54dc897
Showing
13 changed files
with
88 additions
and
103 deletions.
There are no files selected for viewing
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
Empty file.
Empty file.
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
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 |
---|---|---|
@@ -0,0 +1,42 @@ | ||
class ProgressController < ApplicationController | ||
|
||
# GET /about | ||
def index | ||
@projects = Project.all | ||
end | ||
|
||
# GET /api/about/progress | ||
def progress | ||
stats = {} | ||
Project.all.each do |p| | ||
p_stats = {} | ||
num_vulns = Vulnerability.where(project: p).count | ||
p_stats[:num_vulns] = num_vulns | ||
p_stats[:num_vulns_report] = ActiveSupport::NumberHelper.number_to_delimited(num_vulns, :delimiter => ',') | ||
num_curated = Vulnerability.curated.where(project: p).count | ||
p_stats[:num_curated] = num_curated | ||
p_stats[:perc_curated] = 100.0 * num_curated / num_vulns.to_f | ||
p_stats[:perc_report] = "%.1f%%" % p_stats[:perc_curated] | ||
num_w_fixes = Fix.select(:vulnerability_id).distinct.count | ||
p_stats[:perc_fixes] = (100.0 * num_w_fixes / num_vulns.to_f) | ||
# @fix_report = "%.1f%%" % @perc_fixes | ||
# @num_vccs = Vcc.count | ||
# @num_w_vccs = Vcc.select(:vulnerability_id).distinct.count | ||
# @perc_vccs = (100.0 * @num_w_vccs / num_vulns.to_f) | ||
# @vcc_report = "%.1f%%" % @perc_vccs | ||
stats[p.id] = p_stats | ||
end | ||
stats[0] = all_project_stats() | ||
render_json_for_api stats | ||
end | ||
|
||
private | ||
|
||
def all_project_stats | ||
{ | ||
num_vulns: Vulnerability.count | ||
} | ||
end | ||
|
||
|
||
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
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 |
---|---|---|
@@ -1,41 +1,3 @@ | ||
<%= render('shared/title') do %> | ||
Data Curation | ||
<% end %> | ||
<h1>About Us</h1> | ||
|
||
<%= render('shared/grid', size: 8) do %> | ||
<p> | ||
This project relies upon a massive effort to collect, correct, and annotate vulnerability history data. We call this process <b>curating</b>. | ||
</p> | ||
|
||
<ul class="tabs" | ||
id="curate-tabs" | ||
data-tabs | ||
data-deep-link="true" | ||
data-update-history="true" | ||
data-deep-link-smudge="true" | ||
data-deep-link-smudge-delay="500"> | ||
<li class="tabs-title is-active"> | ||
<a href="#howto" draggable="false"> | ||
<i class="vhp-icon-curate"></i> | ||
How to Curate | ||
</a> | ||
</li> | ||
<li class="tabs-title"> | ||
<a href="#progress" aria-selected="true" draggable="false"> | ||
<i class="vhp-icon-graph-pie"></i> | ||
Progress | ||
</a> | ||
</li> | ||
</ul> | ||
<% end %> | ||
|
||
<div data-tabs-content="curate-tabs"> | ||
<div class="tabs-panel is-active" id="howto"> | ||
<%= render 'howto' %> | ||
</div> | ||
<div class="tabs-panel" id="progress"> | ||
<%= render 'progress' %> | ||
</div> | ||
</div> | ||
|
||
<%= javascript_include_tag "about" %> | ||
<p>Stuff about us.</p> |
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
2 changes: 1 addition & 1 deletion
2
app/views/about/_progress.html.erb → app/views/progress/index.html.erb
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
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 |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<div class="row"> | ||
<h1>Case Study Projects</h1> | ||
|
||
<p>TODO: make this better.</p> | ||
|
||
<% Project.all.each do |p| %> | ||
<div class="project-logo"> | ||
<a href="/tags/project-<%= p.subdomain %>"> | ||
<span style= "height:2em; width:2em;" | ||
class="<%= p.subdomain %>-inline-logo"></span> | ||
</a> | ||
</div> | ||
<div id="project-details" | ||
class="project-details" | ||
style="background-color:<%=p.bg_color %>"> | ||
<span> <%= p.name %></span> | ||
</div> | ||
<% end %> | ||
</div> |
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 |
---|---|---|
@@ -0,0 +1,2 @@ | ||
<h1>Project Show Page</h1> | ||
Under construction. |
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