Commit dc86fe0e authored by PidgeyL's avatar PidgeyL
Browse files

remove excess code

parent 37fbcbf4
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -415,7 +415,7 @@ def cve(cveid):
    cvesp = cves.last(rankinglookup=True, namelookup=True, vfeedlookup=True, capeclookup=True,subscorelookup=True)
    cve = cvesp.getcve(cveid=cveid)
    if cve is None:
        return page_not_found(404)
        return render_template('error.html',status={'except':'cve-not-found','info':{'cve':cveid}}) 
    cve = markCPEs(cve)
    return render_template('cve.html', cve=cve)

+6 −6
Original line number Diff line number Diff line
@@ -261,8 +261,8 @@ def cve(cveid):
    cvesp = cves.last(rankinglookup=True, namelookup=True, vfeedlookup=True, capeclookup=True,subscorelookup=True)
    cve = cvesp.getcve(cveid=cveid)
    if cve is None:
        return page_not_found(404)
    return render_template('cve-minimal.html', cve=cve)
        return render_template('error.html',status={'except':'cve-not-found','info':{'cve':cveid}},minimal=True)
    return render_template('cve.html', cve=cve, minimal=True)


@app.route('/browse/<vendor>')
@@ -274,7 +274,7 @@ def browse(vendor=None):
        browseList = getBrowseList(vendor)
        vendor = browseList["vendor"]
        product = browseList["product"]
        return render_template('browse-minimal.html', product=product, vendor=vendor)
        return render_template('browse.html', product=product, vendor=vendor, minimal=True)
    except redisExceptions.ConnectionError:
        return render_template('error.html',
                               status={'except':'redis-connection',
@@ -286,7 +286,7 @@ def search(vendor=None, product=None):
    collection = db.cves
    search = vendor + ":" + product
    cve = collection.find({"vulnerable_configuration": {'$regex': search}}).sort("Modified", -1)
    return render_template('search-minimal.html', vendor=vendor, product=product, cve=cve)
    return render_template('search.html', vendor=vendor, product=product, cve=cve, minimal=True)

@app.route('/link/<vFeedMap>/<field>/<path:value>')
def link(vFeedMap=None,field=None,value=None):
@@ -299,12 +299,12 @@ def link(vFeedMap=None,field=None,value=None):
    cve = list(db.cves.find({'id':{'$in': cveList}}).sort("Modified",-1))
    cvssList=[float(x['cvss']) for x in cve if 'cvss' in x]
    stats={'maxCVSS': max(cvssList), 'minCVSS': min(cvssList),'count':len(cve)}
    return render_template('linked-minimal.html', vFeedMap=vFeedMap, field=field, value=value, cve=cve, stats=stats)
    return render_template('linked.html', vFeedMap=vFeedMap, field=field, value=value, cve=cve, stats=stats, minimal=True)

# error handeling
@app.errorhandler(404)
def page_not_found(e):
    return render_template('404.html'), 404
    return render_template('404.html', minimal=True), 404


# filters
+22 −10
Original line number Diff line number Diff line
@@ -2,17 +2,29 @@
<html lang="en">
<head>
  <title>404</title>
  <!-- metadata -->
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
  <meta name="description" content="Common Vulnerability Exposure most recent entries"/>
  <meta name="author" content="http://github.com/adulau/cve-search - cve-search"/>
  <meta name="author" content="http://github.com/pidgeyl/cve-search - cve-search"/>

  <!-- favicon -->
  <link rel="shortcut icon" href="/static/img/favicon.ico" />
  <!-- defaults -->
  {% include 'defaultHead.html' %}
</head>
<body>
  <h1>404<h1>
  <div class="container-fluid">
    <div class="row">
      <div class="col-sm-12">
        <!-- Nav -->
        {% if minimal %}
          {% include 'menu-minimal.html' %}
        {% else %}
          {% include 'menu.html' %}
        {% endif %}
        <!-- End Nav -->
        <!-- Content -->
        <div class="well">
          <h1>404</h1>
          <h2>This means page not found</h2>
          <p>You navigated to a page that cannot be recreated by the server. Check the URL or try something else.</p>
        </div>
        <!-- end content -->
      </div>
    </div>
  </div>
</body>
</html>

web/templates/browse-minimal.html

deleted100644 → 0
+0 −59
Original line number Diff line number Diff line
<!doctype html>
<html lang="en">
<head>
  <title>Vendor browsing</title>
  <!-- defaults -->
  {% include 'defaultHead.html' %}
</head>

<body>
  <div class="container-fluid">
    <div class="row">
      <div class="col-sm-12">
        <!-- Nav -->
        {% include 'menu-minimal.html' %}
        <!-- End Nav -->
        <!-- Content -->
        <div>
          <!-- breadcrumb -->
          <ol class="breadcrumb">
            {% if product != None%}
              <li> <a href="/browse">Vendors</a></li>
              <li class="active">{{vendor|htmlDecode}}</li>
            {% elif product == None %}
              <li class="active"> Vendors</li>
            {% endif %}
          </ol>
          <!-- browse -->
          <table class="table table-hover table-striped">
            <tbody>
              <tr>
                {% if product != None %}
                  <td class="warning">Products for {{ vendor|htmlDecode }}</td>
                {% elif product == None %}
                  <td class="warning">Vendors</td>
                {% endif %}
              </tr>
              {% if product != None %}
                {% for p in product %}
                  <tr>
                    <td><a href="/search/{{ vendor }}/{{ p|htmlEncode }}">{{ p|htmlDecode }}</a></td>
                  </tr>
                {% endfor %}
              {% else  %}
                {% for v in vendor %}
                  <tr>
                    <td><a href="/browse/{{ v }}">{{ v|htmlDecode }}</a></td>
                  </tr>
                {% endfor %}
              {% endif %}
            </tbody>
          </table>
          <a href="#" class="back-to-top">Back to Top</a>
        </div>
        <!-- end content -->
      </div>
    </div>
  </div>
</body>
</html>
+5 −1
Original line number Diff line number Diff line
@@ -11,7 +11,11 @@
    <div class="row">
      <div class="col-sm-12">
        <!-- Nav -->
        {% if minimal %}
          {% include 'menu-minimal.html' %}
        {% else %}
          {% include 'menu.html' %}
        {% endif %}
        <!-- End Nav -->
        <!-- Content -->
        <div>
Loading