2021-01-15 11:45:49 -05:00
|
|
|
{{define "theme-default/service"}}
|
|
|
|
{{template "common/header" .}}
|
|
|
|
{{template "common/menu" .}}
|
2021-01-16 00:17:11 -05:00
|
|
|
<div class="nb-container">
|
|
|
|
<div class="ui container">
|
|
|
|
<div class="ui segment service-status">
|
|
|
|
<table class="ui celled table">
|
|
|
|
<thead>
|
|
|
|
<tr>
|
|
|
|
<th class="ui center aligned">名称</th>
|
|
|
|
<th class="ui center aligned">30天在线率</th>
|
|
|
|
<th class="ui center aligned">详情</th>
|
|
|
|
<th class="ui center aligned">状态</th>
|
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
<tbody>
|
|
|
|
{{range $service := .Services}}
|
|
|
|
<tr>
|
|
|
|
<td class="ui center aligned">{{$service.Monitor.Name}}</td>
|
|
|
|
<td class="ui center aligned">{{divU64 $service.TotalUp (addU64 $service.TotalUp $service.TotalDown)}}%</td>
|
|
|
|
<td class="ui center aligned">{{range $i,$d := $service.Delay}}
|
|
|
|
<div class="ui icon button{{if gt (add (index $service.Up $i) (index $service.Down $i)) 0}}
|
2021-01-15 11:45:49 -05:00
|
|
|
{{if gt (div (index $service.Down $i) (add (index $service.Up $i) (index $service.Down $i))) 30.0}}danger
|
|
|
|
{{else if gt (div (index $service.Down $i) (add (index $service.Up $i) (index $service.Down $i))) 10.0}}
|
|
|
|
warning{{else}}good{{end}}
|
2021-01-16 00:17:11 -05:00
|
|
|
{{end}}" data-tooltip="{{dayBefore $i}},平均延迟:{{$d}}ms">
|
|
|
|
<i class="delay"></i>
|
|
|
|
</div> {{end}}</td>
|
|
|
|
<td class="ui center aligned">
|
|
|
|
<div class="round{{if gt (addU64 $service.TotalUp $service.TotalDown) 0}}
|
2021-01-15 11:45:49 -05:00
|
|
|
{{if gt (divU64 $service.TotalDown (addU64 $service.TotalUp $service.TotalDown)) 30.0}}danger{{else if gt (divU64 $service.TotalDown (addU64 $service.TotalUp $service.TotalDown)) 10.0}}warning{{else}}good{{end}}
|
2021-01-16 00:17:11 -05:00
|
|
|
{{end}}">
|
|
|
|
<i></i> {{if gt (addU64 $service.TotalUp $service.TotalDown) 0}} {{if gt (divU64 $service.TotalDown (addU64 $service.TotalUp $service.TotalDown)) 30.0}}故障 {{else if gt (divU64 $service.TotalDown (addU64 $service.TotalUp $service.TotalDown)) 10.0}} 低可用{{else}}良好{{end}} {{else}}无数据 {{end}}
|
|
|
|
</div></td>
|
|
|
|
</tr> {{end}}
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
2021-01-15 11:45:49 -05:00
|
|
|
{{template "common/footer" .}}
|
2021-01-16 00:17:11 -05:00
|
|
|
{{end}}
|