示例#1
0
文件: views.py 项目: jie-jay/pegasus
def running_jobs(username, root_wf_id, wf_id):
    """
    Get a list of all running 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, running_jobs_list = dashboard.get_running_jobs(
        wf_id, **args
    )

    for i in range(len(running_jobs_list)):
        running_jobs_list[i] = running_jobs_list[i]._asdict()
        running_jobs_list[i]["DT_RowClass"] = "running"

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

    return serialize(d)
示例#2
0
def running_jobs(username, root_wf_id, wf_id):
    """
    Get a list of all running 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, running_jobs_list = dashboard.get_running_jobs(wf_id, **args)

    for job in running_jobs_list:
        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_running.xhr.json",
        count=total_count,
        filtered=filtered_count,
        jobs=running_jobs_list,
        table_args=args,
    )
示例#3
0
文件: views.py 项目: nova0930/pegasus
def running_jobs(username, root_wf_id, wf_id):
    """
    Get a list of all running 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, running_jobs_list = dashboard.get_running_jobs(
        wf_id, **args
    )

    for job in running_jobs_list:
        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_running.xhr.json',
        count=total_count,
        filtered=filtered_count,
        jobs=running_jobs_list,
        table_args=args
    )
示例#4
0
def running_jobs(root_wf_id, wf_id):
    '''
    Get a list of all running 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, running_jobs_list = dashboard.get_running_jobs(wf_id, **args)

    for job in running_jobs_list:
        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.exec_job_id + '</a>'

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