修复多CPU在默认主题和AngelKanade下显示的问题,完善内网穿透本地化文本 (#415)

This commit is contained in:
UUBulb 2024-08-25 11:33:25 +08:00 committed by GitHub
parent eb6dd2855e
commit 71508f8724
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
8 changed files with 73 additions and 34 deletions

View File

@ -655,6 +655,15 @@ other = "Servers On World Map"
[NAT] [NAT]
other = "NAT Traversal" other = "NAT Traversal"
[LocalService]
other = "Local service"
[LocalServicePlaceholder]
other = "192.168.1.1:80 (with port)"
[BindHostname]
other = "Bind hostname"
[NetworkSpiterList] [NetworkSpiterList]
other = "Network Monitor" other = "Network Monitor"

View File

@ -655,6 +655,15 @@ other = "Servidores en el mapa mundial"
[NAT] [NAT]
other = "NAT traversal" 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] [NetworkSpiterList]
other = "Monitor de red" other = "Monitor de red"

View File

@ -655,6 +655,15 @@ other = "服务器世界分布图"
[NAT] [NAT]
other = "内网穿透" other = "内网穿透"
[LocalService]
other = "内网服务"
[LocalServicePlaceholder]
other = "192.168.1.1:80(带端口)"
[BindHostname]
other = "绑定域名"
[NetworkSpiterList] [NetworkSpiterList]
other = "网络监控" other = "网络监控"

View File

@ -653,7 +653,16 @@ other = "禁止前台切換主題"
other = "伺服器世界分布圖" other = "伺服器世界分布圖"
[NAT] [NAT]
other = "NAT" other = "NAT穿透"
[LocalService]
other = "內網服務"
[LocalServicePlaceholder]
other = "192.168.1.1:80(帶埠號)"
[BindHostname]
other = "綁定網域"
[NetworkSpiterList] [NetworkSpiterList]
other = "網路監控" other = "網路監控"

View File

@ -13,11 +13,11 @@
<input type="number" name="ServerID" placeholder="1"> <input type="number" name="ServerID" placeholder="1">
</div> </div>
<div class="field"> <div class="field">
<label>内网服务</label> <label>{{tr "LocalService"}}</label>
<input type="text" name="Host" placeholder="192.168.1.1:80(带端口)"> <input type="text" name="Host" placeholder="{{tr "LocalServicePlaceholder"}}">
</div> </div>
<div class="field"> <div class="field">
<label>绑定域名</label> <label>{{tr "BindHostname"}}</label>
<input type="text" name="Domain" placeholder="router.app.yourdomain.com"> <input type="text" name="Domain" placeholder="router.app.yourdomain.com">
</div> </div>
</form> </form>

View File

@ -16,8 +16,8 @@
<th>ID</th> <th>ID</th>
<th>{{tr "Name"}}</th> <th>{{tr "Name"}}</th>
<th>Agent ID</th> <th>Agent ID</th>
<th>内网服务</th> <th>{{tr "LocalService"}}</th>
<th>绑定域名</th> <th>{{tr "BindHostname"}}</th>
<th>{{tr "Administration"}}</th> <th>{{tr "Administration"}}</th>
</tr> </tr>
</thead> </thead>

View File

@ -261,22 +261,23 @@
const x = readableBytes(bs) const x = readableBytes(bs)
return x != "NaN undefined" ? x : '0B' return x != "NaN undefined" ? x : '0B'
}, },
getCoreAndGHz(str){ getCoreAndGHz(arr) {
if((str || []).hasOwnProperty(0) === false){ if ((arr || []).length === 0) {
return ''; return '';
} }
str = str[0]; let totalCores = 0;
let GHz = str.match(/(\d|\.)+GHz/g); arr.forEach(str => {
let Core = str.match(/(\d|\.)+ Physical/g); let coreMatch = str.match(/(\d+(\.\d+)?) Physical/g);
GHz = GHz!==null?GHz.hasOwnProperty(0)===false?'':GHz[0]:'' let coreCount = 0;
Core = Core!==null?Core.hasOwnProperty(0)===false?'?':Core[0]:'?' if (coreMatch) {
if(Core === '?'){ coreCount = parseFloat(coreMatch[0]);
let Core = str.match(/(\d|\.)+ Virtual/g); } else {
Core = Core!==null?Core.hasOwnProperty(0)===false?'?':Core[0]:'?' let coreMatch = str.match(/(\d+(\.\d+)?) Virtual/g);
return Core.replace('Virtual','Core') coreCount = coreMatch ? parseFloat(coreMatch[0]) : 0;
} }
return Core.replace('Physical','Core'); totalCores += coreCount;
});
return `${totalCores} Cores`;
}, },
getByteToGB(bs){ getByteToGB(bs){
return (bs/1024/1024/1024).toFixed(2) + 'GB' return (bs/1024/1024/1024).toFixed(2) + 'GB'

View File

@ -474,21 +474,23 @@
const sizes = ["B", "K", "M", "G", "T", "P", "E", "Z", "Y"]; const sizes = ["B", "K", "M", "G", "T", "P", "E", "Z", "Y"];
return parseFloat((bytes / Math.pow(1024, i)).toFixed(2)) + sizes[i]; return parseFloat((bytes / Math.pow(1024, i)).toFixed(2)) + sizes[i];
}, },
getCoreAndGHz(str){ getCoreAndGHz(arr) {
if ((str || []).hasOwnProperty(0) === false) { if ((arr || []).length === 0) {
return ''; return '';
} }
str = str[0]; let totalCores = 0;
let GHz = str.match(/(\d|\.)+GHz/g); arr.forEach(str => {
let Core = str.match(/(\d|\.)+ Physical/g); let coreMatch = str.match(/(\d+(\.\d+)?) Physical/g);
GHz = GHz !== null ? GHz.hasOwnProperty(0) === false ? '' : GHz[0] : '' let coreCount = 0;
Core = Core !== null ? Core.hasOwnProperty(0) === false ? '?' : Core[0] : '?' if (coreMatch) {
if (Core === '?') { coreCount = parseFloat(coreMatch[0]);
let Core = str.match(/(\d|\.)+ Virtual/g); } else {
Core = Core !== null ? Core.hasOwnProperty(0) === false ? '?' : Core[0] : '?' let coreMatch = str.match(/(\d+(\.\d+)?) Virtual/g);
return Core.replace('Virtual', 'Core') coreCount = coreMatch ? parseFloat(coreMatch[0]) : 0;
} }
return Core.replace('Physical', 'Core'); totalCores += coreCount;
});
return `${totalCores} Cores`;
}, },
getK2Gb(bs){ getK2Gb(bs){
bs = bs / 1024 / 1024 / 1024; bs = bs / 1024 / 1024 / 1024;