From 969b32ab68efb5df260b904b647c38575b809777 Mon Sep 17 00:00:00 2001
From: Koha9 <36852125+Koha9@users.noreply.github.com>
Date: Sun, 13 Jul 2025 06:56:26 +0900
Subject: [PATCH] feat(ui): add bootstrap toast for messages
---
app/main.py | 5 +++--
app/templates/base.html | 20 ++++++++++++++++++++
app/templates/login.html | 3 ---
app/templates/playlist.html | 3 ---
4 files changed, 23 insertions(+), 8 deletions(-)
diff --git a/app/main.py b/app/main.py
index f800ce5..4387724 100644
--- a/app/main.py
+++ b/app/main.py
@@ -85,7 +85,7 @@ async def login(
{
"request": request,
"message": "连接成功",
- "success": True,
+ "message_type": "success",
"theme": server_config.theme,
"path": "/login",
"token": token,
@@ -100,7 +100,7 @@ async def login(
{
"request": request,
"message": f"连接失败:{str(e)}",
- "success": False,
+ "message_type": "danger",
"theme": server_config.theme,
"path": "/login",
"scheme": scheme,
@@ -128,6 +128,7 @@ async def set_playlist(
{
"request": request,
"message": f"设置成功:地址 {address},间隔 {interval} 分钟",
+ "message_type": "info",
"theme": server_config.theme,
"path": "/playlist",
},
diff --git a/app/templates/base.html b/app/templates/base.html
index 828078a..6921acf 100644
--- a/app/templates/base.html
+++ b/app/templates/base.html
@@ -87,6 +87,18 @@