mirror of
https://github.com/nezhahq/nezha.git
synced 2025-02-02 01:28:13 -05:00
💄 优化 server-status 主题服务页流量统计
This commit is contained in:
parent
1c00cc8e3b
commit
b6c2410b41
@ -4,7 +4,7 @@
|
||||
<br>
|
||||
<small><i>LOGO designed by <a href="https://xio.ng" target="_blank">熊大</a> .</i></small>
|
||||
<br><br>
|
||||
<img src="https://img.shields.io/github/actions/workflow/status/naiba/nezha/dashboard.yml?branch=master&label=Dash%20v0.15.7&logo=github&style=for-the-badge"> <img src="https://img.shields.io/github/v/release/nezhahq/agent?color=brightgreen&label=Agent&style=for-the-badge&logo=github"> <img src="https://img.shields.io/github/actions/workflow/status/nezhahq/agent/agent.yml?branch=v0.15.7&label=Agent%20CI&logo=github&style=for-the-badge"> <img src="https://img.shields.io/badge/Installer-v0.15.0-brightgreen?style=for-the-badge&logo=linux">
|
||||
<img src="https://img.shields.io/github/actions/workflow/status/naiba/nezha/dashboard.yml?branch=master&label=Dash%20v0.15.8&logo=github&style=for-the-badge"> <img src="https://img.shields.io/github/v/release/nezhahq/agent?color=brightgreen&label=Agent&style=for-the-badge&logo=github"> <img src="https://img.shields.io/github/actions/workflow/status/nezhahq/agent/agent.yml?branch=v0.15.8&label=Agent%20CI&logo=github&style=for-the-badge"> <img src="https://img.shields.io/badge/Installer-v0.15.0-brightgreen?style=for-the-badge&logo=linux">
|
||||
<br>
|
||||
<br>
|
||||
<p>:trollface: <b>Nezha Monitoring: Self-hostable, lightweight, servers and websites monitoring and O&M tool.</b></p>
|
||||
|
4
resource/l10n/en-US.toml
vendored
4
resource/l10n/en-US.toml
vendored
@ -481,8 +481,8 @@ other = "Light Mode"
|
||||
[DarkMode]
|
||||
other = "Dark Mode"
|
||||
|
||||
[SystemMode]
|
||||
other = "System Mode"
|
||||
[FollowSystem]
|
||||
other = "Follow System"
|
||||
|
||||
[GridLayout]
|
||||
other = "Grid Layout"
|
||||
|
4
resource/l10n/es-ES.toml
vendored
4
resource/l10n/es-ES.toml
vendored
@ -481,8 +481,8 @@ other = "Modo luminoso"
|
||||
[DarkMode]
|
||||
other = "Modo oscuro"
|
||||
|
||||
[SystemMode]
|
||||
other = "Modo del sistema"
|
||||
[FollowSystem]
|
||||
other = "Seguir el sistema"
|
||||
|
||||
[GridLayout]
|
||||
other = "Grid Layout"
|
||||
|
2
resource/l10n/zh-CN.toml
vendored
2
resource/l10n/zh-CN.toml
vendored
@ -481,7 +481,7 @@ other = "白昼模式"
|
||||
[DarkMode]
|
||||
other = "暗黑模式"
|
||||
|
||||
[SystemMode]
|
||||
[FollowSystem]
|
||||
other = "跟随系统"
|
||||
|
||||
[GridLayout]
|
||||
|
4
resource/l10n/zh-TW.toml
vendored
4
resource/l10n/zh-TW.toml
vendored
@ -481,8 +481,8 @@ other = "白晝模式"
|
||||
[DarkMode]
|
||||
other = "暗黑模式"
|
||||
|
||||
[SystemMode]
|
||||
other = "系統模式"
|
||||
[FollowSystem]
|
||||
other = "跟隨系統"
|
||||
|
||||
[GridLayout]
|
||||
other = "網格視圖"
|
||||
|
@ -25,7 +25,7 @@
|
||||
{{else}}
|
||||
<li><a href="/login">{{tr "Login" }}</a></li>
|
||||
{{end}}
|
||||
<li><a href="#" @click="setSystemTheme">{{tr "SystemMode" }}
|
||||
<li><a href="#" @click="setSystemTheme">{{tr "FollowSystem" }}
|
||||
<span style="color: #fff" v-if="isSystemTheme"> ✔️</span></a>
|
||||
</li>
|
||||
<li><a href="#" @click="setTheme('dark', true)">{{tr "DarkMode" }}
|
||||
|
@ -38,7 +38,7 @@
|
||||
</td>
|
||||
<td style="text-align: center;" class="node-cell location">
|
||||
<i :class="node.location + ' flag'"></i>
|
||||
<span>@#node.location#@</span>
|
||||
<span class="text-uppercase">@#node.location#@</span>
|
||||
</td>
|
||||
<td style="text-align: center;" class="node-cell uptime">@#node.uptime#@</td>
|
||||
<td style="text-align: center;" class="node-cell load">@#node.load#@</td>
|
||||
|
@ -44,59 +44,52 @@
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="ui container">
|
||||
<div class="service-status" style="margin-bottom: 20px;">
|
||||
{{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>
|
||||
<th class='ui center aligned' style='padding: 0px 31px 0px 31px;'>{{tr "Transleft"}}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{{range $id, $stats := .CycleTransferStats}}
|
||||
{{range $innerId, $transfer := $stats.Transfer}}
|
||||
{{$TransLeftPercent := TransLeftPercent (UintToFloat $transfer) (UintToFloat $stats.Max)}}
|
||||
<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>
|
||||
<td class="ui center aligned" style="padding: 14px 0px 0px 0px; position: relative;">
|
||||
<div class="thirteen wide column">
|
||||
<div class="ui progress {{TransClassName $TransLeftPercent}}"
|
||||
style=" background: rgba(0,0,0,.1); background-color: rgba(0,0,0,.1)!important; height: 25px;">
|
||||
<div class="bar"
|
||||
style="transition-duration: 300ms; min-width: unset; background-color: rgb(10, 148, 242); width: {{$TransLeftPercent}}% !important;"></div>
|
||||
<small style="position: relative; top: -2em;">{{TransLeft $stats.Max $transfer}} /
|
||||
{{$TransLeftPercent}} %</small></div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
{{end}}
|
||||
{{end}}
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<div class="ui container" style="margin-bottom: 20px;">
|
||||
{{if .CycleTransferStats}}
|
||||
<h2 style="text-align: center;">{{tr "CycleTransferStats"}}</h2>
|
||||
<table class="table table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>ID</th>
|
||||
<th>{{tr "Rules"}}</th>
|
||||
<th>{{tr "Server"}}</th>
|
||||
<th>{{tr "From"}}</th>
|
||||
<th>{{tr "To"}}</th>
|
||||
<th>MAX</th>
|
||||
<th>MIN</th>
|
||||
<th>{{tr "NextCheck"}}</th>
|
||||
<th>{{tr "CurrentUsage"}}</th>
|
||||
<th class='ui center aligned'>{{tr "Transleft"}}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{{range $id, $stats := .CycleTransferStats}}
|
||||
{{range $innerId, $transfer := $stats.Transfer}}
|
||||
{{$TransLeftPercent := TransLeftPercent (UintToFloat $transfer) (UintToFloat $stats.Max)}}
|
||||
<tr>
|
||||
<td>{{$id}}</td>
|
||||
<td>{{$stats.Name}}</td>
|
||||
<td>{{index $stats.ServerName $innerId}}</td>
|
||||
<td>{{$stats.From|tf}}</td>
|
||||
<td>{{$stats.To|tf}}</td>
|
||||
<td>{{$stats.Max|bf}}</td>
|
||||
<td>{{$stats.Min|bf}}</td>
|
||||
<td>{{(index $stats.NextUpdate $innerId)|sft}}</td>
|
||||
<td>{{$transfer|bf}}</td>
|
||||
<td>
|
||||
<div class="ui progress {{TransClassName $TransLeftPercent}}"
|
||||
style=" background: rgba(0,0,0,.1); background-color: rgba(0,0,0,.1)!important; height: 25px; margin: unset !important">
|
||||
<div class="bar"
|
||||
style="transition-duration: 300ms; min-width: unset; background-color: rgb(10, 148, 242); width: {{$TransLeftPercent}}% !important"></div>
|
||||
<small style="position: relative; top: -2em;">{{TransLeft $stats.Max $transfer}} /
|
||||
{{$TransLeftPercent}} %</small></div>
|
||||
</td>
|
||||
</tr>
|
||||
{{end}}
|
||||
</div>
|
||||
{{end}}
|
||||
</tbody>
|
||||
</table>
|
||||
{{end}}
|
||||
</div>
|
||||
{{template "theme-server-status/content-footer" .}}
|
||||
</div>
|
||||
|
@ -12,7 +12,7 @@ import (
|
||||
"github.com/naiba/nezha/pkg/utils"
|
||||
)
|
||||
|
||||
var Version = "v0.15.7" // !!记得修改 README 中的 badge 版本!!
|
||||
var Version = "v0.15.8" // !!记得修改 README 中的 badge 版本!!
|
||||
|
||||
var (
|
||||
Conf *model.Config
|
||||
|
Loading…
Reference in New Issue
Block a user