예제 #1
0
def get_top10_standing():
    query = qb.from_params(request.args)
    top10 = Alert.get_top10_standing(query)

    if top10:
        return jsonify(status="ok", top10=top10, total=len(top10))
    else:
        return jsonify(status="ok", message="not found", top10=[], total=0)
예제 #2
0
def get_top10_standing():
    query = qb.from_params(request.args, customers=g.customers)
    top10 = Alert.get_top10_standing(query)

    if top10:
        return jsonify(
            status='ok',
            top10=top10,
            total=len(top10),
            autoRefresh=Switch.find_by_name('auto-refresh-allow').is_on)
    else:
        return jsonify(
            status='ok',
            message='not found',
            top10=[],
            total=0,
            autoRefresh=Switch.find_by_name('auto-refresh-allow').is_on)