| 1 |
from __future__ import annotations |
| 2 |
|
| 3 |
from flask import g |
| 4 |
|
| 5 |
from . import DebugPanel |
| 6 |
|
| 7 |
|
| 8 |
class GDebugPanel(DebugPanel): |
| 9 |
"""A panel to display ``flask.g`` content.""" |
| 10 |
|
| 11 |
name = "g" |
| 12 |
has_content = True |
| 13 |
|
| 14 |
def nav_title(self) -> str: |
| 15 |
return "flask.g" |
| 16 |
|
| 17 |
def title(self) -> str: |
| 18 |
return "flask.g content" |
| 19 |
|
| 20 |
def url(self) -> str: |
| 21 |
return "" |
| 22 |
|
| 23 |
def content(self) -> str: |
| 24 |
context = self.context.copy() |
| 25 |
context.update({"g_content": g.__dict__}) |
| 26 |
return self.render("panels/g.html", context) |