From 5d18063dd798ccf33320f5f6a21304a035905d70 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Ckris=E2=80=9D?= <“x@hi.sy”> Date: Thu, 28 Apr 2022 17:35:11 +0200 Subject: [PATCH 1/4] First Commit --- resource/l10n/zh-CN.toml | 2 ++ resource/template/common/menu.html | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/resource/l10n/zh-CN.toml b/resource/l10n/zh-CN.toml index b387822..a0ab280 100644 --- a/resource/l10n/zh-CN.toml +++ b/resource/l10n/zh-CN.toml @@ -1,2 +1,4 @@ [nezhaMonitor] other = "哪吒监控" +[Server] +other = "主机" \ No newline at end of file diff --git a/resource/template/common/menu.html b/resource/template/common/menu.html index bd5bb4f..2d8be82 100644 --- a/resource/template/common/menu.html +++ b/resource/template/common/menu.html @@ -5,7 +5,7 @@ {{if .IsAdminPage}} - 主机 + {{tr "Server"}} 服务 任务 报警 From 4dad15150c25f15620264b484a594343eea0ba64 Mon Sep 17 00:00:00 2001 From: Kris <“x@hi.sy”> Date: Thu, 28 Apr 2022 18:13:32 +0200 Subject: [PATCH 2/4] modified: resource/l10n/zh-CN.toml modified: resource/template/common/menu.html --- resource/l10n/zh-CN.toml | 20 +++++++++++++++++++- resource/template/common/menu.html | 20 ++++++++++---------- 2 files changed, 29 insertions(+), 11 deletions(-) diff --git a/resource/l10n/zh-CN.toml b/resource/l10n/zh-CN.toml index a0ab280..c50ef5b 100644 --- a/resource/l10n/zh-CN.toml +++ b/resource/l10n/zh-CN.toml @@ -1,4 +1,22 @@ [nezhaMonitor] other = "哪吒监控" [Server] -other = "主机" \ No newline at end of file +other = "主机" +[Services] +other = "服务" +[Task] +other = "任务" +[Notification] +other = "报警" +[Settings] +other = "设置" +[Home] +other = "首页" +[Backtohomepage] +other = "返回前台" +[AdminPanel] +other = "管理后台" +[Logout] +other = "注销登录" +[Login] +other = "登录" \ No newline at end of file diff --git a/resource/template/common/menu.html b/resource/template/common/menu.html index 2d8be82..d70530d 100644 --- a/resource/template/common/menu.html +++ b/resource/template/common/menu.html @@ -6,15 +6,15 @@ {{if .IsAdminPage}} {{tr "Server"}} - 服务 - 任务 - 报警 + {{tr "Services"}} + {{tr "Task"}} + {{tr "Notification"}} - 设置 + {{tr "Settings"}} {{else}} - 首页 - 服务 + {{tr "Home"}} + {{tr "Services"}} {{end}} From 0e9dfc0c7e443d1fd9d48451f230d0459dc695cc Mon Sep 17 00:00:00 2001 From: Kris <“x@hi.sy”> Date: Fri, 29 Apr 2022 04:52:26 +0200 Subject: [PATCH 3/4] modified: resource/l10n/zh-CN.toml modified: resource/template/common/menu.html modified: resource/template/component/confirm.html modified: resource/template/component/cron.html modified: resource/template/component/monitor.html modified: resource/template/component/notification.html modified: resource/template/component/rule.html modified: resource/template/component/server.html modified: resource/template/dashboard/cron.html modified: resource/template/dashboard/error.html modified: resource/template/dashboard/login.html modified: resource/template/dashboard/monitor.html modified: resource/template/dashboard/notification.html modified: resource/template/dashboard/server.html modified: resource/template/dashboard/setting.html modified: resource/template/dashboard/terminal.html --- resource/l10n/zh-CN.toml | 201 +++++++++++++++++- resource/template/common/menu.html | 4 +- resource/template/component/confirm.html | 4 +- resource/template/component/cron.html | 38 ++-- resource/template/component/monitor.html | 39 ++-- resource/template/component/notification.html | 18 +- resource/template/component/rule.html | 14 +- resource/template/component/server.html | 26 +-- resource/template/dashboard/cron.html | 26 +-- resource/template/dashboard/error.html | 2 +- resource/template/dashboard/login.html | 6 +- resource/template/dashboard/monitor.html | 30 +-- resource/template/dashboard/notification.html | 26 +-- resource/template/dashboard/server.html | 36 ++-- resource/template/dashboard/setting.html | 36 ++-- resource/template/dashboard/terminal.html | 4 +- 16 files changed, 351 insertions(+), 159 deletions(-) diff --git a/resource/l10n/zh-CN.toml b/resource/l10n/zh-CN.toml index c50ef5b..54e71cb 100644 --- a/resource/l10n/zh-CN.toml +++ b/resource/l10n/zh-CN.toml @@ -12,11 +12,208 @@ other = "报警" other = "设置" [Home] other = "首页" -[Backtohomepage] +[BackToHomepage] other = "返回前台" [AdminPanel] other = "管理后台" [Logout] other = "注销登录" [Login] -other = "登录" \ No newline at end of file +other = "登录" +[ConfirmLogout] +other = "确认注销?" +[AfterLoggingOutYouHaveToLoginAgain] +other = "注销后您必须重新登录才能使用" +[Cancel] +other = "取消" +[Confirm] +other = "确认" +[AddScheduledTasks] +other = "添加计划任务" +[Name] +other = "名称" +[Scheduler] +other = "计划" +[BackUp] +other = "备份" +[3amDaily] +other = "(每天3点)" +[Command] +other = "命令" +[Coverage] +other = "覆盖范围" +[IgnoreAllAndExecuteOnlyThroughSpecificServers] +other = "忽略所有,仅通过特定服务器执行" +[AllIncludedOnlySpecificServersAreNotExecuted] +other = "覆盖所有,仅特定服务器不执行" +[SpecificServers] +other = "特定服务器" +[EnterIdAndNameToSearch] +other = "输入ID/名称以搜索" +[NotificationMethod] +other = "通知方式组" +[PushSuccessMessages] +other = "推送成功的消息" +[TheFormaOfTheScheduleIs] +other = "计划的格式为:" +[SecondsMinutesHoursDaysMonthsWeeksSeeDetails] +other = "秒 分 时 天 月 星期,详情见" +[ScheduleExpressionFormat] +other = "计划表达式格式" +[IntroductionOfCommands] +other = "命令:就像写 shell/bat 脚本一样,但是不推荐换行,多个命令使用 &&/& 连接,如果遇到 xxx 命令找不到,可能是PATH 环境变量的问题,Linux 主机在命令开头加入source ~/.bashrc或者使用绝对路径执行。" +[AddMonitor] +other = "添加监控" +[Blog] +other = "博客" +[Target] +other = "目标" +[Type] +other = "类型" +[SslExpirationOrChange] +other = "(SSL到期、变更)" +[Duration] +other = "请求间隔" +[Seconds] +other = "秒" +[EnableFailureNotification] +other = "启用故障通知" +[IntroductionOfMonitor] +other = """ +类型为 HTTP-GET 时输入URL(带 http/https, HTTPS协议的会顺带监控SSL证书); +类型为 ICMP-Ping 时输入主机名/IP,不带端口; +类型为 TCP-Ping 时输入主机名/IP + 端口号:example.com:22""" +[AddNotificationMethod] +other = "添加通知方式" +[Tag] +other = "分组" +[DoNotSendTestMessages] +other = "不发送测试信息" +[RequestMethod] +other = "请求方式" +[RequestType] +other = "请求类型" +[VerifySSL] +other = "验证SSL" +[AddNotificationRule] +other = "添加报警规则" +[Rules] +other = "规则" +[NotificationMethod] +other = "通知方式组" +[Enable] +other = "启用" +[AddServer] +other = "添加服务器" +[ServerGroup] +other = "服务器分组" +[EinsteinLightspeed1] +other = "爱因斯坦-光速1号" +[DisplayIndex] +other = "排序" +[TheLargerTheNumberTheHigherThePriority] +other = "越大越靠前" +[Secret] +other = "密钥" +[Note] +other = "备注" +[LinuxOneKeyInstall] +other = "Linux 一键安装" +[NoDomainAlert] +other = "请先在设置页面配置 未接入CDN的面板服务器域名/IP" +[PushSuccessfully] +other = "成功推送" +[LastExecution] +other = "最后执行" +[LastResult] +other = "最后结果" +[Administration] +other = "管理" +[CoverAll] +other = "覆盖所有" +[IgnoreAll] +other = "忽略所有" +[DeleteScheduledTask] +other = "删除计划任务" +[ConfirmToDeleteThisScheduledTask] +other = "确认删除此计划任务?" +[AccessDenied] +other = "访问受限" +[Use] +other = "使用" +[AccountToLogin] +other = "账号登录" +[SignUp] +other = "注册" +[DontHaveAnAccount] +other = "没有账号?" +[SSLCertificate] +other = "HTTP(S)/SSL证书" +[TCPPort] +other = "TCP 端口" +[DeleteService] +other = "删除服务" +[ConfirmToDeleteThisService] +other = "确认删除此服务?" +[DeleteNotificationMethod] +other = "删除通知方式" +[ConfirmToDeleteThisNotificationMethod] +other = "确认删除此通知方式?" +[ForceUpdate] +other = "强制更新" +[SelectAll] +other = "全选" +[VersionNumber] +other = "版本号" +[OneKeyInstall] +other = "一键安装" +[ClickToCopyTheInstallationCommand] +other = "点击复制安装命令" +[NotSupportedYet] +other = "尚未支持,请下载release手动安装" +[DeleteServer] +other = "删除主机" +[ConfirmToDeleteThisServer] +other = "确认删除此主机?" +[NoServerSelected] +other = "当前没有选中的服务器" +[ExecutionResults] +other = "执行结果" +[SiteTitle] +other = "站点标题" +[AdministratorList] +other = "管理员列表" +[Theme] +other = "主题" +[DefaultTheme] +other = "默认主题" +[CustomCodes] +other = "自定义代码(style、script 都可以)" +[AccessPassword] +other = "前台查看密码" +[PanelServerDomainAndIP] +other = "未接入CDN的面板服务器域名/IP" +[IPChangeAlert] +other = "IP 变更提醒" +[AllIncludedOnlySpecificServersAreNotAlerted] +other = "覆盖所有,仅特定服务器不提醒" +[IgnoreAllOnlyAlertSpecificServers] +other = "忽略所有,仅提醒特定服务器" +[IgnoreAllRequestOnlyThroughSpecificServers] +other = "忽略所有,仅通过特定服务器请求" +[AllIncludedOnlySpecificServersAreNotRequest] +other = "覆盖所有,仅特定服务器不请求" +[ServerIDSeparatedByCommas] +other = "服务器ID 以逗号隔开" +[IPChangeNotificationTag] +other = "提醒发送至指定的通知分组" +[NotificationMessagesDoNotHideIP] +other = "通知信息IP不打码" +[Save] +other = "保存" +[ModifiedSuccessfully] +other = "修改成功" +[TerminalConnectionTimeOutOrSessionEnded] +other = "Terminal 连接超时或会话已结束" +[TerminalConnectionFailed] +other = "Terminal 连接失败,请检查 /terminal/* 的 WebSocket 反代情况" \ No newline at end of file diff --git a/resource/template/common/menu.html b/resource/template/common/menu.html index d70530d..e6c5fdc 100644 --- a/resource/template/common/menu.html +++ b/resource/template/common/menu.html @@ -27,14 +27,14 @@ diff --git a/resource/template/component/confirm.html b/resource/template/component/confirm.html index 3db8b45..9cdbfa1 100644 --- a/resource/template/component/confirm.html +++ b/resource/template/component/confirm.html @@ -4,8 +4,8 @@
-
取消
-
diff --git a/resource/template/component/cron.html b/resource/template/component/cron.html index 0b71952..722351d 100644 --- a/resource/template/component/cron.html +++ b/resource/template/component/cron.html @@ -1,62 +1,60 @@ {{define "component/cron"}} diff --git a/resource/template/component/monitor.html b/resource/template/component/monitor.html index 98fba8a..dc0fb52 100644 --- a/resource/template/component/monitor.html +++ b/resource/template/component/monitor.html @@ -1,15 +1,15 @@ {{define "component/monitor"}} diff --git a/resource/template/component/notification.html b/resource/template/component/notification.html index 98086ae..808fd48 100644 --- a/resource/template/component/notification.html +++ b/resource/template/component/notification.html @@ -1,15 +1,15 @@ {{define "component/notification"}}
-
取消
-
diff --git a/resource/template/component/rule.html b/resource/template/component/rule.html index 8448244..5fc5c29 100644 --- a/resource/template/component/rule.html +++ b/resource/template/component/rule.html @@ -1,32 +1,32 @@ {{define "component/rule"}} diff --git a/resource/template/component/server.html b/resource/template/component/server.html index ab88344..f0e4112 100644 --- a/resource/template/component/server.html +++ b/resource/template/component/server.html @@ -1,32 +1,32 @@ {{define "component/server"}} diff --git a/resource/template/dashboard/cron.html b/resource/template/dashboard/cron.html index 842d914..febca61 100644 --- a/resource/template/dashboard/cron.html +++ b/resource/template/dashboard/cron.html @@ -6,7 +6,7 @@
@@ -14,16 +14,16 @@ ID - 名称 - 计划 - 命令 - 通知方式组 - 成功推送 - 覆盖范围 - 特定服务器 - 最后执行 - 最后结果 - 管理 + {{tr "Name"}} + {{tr "Scheduler"}} + {{tr "Command"}} + {{tr "NotificationMethod"}} + {{tr "PushSuccessfully"}} + {{tr "Coverage"}} + {{tr "SpecificServers"}} + {{tr "LastExecution"}} + {{tr "LastResult"}} + {{tr "Administration"}} @@ -35,7 +35,7 @@ {{$cron.Command}} {{$cron.NotificationTag}} {{$cron.PushSuccessful}} - {{if eq $cron.Cover 0}}忽略所有{{else}}覆盖所有{{end}} + {{if eq $cron.Cover 0}}{{tr "IgnoreAll"}}{{else}}{{tr "CoverAll"}}{{end}} {{$cron.ServersRaw}} {{$cron.LastExecutedAt|tf}} {{$cron.LastResult}} @@ -48,7 +48,7 @@ diff --git a/resource/template/dashboard/error.html b/resource/template/dashboard/error.html index b23c8b7..d920a73 100644 --- a/resource/template/dashboard/error.html +++ b/resource/template/dashboard/error.html @@ -6,7 +6,7 @@

