diff options
author | 2020-04-20 13:26:21 +0200 | |
---|---|---|
committer | 2020-04-20 13:26:21 +0200 | |
commit | eb3710c2671246889b8d45b752cb251c02349aad (patch) | |
tree | ee0acd0d9afd8cc133c10122fa188788401c0b34 /web | |
parent | Correctly display the user name in comments (diff) | |
download | glsamaker-eb3710c2671246889b8d45b752cb251c02349aad.tar.gz glsamaker-eb3710c2671246889b8d45b752cb251c02349aad.tar.bz2 glsamaker-eb3710c2671246889b8d45b752cb251c02349aad.zip |
Add a page to manually enter a cve
Signed-off-by: Max Magorsch <arzano@gentoo.org>
Diffstat (limited to 'web')
-rw-r--r-- | web/packs/src/javascript/cvetool.js | 12 | ||||
-rw-r--r-- | web/templates/index/new.tmpl | 106 |
2 files changed, 117 insertions, 1 deletions
diff --git a/web/packs/src/javascript/cvetool.js b/web/packs/src/javascript/cvetool.js index 2a04c5b..d672a07 100644 --- a/web/packs/src/javascript/cvetool.js +++ b/web/packs/src/javascript/cvetool.js @@ -89,6 +89,13 @@ function initDatatable(){ } }, { + text: 'New', + className: 'btn-sm btn-outline-secondary float-left colvis-btn new-btn', + action: function ( e, dt, node, config ) { + Turbolinks.visit("/cve/new"); + } + }, + { text: 'State', className: 'btn-sm btn-outline-secondary float-left colvis-btn mr-2 dropdown-toggle view-filter-state' } @@ -105,10 +112,13 @@ function initDatatable(){ $('#table_id_filter').prepend( '<div id="filterByStateDropdown" class="dropdown"> <div class="dropdown-menu" aria-labelledby="dropdownMenuButton"> <button id="filterByStateNew" class="dropdown-item"><span class="badge badge-danger state">New</span></button> <button id="filterByStateAssigned" class="dropdown-item"><span class="badge badge-success state">Assigned</span></button> <button id="filterByStateNFU" class="dropdown-item"><span class="badge badge-info state">NFU</span></button> <button id="filterByStateLater" class="dropdown-item"><span class="badge badge-warning state">Later</span></button> <button id="filterByStateInvalid" class="dropdown-item"><span class="badge badge-dark state">Invalid</span></button> <div class="dropdown-divider"></div> <button id="filterByStateAll" class="dropdown-item">All</button> </div> </div>' ); - $('#table_id_filter').prepend( "<span class='m-1 float-left'> Filter by </span>" ); + $('#table_id_filter').prepend( "<span class='m-1 ml-5 float-left'> Filter by </span>" ); $('.view-filter-state').prependTo( $('#filterByStateDropdown') ); document.querySelector(".view-filter-state").setAttribute('data-toggle', 'dropdown'); + $('#table_id_filter').prepend( $('.new-btn') ); + $('#table_id_filter').prepend( "<span class='m-1 float-left'> Create </span>" ); + $("#filterByStateNew").on('click', function () { $('.view-filter-state').text("New"); table.columns( 10 ).search( "New" ).draw(); diff --git a/web/templates/index/new.tmpl b/web/templates/index/new.tmpl new file mode 100644 index 0000000..ccbb33b --- /dev/null +++ b/web/templates/index/new.tmpl @@ -0,0 +1,106 @@ +<!DOCTYPE html> +<html lang="en"> +{{template "head"}} +<body> +{{template "header" .}} + +<div class="container mb-5"> + <div class="row"> + <div class="col-12"> + + <h2 class="ml-1 mb-4">New CVE </h2> + + <div class="card px-2 mx-1"> + <div class="card-body"> + + <form action="/cve/new" method="POST"> + + + <div class="col-sm-12 pr-0"> + <span class="badge badge-danger badge-request">New</span> + <span class="badge badge-warning badge-draft" style="display: none;">Draft</span> + <a id="cve_id_label" style="color:#000000;" href="">CVE </a> + + <span id="summary_container"> + <small style="margin-left:5px;color:#505152;">Created: 2020-04-08 16:05 UTC</small> + </span> + + + </div> + + <div class="col-sm-12"> + <h1 style="font-size: 20px;margin-top:10px;margin-bottom:4px;"><span id="short_desc_nonedit_display"> + New Common Vulnerabilities and Exposures Report + </span></h1> + </div> + + + <style> + .advanced-fields { + color: grey; + } + </style> + + + + <div class="row mt-5"> + <div class="col-2 text-right"> + <b>ID</b><br/> + <small>Please enter the ID of the new CVE here.</small> + </div> + <div class="col-10"> + <input placeholder="CVE-YYYY-NNNN" id="id" name="id" type="text" class="form-control" style="display:inline-block;max-width: 200px;background: none;"/> + <i id="bug-spinner" class="fa fa-lg fa-refresh fa-spin ml-3" style="display: none;" aria-hidden="true"></i> + <i id="bug-refresh-ok" class="fa fa-lg fa-check ml-3" style="display: none;color: green;" aria-hidden="true"></i> + <i id="bug-refresh-failed" class="fa fa-lg fa-times ml-3" style="display: none;color: darkred;" aria-hidden="true"></i> + </div> + </div> + + <div class="row mt-4"> + <div class="col-2 text-right"> + <b>Base Score</b><br/> + <small>You can set a BaseScore for the CVE here</small> + </div> + <div class="col-10"> + <input placeholder="optional" id="basescore" name="basescore" type="text" class="form-control" style="display:inline-block;max-width: 200px;background: none;"/> + </div> + </div> + + <div class="row mt-4"> + <div class="col-2 text-right"> + <b>Summary</b><br/> + <small>Please summarize the new CVE here</small> + </div> + <div class="col-10"> + <textarea id="summary" name="summary" rows="5" class="form-control" style="max-width: 600px;background: none;"></textarea> + </div> + </div> + + + <hr class="mt-4"/> + + <div class="row mt-4"> + <div class="col-2 text-right"></div> + <div class="col-10"> + <button type="submit" class="btn btn-primary float-right"> Create CVE <i class="fa fa-angle-double-right ml-1" aria-hidden="true"></i></button> + + </div> + </div> + + </form> + + </div> + </div> + + + + </div> + </div> +</div> + + +{{template "footer" .}} + + +</body> +</html> |