|
5 | 5 | from flask.blueprints import Blueprint |
6 | 6 |
|
7 | 7 | from .utils import ( |
| 8 | + create_heat_markdown, |
8 | 9 | create_leaderboard_markdown, |
9 | 10 | create_nodes_markdown, |
10 | 11 | create_topbar_markdown, |
11 | 12 | ) |
12 | 13 |
|
13 | 14 | overlays: dict = { |
14 | | - "DDS": {"node": True, "topbar": True, "leaderboard": True}, |
15 | | - "LCDR": {"node": True, "topbar": True, "leaderboard": False}, |
| 15 | + "DDS": {"node": True, "topbar": True, "leaderboard": True, "heat": True}, |
| 16 | + "LCDR": {"node": True, "topbar": True, "leaderboard": False, "heat": True}, |
| 17 | + "APEX": {"node": True, "topbar": True, "leaderboard": False, "heat": True}, |
16 | 18 | } |
17 | 19 |
|
18 | 20 |
|
@@ -50,7 +52,7 @@ def create_panels(self, _args: dict) -> None: |
50 | 52 | panel_id, |
51 | 53 | f"{overlay_name} - OBS Overlays", |
52 | 54 | "streams", |
53 | | - open=True, |
| 55 | + open=False, |
54 | 56 | ) |
55 | 57 |
|
56 | 58 | # Create and register markdown blocks based on the features |
@@ -80,6 +82,12 @@ def create_panels(self, _args: dict) -> None: |
80 | 82 | panel_id, f"{overlay_name}-Nodes", nodes_markdown |
81 | 83 | ) |
82 | 84 |
|
| 85 | + if features.get("heat"): |
| 86 | + heat_markdown = create_heat_markdown(overlay_name, base_path) |
| 87 | + self._rhapi.ui.register_markdown( |
| 88 | + panel_id, f"{overlay_name}-Heat", heat_markdown |
| 89 | + ) |
| 90 | + |
83 | 91 |
|
84 | 92 | def initialize(rhapi: object) -> None: |
85 | 93 | """Initialize the plugin. |
@@ -149,4 +157,16 @@ def render_class_leaderboard_overlay(name: str, class_id: int) -> str: |
149 | 157 | class_id=class_id, |
150 | 158 | ) |
151 | 159 |
|
| 160 | + @bp.route("/stream/overlay/<string:name>/heat/upcoming") |
| 161 | + def render_heat_overlay(name: str) -> str: |
| 162 | + """Render the upcoming heat overlay.""" |
| 163 | + return templating.render_template( |
| 164 | + f"stream/heat/heat_{name}.html", |
| 165 | + serverInfo=None, |
| 166 | + getOption=rhapi.db.option, |
| 167 | + getConfig=rhapi.config.get_item, |
| 168 | + __=rhapi.__, |
| 169 | + num_nodes=len(rhapi.interface.seats), |
| 170 | + ) |
| 171 | + |
152 | 172 | rhapi.ui.blueprint_add(bp) |
0 commit comments