diff --git a/web/assets/js/util/common.js b/web/assets/js/util/common.js
index 39c964d1..7225e4ba 100644
--- a/web/assets/js/util/common.js
+++ b/web/assets/js/util/common.js
@@ -33,13 +33,13 @@ function safeBase64(str) {
function formatSecond(second) {
if (second < 60) {
- return second.toFixed(0) + ' 秒';
+ return second.toFixed(0) + ' s';
} else if (second < 3600) {
- return (second / 60).toFixed(0) + ' 分钟';
+ return (second / 60).toFixed(0) + ' m';
} else if (second < 3600 * 24) {
- return (second / 3600).toFixed(0) + ' 小时';
+ return (second / 3600).toFixed(0) + ' h';
} else {
- return (second / 3600 / 24).toFixed(0) + ' 天';
+ return (second / 3600 / 24).toFixed(0) + ' d';
}
}
diff --git a/web/html/xui/index.html b/web/html/xui/index.html
index 05d849d4..c2a2a253 100644
--- a/web/html/xui/index.html
+++ b/web/html/xui/index.html
@@ -35,7 +35,7 @@
:stroke-color="status.mem.color"
:percent="status.mem.percent">
- 内存: [[ sizeFormat(status.mem.current) ]] / [[ sizeFormat(status.mem.total) ]]
+ {{ i18n "pages.index.memory"}}: [[ sizeFormat(status.mem.current) ]] / [[ sizeFormat(status.mem.total) ]]
@@ -55,7 +55,7 @@
:stroke-color="status.disk.color"
:percent="status.disk.percent">
- 硬盘: [[ sizeFormat(status.disk.current) ]] / [[ sizeFormat(status.disk.total) ]]
+ {{ i18n "pages.index.hard"}}: [[ sizeFormat(status.disk.current) ]] / [[ sizeFormat(status.disk.total) ]]
@@ -68,7 +68,7 @@
- xray 状态:
+ {{ i18n "pages.index.xrayStatus" }}:
[[ status.xray.state ]]
@@ -77,16 +77,16 @@
[[ status.xray.version ]]
- 切换版本
+ {{ i18n "pages.index.xraySwitch"}}
- 运行时间:
+ {{ i18n "pages.index.operationHours" }}:
[[ formatSecond(status.uptime) ]]
- 系统自启动以来的运行时间
+ {{ i18n "pages.index.operationHoursDesc" }}
@@ -94,15 +94,15 @@
- 系统负载: [[ status.loads[0] ]] | [[ status.loads[1] ]] | [[ status.loads[2] ]]
+ {{ i18n "pages.index.systemLoad" }}: [[ status.loads[0] ]] | [[ status.loads[1] ]] | [[ status.loads[2] ]]
- tcp / udp 连接数: [[ status.tcpCount ]] / [[ status.udpCount ]]
+ tcp / udp {{ i18n "pages.index.connectionCount" }}: [[ status.tcpCount ]] / [[ status.udpCount ]]
- 所有网卡的总连接数
+ {{ i18n "pages.index.connectionCountDesc" }}
@@ -116,7 +116,7 @@
[[ sizeFormat(status.netIO.up) ]] / S
- 所有网卡的总上传速度
+ {{ i18n "pages.index.upSpeed" }}
@@ -126,7 +126,7 @@
[[ sizeFormat(status.netIO.down) ]] / S
- 所有网卡的总下载速度
+ {{ i18n "pages.index.downSpeed" }}
@@ -142,7 +142,7 @@
[[ sizeFormat(status.netTraffic.sent) ]]
- 系统启动以来所有网卡的总上传流量
+ {{ i18n "pages.index.totalSent" }}
@@ -152,7 +152,7 @@
[[ sizeFormat(status.netTraffic.recv) ]]
- 系统启动以来所有网卡的总下载流量
+ {{ i18n "pages.index.totalReceive" }}
@@ -164,11 +164,11 @@
- versionModal.visible = false"
- ok-text="确定" cancel-text="取消">
- 点击你想切换的版本
- 请谨慎选择,旧版本可能配置不兼容
+ ok-text='{{ i18n "confirm" }}' cancel-text='{{ i18n "cancel"}}'>
+ {{ i18n "pages.index.xraySwitchClick"}}
+ {{ i18n "pages.index.xraySwitchClickDesk"}}
@@ -277,10 +277,10 @@
status: new Status(),
versionModal,
spinning: false,
- loadingTip: '加载中',
+ loadingTip: '{{ i18n "loading"}}',
},
methods: {
- loading(spinning, tip = '加载中') {
+ loading(spinning, tip = '{{ i18n "loading"}}') {
this.spinning = spinning;
this.loadingTip = tip;
},
@@ -304,13 +304,13 @@
},
switchV2rayVersion(version) {
this.$confirm({
- title: '切换 xray 版本',
- content: '是否切换 xray 版本至' + ` ${version}?`,
- okText: '确定',
- cancelText: '取消',
+ title: '{{ i18n "pages.index.xraySwitchVersionDialog"}}',
+ content: '{{ i18n "pages.index.xraySwitchVersionDialogDesc"}}' + ` ${version}?`,
+ okText: '{{ i18n "confirm"}}',
+ cancelText: '{{ i18n "cancel"}}',
onOk: async () => {
versionModal.hide();
- this.loading(true, '安装中,请不要刷新此页面');
+ this.loading(true, '{{ i18n "pages.index.dontRefresh"}}');
await HttpUtil.post(`/server/installXray/${version}`);
this.loading(false);
},
diff --git a/web/translation/translate.en_US.toml b/web/translation/translate.en_US.toml
index 0ec238d9..c70911fd 100644
--- a/web/translation/translate.en_US.toml
+++ b/web/translation/translate.en_US.toml
@@ -11,6 +11,12 @@
"enable" = "enable"
"protocol" = "protocol"
+"loading" = "Loading"
+"second" = "second"
+"minute" = "minute"
+"hour" = "hour"
+"day" = "day"
+
[menu]
"dashboard" = "System Status"
"inbounds" = "Inbounds"
@@ -31,6 +37,25 @@
[pages.index]
"title" = "system status"
+"memory" = "memory"
+"hard" = "hard disk"
+"xrayStatus" = "xray Status"
+"xraySwitch" = "Switch Version"
+"xraySwitchClick" = "Click on the version you want to switch"
+"xraySwitchClickDesk" = "Please choose carefully, older versions may have incompatible configurations"
+"operationHours" = "Operation Hours"
+"operationHoursDesc" = "The running time of the system since it was started"
+"systemLoad" = "System Load"
+"connectionCount" = "Connection Count"
+"connectionCountDesc" = "The total number of connections for all network cards"
+"upSpeed" = "Total upload speed for all network cards"
+"downSpeed" = "Total download speed for all network cards"
+"totalSent" = "Total upload traffic of all network cards since system startup"
+"totalReceive" = "Total download traffic of all network cards since system startup"
+"xraySwitchVersionDialog" = "switch xray version"
+"xraySwitchVersionDialogDesc" = "whether to switch the xray version to"
+"dontRefresh" = "Installation is in progress, please do not refresh this page"
+
[pages.inbounds]
"title" = "Inbounds"
diff --git a/web/translation/translate.zh_Hans.toml b/web/translation/translate.zh_Hans.toml
index a9bbdcfb..c81896fd 100644
--- a/web/translation/translate.zh_Hans.toml
+++ b/web/translation/translate.zh_Hans.toml
@@ -11,6 +11,12 @@
"enable" = "启用"
"protocol" = "协议"
+"loading" = "加载中"
+"second" = "秒"
+"minute" = "分钟"
+"hour" = "小时"
+"day" = "天"
+
[menu]
"dashboard" = "系统状态"
"inbounds" = "入站列表"
@@ -30,6 +36,25 @@
[pages.index]
"title" = "系统状态"
+"memory" = "内存"
+"hard" = "硬盘"
+"xrayStatus" = "xray 状态"
+"xraySwitch" = "切换版本"
+"xraySwitchClick" = "点击你想切换的版本"
+"xraySwitchClickDesk" = "请谨慎选择,旧版本可能配置不兼容"
+"operationHours" = "运行时间"
+"operationHoursDesc" = "系统自启动以来的运行时间"
+"systemLoad" = "系统负载"
+"connectionCount" = "连接数"
+"connectionCountDesc" = "所有网卡的总连接数"
+"upSpeed" = "所有网卡的总上传速度"
+"downSpeed" = "所有网卡的总下载速度"
+"totalSent" = "系统启动以来所有网卡的总上传流量"
+"totalReceive" = "系统启动以来所有网卡的总下载流量"
+"xraySwitchVersionDialog" = "切换 xray 版本"
+"xraySwitchVersionDialogDesc" = "是否切换 xray 版本至"
+"dontRefresh" = "安装中,请不要刷新此页面"
+
[pages.inbounds]
"title" = "入站列表"