初始化仓库

This commit is contained in:
2026-06-02 23:14:41 +08:00
commit 0bc3f02670
520 changed files with 191097 additions and 0 deletions
+27
View File
@@ -0,0 +1,27 @@
//go:build !no_web
package web
import (
"embed"
"io/fs"
"log/slog"
"github.com/chenhg5/cc-connect/core"
)
//go:embed all:dist
var distFS embed.FS
func init() {
sub, err := fs.Sub(distFS, "dist")
if err != nil {
slog.Warn("web: embedded dist directory unavailable; web admin disabled", "error", err)
return
}
if _, err := fs.Stat(sub, "index.html"); err != nil {
slog.Warn("web: embedded dist assets missing index.html; web admin disabled", "error", err)
return
}
core.RegisterWebAssets(sub)
}