| 1 |
from __future__ import annotations |
| 2 |
|
| 3 |
from flask import current_app |
| 4 |
|
| 5 |
from . import DebugPanel |
| 6 |
|
| 7 |
|
| 8 |
class ConfigVarsDebugPanel(DebugPanel): |
| 9 |
"""A panel to display all variables from Flask configuration.""" |
| 10 |
|
| 11 |
name = "ConfigVars" |
| 12 |
has_content = True |
| 13 |
|
| 14 |
def nav_title(self) -> str: |
| 15 |
return "Config" |
| 16 |
|
| 17 |
def title(self) -> str: |
| 18 |
return "Config" |
| 19 |
|
| 20 |
def url(self) -> str: |
| 21 |
return "" |
| 22 |
|
| 23 |
def content(self) -> str: |
| 24 |
context = self.context.copy() |
| 25 |
context.update( |
| 26 |
{ |
| 27 |
"config": current_app.config, |
| 28 |
} |
| 29 |
) |
| 30 |
return self.render("panels/config_vars.html", context) |