fix: retain full network results independently of text widget limits
Verify Tessera GUI / verify (push) Failing after 9m42s

This commit is contained in:
2026-10-23 19:49:49 +08:00
parent 053b0f5fba
commit eb48ec3396
5 changed files with 10 additions and 7 deletions
+5 -2
View File
@@ -3,11 +3,14 @@ class TextFetcher {
problem: TextBlock
status: TextBlock
task: Object
response: String
function apply(self: TextFetcher): Unit {
self.output.text = self.task.result()
self.response = self.task.result()
self.output.text = "请求完成;在 REPL 查看 fetcher.response"
}
function fetch(self: TextFetcher, url: String): Unit {
self.task = ui.fetchText(self, "request", url, self.apply)
self.response = ""
self.output.text = ""
self.status.bind("text", self.task.status)
self.problem.bind("text", self.task.error)
@@ -16,7 +19,7 @@ class TextFetcher {
output = TextBlock("尚未请求网络")
problem = TextBlock("")
status = TextBlock("")
fetcher = TextFetcher(output, problem, status, ui.state(0))
fetcher = TextFetcher(output, problem, status, ui.state(0), "")
page = Page()
page.title = "异步网络"
page.render(Column(24,16,TextBlock("在 REPL 调用 fetcher.fetch(HTTP 或 HTTPS 地址字符串)",2),status,problem,output))