Commit abaffdfe authored by ale's avatar ale

add index.html template

parent 92317b69
<html>
<head>
<title>A/I :: Offline Intrusion Scan</title>
</head>
<body>
<h1>A/I :: Offline Intrusion Scan</h1>
<table>
<thead>
<tr>
<th>User</th>
<th>Site</th>
<th>Infection</th>
<th>Path</th>
<th>Timestamp</th>
</tr>
</thead>
<tbody>
{% for username, entries in virus_by_user.iteritems() %}
{% for entry in entries %}
<tr>
<td>{{ username }}</td>
<td>{{ entry['site'] }}</td>
<td>{{ entry['path'] | truncate(30) }}</td>
<td>{{ entry['virus'] }}</td>
<td>{{ entry['found_at'] | formatstamp }}</td>
</tr>
{% endfor %}
{% endfor %}
</tbody>
</table>
</body>
</html>
......@@ -7,13 +7,18 @@
import json
import time
import redis
from flask import Flask, request, abort, g
from flask import Flask, request, abort, g, render_template
from flask.ext.cache import Cache
app = Flask(__name__)
cache = Cache(app)
@app.template_filter('formatstamp')
def formatstamp(t):
return time.strftime('%Y/%m/%d %H:%M', time.gmtime(int(t)))
def get_redis_connection():
return redis.Redis(
host=app.config['REDIS_HOST'],
......
......@@ -13,7 +13,9 @@ setup(
setup_requires=[],
zip_safe=True,
packages=find_packages(),
package_data={},
package_data={
'offlinescan': ['ai/templates/*.html'],
},
entry_points={
'console_scripts': [
'ofs-incremental-scan = offlinescan.incremental_scan:main',
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment