This commit is contained in:
2026-06-12 14:20:55 +08:00
parent 39788bf6d4
commit 0511c19f5f
8 changed files with 2053 additions and 443 deletions

View File

@@ -2,8 +2,6 @@
//
// go run ./cmd/qygl_report_preview -in resources/dev-report/built.json
// go run ./cmd/qygl_report_preview -in built.json -addr :8899 -watch
//
// 每次打开/刷新页面都会重新读取 -in 文件;加 -watch 后保存 JSON 会自动刷新浏览器。
package main
import (
@@ -114,6 +112,9 @@ func main() {
log.Fatalf("解析模板: %v", err)
}
mediaDir := filepath.Join(rootAbs, "resources", "qygl-media")
http.Handle("/reports/qygl/media/", http.StripPrefix("/reports/qygl/media/", http.FileServer(http.Dir(mediaDir))))
http.HandleFunc("/__version", func(w http.ResponseWriter, r *http.Request) {
tag, err := fileVersionTag(inAbs)
if err != nil {