{% extends "base.html" %}
{% block content %}
    <div class="results">
        <div class="page-header">
            <h3>Results</h3>
        </div>
        <div class="overview">
        <table class="table table-striped table-bordered">
            <thead>
                <tr>
                    <th>Filename</th>
                    <th>File Size</th>
                    <th>MD5</th>
                    <th>Processing Start</th>
                    <th>Duration</th>
                    <th>Status</th>
                </tr>
            </thead>
            <tbody>
                <tr>
                	<td>{{filename}}</td>
                	<td>{{filesize|filesizeformat}}</td>
                	<td>{{md5}}</td>
                	<td>{{start}}</td>
                	<td>{{duration}}</td>
                	<td>{{status}}</td>
                </tr>
			</tbody>
		</table>        	
        </div>
		{% if not status == "Success" %}
		<div class="alert alert-danger">{{stderr}}</div>
		{% endif %}
        <div class="alerts">
        <table class="table table-striped table-bordered">
            <thead>
                <tr>
                    <th>Timestamp</th>
                    <th>SID</th>
                    <th>Class Type</th>
                    <th style="width: 40%;">Message</th>
                    <th>Source</th>
                    <th>Destination</th>
                    <th>Protocol</th>
                </tr>
            </thead>
            <tbody>
            {% for row in alerts | sort(attribute='timestamp')%}
                <tr>
                    <td>{{row.timestamp}}</td>
                    <td>{{row.sid}}</td>
                    <td>{{row.classtype}}</td>
                    <td>{{row.message}}</td>
                    <td>{{row.source}}</td>
                    <td>{{row.destination}}</td>
                    <td>{{row.protocol}}</td>
                </tr>
            {% else %}
            <tr><td colspan="7">No Alerts Generated</td></tr>
            {% endfor %}
            </tbody>
        </table>
        </div>
    </div>
{% endblock %}