@app.route('<STR_LIT:/>')<EOL>@requires_auth<EOL>def home():
<EOL>preview = config()['<STR_LIT>']['<STR_LIT>']<EOL>previewdir = config()['<STR_LIT>']['<STR_LIT>']<EOL>preview = [p.replace('<STR_LIT>', previewdir) for p in preview]<EOL>preview = zip(preview, range(len(preview)))<EOL>preview = [p[<NUM_LIT:1>] for p in preview if os.path.isfile(p[<NUM_LIT:0>])]<EOL>try:<EOL><INDENT>limit_upcoming = int(request.args.get('<STR_LIT>', <NUM_LIT:5>))<EOL>limit_processed = int(request.args.get('<STR_LIT>', <NUM_LIT:15>))<EOL><DEDENT>except ValueError:<EOL><INDENT>limit_upcoming = <NUM_LIT:5><EOL>limit_processed = <NUM_LIT:15><EOL><DEDENT>db = get_session()<EOL>upcoming_events = db.query(UpcomingEvent).order_by(UpcomingEvent.start).limit(limit_upcoming)<EOL>recorded_events = db.query(RecordedEvent).order_by(RecordedEvent.start.desc()).limit(limit_processed)<EOL>recording = get_service_status(Service.CAPTURE) == ServiceStatus.BUSY<EOL>uploading = get_service_status(Service.INGEST) == ServiceStatus.BUSY<EOL>processed = db.query(RecordedEvent).count()<EOL>upcoming = db.query(UpcomingEvent).count()<EOL>return render_template('<STR_LIT>', preview=preview, config=config(),<EOL>recorded_events=recorded_events,<EOL>upcoming_events=upcoming_events,<EOL>recording=recording, uploading=uploading,<EOL>processed=processed, upcoming=upcoming,<EOL>limit_upcoming=limit_upcoming,<EOL>limit_processed=limit_processed,<EOL>dtfmt=dtfmt)<EOL>
Serve the status page of the capture agent.