Esempio n. 1
0
def top_domains():
    if request.is_xhr :
        table_args = __get_datatables_args()
        totalCount, filteredCount, domains = db.get_top_domains(**table_args)
        return render_template('top_domains.json', table_args=table_args, count=totalCount, filtered=filteredCount, domains=domains)

    if request.args or 'formdata' not in session:
        session['formdata'] = request.args
    form = forms.PeriodForm(formdata=session['formdata'])
    form.validate()
    return render_template('top_domains.html', form=form)
Esempio n. 2
0
def index():
    if request.args or 'formdata' not in session:
        session['formdata'] = request.args
    form = forms.PeriodForm(formdata=session['formdata'])
    form.validate()
    start = form.get_start()
    end = form.get_end()


    raw = db.count_raw_data(start, end)
    invalid = db.count_invalid_data(start, end)
    errors = db.count_planner_errors(start, end)
    planner_stats = db.get_planner_stats(start, end)
    dagman_stats = db.get_dagman_stats(start, end)
    downloads = db.count_downloads(start, end)

    table_args = {
        "limit" : 5,
        "offset" : 0,
        "start_time" : start,
        "end_time" : end
    }
    # These count variables are just dummies to get the top_hosts and top_domains
    totalCount, filterCount, top_hosts = db.get_top_hosts(**table_args)
    totalCount, filterCount, top_domains = db.get_top_domains(**table_args)


    return render_template('index.html',
            raw=raw,
            invalid=invalid,
            planner_errors=errors,
            planner_stats=planner_stats,
            dagman_stats=dagman_stats,
            top_hosts=top_hosts,
            top_domains=top_domains,
            downloads=downloads,
            form=form)