48 lines
1.4 KiB
Plaintext
48 lines
1.4 KiB
Plaintext
package view
|
|
|
|
import (
|
|
"context"
|
|
"fmt"
|
|
"gitea.zokki.net/zokki/speed-tester/database"
|
|
view "gitea.zokki.net/zokki/speed-tester/view/shared"
|
|
)
|
|
|
|
templ Index(ctx context.Context) {
|
|
{{
|
|
errors, _ := database.GetAllErrors(ctx)
|
|
}}
|
|
@view.Layout() {
|
|
<div class="wrapper flex flex-col gap-2">
|
|
<canvas id="speed-chart"></canvas>
|
|
<div class="flex gap-4">
|
|
<button class="reset-chart primary">Reset zoom</button>
|
|
<button class="last-hours secondary">last hours</button>
|
|
<button class="complete-data secondary">complete data</button>
|
|
</div>
|
|
</div>
|
|
<div class="wrapper flex flex-col gap-2">
|
|
<canvas id="latency-chart"></canvas>
|
|
<div class="flex gap-4">
|
|
<button class="reset-chart primary">Reset zoom</button>
|
|
<button class="last-hours secondary">last hours</button>
|
|
<button class="complete-data secondary">complete data</button>
|
|
</div>
|
|
</div>
|
|
<div class="wrapper flex flex-col gap-2">
|
|
<canvas id="duration-chart"></canvas>
|
|
<div class="flex gap-4">
|
|
<button class="reset-chart primary">Reset zoom</button>
|
|
<button class="last-hours secondary">last hours</button>
|
|
<button class="complete-data secondary">complete data</button>
|
|
</div>
|
|
</div>
|
|
<ul>
|
|
<caption>Errors:</caption>
|
|
for _, error := range errors {
|
|
{{ log := fmt.Sprintf("[%s] (%s): %s", error.CreationDate, error.Detail, error.Error) }}
|
|
<li>{ log }</li>
|
|
}
|
|
</ul>
|
|
}
|
|
}
|