From 7c6e0b8acfe472b341310230049b15e9fc211014 Mon Sep 17 00:00:00 2001 From: guyue55 <1724246050@qq.com> Date: Tue, 4 Mar 2025 11:39:16 +0800 Subject: [PATCH] =?UTF-8?q?1.=20=E4=BC=98=E5=8C=96=E6=97=A5=E5=BF=97?= =?UTF-8?q?=E5=AD=98=E5=82=A8=E8=B7=AF=E5=BE=84=EF=BC=9B=202.=20=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D=E5=B9=B6=E4=BC=98=E5=8C=96=E9=A6=96=E9=A1=B5=E5=8D=A1?= =?UTF-8?q?=E7=89=87=E6=97=A0=E6=B3=95=E7=82=B9=E5=87=BB=E9=97=AE=E9=A2=98?= =?UTF-8?q?=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 5 ++++- app/main.py | 12 ++++++------ app/templates/index.html | 38 ++++++++++++++------------------------ 3 files changed, 24 insertions(+), 31 deletions(-) diff --git a/.gitignore b/.gitignore index 0769e0a..94abea6 100644 --- a/.gitignore +++ b/.gitignore @@ -171,4 +171,7 @@ cython_debug/ .pypirc # other file -*.log \ No newline at end of file +*.log + +# logs directory +logs/ \ No newline at end of file diff --git a/app/main.py b/app/main.py index 35292f0..1210def 100644 --- a/app/main.py +++ b/app/main.py @@ -11,27 +11,27 @@ from app.api.pages import page_router from app.core.config import settings from app.models.database import init_db -# 配置日志 +# 配置日志,确保日志目录存在 +log_dir = Path(__file__).parent.parent / "logs" +log_dir.mkdir(exist_ok=True) + logging.basicConfig( level=logging.INFO, format="%(asctime)s - %(name)s - %(levelname)s - %(message)s", handlers=[ logging.StreamHandler(), - logging.FileHandler(filename="app.log", encoding="utf-8") + logging.FileHandler(filename=str(log_dir / "app.log"), encoding="utf-8") ] ) logger = logging.getLogger(__name__) # 设置模板目录 templates = Jinja2Templates(directory=str(Path(__file__).parent / "templates")) -print("*"*100) -print("templates:", templates) -print(str(Path(__file__).parent / "templates")) app = FastAPI( title=settings.APP_NAME, description="配置中心API", - version="1.0.0", + version="1.0.1", docs_url="/api/docs", redoc_url="/api/redoc", openapi_url="/api/openapi.json" diff --git a/app/templates/index.html b/app/templates/index.html index 4dd8cf7..4edb90b 100644 --- a/app/templates/index.html +++ b/app/templates/index.html @@ -11,43 +11,25 @@

配置中心是一个统一管理各类配置的平台,提供便捷的配置创建、修改、删除和查询功能。

-
+
-
+ -
+
-
+
@@ -89,6 +71,14 @@ border: 1px solid rgba(0,0,0,0.08); position: relative; overflow: hidden; + text-decoration: none; + color: inherit; +} + +.stats-card:hover { + transform: translateY(-8px); + box-shadow: 0 15px 30px rgba(0,0,0,0.1); + cursor: pointer; } .stats-card::before {