- 访问受限 + {{tr "AccessDenied"}}

diff --git a/resource/template/dashboard/login.html b/resource/template/dashboard/login.html index dfe5c79..95b6aa5 100644 --- a/resource/template/dashboard/login.html +++ b/resource/template/dashboard/login.html @@ -6,12 +6,12 @@

- 使用 {{.LoginType}} 账号登录 + {{tr "Use"}} {{.LoginType}} {{tr "AccountToLogin"}}

- 登录 + {{tr "Login"}}
- 没有账号? 注册 + {{tr "DontHaveAnAccount"}} {{tr "SignUp"}}
diff --git a/resource/template/dashboard/monitor.html b/resource/template/dashboard/monitor.html index 2feff3a..a1b3881 100644 --- a/resource/template/dashboard/monitor.html +++ b/resource/template/dashboard/monitor.html @@ -5,7 +5,7 @@
@@ -13,15 +13,15 @@ ID - 名称 - 目标 - 覆盖范围 - 特定服务器 - 类型 - 请求间隔 - 通知方式组 - 通知 - 管理 + {{tr "Name"}} + {{tr "Target"}} + {{tr "Coverage"}} + {{tr "SpecificServers"}} + {{tr "Type"}} + {{tr "Duration"}} + {{tr "NotificationMethod"}} + {{tr "Notification"}} + {{tr "Administration"}} @@ -30,13 +30,13 @@ {{$monitor.ID}} {{$monitor.Name}} {{$monitor.Target}} - {{if eq $monitor.Cover 0}}覆盖所有{{else}}忽略所有{{end}} + {{if eq $monitor.Cover 0}}{{tr "CoverAll"}}{{else}}{{tr "IgnoreAll"}}{{end}} {{$monitor.SkipServersRaw}} - {{if eq $monitor.Type 1}}HTTP(S)/SSL证书 {{else if eq $monitor.Type - 2}} ICMP Ping {{else}} TCP 端口 {{end}} + {{if eq $monitor.Type 1}}{{tr "SSLCertificate"}} {{else if eq $monitor.Type + 2}} ICMP Ping {{else}} {{tr "TCPPort"}} {{end}} - {{$monitor.Duration}}秒 + {{$monitor.Duration}}{{tr "Seconds"}} {{$monitor.NotificationTag}} {{$monitor.Notify}} @@ -45,7 +45,7 @@ diff --git a/resource/template/dashboard/notification.html b/resource/template/dashboard/notification.html index d012b8c..3148efa 100644 --- a/resource/template/dashboard/notification.html +++ b/resource/template/dashboard/notification.html @@ -6,7 +6,7 @@
@@ -14,11 +14,11 @@ ID - 名称 - 分组 + {{tr "Name"}} + {{tr "Tag"}} URL - 验证SSL - 管理 + {{tr "VerifySSL"}} + {{tr "Administration"}} @@ -35,7 +35,7 @@ @@ -48,7 +48,7 @@
@@ -56,11 +56,11 @@ ID - 名称 - 通知方式组 - 规则 - 启用 - 管理 + {{tr "Name"}} + {{tr "NotificationMethod"}} + {{tr "Rules"}} + {{tr "Enable"}} + {{tr "Administration"}} @@ -77,7 +77,7 @@ diff --git a/resource/template/dashboard/server.html b/resource/template/dashboard/server.html index 3a00318..563de57 100644 --- a/resource/template/dashboard/server.html +++ b/resource/template/dashboard/server.html @@ -6,26 +6,26 @@
- - - - + + + + - - - - - + + + + + @@ -40,14 +40,14 @@ @@ -61,7 +61,7 @@ @@ -92,7 +92,7 @@ }) if (servers.length == 0) { $.suiAlert({ - title: '当前没有选中的服务器', + title: '{{tr "NoServerSelected"}}', description: '', type: 'warning', time: '2', @@ -104,7 +104,7 @@ .then((resp) => { if (resp.code == 200) { $.suiAlert({ - title: '执行结果', + title: '{{tr "ExecutionResults"}}', description: resp.message, type: 'success', time: '3', diff --git a/resource/template/dashboard/setting.html b/resource/template/dashboard/setting.html index 77aa0b2..2987944 100644 --- a/resource/template/dashboard/setting.html +++ b/resource/template/dashboard/setting.html @@ -5,17 +5,17 @@
- +
- +
- +
- +
- +
- +
- +
- +
- - {{tr "SpecificServers"}} +
- +
- +
- +
- +
@@ -81,7 +81,7 @@ if (resp.code == 200) { $.suiAlert({ title: '', - description: '修改成功', + description: '{{tr "ModifiedSuccessfully"}}', type: 'success', time: '3', position: 'top-center', diff --git a/resource/template/dashboard/terminal.html b/resource/template/dashboard/terminal.html index 4aea4d3..164e297 100644 --- a/resource/template/dashboard/terminal.html +++ b/resource/template/dashboard/terminal.html @@ -84,12 +84,12 @@ } socket.onclose = () => { - alert('Terminal 连接超时或会话已结束') + alert('{{tr "TerminalConnectionTimeOutOrSessionEnded"}}') window.close() } socket.onerror = () => { - alert('Terminal 连接失败,请检查 /terminal/* 的 WebSocket 反代情况') + alert('{{tr "TerminalConnectionFailed"}}') } From c55c1edca329f0a09cacbdc96cbbf934099bb888 Mon Sep 17 00:00:00 2001 From: naiba Date: Fri, 29 Apr 2022 11:45:41 +0800 Subject: [PATCH 4/4] fix typo --- resource/l10n/zh-CN.toml | 6 ++---- resource/template/common/menu.html | 2 +- resource/template/component/cron.html | 2 +- resource/template/component/monitor.html | 2 +- resource/template/dashboard/monitor.html | 2 +- 5 files changed, 6 insertions(+), 8 deletions(-) diff --git a/resource/l10n/zh-CN.toml b/resource/l10n/zh-CN.toml index 54e71cb..6d20a27 100644 --- a/resource/l10n/zh-CN.toml +++ b/resource/l10n/zh-CN.toml @@ -80,8 +80,8 @@ other = "秒" other = "启用故障通知" [IntroductionOfMonitor] other = """ -类型为 HTTP-GET 时输入URL(带 http/https, HTTPS协议的会顺带监控SSL证书); -类型为 ICMP-Ping 时输入主机名/IP,不带端口; +类型为 HTTP-GET 时输入URL(带 http/https, HTTPS协议的会顺带监控SSL证书);
+类型为 ICMP-Ping 时输入主机名/IP,不带端口;
类型为 TCP-Ping 时输入主机名/IP + 端口号:example.com:22""" [AddNotificationMethod] other = "添加通知方式" @@ -99,8 +99,6 @@ other = "验证SSL" other = "添加报警规则" [Rules] other = "规则" -[NotificationMethod] -other = "通知方式组" [Enable] other = "启用" [AddServer] diff --git a/resource/template/common/menu.html b/resource/template/common/menu.html index e6c5fdc..3423c4e 100644 --- a/resource/template/common/menu.html +++ b/resource/template/common/menu.html @@ -34,7 +34,7 @@ {{tr "AdminPanel"}} {{end}} - diff --git a/resource/template/component/cron.html b/resource/template/component/cron.html index 722351d..c2bd0b7 100644 --- a/resource/template/component/cron.html +++ b/resource/template/component/cron.html @@ -48,7 +48,7 @@ {{tr "TheFormaOfTheScheduleIs"}}* * * * * * {{tr "SecondsMinutesHoursDaysMonthsWeeksSeeDetails"}} {{tr "ScheduleExpressionFormat"}}
- {{tr "IntroductionOfCommands"}} + {{safe (tr "IntroductionOfCommands")}}

diff --git a/resource/template/component/monitor.html b/resource/template/component/monitor.html index dc0fb52..5b4c09c 100644 --- a/resource/template/component/monitor.html +++ b/resource/template/component/monitor.html @@ -57,7 +57,7 @@

- {{tr "IntroductionOfMonitor"}} + {{safe (tr "IntroductionOfMonitor")}}

diff --git a/resource/template/dashboard/monitor.html b/resource/template/dashboard/monitor.html index a1b3881..a9872a8 100644 --- a/resource/template/dashboard/monitor.html +++ b/resource/template/dashboard/monitor.html @@ -45,7 +45,7 @@
ID(排序)名称分组ID({{tr "DisplayIndex"}}){{tr "Name"}}{{tr "Tag"}} IP版本号密钥一键安装备注管理{{tr "VersionNumber"}}{{tr "Secret"}}{{tr "OneKeyInstall"}}{{tr "Note"}}{{tr "Administration"}}
{{$server.Secret}} - -