From f8c65d2c4aec1736559c18cc41acb3a3ef4f317e Mon Sep 17 00:00:00 2001 From: naiba Date: Tue, 7 Nov 2023 22:49:31 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=92=84=20=E4=BC=98=E5=8C=96=20server-stat?= =?UTF-8?q?us=20=E4=B8=BB=E9=A2=98=E6=9C=8D=E5=8A=A1=E9=A1=B5=E6=B5=81?= =?UTF-8?q?=E9=87=8F=E7=BB=9F=E8=AE=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 2 +- resource/l10n/en-US.toml | 4 +- resource/l10n/es-ES.toml | 4 +- resource/l10n/zh-CN.toml | 2 +- resource/l10n/zh-TW.toml | 4 +- .../theme-server-status/content-nav.html | 2 +- .../template/theme-server-status/home.html | 2 +- .../template/theme-server-status/service.html | 97 +++++++++---------- service/singleton/singleton.go | 2 +- 9 files changed, 56 insertions(+), 63 deletions(-) diff --git a/README.md b/README.md index 506ceb14719..3f8a2626d12 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@
LOGO designed by 熊大 .

-    +   

:trollface: Nezha Monitoring: Self-hostable, lightweight, servers and websites monitoring and O&M tool.

diff --git a/resource/l10n/en-US.toml b/resource/l10n/en-US.toml index 9a6e1dd9f49..22539459472 100644 --- a/resource/l10n/en-US.toml +++ b/resource/l10n/en-US.toml @@ -481,8 +481,8 @@ other = "Light Mode" [DarkMode] other = "Dark Mode" -[SystemMode] -other = "System Mode" +[FollowSystem] +other = "Follow System" [GridLayout] other = "Grid Layout" diff --git a/resource/l10n/es-ES.toml b/resource/l10n/es-ES.toml index 44dcae01e6d..14cb196f6fb 100644 --- a/resource/l10n/es-ES.toml +++ b/resource/l10n/es-ES.toml @@ -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" diff --git a/resource/l10n/zh-CN.toml b/resource/l10n/zh-CN.toml index ce9fa87a3e8..0b2a7a2af1e 100644 --- a/resource/l10n/zh-CN.toml +++ b/resource/l10n/zh-CN.toml @@ -481,7 +481,7 @@ other = "白昼模式" [DarkMode] other = "暗黑模式" -[SystemMode] +[FollowSystem] other = "跟随系统" [GridLayout] diff --git a/resource/l10n/zh-TW.toml b/resource/l10n/zh-TW.toml index 69b933a5e7b..fc23ea7e5a7 100644 --- a/resource/l10n/zh-TW.toml +++ b/resource/l10n/zh-TW.toml @@ -481,8 +481,8 @@ other = "白晝模式" [DarkMode] other = "暗黑模式" -[SystemMode] -other = "系統模式" +[FollowSystem] +other = "跟隨系統" [GridLayout] other = "網格視圖" diff --git a/resource/template/theme-server-status/content-nav.html b/resource/template/theme-server-status/content-nav.html index d5d0a6df15f..f7ba99642e5 100644 --- a/resource/template/theme-server-status/content-nav.html +++ b/resource/template/theme-server-status/content-nav.html @@ -25,7 +25,7 @@ {{else}}
  • {{tr "Login" }}
  • {{end}} -
  • {{tr "SystemMode" }} +
  • {{tr "FollowSystem" }} ✔️
  • {{tr "DarkMode" }} diff --git a/resource/template/theme-server-status/home.html b/resource/template/theme-server-status/home.html index 53d69efa6ef..340005d684e 100644 --- a/resource/template/theme-server-status/home.html +++ b/resource/template/theme-server-status/home.html @@ -38,7 +38,7 @@   - @#node.location#@ + @#node.location#@ @#node.uptime#@ @#node.load#@ diff --git a/resource/template/theme-server-status/service.html b/resource/template/theme-server-status/service.html index 93cd18b0ceb..320e07fe347 100644 --- a/resource/template/theme-server-status/service.html +++ b/resource/template/theme-server-status/service.html @@ -44,59 +44,52 @@ -
    -
    - {{if .CycleTransferStats}} - -

    {{tr "CycleTransferStats"}}

    - - - - - - - - - - - - - - - - - - {{range $id, $stats := .CycleTransferStats}} - {{range $innerId, $transfer := $stats.Transfer}} - {{$TransLeftPercent := TransLeftPercent (UintToFloat $transfer) (UintToFloat $stats.Max)}} - - - - - - - - - - - - - {{end}} - {{end}} - -
    ID{{tr "Rules"}}{{tr "Server"}}{{tr "From"}}{{tr "To"}}MAXMIN{{tr "NextCheck"}}{{tr "CurrentUsage"}}{{tr "Transleft"}}
    {{$id}}{{$stats.Name}}{{index $stats.ServerName $innerId}}{{$stats.From|tf}}{{$stats.To|tf}}{{$stats.Max|bf}}{{$stats.Min|bf}}{{(index $stats.NextUpdate $innerId)|sft}}{{$transfer|bf}} -
    -
    -
    - {{TransLeft $stats.Max $transfer}} / - {{$TransLeftPercent}} %
    -
    -
    - +
    + {{if .CycleTransferStats}} +

    {{tr "CycleTransferStats"}}

    + + + + + + + + + + + + + + + + + {{range $id, $stats := .CycleTransferStats}} + {{range $innerId, $transfer := $stats.Transfer}} + {{$TransLeftPercent := TransLeftPercent (UintToFloat $transfer) (UintToFloat $stats.Max)}} + + + + + + + + + + + + + {{end}} {{end}} - + +
    ID{{tr "Rules"}}{{tr "Server"}}{{tr "From"}}{{tr "To"}}MAXMIN{{tr "NextCheck"}}{{tr "CurrentUsage"}}{{tr "Transleft"}}
    {{$id}}{{$stats.Name}}{{index $stats.ServerName $innerId}}{{$stats.From|tf}}{{$stats.To|tf}}{{$stats.Max|bf}}{{$stats.Min|bf}}{{(index $stats.NextUpdate $innerId)|sft}}{{$transfer|bf}} +
    +
    + {{TransLeft $stats.Max $transfer}} / + {{$TransLeftPercent}} %
    +
    + {{end}}
    {{template "theme-server-status/content-footer" .}}
    diff --git a/service/singleton/singleton.go b/service/singleton/singleton.go index d7cf53c6c9f..ba63041a84d 100644 --- a/service/singleton/singleton.go +++ b/service/singleton/singleton.go @@ -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