Discover Packages
github.com/Xsxdot/handoff
internal
webui
package
Version:
v0.4.0
Opens a new window with list of versions in this module.
Published: Sep 3, 2026
License: Apache-2.0
Opens a new window with license information.
Imports: 2
Opens a new window with list of imports.
Imported by: 0 modules, 0 packages
The first number is the count of modules that contain a package that imports this one.
The module count is a better indicator of popularity than the package count.
A module with 100 importing packages is counted only once instead of 100 times,
reflecting the fact that the choice to use the package was likely made only once,
not 100 times.
A '?' means that the value hasn't been computed yet.
Opens a new window with list of known importers.
Documentation
Documentation
¶
Package webui 持有 Web 控制台的静态资源,并按构建标签在两种形态间切换。
职责:
对外提供唯一入口 FS(),返回控制台静态资源的根文件系统。
通过 Embedded() 报告当前二进制是否嵌入了真实构建产物。
边界:
不做 HTTP 伺服、不判断路由、不设缓存头——那些是 internal/agentd 的事。
不负责生成产物:产物由 `npm run build` 产出到 web/dist/,再由 release
流水线拷进本包的 dist/ 目录。本包只负责嵌入。
两个入口(FS / Embedded)分别在 embed.go(//go:build embedweb)
与 stub.go(//go:build !embedweb)中声明,各自实现自己的形态。
为什么要两份实现:go:embed 指向不存在的目录是**编译期错误**。若无条件
embed,任何没有先跑前端构建的机器上 `go build ./...` 与 `go test ./...`
都会整片失败。而把产物或占位文件提交进仓库会让 `npm run build` 之后工作区
变脏,与 handoff 自己「dispatch 要求工作区干净」的硬约束冲突。故用构建标签
embedweb 分开:默认不嵌,release 才嵌。
Embedded 报告当前二进制是否嵌入了真实的前端构建产物。
默认构建下恒为 false。调用方(如 agentd 启动日志)应据此告诉运维
「这份二进制有没有前端」——否则前端打不开时无从判断是构建问题还是运行问题。
FS 返回控制台静态资源的根文件系统。永不返回 nil。
默认构建下返回只含一页说明的 stub,见 stubIndex。
Source Files
¶
Click to show internal directories.
Click to hide internal directories.