From 71508f8724e5736b318d33446e3cdd8b7029cd26 Mon Sep 17 00:00:00 2001
From: UUBulb <35923940+uubulb@users.noreply.github.com>
Date: Sun, 25 Aug 2024 11:33:25 +0800
Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=A4=9ACPU=E5=9C=A8?=
=?UTF-8?q?=E9=BB=98=E8=AE=A4=E4=B8=BB=E9=A2=98=E5=92=8CAngelKanade?=
=?UTF-8?q?=E4=B8=8B=E6=98=BE=E7=A4=BA=E7=9A=84=E9=97=AE=E9=A2=98=EF=BC=8C?=
=?UTF-8?q?=E5=AE=8C=E5=96=84=E5=86=85=E7=BD=91=E7=A9=BF=E9=80=8F=E6=9C=AC?=
=?UTF-8?q?=E5=9C=B0=E5=8C=96=E6=96=87=E6=9C=AC=20(#415)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
resource/l10n/en-US.toml | 9 ++++++
resource/l10n/es-ES.toml | 9 ++++++
resource/l10n/zh-CN.toml | 9 ++++++
resource/l10n/zh-TW.toml | 11 ++++++-
resource/template/component/nat.html | 6 ++--
resource/template/dashboard-default/nat.html | 4 +--
.../template/theme-angel-kanade/home.html | 31 ++++++++++---------
resource/template/theme-default/home.html | 28 +++++++++--------
8 files changed, 73 insertions(+), 34 deletions(-)
diff --git a/resource/l10n/en-US.toml b/resource/l10n/en-US.toml
index 28ff53c7a7..bb46b046ff 100644
--- a/resource/l10n/en-US.toml
+++ b/resource/l10n/en-US.toml
@@ -655,6 +655,15 @@ other = "Servers On World Map"
[NAT]
other = "NAT Traversal"
+[LocalService]
+other = "Local service"
+
+[LocalServicePlaceholder]
+other = "192.168.1.1:80 (with port)"
+
+[BindHostname]
+other = "Bind hostname"
+
[NetworkSpiterList]
other = "Network Monitor"
diff --git a/resource/l10n/es-ES.toml b/resource/l10n/es-ES.toml
index fa21889d9e..e4ba8f76b9 100644
--- a/resource/l10n/es-ES.toml
+++ b/resource/l10n/es-ES.toml
@@ -655,6 +655,15 @@ other = "Servidores en el mapa mundial"
[NAT]
other = "NAT traversal"
+[LocalService]
+other = "Servicio de red local"
+
+[LocalServicePlaceholder]
+other = "192.168.1.1:80 (con puerto)"
+
+[BindHostname]
+other = "Vincular nombre de host"
+
[NetworkSpiterList]
other = "Monitor de red"
diff --git a/resource/l10n/zh-CN.toml b/resource/l10n/zh-CN.toml
index 61e81f813b..2a622f4cda 100644
--- a/resource/l10n/zh-CN.toml
+++ b/resource/l10n/zh-CN.toml
@@ -655,6 +655,15 @@ other = "服务器世界分布图"
[NAT]
other = "内网穿透"
+[LocalService]
+other = "内网服务"
+
+[LocalServicePlaceholder]
+other = "192.168.1.1:80(带端口)"
+
+[BindHostname]
+other = "绑定域名"
+
[NetworkSpiterList]
other = "网络监控"
diff --git a/resource/l10n/zh-TW.toml b/resource/l10n/zh-TW.toml
index e9fcf92684..aa84097f59 100644
--- a/resource/l10n/zh-TW.toml
+++ b/resource/l10n/zh-TW.toml
@@ -653,7 +653,16 @@ other = "禁止前台切換主題"
other = "伺服器世界分布圖"
[NAT]
-other = "NAT"
+other = "NAT穿透"
+
+[LocalService]
+other = "內網服務"
+
+[LocalServicePlaceholder]
+other = "192.168.1.1:80(帶埠號)"
+
+[BindHostname]
+other = "綁定網域"
[NetworkSpiterList]
other = "網路監控"
diff --git a/resource/template/component/nat.html b/resource/template/component/nat.html
index 4caf92752a..65e400874e 100644
--- a/resource/template/component/nat.html
+++ b/resource/template/component/nat.html
@@ -13,11 +13,11 @@
-
-
+
+
-
+
diff --git a/resource/template/dashboard-default/nat.html b/resource/template/dashboard-default/nat.html
index e2449fc5e9..0136228780 100644
--- a/resource/template/dashboard-default/nat.html
+++ b/resource/template/dashboard-default/nat.html
@@ -16,8 +16,8 @@
ID |
{{tr "Name"}} |
Agent ID |
- 内网服务 |
- 绑定域名 |
+ {{tr "LocalService"}} |
+ {{tr "BindHostname"}} |
{{tr "Administration"}} |
diff --git a/resource/template/theme-angel-kanade/home.html b/resource/template/theme-angel-kanade/home.html
index 9479b5273f..0c0b06cec9 100644
--- a/resource/template/theme-angel-kanade/home.html
+++ b/resource/template/theme-angel-kanade/home.html
@@ -261,22 +261,23 @@
const x = readableBytes(bs)
return x != "NaN undefined" ? x : '0B'
},
- getCoreAndGHz(str){
- if((str || []).hasOwnProperty(0) === false){
- return '';
+ getCoreAndGHz(arr) {
+ if ((arr || []).length === 0) {
+ return '';
}
- str = str[0];
- let GHz = str.match(/(\d|\.)+GHz/g);
- let Core = str.match(/(\d|\.)+ Physical/g);
- GHz = GHz!==null?GHz.hasOwnProperty(0)===false?'':GHz[0]:''
- Core = Core!==null?Core.hasOwnProperty(0)===false?'?':Core[0]:'?'
- if(Core === '?'){
- let Core = str.match(/(\d|\.)+ Virtual/g);
- Core = Core!==null?Core.hasOwnProperty(0)===false?'?':Core[0]:'?'
- return Core.replace('Virtual','Core')
- }
- return Core.replace('Physical','Core');
-
+ let totalCores = 0;
+ arr.forEach(str => {
+ let coreMatch = str.match(/(\d+(\.\d+)?) Physical/g);
+ let coreCount = 0;
+ if (coreMatch) {
+ coreCount = parseFloat(coreMatch[0]);
+ } else {
+ let coreMatch = str.match(/(\d+(\.\d+)?) Virtual/g);
+ coreCount = coreMatch ? parseFloat(coreMatch[0]) : 0;
+ }
+ totalCores += coreCount;
+ });
+ return `${totalCores} Cores`;
},
getByteToGB(bs){
return (bs/1024/1024/1024).toFixed(2) + 'GB'
diff --git a/resource/template/theme-default/home.html b/resource/template/theme-default/home.html
index 21972a67a8..cc51b2c319 100644
--- a/resource/template/theme-default/home.html
+++ b/resource/template/theme-default/home.html
@@ -474,21 +474,23 @@
const sizes = ["B", "K", "M", "G", "T", "P", "E", "Z", "Y"];
return parseFloat((bytes / Math.pow(1024, i)).toFixed(2)) + sizes[i];
},
- getCoreAndGHz(str){
- if ((str || []).hasOwnProperty(0) === false) {
+ getCoreAndGHz(arr) {
+ if ((arr || []).length === 0) {
return '';
}
- str = str[0];
- let GHz = str.match(/(\d|\.)+GHz/g);
- let Core = str.match(/(\d|\.)+ Physical/g);
- GHz = GHz !== null ? GHz.hasOwnProperty(0) === false ? '' : GHz[0] : ''
- Core = Core !== null ? Core.hasOwnProperty(0) === false ? '?' : Core[0] : '?'
- if (Core === '?') {
- let Core = str.match(/(\d|\.)+ Virtual/g);
- Core = Core !== null ? Core.hasOwnProperty(0) === false ? '?' : Core[0] : '?'
- return Core.replace('Virtual', 'Core')
- }
- return Core.replace('Physical', 'Core');
+ let totalCores = 0;
+ arr.forEach(str => {
+ let coreMatch = str.match(/(\d+(\.\d+)?) Physical/g);
+ let coreCount = 0;
+ if (coreMatch) {
+ coreCount = parseFloat(coreMatch[0]);
+ } else {
+ let coreMatch = str.match(/(\d+(\.\d+)?) Virtual/g);
+ coreCount = coreMatch ? parseFloat(coreMatch[0]) : 0;
+ }
+ totalCores += coreCount;
+ });
+ return `${totalCores} Cores`;
},
getK2Gb(bs){
bs = bs / 1024 / 1024 / 1024;