feat: frontend shell — project picker, legend, modals (new project / cable type / delete), URL ?project= state

This commit is contained in:
mAi
2026-05-15 16:45:29 +02:00
parent 1e3988161b
commit c13000ee7e
4 changed files with 741 additions and 0 deletions

23
web/web.go Normal file
View File

@@ -0,0 +1,23 @@
// Package web bundles the frontend (HTML/JS/CSS) into the Go binary
// via embed.FS so deploying mCables means shipping one file.
package web
import (
"embed"
"io/fs"
)
//go:embed all:static
var assets embed.FS
// Static returns the frontend filesystem rooted at the package's static/
// dir so callers see index.html at "/".
func Static() fs.FS {
sub, err := fs.Sub(assets, "static")
if err != nil {
// embed sub-rooting can only fail if "static" doesn't exist,
// which is a build-time error. Panic is the right shape.
panic(err)
}
return sub
}