@@ -5,6 +5,7 @@ class Settings(BaseSettings):
|
||||
model_config = SettingsConfigDict(env_file=".env", env_file_encoding="utf-8", extra="ignore")
|
||||
|
||||
app_name: str = "VpnPanel"
|
||||
app_version: str = "1.0.0"
|
||||
secret_key: str = "change-me"
|
||||
debug: bool = False
|
||||
|
||||
|
||||
+6
-1
@@ -10,11 +10,16 @@ from app.routers import admin, auth, public, xui
|
||||
|
||||
|
||||
def create_app() -> FastAPI:
|
||||
app = FastAPI(title=settings.app_name, docs_url="/api/docs" if settings.debug else None)
|
||||
app = FastAPI(
|
||||
title=settings.app_name,
|
||||
version=settings.app_version,
|
||||
docs_url="/api/docs" if settings.debug else None,
|
||||
)
|
||||
install_session_middleware(app)
|
||||
|
||||
base = Path(__file__).resolve().parent
|
||||
templates = Jinja2Templates(directory=str(base / "templates"))
|
||||
templates.env.globals["app_version"] = settings.app_version
|
||||
app.state.templates = templates
|
||||
app.state.settings = settings
|
||||
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
</nav>
|
||||
<div class="meta">
|
||||
<div>{{ admin.username }}</div>
|
||||
<div class="muted" style="margin-top:0.35rem;font-size:0.78rem">v{{ app_version }}</div>
|
||||
<form class="inline-form" method="post" action="/admin/logout" style="margin-top:0.6rem">
|
||||
<button class="btn btn-ghost btn-sm" type="submit" style="color:#d7dee5;border-color:#2a343c">Выйти</button>
|
||||
</form>
|
||||
|
||||
Reference in New Issue
Block a user