| |
@@ -4,6 +4,7 @@
|
| |
from copr_common.enums import StatusEnum
|
| |
from coprs.views.status_ns import status_ns
|
| |
from coprs.logic import builds_logic
|
| |
+ from coprs.logic import complex_logic
|
| |
|
| |
|
| |
@status_ns.route("/")
|
| |
@@ -11,27 +12,26 @@
|
| |
def pending():
|
| |
tasks = builds_logic.BuildsLogic.get_pending_build_tasks(background=False).limit(300).all()
|
| |
bg_tasks_cnt = builds_logic.BuildsLogic.get_pending_build_tasks(background=True).count()
|
| |
- return flask.render_template("status/pending.html",
|
| |
- number=len(tasks),
|
| |
- tasks=tasks, bg_tasks_cnt=bg_tasks_cnt)
|
| |
+ return render_status("pending", tasks=tasks, bg_tasks_cnt=bg_tasks_cnt)
|
| |
|
| |
|
| |
@status_ns.route("/running/")
|
| |
def running():
|
| |
tasks = builds_logic.BuildsLogic.get_build_tasks(StatusEnum("running")).limit(300).all()
|
| |
- return flask.render_template("status/running.html",
|
| |
- number=len(tasks),
|
| |
- tasks=tasks)
|
| |
+ return render_status("running", tasks=tasks)
|
| |
|
| |
|
| |
@status_ns.route("/importing/")
|
| |
def importing():
|
| |
tasks = builds_logic.BuildsLogic.get_build_importing_queue(background=False).limit(300).all()
|
| |
bg_tasks_cnt = builds_logic.BuildsLogic.get_build_importing_queue(background=True).count()
|
| |
- return flask.render_template("status/importing.html",
|
| |
- number=len(list(tasks)),
|
| |
- bg_tasks_cnt=bg_tasks_cnt,
|
| |
- tasks=tasks)
|
| |
+ return render_status("importing", tasks=tasks, bg_tasks_cnt=bg_tasks_cnt)
|
| |
+
|
| |
+
|
| |
+ def render_status(build_status, tasks, bg_tasks_cnt=None):
|
| |
+ queue_sizes = complex_logic.ComplexLogic.get_queue_sizes()
|
| |
+ return flask.render_template("status/{}.html".format(build_status), number=len(tasks), tasks=tasks,
|
| |
+ bg_tasks_cnt=bg_tasks_cnt, queue_sizes=queue_sizes)
|
| |
|
| |
|
| |
@status_ns.route("/stats/")
|
| |
See #552
You can see a screenshot here - https://frostyx.fedorapeople.org/pagure/queue-tabs-badges.png