Skip to content

Commit

Permalink
[#81 Add USCERT and JPCERT alert information and Fix collapser
Browse files Browse the repository at this point in the history
]
  • Loading branch information
ishiDACo committed Sep 25, 2020
1 parent ae2d45d commit cf57b11
Show file tree
Hide file tree
Showing 3 changed files with 68 additions and 6 deletions.
10 changes: 8 additions & 2 deletions dist/css/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -299,14 +299,20 @@ section {
margin-top: 10px;
}

#title-References {
.title {
font-size: 14px;
}

#count-References {
.count {
margin-left: 10px;
}

a.collapse {
height: 100%;
width: 100%;
display: inline-block;
}

.modal .large {
width: 1650px;
margin-left: -525px;
Expand Down
36 changes: 34 additions & 2 deletions dist/js/vulsrepo.js
Original file line number Diff line number Diff line change
Expand Up @@ -1086,6 +1086,7 @@ const createDetailData = function(cveID) {
targetObj["DistroAdvisories"] = tmpCve.distroAdvisories;
targetObj["exploits"] = tmpCve.exploits;
targetObj["metasploits"] = tmpCve.metasploits;
targetObj["alertDict"] = tmpCve.alertDict;
$.each(vulsrepo.detailTaget, function(i, i_val) {
if (tmpCve.cveContents !== undefined && tmpCve.cveContents[i_val] !== undefined) {
targetObj.cveContents[i_val] = tmpCve.cveContents[i_val];
Expand All @@ -1099,8 +1100,9 @@ const createDetailData = function(cveID) {

const initDetail = function() {
$("#modal-label").text("");
$("#count-cert").text("0");
$("#count-References").text("0");
$("#CweID,#Link,#References").empty();
$("#CweID,#Link,#cert,#References").empty();

$.each(vulsrepo.detailTaget, function(i, i_val) {
$("#typeName_" + i_val).empty();
Expand Down Expand Up @@ -1424,6 +1426,37 @@ const displayDetail = function(cveID) {
$("#typeName_amazon").append("Amazon");
}

const prioltyFlag = db.get("vulsrepo_pivotPriority");

// ---USCERT/JPCERT---
let countCert = 0;

let nvd = prioltyFlag.indexOf("nvd");
let jvn = prioltyFlag.indexOf("jvn");
var addCert = function(target, cert) {
if (data.alertDict[target] !== undefined) {
if (isCheckNull(data.alertDict[target]) === false) {
$("#cert").append("<div>===" + cert + " Alert===</div>");
$.each(data.alertDict[target], function(x, x_val) {
let title = cert;
if (x_val.title !== undefined) {
title = x_val.title;
}
$("#cert").append("<div>[" + title + "]<a href=\"" + x_val.url + "\" rel='noopener noreferrer' target='_blank'> (" + x_val.url + ")</a></div>");
countCert++;
});
}
}
}
if (nvd < jvn) {
addCert("en", "USCERT");
addCert("ja", "JPCERT");
} else {
addCert("ja", "JPCERT");
addCert("en", "USCERT");
}
$("#count-cert").text(countCert);

// ---References---
let countRef = 0;

Expand All @@ -1439,7 +1472,6 @@ const displayDetail = function(cveID) {
}
}

const prioltyFlag = db.get("vulsrepo_pivotPriority");
$.each(prioltyFlag, function(i, i_val) {
addRef(i_val);
});
Expand Down
28 changes: 26 additions & 2 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -266,13 +266,37 @@ <h4 class="modal-title" id="modal-label"></h4>
</div>
</div>
</div>
<div class="row full-width-row">
<div>
<div class="col-xs-6">
<section>
<div class="panel-group" id="panel-cert">
<div class="panel panel-primary">
<div class="panel-heading">
<h4 class="panel-title accordion-toggle title">
<a id="title-cert" data-toggle="collapse" data-parent="#panel-cert" href="#collapse-cert" class="collapse">USCERT / JPCERT<span id="count-cert" class="badge count">0</span></a>
</h4>
</div>
<div id="collapse-cert" class="panel-collapse collapse">
<div class="panel-body">
<div id="cert"></div>
</div>
</div>
</div>
</div>
</section>
</div>
<div class="col-xs-6">
</div>
</div>
</div>
</div>
<section>
<div class="panel-group" id="panel-References">
<div class="panel panel-primary">
<div class="panel-heading">
<h4 class="panel-title accordion-toggle">
<a id="title-References" data-toggle="collapse" data-parent="#panel-References" href="#collapse-References">References<span id="count-References" class="badge">0</span></a>
<h4 class="panel-title accordion-toggle title">
<a id="title-References" data-toggle="collapse" data-parent="#panel-References" href="#collapse-References" class="collapse">References<span id="count-References" class="badge count">0</span></a>
</h4>
</div>
<div id="collapse-References" class="panel-collapse collapse">
Expand Down

0 comments on commit cf57b11

Please sign in to comment.