package components import ( "context" "fmt" "github.com/starfleetcptn/gomft/internal/db" "strconv" ) type DashboardData struct { RecentJobs []db.JobHistory ActiveTransfers int CompletedToday int FailedTransfers int Configs map[uint]db.TransferConfig } templ Dashboard(ctx context.Context, data DashboardData) { @LayoutWithContext("Dashboard", ctx) {

Dashboard

Active Transfers

{ strconv.Itoa(data.ActiveTransfers) }

Completed Today

{ strconv.Itoa(data.CompletedToday) }

Failed Transfers

{ strconv.Itoa(data.FailedTransfers) }

Recent Jobs

if len(data.RecentJobs) == 0 {

No recent jobs found

Create your first job
} else {
    for _, job := range data.RecentJobs {
  • if job.Status == "completed" { } else if job.Status == "failed" { } else { }

    { getConfigNameForHistory(job, data.Configs) }

    Started: { job.StartTime.Format("Jan 02, 2006 15:04:05") }

  • }
}

Quick Actions

Create New Config Create New Job View Transfer History

System Status

Server Online
Scheduler Running
Database Connected
} }