### Description

Allow users to re-use recent DagRun configurations upon running a DAG.
This can be achieved by adding a dropdown that contains some information about recent configurations. When user selects an item, the relevant JSON configuration can be pasted to the "Configuration JSON" textbox.
<img width="692" alt="Screen Shot 2022-11-16 at 16 22 30" src="https://user-images.githubusercontent.com/39705397/202209536-c709ec75-c768-48ab-97d4-82b02af60569.png">
<img width="627" alt="Screen Shot 2022-11-16 at 16 22 38" src="https://user-images.githubusercontent.com/39705397/202209553-08828521-dba2-4e83-8e2a-6dec850086de.png">
<img width="612" alt="Screen Shot 2022-11-16 at 16 38 40" src="https://user-images.githubusercontent.com/39705397/202209755-0946521a-e1a5-44cb-ae74-d43ca3735f31.png">


### Use case/motivation

Commonly, DAGs are triggered using repetitive configurations. Sometimes the same configuration is used for triggering a DAG, and sometimes, the configuration differs by just a few parameters. 

This interaction forces a user to store the templates he uses somewhere on his machine or to start searching for the configuration he needs in `dagrun/list/`, which does take extra time.

It will be handy to offer a user an option to select one of the recent configurations upon running a DAG.

### Related issues

_No response_

### Are you willing to submit a PR?

- [ ] Yes I am willing to submit a PR!

### Code of Conduct

- [X] I agree to follow this project's [Code of Conduct](https://github.com/apache/airflow/blob/main/CODE_OF_CONDUCT.md)

"""
    Return a dict of the task quantity, grouped by dag id and task status.
    :param qry: The data in the format (<dag id>, <task state>, <is dag running>, <task count>),
        ordered by <dag id> and <is dag running>
    """
    data = {}
    last_dag_id = None
    has_running_dags = False
    for dag_id, state, is_dag_running, count in qry:
        if last_dag_id != dag_id:
            last_dag_id = dag_id
            has_running_dags = False
        elif not is_dag_running and has_running_dags:
            continue
        if is_dag_running:
            has_running_dags = True
        if dag_id not in data:
            data[dag_id] = {}
        data[dag_id][state] = count
    return data
def redirect_or_json(origin, msg, status="", status_code=200):