示例#1
0
def successful_jobs(username, root_wf_id, wf_id):
    """
    Get a list of all successful jobs of the latest instance for a given workflow.
    """
    dashboard = Dashboard(g.master_db_url, root_wf_id, wf_id)
    args = __get_datatables_args()

    total_count, filtered_count, successful_jobs_list = dashboard.get_successful_jobs(wf_id, **args)

    for job in successful_jobs_list:
        job.duration_formatted = filters.time_to_str(job.duration)
        job.exec_job_id = (
            '<a href="'
            + url_for(
                ".job", root_wf_id=root_wf_id, wf_id=wf_id, job_id=job.job_id, job_instance_id=job.job_instance_id
            )
            + '">'
            + job.exec_job_id
            + "</a>"
        )

    return render_template(
        "workflow/jobs_successful.xhr.json",
        count=total_count,
        filtered=filtered_count,
        jobs=successful_jobs_list,
        table_args=args,
    )
示例#2
0
文件: views.py 项目: jie-jay/pegasus
def successful_jobs(username, root_wf_id, wf_id):
    """
    Get a list of all successful jobs of the latest instance for a given workflow.
    """
    dashboard = Dashboard(g.master_db_url, root_wf_id, wf_id)
    args = __get_datatables_args()

    total_count, filtered_count, successful_jobs_list = dashboard.get_successful_jobs(
        wf_id, **args
    )

    for i in range(len(successful_jobs_list)):
        successful_jobs_list[i] = successful_jobs_list[i]._asdict()
        successful_jobs_list[i]["DT_RowClass"] = "successful"
        successful_jobs_list[i]["root_wf_id"] = root_wf_id
        successful_jobs_list[i]["wf_id"] = wf_id
        successful_jobs_list[i]["duration_formatted"] = filters.time_to_str(
            successful_jobs_list[i]["duration"]
        )

    d = {
        "draw": args["sequence"] if args["sequence"] else 0,
        "recordsTotal": total_count
        if total_count is not None
        else len(successful_jobs_list),
        "data": successful_jobs_list,
    }
    if args["limit"]:
        d["recordsFiltered"] = filtered_count

    return serialize(d)
示例#3
0
def successful_jobs(username, root_wf_id, wf_id):
    """
    Get a list of all successful jobs of the latest instance for a given workflow.
    """
    dashboard = Dashboard(g.master_db_url, root_wf_id, wf_id)
    args = __get_datatables_args()

    total_count, filtered_count, successful_jobs_list = dashboard.get_successful_jobs(
        wf_id, **args)

    for job in successful_jobs_list:
        job.duration_formatted = filters.time_to_str(job.duration)
        job.exec_job_id = '<a href="' + url_for(
            '.job',
            root_wf_id=root_wf_id,
            wf_id=wf_id,
            job_id=job.job_id,
            job_instance_id=job.job_instance_id
        ) + '">' + job.exec_job_id + '</a>'

    return render_template('workflow/jobs_successful.xhr.json',
                           count=total_count,
                           filtered=filtered_count,
                           jobs=successful_jobs_list,
                           table_args=args)