Add favicon for control panel
This commit is contained in:
parent
908218ebac
commit
0d0ba1618f
|
@ -29,6 +29,8 @@ func WebServer() {
|
||||||
LoadHTMLFromEmbedFS(r, templatesFolder, "templates/*.html")
|
LoadHTMLFromEmbedFS(r, templatesFolder, "templates/*.html")
|
||||||
r.StaticFileFS("/style.css", "./templates/style.css", http.FS(templatesFolder))
|
r.StaticFileFS("/style.css", "./templates/style.css", http.FS(templatesFolder))
|
||||||
r.StaticFileFS("/htmx.js", "./templates/htmx.js", http.FS(templatesFolder))
|
r.StaticFileFS("/htmx.js", "./templates/htmx.js", http.FS(templatesFolder))
|
||||||
|
setFavicons(r)
|
||||||
|
|
||||||
r.GET("/", getRoot)
|
r.GET("/", getRoot)
|
||||||
r.GET("/command/:clientid", getCommands)
|
r.GET("/command/:clientid", getCommands)
|
||||||
r.POST("/command/:clientid", execCMD)
|
r.POST("/command/:clientid", execCMD)
|
||||||
|
@ -111,3 +113,13 @@ func execCMD(c *gin.Context) {
|
||||||
prettyOut := strings.Replace(out, "\n", "<br>", -1)
|
prettyOut := strings.Replace(out, "\n", "<br>", -1)
|
||||||
c.String(http.StatusOK, "$ "+command+"<br>"+prettyOut)
|
c.String(http.StatusOK, "$ "+command+"<br>"+prettyOut)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func setFavicons(r *gin.Engine) {
|
||||||
|
r.StaticFileFS("/favicon.ico", "./templates/assets/favicon.ico", http.FS(templatesFolder))
|
||||||
|
r.StaticFileFS("/favicon-32x32.png", "./templates/assets/favicon-32x32.png", http.FS(templatesFolder))
|
||||||
|
r.StaticFileFS("/favicon-16x16.png", "./templates/assets/favicon-16x16.png", http.FS(templatesFolder))
|
||||||
|
r.StaticFileFS("/apple-touch-icon.png", "./templates/assets/apple-touch-icon.png", http.FS(templatesFolder))
|
||||||
|
r.StaticFileFS("/android-chrome-512x512.png", "./templates/assets/android-chrome-512x512.png", http.FS(templatesFolder))
|
||||||
|
r.StaticFileFS("/android-chrome-192x192.png", "./templates/assets/android-chrome-192x192.png", http.FS(templatesFolder))
|
||||||
|
r.StaticFileFS("/site.webmanifest", "./templates/assets/site.webmanifest", http.FS(templatesFolder))
|
||||||
|
}
|
||||||
|
|
Binary file not shown.
After Width: | Height: | Size: 14 KiB |
Binary file not shown.
After Width: | Height: | Size: 30 KiB |
Binary file not shown.
After Width: | Height: | Size: 12 KiB |
Binary file not shown.
After Width: | Height: | Size: 731 B |
Binary file not shown.
After Width: | Height: | Size: 1.6 KiB |
Binary file not shown.
After Width: | Height: | Size: 15 KiB |
|
@ -0,0 +1 @@
|
||||||
|
{"name":"","short_name":"","icons":[{"src":"/android-chrome-192x192.png","sizes":"192x192","type":"image/png"},{"src":"/android-chrome-512x512.png","sizes":"512x512","type":"image/png"}],"theme_color":"#ffffff","background_color":"#ffffff","display":"standalone"}
|
Loading…
Reference in New Issue