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 {