Add logos and static

This commit is contained in:
Ettore Di Giacinto
2024-04-12 00:48:11 +02:00
parent 677a96074b
commit 97f5ba16cd
6 changed files with 11 additions and 2 deletions

View File

@@ -36,6 +36,9 @@ func init() {
//go:embed views/*
var viewsfs embed.FS
//go:embed public/*
var embeddedFiles embed.FS
func main() {
// current dir
cwd, err := os.Getwd()

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 118 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 341 KiB

View File

@@ -2,14 +2,19 @@ package main
import (
"math/rand"
"net/http"
fiber "github.com/gofiber/fiber/v2"
"github.com/gofiber/fiber/v2/middleware/filesystem"
)
func RegisterRoutes(webapp *fiber.App, pool *AgentPool, db *InMemoryDatabase, app *App) {
// Serve static files
webapp.Static("/", "./public")
webapp.Use("/public", filesystem.New(filesystem.Config{
Root: http.FS(embeddedFiles),
PathPrefix: "public",
Browse: true,
}))
webapp.Get("/", func(c *fiber.Ctx) error {
return c.Render("views/index", fiber.Map{

View File

@@ -11,6 +11,7 @@
<h1 class="text-3xl md:text-5xl font-bold">Smart Agent Dashboard</h1>
</header>
<div class="flex flex-col items-center space-y-4">
<img class="flex" src="/public/logo_1.png" width="250">
<!-- Button to Agent List Page -->
<a href="/agents" class="bg-blue-500 hover:bg-blue-700 text-white font-bold py-2 px-4 rounded">
Agent List