From 1c00cc8e3b1c4cc65b3342b7e532e592f3393f97 Mon Sep 17 00:00:00 2001 From: naiba Date: Tue, 7 Nov 2023 22:15:13 +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?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 2 +- go.mod | 2 +- resource/l10n/en-US.toml | 14 +------------- resource/l10n/es-ES.toml | 16 ++-------------- resource/l10n/zh-CN.toml | 16 ++-------------- resource/l10n/zh-TW.toml | 2 +- resource/template/theme-default/home.html | 2 +- .../theme-server-status/content-footer.html | 7 +------ .../theme-server-status/content-nav.html | 16 +++++++++------- .../template/theme-server-status/header.html | 2 -- resource/template/theme-server-status/home.html | 6 +++--- .../template/theme-server-status/service.html | 2 +- service/singleton/singleton.go | 2 +- 13 files changed, 24 insertions(+), 65 deletions(-) diff --git a/README.md b/README.md index fd2595fcd4..506ceb1471 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/go.mod b/go.mod index b88ec4a094..04231910ab 100644 --- a/go.mod +++ b/go.mod @@ -20,6 +20,7 @@ require ( github.com/patrickmn/go-cache v2.1.0+incompatible github.com/robfig/cron/v3 v3.0.1 github.com/samber/lo v1.38.1 + github.com/spf13/pflag v1.0.5 github.com/spf13/viper v1.17.0 github.com/stretchr/testify v1.8.4 github.com/xanzy/go-gitlab v0.93.1 @@ -71,7 +72,6 @@ require ( github.com/sourcegraph/conc v0.3.0 // indirect github.com/spf13/afero v1.10.0 // indirect github.com/spf13/cast v1.5.1 // indirect - github.com/spf13/pflag v1.0.5 // indirect github.com/subosito/gotenv v1.6.0 // indirect github.com/twitchyliquid64/golang-asm v0.15.1 // indirect github.com/ugorji/go/codec v1.2.11 // indirect diff --git a/resource/l10n/en-US.toml b/resource/l10n/en-US.toml index dadb08fcd0..9a6e1dd9f4 100644 --- a/resource/l10n/en-US.toml +++ b/resource/l10n/en-US.toml @@ -607,17 +607,5 @@ other = "Info" [HideForGuest] other = "No display to visitors" -[Feature] +[Menu] other = "Menu" - -[SitePV] -other = "Total page views" - -[SitePVUnit] -other = "Page views" - -[SiteUV] -other = "Total visitors" - -[SiteUVUnit] -other = "Visitors" \ No newline at end of file diff --git a/resource/l10n/es-ES.toml b/resource/l10n/es-ES.toml index e4ed623098..44dcae01e6 100644 --- a/resource/l10n/es-ES.toml +++ b/resource/l10n/es-ES.toml @@ -607,17 +607,5 @@ other = "Información" [HideForGuest] other = "No se muestra a los visitantes" -[Feature] -other = "Características" - -[SitePV] -other = "Número total de visitas al sitio" - -[SitePVUnit] -other = "visitas" - -[SiteUV] -other = "Número total de visitantes únicos al sitio" - -[SiteUVUnit] -other = "visitantes únicos" \ No newline at end of file +[Menu] +other = "Menú" diff --git a/resource/l10n/zh-CN.toml b/resource/l10n/zh-CN.toml index acc7b0479a..ce9fa87a3e 100644 --- a/resource/l10n/zh-CN.toml +++ b/resource/l10n/zh-CN.toml @@ -607,17 +607,5 @@ other = "信息" [HideForGuest] other = "对游客隐藏" -[Feature] -other = "功能" - -[SitePV] -other = "本站总访问量" - -[SitePVUnit] -other = "次" - -[SiteUV] -other = "本站总访客数" - -[SiteUVUnit] -other = "人次" \ No newline at end of file +[Menu] +other = "菜单" \ No newline at end of file diff --git a/resource/l10n/zh-TW.toml b/resource/l10n/zh-TW.toml index cc246def58..69b933a5e7 100644 --- a/resource/l10n/zh-TW.toml +++ b/resource/l10n/zh-TW.toml @@ -607,7 +607,7 @@ other = "訊息" [HideForGuest] other = "對遊客隱藏" -[Feature] +[Menu] other = "功能" [SitePV] diff --git a/resource/template/theme-default/home.html b/resource/template/theme-default/home.html index 2120f66f69..a591e7a9a8 100644 --- a/resource/template/theme-default/home.html +++ b/resource/template/theme-default/home.html @@ -227,7 +227,7 @@ secondToDate(s) { var d = Math.floor(s / 3600 / 24); if (d > 0) { - return d + " {{tr "Day"}}" + return d + ' {{tr "Day"}}' } var h = Math.floor(s / 3600 % 24); var m = Math.floor(s / 60 % 60); diff --git a/resource/template/theme-server-status/content-footer.html b/resource/template/theme-server-status/content-footer.html index d9c99f550f..eee8f61fb3 100644 --- a/resource/template/theme-server-status/content-footer.html +++ b/resource/template/theme-server-status/content-footer.html @@ -2,12 +2,7 @@

{{ .Title }} | Theme ServerStatus | Powered by {{tr "NezhaMonitoring"}} -

-

- + href="https://github.com/naiba/nezha">{{tr "NezhaMonitoring"}} {{.Version}}

{{end}} \ No newline at end of file diff --git a/resource/template/theme-server-status/content-nav.html b/resource/template/theme-server-status/content-nav.html index 5314fcb1cd..d5d0a6df15 100644 --- a/resource/template/theme-server-status/content-nav.html +++ b/resource/template/theme-server-status/content-nav.html @@ -9,28 +9,30 @@ - {{ .Title }} + {{.Conf.Site.Brand}}
-
+
{{if .CycleTransferStats}}

{{tr "CycleTransferStats"}}

diff --git a/service/singleton/singleton.go b/service/singleton/singleton.go index 004e7e2b5a..d7cf53c6c9 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.6" // !!记得修改 README 中的 badge 版本!! +var Version = "v0.15.7" // !!记得修改 README 中的 badge 版本!! var ( Conf *model.Config