mirror of
https://github.com/nezhahq/nezha.git
synced 2025-01-22 12:48:14 -05:00
Merge pull request #59 from ilay1678/master
优化服务监控布局 Co-authored-by: ilay1678 <7021399+ilay1678@users.noreply.github.com>
This commit is contained in:
commit
3d330e7248
@ -1,42 +1,42 @@
|
||||
{{define "theme-default/service"}}
|
||||
{{template "common/header" .}}
|
||||
{{template "common/menu" .}}
|
||||
<div class="nb-container">
|
||||
<div class="ui container">
|
||||
<div class="ui segment service-status">
|
||||
{{range $service := .Services}}
|
||||
<div class="ui grid">
|
||||
<div class="three wide column">
|
||||
<p>{{$service.Monitor.Name}}</p>
|
||||
<p>30天在线率{{divU64 $service.TotalDown (addU64 $service.TotalUp $service.TotalDown)}}%</p>
|
||||
</div>
|
||||
<div class="eleven wide column">
|
||||
{{range $i,$d := $service.Delay}}
|
||||
<div class="ui icon button{{if gt (add (index $service.Up $i) (index $service.Down $i)) 0}}
|
||||
<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}}
|
||||
{{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}}
|
||||
{{end}}" data-tooltip="{{dayBefore $i}},平均延迟:{{$d}}ms">
|
||||
<i class="delay"></i>
|
||||
</div>
|
||||
{{end}}
|
||||
</div>
|
||||
<div class="two wide column round{{if gt (addU64 $service.TotalUp $service.TotalDown) 0}}
|
||||
{{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}}
|
||||
{{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}}
|
||||
{{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>
|
||||
</div>
|
||||
<div class="ui divider"></div>
|
||||
{{end}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{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>
|
||||
{{template "common/footer" .}}
|
||||
{{end}}
|
||||
{{end}}
|
||||
|
Loading…
Reference in New Issue
Block a user