初步规划TuUi模式,并预留接口

This commit is contained in:
Falck
2026-05-02 13:32:51 +08:00
parent 9f7ca46f96
commit 0783428f80
24 changed files with 597 additions and 116 deletions

View File

@@ -1344,6 +1344,14 @@ class TUIManager:
else:
self.show_error(f"Page not found: {path}")
def render_page(self, path: str = None) -> str:
"""渲染指定页面,返回终端文本(不写入画布)"""
path = path or self.current_page
if not path or path not in self.pages:
return ""
html = self.pages[path]
return self.renderer.render_with_frame(html, title=f"NebulaShell - {path}")
def render_current(self):
"""渲染当前页面"""
if not self.current_page or self.current_page not in self.pages: