This commit is contained in:
@@ -59,7 +59,7 @@ table tr:nth-child(even)
|
|||||||
table tbody tr
|
table tbody tr
|
||||||
transition: background 180ms ease-in-out
|
transition: background 180ms ease-in-out
|
||||||
&:hover
|
&:hover
|
||||||
background: lightgrey
|
background: #d8d8d8
|
||||||
|
|
||||||
/* Material card styles */
|
/* Material card styles */
|
||||||
.card-1
|
.card-1
|
||||||
@@ -108,12 +108,12 @@ table tbody tr
|
|||||||
|
|
||||||
a
|
a
|
||||||
color: white
|
color: white
|
||||||
|
text-decoration: none
|
||||||
font-size: 2.25rem
|
font-size: 2.25rem
|
||||||
line-height: 64px
|
line-height: 64px
|
||||||
transition: all 200ms ease-in-out
|
transition: all 200ms ease-in-out
|
||||||
&:hover
|
&:hover
|
||||||
color: #eee
|
color: #eee
|
||||||
font-size: 2.5rem
|
|
||||||
|
|
||||||
#main-content
|
#main-content
|
||||||
padding: 15px 25px
|
padding: 15px 25px
|
||||||
|
|||||||
-14
@@ -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:
|
|
||||||
@@ -16,8 +16,8 @@
|
|||||||
{{ range $b := .benchmarks }}
|
{{ range $b := .benchmarks }}
|
||||||
<tr>
|
<tr>
|
||||||
<td><a href="/benchmark/{{ $b.ID }}">{{ $b.Name }}</a></td>
|
<td><a href="/benchmark/{{ $b.ID }}">{{ $b.Name }}</a></td>
|
||||||
<td>{{ $b.CreatedAt.Format "01/02/2006 15:04am" }}</td>
|
<td>{{ $b.CreatedAt.Format "01/02/2006 3:04pm" }}</td>
|
||||||
<td>{{ $b.UpdatedAt.Format "01/02/2006 15:04am" }}</td>
|
<td>{{ $b.UpdatedAt.Format "01/02/2006 3:04pm" }}</td>
|
||||||
</tr>
|
</tr>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
</tbody>
|
</tbody>
|
||||||
|
|||||||
@@ -16,8 +16,8 @@
|
|||||||
{{ range $h := .hardware }}
|
{{ range $h := .hardware }}
|
||||||
<tr>
|
<tr>
|
||||||
<td><a href="/hardware/{{ $h.ID }}">{{ $h.Name }}</a></td>
|
<td><a href="/hardware/{{ $h.ID }}">{{ $h.Name }}</a></td>
|
||||||
<td>{{ $h.CreatedAt.Format "01/02/2006 15:04am" }}</td>
|
<td>{{ $h.CreatedAt.Format "01/02/2006 3:04pm" }}</td>
|
||||||
<td>{{ $h.UpdatedAt.Format "01/02/2006 15:04am" }}</td>
|
<td>{{ $h.UpdatedAt.Format "01/02/2006 3:04pm" }}</td>
|
||||||
</tr>
|
</tr>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
</tbody>
|
</tbody>
|
||||||
|
|||||||
@@ -27,7 +27,7 @@
|
|||||||
<tr>
|
<tr>
|
||||||
<td><a href="/test/{{ $test.ID }}">{{ $test.Name }}</a></td>
|
<td><a href="/test/{{ $test.ID }}">{{ $test.Name }}</a></td>
|
||||||
<td>{{ len $test.Benchmarks }}</td>
|
<td>{{ len $test.Benchmarks }}</td>
|
||||||
<td>{{ $test.CreatedAt.Format "01/02/2006 15:04am" }}</td>
|
<td>{{ $test.CreatedAt.Format "01/02/2006 3:04pm" }}</td>
|
||||||
</tr>
|
</tr>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
</tbody>
|
</tbody>
|
||||||
|
|||||||
@@ -2,4 +2,79 @@
|
|||||||
|
|
||||||
<p>This is the BLT dashboard.</p>
|
<p>This is the BLT dashboard.</p>
|
||||||
|
|
||||||
|
<section class="row">
|
||||||
|
<h3>Recently updated tests:</h3>
|
||||||
|
|
||||||
|
<table class="twelve columns card-2">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<td>Title</td>
|
||||||
|
<td>Created at</td>
|
||||||
|
<td>Last updated</td>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
{{ range $p := .tests }}
|
||||||
|
<tr>
|
||||||
|
<td><a href="/test/{{ $p.ID }}">{{ $p.Name }}</a></td>
|
||||||
|
<td>{{ $p.CreatedAt.Format "01/02/2006 3:04pm" }}</td>
|
||||||
|
<td>{{ $p.UpdatedAt.Format "01/02/2006 3:04pm" }}</td>
|
||||||
|
</tr>
|
||||||
|
{{ end }}
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
<p>Visit the <a href="/test/list">tests</a> page to for more information and actions.</p>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
<hr>
|
||||||
|
|
||||||
|
<section class="row">
|
||||||
|
<div class="six columns">
|
||||||
|
<h3>Recently updated hardware:</h3>
|
||||||
|
|
||||||
|
<table class="u-full-width card-2">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<td>Name</td>
|
||||||
|
<td>Created at</td>
|
||||||
|
<td>Last updated</td>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
{{ range $h := .hardware }}
|
||||||
|
<tr>
|
||||||
|
<td><a href="/hardware/{{ $h.ID }}">{{ $h.Name }}</a></td>
|
||||||
|
<td>{{ $h.CreatedAt.Format "01/02/2006 3:04pm" }}</td>
|
||||||
|
<td>{{ $h.UpdatedAt.Format "01/02/2006 3:04pm" }}</td>
|
||||||
|
</tr>
|
||||||
|
{{ end }}
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="six columns">
|
||||||
|
<h3>Recently updated benchmarks:</h3>
|
||||||
|
|
||||||
|
<table class="u-full-width card-2">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<td>Name</td>
|
||||||
|
<td>Created at</td>
|
||||||
|
<td>Last updated</td>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
{{ range $b := .benchmarks }}
|
||||||
|
<tr>
|
||||||
|
<td><a href="/benchmark/{{ $b.ID }}">{{ $b.Name }}</a></td>
|
||||||
|
<td>{{ $b.CreatedAt.Format "01/02/2006 3:04pm" }}</td>
|
||||||
|
<td>{{ $b.UpdatedAt.Format "01/02/2006 3:04pm" }}</td>
|
||||||
|
</tr>
|
||||||
|
{{ end }}
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
|
||||||
{{ template "footer" . }}
|
{{ template "footer" . }}
|
||||||
|
|||||||
@@ -16,8 +16,8 @@
|
|||||||
{{ range $p := .tests }}
|
{{ range $p := .tests }}
|
||||||
<tr>
|
<tr>
|
||||||
<td><a href="/test/{{ $p.ID }}">{{ $p.Name }}</a></td>
|
<td><a href="/test/{{ $p.ID }}">{{ $p.Name }}</a></td>
|
||||||
<td>{{ $p.CreatedAt.Format "01/02/2006 15:04am" }}</td>
|
<td>{{ $p.CreatedAt.Format "01/02/2006 3:04pm" }}</td>
|
||||||
<td>{{ $p.UpdatedAt.Format "01/02/2006 15:04am" }}</td>
|
<td>{{ $p.UpdatedAt.Format "01/02/2006 3:04pm" }}</td>
|
||||||
</tr>
|
</tr>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
</tbody>
|
</tbody>
|
||||||
|
|||||||
@@ -4,9 +4,25 @@ import (
|
|||||||
"net/http"
|
"net/http"
|
||||||
|
|
||||||
"github.com/flamego/template"
|
"github.com/flamego/template"
|
||||||
|
|
||||||
|
"git.metaunix.net/bitgoblin/blt/models"
|
||||||
)
|
)
|
||||||
|
|
||||||
func GetDashboard(t template.Template, data template.Data) {
|
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"
|
data["title"] = "Dashboard"
|
||||||
t.HTML(http.StatusOK, "index/dashboard")
|
t.HTML(http.StatusOK, "index/dashboard")
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user