feat(help): 重构帮助系统为图片渲染模式

添加浏览器管理器和图片管理器,用于通过 Playwright 渲染帮助菜单为图片
重构命令管理器以支持图片缓存和同步功能
添加 HTML 模板用于帮助菜单渲染
This commit is contained in:
2026-01-11 21:10:42 +08:00
parent 862ed0d581
commit de1f2e5119
8 changed files with 403 additions and 7 deletions

134
templates/help.html Normal file
View File

@@ -0,0 +1,134 @@
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>NeoBot 帮助菜单</title>
<style>
:root {
--primary-color: #4a90e2;
--bg-color: #f5f7fa;
--card-bg: #ffffff;
--text-color: #333333;
--secondary-text: #666666;
--border-radius: 12px;
--shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}
body {
font-family: 'Microsoft YaHei', 'Segoe UI', Roboto, sans-serif;
background-color: var(--bg-color);
color: var(--text-color);
margin: 0;
padding: 20px;
display: flex;
justify-content: center;
}
.container {
width: 600px;
background-color: var(--bg-color);
}
.header {
text-align: center;
margin-bottom: 30px;
padding: 20px 0;
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
border-radius: var(--border-radius);
color: white;
box-shadow: var(--shadow);
}
.header h1 {
margin: 0;
font-size: 2.5em;
letter-spacing: 2px;
}
.header p {
margin: 10px 0 0;
opacity: 0.9;
}
.plugin-list {
display: flex;
flex-direction: column;
gap: 15px;
}
.plugin-card {
background-color: var(--card-bg);
border-radius: var(--border-radius);
padding: 20px;
box-shadow: var(--shadow);
transition: transform 0.2s;
border-left: 5px solid var(--primary-color);
}
.plugin-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 10px;
border-bottom: 1px solid #eee;
padding-bottom: 10px;
}
.plugin-name {
font-size: 1.2em;
font-weight: bold;
color: var(--primary-color);
}
.plugin-desc {
color: var(--secondary-text);
margin-bottom: 15px;
line-height: 1.5;
}
.plugin-usage {
background-color: #f8f9fa;
padding: 10px;
border-radius: 6px;
font-family: 'Consolas', monospace;
font-size: 0.9em;
color: #d63384;
border: 1px solid #e9ecef;
}
.footer {
text-align: center;
margin-top: 30px;
color: var(--secondary-text);
font-size: 0.8em;
}
</style>
</head>
<body>
<div class="container">
<div class="header">
<h1>NeoBot</h1>
<p>功能插件列表</p>
</div>
<div class="plugin-list">
{% for plugin in plugins %}
<div class="plugin-card">
<div class="plugin-header">
<span class="plugin-name">{{ plugin.name }}</span>
</div>
<div class="plugin-desc">{{ plugin.description }}</div>
<div class="plugin-usage">
{{ plugin.usage }}
</div>
</div>
{% endfor %}
</div>
<div class="footer">
Generated by NeoBot • Playwright Rendering
</div>
</div>
</body>
</html>