Exemplo n.º 1
0
def view_dashboard(dashboard_id):
    """Create a new dashboard."""
    dashboard = get_dashboard_data(current_user, dashboard_id)
    if dashboard is None:
        abort(404)
    return render_template(
        'public/dashboard.html',
        dashboard_id=dashboard_id,
        dashboard=dashboard,
        raw=request.path.endswith('/raw'),
        user_token=current_user.api_token,
    )
Exemplo n.º 2
0
def get_dashboard(user, *args, **kwargs):
    data = request.get_json()
    dashboard_id = data.get("dashboard_id")
    results = get_dashboard_data(user, dashboard_id)
    results['success'] = True
    return jsonify(results)