Skip to content

[Bug]Code blocks inside list items show white background in dark mode #7664

@MostimaBridges

Description

@MostimaBridges

What happened / 发生了什么

深色模式下,列表项内的代码块背景是白色的
预期:所有代码块都显示深色背景
实际:顶层代码块正常,列表内代码块是白色
根因:上游 markstream-vue 的 ListItemNode 未转发 isDark prop

Reproduce / 如何复现?

让 LLM 回复包含列表嵌套代码块的 markdown

AstrBot version, deployment method (e.g., Windows Docker Desktop deployment), provider used, and messaging platform used. / AstrBot 版本、部署方式(如 Windows Docker Desktop 部署)、使用的提供商、使用的消息平台适配器

4.23.1 windows webui

OS

Windows

Logs / 报错日志

以下是这个页面的html

已完成AstrBot的Nginx配置修复!以下是操作总结:

已执行的操作

  1. 配置备份:创建了 nginx.conf.backup.before_astrbot_fix 备份文件

  2. 精准修改:仅修改了AstrBot HTTPS配置中的缓冲设置:

    • proxy_buffering on;proxy_buffering off;

    • 添加了 proxy_cache off;

  3. 配置验证:Nginx配置语法检查通过

  4. 服务重启:Nginx已平滑重新加载配置

修改后的AstrBot配置

Nginx
location / {
    proxy_pass http://127.0.0.1:6185;
    proxy_set_header Host $host;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header X-Forwarded-Proto $scheme;
    proxy_buffering off;      # 关键修复:关闭缓冲
    proxy_cache off;          # 关键修复:关闭缓存
    proxy_set_header Connection "";
    # ... 其他设置保持不变
}

测试建议

请测试AstrBot的以下实时功能:

  1. 实时日志功能:访问 https://114514.1919810.123,检查实时日志流 (/api/live-log) 是否正常

  2. 其他实时功能:检查AstrBot中任何需要实时更新的功能

  3. 常规功能:确保普通页面加载和API调用仍然正常

与NapCat修复的对比

两个服务的修复完全一致:

  • NapCat:之前已修复,现在工作正常 ✓

  • AstrBot:刚刚修复,配置相同 ✓

故障排查指引

如果AstrBot仍有实时功能问题:

  1. 浏览器开发者工具

    • 按F12 → Console标签,查看SSE相关错误

    • Network标签,筛选"EventStream"类型请求

  2. Nginx错误日志

    Cmd
    type "C:\nginx-1.28.0\logs\error.log" | findstr astrbot
    
  3. 进一步调整(如需要):

    Nginx
    # 调整Connection头(如果问题依旧)
    proxy_set_header Connection $connection_upgrade;
    # 或添加WebSocket支持
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection "upgrade";
    

重要提醒

影响范围:仅修改AstrBot HTTPS配置,其他服务配置不变
性能影响proxy_buffering off 对实时应用是必要的,可能轻微增加负载
回滚方案:如有问题,可使用备份恢复:

Cmd
copy "C:\nginx-1.28.0\conf\nginx.conf.backup.before_astrbot_fix" "C:\nginx-1.28.0\conf\nginx.conf"
nginx -s reload

总结

两个实时应用(NapCat和AstrBot)的SSE/WebSocket流问题都已通过关闭Nginx响应缓冲解决。这是处理实时数据流的标准做法。

请测试AstrBot的功能并告诉我结果。如果仍有问题,我们可以进一步调整Connection头或其他设置。

Are you willing to submit a PR? / 你愿意提交 PR 吗?

  • Yes!

Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:webuiThe bug / feature is about webui(dashboard) of astrbot.bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions