This commit is contained in:
parent
aa11762faa
commit
104e92350b
11
app/main.py
11
app/main.py
|
@ -53,7 +53,16 @@ def get_xml_data(server: str, ticket_path: str):
|
||||||
|
|
||||||
@app.get("/", response_class=HTMLResponse)
|
@app.get("/", response_class=HTMLResponse)
|
||||||
async def index(request: Request):
|
async def index(request: Request):
|
||||||
return templates.TemplateResponse("index.html", {"request": request})
|
# 提供默认的 release_data 和 obtain_data
|
||||||
|
return templates.TemplateResponse(
|
||||||
|
"index.html",
|
||||||
|
{
|
||||||
|
"request": request,
|
||||||
|
"release_data": None, # 默认值
|
||||||
|
"obtain_data": None, # 默认值
|
||||||
|
"server": None, # 默认服务器地址为空
|
||||||
|
},
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
@app.post("/fetch", response_class=HTMLResponse)
|
@app.post("/fetch", response_class=HTMLResponse)
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
</form>
|
</form>
|
||||||
<br>
|
<br>
|
||||||
<div align="center">
|
<div align="center">
|
||||||
{% if obtain_data.response_code == "" %}
|
{% if obtain_data.response_code | default ("") == "" %}
|
||||||
<h3> Please input your server to check. </h3>
|
<h3> Please input your server to check. </h3>
|
||||||
{% elif obtain_data.error %}
|
{% elif obtain_data.error %}
|
||||||
<h3 style="color: red;">{{ obtain_data.error }}</h3> <!-- 显示错误信息 -->
|
<h3 style="color: red;">{{ obtain_data.error }}</h3> <!-- 显示错误信息 -->
|
||||||
|
|
Loading…
Reference in New Issue
Block a user