Esempio n. 1
0
def index():
    """Dashboard view."""
    metadata = Metadata.query.first()
    if not current_user.is_authenticated:
        return render_template('index.html', metadata=metadata)

    recent_query = api.analyses(status='completed').limit(10)
    fail_query = api.analyses(status='failed').filter_by(is_visible=True)
    running_query = api.analyses(status=['running', 'pending'])
    return render_template('dashboard.html', fails=fail_query,
                           runnings=running_query, recents=recent_query,
                           metadata=metadata)
Esempio n. 2
0
def analyses():
    """Show all analyses."""
    page_num = int(request.args.get('page', 1))
    query_str = request.args.get('query_str')
    query = api.analyses()
    if query_str:
        query = query.filter(sqa.or_(Analysis.case_id.contains(query_str),
                                     Analysis.status == query_str))
    page = query.paginate(page=page_num, per_page=30)
    return render_template('analyses.html', analyses=page, query_str=query_str)
Esempio n. 3
0
def analysis(case_id):
    """Show history for an analysis."""
    analyses = api.analyses(analysis_id=case_id)
    return render_template('analysis.html', analyses=analyses, case_id=case_id)