🐞 fix: 显示运行时长国际化

This commit is contained in:
IGCrystal
2025-06-23 12:08:27 +08:00
parent a20d98bf93
commit 4e28ea1883
4 changed files with 29 additions and 10 deletions

View File

@@ -21,7 +21,8 @@
},
"runningTime": {
"title": "Uptime",
"subtitle": "System uptime duration"
"subtitle": "System uptime duration",
"format": "{hours}h {minutes}m {seconds}s"
},
"memoryUsage": {
"title": "Memory Usage",

View File

@@ -21,7 +21,8 @@
},
"runningTime": {
"title": "运行时间",
"subtitle": "系统已运行时长"
"subtitle": "系统已运行时长",
"format": "{hours}小时{minutes}分{seconds}秒"
},
"memoryUsage": {
"title": "内存占用",

View File

@@ -30,7 +30,16 @@ export default {
},
computed: {
formattedTime() {
return this.stat?.running || this.t('status.loading');
if (!this.stat?.running) {
return this.t('status.loading');
}
const { hours, minutes, seconds } = this.stat.running;
return this.t('stats.runningTime.format', {
hours,
minutes,
seconds
});
}
}
};