nonebot-plugin-shiro-web-console 0.1.14__py3-none-any.whl → 0.1.15__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of nonebot-plugin-shiro-web-console might be problematic. Click here for more details.
- nonebot_plugin_shiro_web_console/__init__.py +18 -4
- {nonebot_plugin_shiro_web_console-0.1.14.dist-info → nonebot_plugin_shiro_web_console-0.1.15.dist-info}/METADATA +6 -1
- nonebot_plugin_shiro_web_console-0.1.15.dist-info/RECORD +7 -0
- nonebot_plugin_shiro_web_console-0.1.14.dist-info/RECORD +0 -7
- {nonebot_plugin_shiro_web_console-0.1.14.dist-info → nonebot_plugin_shiro_web_console-0.1.15.dist-info}/WHEEL +0 -0
- {nonebot_plugin_shiro_web_console-0.1.14.dist-info → nonebot_plugin_shiro_web_console-0.1.15.dist-info}/licenses/LICENSE +0 -0
|
@@ -35,7 +35,7 @@ __plugin_meta__ = PluginMetadata(
|
|
|
35
35
|
supported_adapters={"~onebot.v11"},
|
|
36
36
|
extra={
|
|
37
37
|
"author": "luojisama",
|
|
38
|
-
"version": "0.1.
|
|
38
|
+
"version": "0.1.15",
|
|
39
39
|
"pypi_test": "nonebot-plugin-shiro-web-console",
|
|
40
40
|
},
|
|
41
41
|
)
|
|
@@ -77,6 +77,15 @@ async def log_sink(message):
|
|
|
77
77
|
# 注册 loguru sink
|
|
78
78
|
logger.add(log_sink, format="{time} {level} {message}", level="INFO")
|
|
79
79
|
|
|
80
|
+
# Async lock for plugin actions
|
|
81
|
+
store_lock = asyncio.Lock()
|
|
82
|
+
|
|
83
|
+
# Persistent log configuration
|
|
84
|
+
log_dir = nonebot_plugin_localstore.get_plugin_data_dir() / "logs"
|
|
85
|
+
log_dir.mkdir(parents=True, exist_ok=True)
|
|
86
|
+
full_log_path = log_dir / "web_console_full.log"
|
|
87
|
+
logger.add(full_log_path, rotation="10 MB", encoding="utf-8", level="INFO", format="{time:YYYY-MM-DD HH:mm:ss} | {level} | {module}:{line} | {message}")
|
|
88
|
+
|
|
80
89
|
# 验证码管理
|
|
81
90
|
class AuthManager:
|
|
82
91
|
def __init__(self):
|
|
@@ -608,6 +617,12 @@ if app:
|
|
|
608
617
|
async def get_logs():
|
|
609
618
|
return list(log_buffer)
|
|
610
619
|
|
|
620
|
+
@app.get("/web_console/api/logs/download", dependencies=[Depends(check_auth)])
|
|
621
|
+
async def download_logs():
|
|
622
|
+
if not full_log_path.exists():
|
|
623
|
+
return Response("暂无日志记录", status_code=404)
|
|
624
|
+
return FileResponse(full_log_path, filename="nonebot_full.log", media_type="text/plain")
|
|
625
|
+
|
|
611
626
|
@app.get("/web_console/api/plugins", dependencies=[Depends(check_auth)])
|
|
612
627
|
async def get_plugins():
|
|
613
628
|
from nonebot import get_loaded_plugins
|
|
@@ -1080,7 +1095,6 @@ if app:
|
|
|
1080
1095
|
# 保持连接,接收心跳或其他
|
|
1081
1096
|
await websocket.receive_text()
|
|
1082
1097
|
except WebSocketDisconnect:
|
|
1083
|
-
active_connections.
|
|
1098
|
+
active_connections.discard(websocket)
|
|
1084
1099
|
except Exception:
|
|
1085
|
-
|
|
1086
|
-
active_connections.remove(websocket)
|
|
1100
|
+
active_connections.discard(websocket)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: nonebot-plugin-shiro-web-console
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.15
|
|
4
4
|
Summary: 一个用于 NoneBot2 的网页控制台插件,支持通过浏览器查看日志和发送消息
|
|
5
5
|
Project-URL: Homepage, https://github.com/luojisama/nonebot-plugin-shiro-web-console
|
|
6
6
|
Project-URL: Bug Tracker, https://github.com/luojisama/nonebot-plugin-shiro-web-console/issues
|
|
@@ -61,6 +61,11 @@ web_console_password=your_password # 设置固定登录密码
|
|
|
61
61
|
|
|
62
62
|
## 更新日志
|
|
63
63
|
|
|
64
|
+
### v0.1.15
|
|
65
|
+
- **修复**:修复插件商店操作时的 500 错误(缺少异步锁定义)。
|
|
66
|
+
- **修复**:修复 WebSocket 连接断开时的异常报错。
|
|
67
|
+
- **新增**:正式实装完整日志记录与下载功能。
|
|
68
|
+
|
|
64
69
|
### v0.1.14
|
|
65
70
|
- **新增**:完整运行日志记录功能,支持在网页端直接下载。
|
|
66
71
|
- **优化**:添加插件商店操作锁,解决多插件同时更新导致的冲突问题。
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
nonebot_plugin_shiro_web_console/__init__.py,sha256=o9bYKCRn1ObiOLEt0wM3obDM446HYmyFgLa_2y7_VaE,43192
|
|
2
|
+
nonebot_plugin_shiro_web_console/config.py,sha256=LqHht8N5CuSMyBbEjzyJgfZtg05cvBlpGn_2MgTjt-g,202
|
|
3
|
+
nonebot_plugin_shiro_web_console/static/index.html,sha256=er7iyIdX8Z4vD3yjRC5noAUvpnLszztOycsB6D5Y4fg,90118
|
|
4
|
+
nonebot_plugin_shiro_web_console-0.1.15.dist-info/METADATA,sha256=KTsBeu6ykS7X1L_gzT8Vr94h92mIU7FZFPa1z-P96vs,2591
|
|
5
|
+
nonebot_plugin_shiro_web_console-0.1.15.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
|
|
6
|
+
nonebot_plugin_shiro_web_console-0.1.15.dist-info/licenses/LICENSE,sha256=WedEfsrQQfoZsmbJHIAPn4UY_IcpavYULMV5in_ZPbg,1066
|
|
7
|
+
nonebot_plugin_shiro_web_console-0.1.15.dist-info/RECORD,,
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
nonebot_plugin_shiro_web_console/__init__.py,sha256=ff9EWyPSOx4xqc0d-BMCf6ivYTgOjAIC9hNCLtrOIm8,42518
|
|
2
|
-
nonebot_plugin_shiro_web_console/config.py,sha256=LqHht8N5CuSMyBbEjzyJgfZtg05cvBlpGn_2MgTjt-g,202
|
|
3
|
-
nonebot_plugin_shiro_web_console/static/index.html,sha256=er7iyIdX8Z4vD3yjRC5noAUvpnLszztOycsB6D5Y4fg,90118
|
|
4
|
-
nonebot_plugin_shiro_web_console-0.1.14.dist-info/METADATA,sha256=rpcuqIcQ4iY0MpRjuS6MLXCwmJf8a-weon4eJ68Ioi8,2361
|
|
5
|
-
nonebot_plugin_shiro_web_console-0.1.14.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
|
|
6
|
-
nonebot_plugin_shiro_web_console-0.1.14.dist-info/licenses/LICENSE,sha256=WedEfsrQQfoZsmbJHIAPn4UY_IcpavYULMV5in_ZPbg,1066
|
|
7
|
-
nonebot_plugin_shiro_web_console-0.1.14.dist-info/RECORD,,
|
|
File without changes
|