watchyourlan/internal/web/index.go
2024-07-10 04:24:46 +07:00

24 lines
445 B
Go

package web
import (
"log"
"net/http"
"github.com/gin-gonic/gin"
"github.com/aceberg/WatchYourLAN/internal/arp"
"github.com/aceberg/WatchYourLAN/internal/models"
)
func indexHandler(c *gin.Context) {
var guiData models.GuiData
guiData.Config = appConfig
res := arp.Scan(appConfig.Ifaces)
log.Println("ARPSCAN:", res)
go arp.GoScan()
c.HTML(http.StatusOK, "header.html", guiData)
c.HTML(http.StatusOK, "index.html", guiData)
}