- Add a react UI to replace the plain HTML one. 
- Serve as a foundation for better GUI interactions
This commit is contained in:
Benson Wong
2025-06-16 16:45:19 -07:00
committed by GitHub
parent 75015f82ea
commit 9a3c656738
34 changed files with 5155 additions and 373 deletions

24
proxy/ui_embed.go Normal file
View File

@@ -0,0 +1,24 @@
package proxy
import (
"embed"
"io/fs"
"net/http"
)
//go:embed ui_dist
var reactStaticFS embed.FS
// GetReactFS returns the embedded React filesystem
func GetReactFS() (http.FileSystem, error) {
subFS, err := fs.Sub(reactStaticFS, "ui_dist")
if err != nil {
return nil, err
}
return http.FS(subFS), nil
}
// GetReactIndexHTML returns the main index.html for the React app
func GetReactIndexHTML() ([]byte, error) {
return reactStaticFS.ReadFile("ui_dist/index.html")
}