Skip to content

Commit 5c05df4

Browse files
Add styles for the web interface and embed CSS in web.go
- Created a new CSS file (style.css) with comprehensive styles for the web application, including dark mode support, card styles, metrics, charts, and various UI components. - Updated web.go to embed the new style.css along with the existing index.html and script.js files.
1 parent bb712f8 commit 5c05df4

5 files changed

Lines changed: 1018 additions & 856 deletions

File tree

cmd/netmon/main.go

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,20 @@ func main() {
5252
}
5353
return c.HTMLBlob(http.StatusOK, data)
5454
})
55+
e.GET("/style.css", func(c *echo.Context) error {
56+
data, err := web.FS.ReadFile("style.css")
57+
if err != nil {
58+
return err
59+
}
60+
return c.Blob(http.StatusOK, "text/css", data)
61+
})
62+
e.GET("/script.js", func(c *echo.Context) error {
63+
data, err := web.FS.ReadFile("script.js")
64+
if err != nil {
65+
return err
66+
}
67+
return c.Blob(http.StatusOK, "application/javascript", data)
68+
})
5569

5670
log.Info("starting server", "addr", ":8080")
5771
if err := e.Start(":8080"); err != nil {

0 commit comments

Comments
 (0)