mirror of
https://github.com/nezhahq/nezha.git
synced 2025-01-23 13:18:13 -05:00
82 lines
4.1 KiB
HTML
Vendored
82 lines
4.1 KiB
HTML
Vendored
{{define "theme-default/service"}}
|
||
{{template "common/header" .}}
|
||
{{if ts .CustomCode}}
|
||
{{.CustomCode|safe}}
|
||
{{end}}
|
||
{{template "common/menu" .}}
|
||
<div class="nb-container">
|
||
<div class="ui container">
|
||
<div class="service-status">
|
||
<table class="ui celled table">
|
||
<thead>
|
||
<tr>
|
||
<th class="ui center aligned">{{tr "Name"}}</th>
|
||
<th class="ui center aligned">{{tr "30DaysOnline"}}</th>
|
||
<th class="ui center aligned">{{tr "Details"}}</th>
|
||
<th class="ui center aligned">{{tr "Status"}}</th>
|
||
</tr>
|
||
</thead>
|
||
<tbody>
|
||
{{range $service := .Services}}
|
||
<tr>
|
||
<td class="ui center aligned">{{$service.Monitor.Name}}</td>
|
||
<td class="ui center aligned">
|
||
{{float32f (divU64 $service.TotalUp (addU64 $service.TotalUp $service.TotalDown))}}%
|
||
</td>
|
||
<td class="ui center aligned">{{range $i,$d := $service.Delay}}
|
||
<div class="ui icon button {{className (div (index $service.Up $i) (add (index $service.Up $i) (index $service.Down $i)))}}"
|
||
data-tooltip="{{dayBefore $i}},{{tr "Availability"}}:{{float32f (div (index $service.Up $i) (add (index $service.Up $i) (index $service.Down $i)))}}%,{{tr "AverageLatency"}}:{{float32f $d}}ms">
|
||
</div> {{end}}
|
||
</td>
|
||
<td class="ui center aligned delay-today">
|
||
<i
|
||
class="delay-today {{className (divU64 $service.CurrentUp (addU64 $service.CurrentUp $service.CurrentDown))}}"></i>
|
||
{{statusName (divU64 $service.CurrentUp (addU64 $service.CurrentUp $service.CurrentDown))}}
|
||
</td>
|
||
</tr> {{end}}
|
||
</tbody>
|
||
</table>
|
||
|
||
{{if .CycleTransferStats}}
|
||
|
||
<h2 style="text-align: center;">{{tr "CycleTransferStats"}}</h2>
|
||
|
||
<table class="ui celled table">
|
||
<thead>
|
||
<tr>
|
||
<th class="ui center aligned">ID</th>
|
||
<th class="ui center aligned">{{tr "Rules"}}</th>
|
||
<th class="ui center aligned">{{tr "Server"}}</th>
|
||
<th class="ui center aligned">{{tr "From"}}</th>
|
||
<th class="ui center aligned">{{tr "To"}}</th>
|
||
<th class="ui center aligned">MAX</th>
|
||
<th class="ui center aligned">MIN</th>
|
||
<th class="ui center aligned">{{tr "NextCheck"}}</th>
|
||
<th class="ui center aligned">{{tr "CurrentUsage"}}</th>
|
||
</tr>
|
||
</thead>
|
||
<tbody>
|
||
{{range $id, $stats := .CycleTransferStats}}
|
||
{{range $innerId, $transfer := $stats.Transfer}}
|
||
<tr>
|
||
<td class="ui center aligned">{{$id}}</td>
|
||
<td class="ui center aligned">{{$stats.Name}}</td>
|
||
<td class="ui center aligned">{{index $stats.ServerName $innerId}}</td>
|
||
<td class="ui center aligned">{{$stats.From|tf}}</td>
|
||
<td class="ui center aligned">{{$stats.To|tf}}</td>
|
||
<td class="ui center aligned">{{$stats.Max|bf}}</td>
|
||
<td class="ui center aligned">{{$stats.Min|bf}}</td>
|
||
<td class="ui center aligned">{{(index $stats.NextUpdate $innerId)|sft}}</td>
|
||
<td class="ui center aligned">{{$transfer|bf}}</td>
|
||
</tr>
|
||
{{end}}
|
||
{{end}}
|
||
</tbody>
|
||
</table>
|
||
|
||
{{end}}
|
||
</div>
|
||
</div>
|
||
</div>
|
||
{{template "common/footer" .}}
|
||
{{end}} |