Skip to content

Commit 9b0e151

Browse files
committed
修复:挂载静态文件
1 parent bc92943 commit 9b0e151

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

src/api/model_api.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ def create_api(manager):
2424

2525
# 挂载静态文件
2626
app.mount("/static", StaticFiles(directory="static"), name="static")
27+
app.mount("/templates", StaticFiles(directory="templates"), name="templates")
2728

2829
@app.get("/")
2930
async def read_root():

templates/index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js"
1212
integrity="sha384-YvpcrYf0tY3lHB60NNkmXc5s9fDVZLESaAA55NDzOxhy9GkcIdslK1eN7N6jIeHz"
1313
crossorigin="anonymous"></script>
14-
<link href="./css/style.css" rel="stylesheet">
14+
<link href="/templates/css/style.css" rel="stylesheet">
1515
</head>
1616
<body>
1717
<nav class="navbar bg-body-secondary navbar-expand-lg sticky-top">
@@ -20,7 +20,7 @@
2020
<img src="../static/favicon.svg" alt="Stable Diffusion 模型管理器" height="26">
2121
</a>
2222

23-
<button class="btn ms-auto" id="nsfwToggle">
23+
<button class="btn btn-success ms-auto" id="nsfwToggle">
2424
<i class="bi bi-eye-slash-fill" id="nsfwIcon"></i>
2525
<span class="ms-1" id="nsfwText">NSFW 已关闭</span>
2626
</button>

0 commit comments

Comments
 (0)