feat: 完善 Web UI 细节
新增页面:
- session_detail.html - 会话详情独立页面
- channel_edit.html - 频道配置编辑独立页面
- 错误页面 (401/403/404/500)
功能优化:
- 添加错误处理器支持 HTML 响应
- 更新编辑按钮跳转独立页面
- 完善暗黑主题支持
作者: 小黑 🐶
This commit is contained in:
@@ -57,3 +57,23 @@ def sessions():
|
||||
agents = Agent.query.all()
|
||||
sessions = Session.query.order_by(Session.last_active_at.desc()).limit(50).all()
|
||||
return render_template('monitor/sessions.html', sessions=sessions, agents=agents)
|
||||
|
||||
|
||||
@web_bp.route('/monitor/sessions/<session_id>')
|
||||
@jwt_required()
|
||||
def session_detail(session_id):
|
||||
"""会话详情页面"""
|
||||
session = Session.query.get_or_404(session_id)
|
||||
messages = Message.query.filter_by(session_id=session_id).order_by(
|
||||
Message.created_at.asc()
|
||||
).limit(200).all()
|
||||
return render_template('monitor/session_detail.html', session=session, messages=messages)
|
||||
|
||||
|
||||
@web_bp.route('/config/channels/<channel_id>/edit')
|
||||
@jwt_required()
|
||||
def channel_edit(channel_id):
|
||||
"""编辑频道配置页面"""
|
||||
from app.models.channel_config import ChannelConfig
|
||||
config = ChannelConfig.query.get_or_404(channel_id)
|
||||
return render_template('config/channel_edit.html', config=config)
|
||||
|
||||
Reference in New Issue
Block a user