From 2d62d1d18b989b52a9309a2f7cf9a7c6a4a4c0cf Mon Sep 17 00:00:00 2001 From: Gregory Ballantine Date: Fri, 24 Jul 2026 12:18:22 -0400 Subject: [PATCH] Fixed timestamps; added info to dashboard --- assets/styles/kourend.sass | 4 +- runner.conf | 14 ------- templates/benchmark/list.tmpl | 4 +- templates/hardware/list.tmpl | 4 +- templates/hardware/view.tmpl | 2 +- templates/index/dashboard.tmpl | 75 ++++++++++++++++++++++++++++++++++ templates/test/list.tmpl | 4 +- web/routes/index.go | 16 ++++++++ 8 files changed, 100 insertions(+), 23 deletions(-) delete mode 100644 runner.conf diff --git a/assets/styles/kourend.sass b/assets/styles/kourend.sass index ea014be..c3598c7 100644 --- a/assets/styles/kourend.sass +++ b/assets/styles/kourend.sass @@ -59,7 +59,7 @@ table tr:nth-child(even) table tbody tr transition: background 180ms ease-in-out &:hover - background: lightgrey + background: #d8d8d8 /* Material card styles */ .card-1 @@ -108,12 +108,12 @@ table tbody tr a color: white + text-decoration: none font-size: 2.25rem line-height: 64px transition: all 200ms ease-in-out &:hover color: #eee - font-size: 2.5rem #main-content padding: 15px 25px diff --git a/runner.conf b/runner.conf deleted file mode 100644 index 1c95660..0000000 --- a/runner.conf +++ /dev/null @@ -1,14 +0,0 @@ -root: . -tmp_path: ./tmp -build_name: runner-build -build_log: runner-build-errors.log -valid_ext: .go, .tpl, .tmpl, .html -no_rebuild_ext: .tpl, .tmpl, .html -ignored: assets, tmp, node_modules, data, vendor -build_delay: 600 -colors: 1 -log_color_main: cyan -log_color_build: yellow -log_color_runner: green -log_color_watcher: magenta -log_color_app: diff --git a/templates/benchmark/list.tmpl b/templates/benchmark/list.tmpl index bebd020..e32b0d4 100644 --- a/templates/benchmark/list.tmpl +++ b/templates/benchmark/list.tmpl @@ -16,8 +16,8 @@ {{ range $b := .benchmarks }} {{ $b.Name }} - {{ $b.CreatedAt.Format "01/02/2006 15:04am" }} - {{ $b.UpdatedAt.Format "01/02/2006 15:04am" }} + {{ $b.CreatedAt.Format "01/02/2006 3:04pm" }} + {{ $b.UpdatedAt.Format "01/02/2006 3:04pm" }} {{ end }} diff --git a/templates/hardware/list.tmpl b/templates/hardware/list.tmpl index 7c8dfaa..33da829 100644 --- a/templates/hardware/list.tmpl +++ b/templates/hardware/list.tmpl @@ -16,8 +16,8 @@ {{ range $h := .hardware }} {{ $h.Name }} - {{ $h.CreatedAt.Format "01/02/2006 15:04am" }} - {{ $h.UpdatedAt.Format "01/02/2006 15:04am" }} + {{ $h.CreatedAt.Format "01/02/2006 3:04pm" }} + {{ $h.UpdatedAt.Format "01/02/2006 3:04pm" }} {{ end }} diff --git a/templates/hardware/view.tmpl b/templates/hardware/view.tmpl index f58ae6e..470db68 100644 --- a/templates/hardware/view.tmpl +++ b/templates/hardware/view.tmpl @@ -27,7 +27,7 @@ {{ $test.Name }} {{ len $test.Benchmarks }} - {{ $test.CreatedAt.Format "01/02/2006 15:04am" }} + {{ $test.CreatedAt.Format "01/02/2006 3:04pm" }} {{ end }} diff --git a/templates/index/dashboard.tmpl b/templates/index/dashboard.tmpl index a19e34e..22fd253 100644 --- a/templates/index/dashboard.tmpl +++ b/templates/index/dashboard.tmpl @@ -2,4 +2,79 @@

This is the BLT dashboard.

+
+

Recently updated tests:

+ + + + + + + + + + + {{ range $p := .tests }} + + + + + + {{ end }} + +
TitleCreated atLast updated
{{ $p.Name }}{{ $p.CreatedAt.Format "01/02/2006 3:04pm" }}{{ $p.UpdatedAt.Format "01/02/2006 3:04pm" }}
+ +

Visit the tests page to for more information and actions.

+
+ +
+ +
+
+

Recently updated hardware:

+ + + + + + + + + + + {{ range $h := .hardware }} + + + + + + {{ end }} + +
NameCreated atLast updated
{{ $h.Name }}{{ $h.CreatedAt.Format "01/02/2006 3:04pm" }}{{ $h.UpdatedAt.Format "01/02/2006 3:04pm" }}
+
+ +
+

Recently updated benchmarks:

+ + + + + + + + + + + {{ range $b := .benchmarks }} + + + + + + {{ end }} + +
NameCreated atLast updated
{{ $b.Name }}{{ $b.CreatedAt.Format "01/02/2006 3:04pm" }}{{ $b.UpdatedAt.Format "01/02/2006 3:04pm" }}
+
+
+ {{ template "footer" . }} diff --git a/templates/test/list.tmpl b/templates/test/list.tmpl index 1c645ef..526b752 100644 --- a/templates/test/list.tmpl +++ b/templates/test/list.tmpl @@ -16,8 +16,8 @@ {{ range $p := .tests }} {{ $p.Name }} - {{ $p.CreatedAt.Format "01/02/2006 15:04am" }} - {{ $p.UpdatedAt.Format "01/02/2006 15:04am" }} + {{ $p.CreatedAt.Format "01/02/2006 3:04pm" }} + {{ $p.UpdatedAt.Format "01/02/2006 3:04pm" }} {{ end }} diff --git a/web/routes/index.go b/web/routes/index.go index 4926e8d..06ea529 100644 --- a/web/routes/index.go +++ b/web/routes/index.go @@ -4,9 +4,25 @@ import ( "net/http" "github.com/flamego/template" + + "git.metaunix.net/bitgoblin/blt/models" ) func GetDashboard(t template.Template, data template.Data) { + // add tests to template; limited to 10 most recent + var tests []models.Test + models.DB.Order("updated_at desc").Limit(10).Find(&tests) + data["tests"] = tests + + // add hardwares to template; limited to 5 most recent + var hardware []models.Hardware + models.DB.Order("updated_at desc").Limit(5).Find(&hardware) + data["hardware"] = hardware + // add benchmarks to template; limited to 5 most recent + var benchmarks []models.Benchmark + models.DB.Order("updated_at desc").Limit(5).Find(&benchmarks) + data["benchmarks"] = benchmarks + data["title"] = "Dashboard" t.HTML(http.StatusOK, "index/dashboard") }