diff --git a/README.md b/README.md index 506ceb14719..3f8a2626d12 100644 --- a/README.md +++ b/README.md @@ -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> 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}} <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" }} 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 @@ </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> 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 @@ </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 table-condensed"> + <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' 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>{{$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;"> + <div class="bar" + style="transition-duration: 300ms; min-width: unset; background-color: rgb(10, 148, 242); width: {{$TransLeftPercent}}% !important; margin: unset !important"></div> + <small style="position: relative; top: -2em;">{{TransLeft $stats.Max $transfer}} / + {{$TransLeftPercent}} %</small></div> + </td> + </tr> + {{end}} {{end}} - </div> + </tbody> + </table> + {{end}} </div> {{template "theme-server-status/content-footer" .}} </div> 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