mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2025-12-25 16:59:20 +08:00
chore: Modify the default runtime value on the overview page (#11159)
This commit is contained in:
parent
28303ffa82
commit
ba999c516a
1 changed files with 4 additions and 1 deletions
|
|
@ -57,11 +57,14 @@ export function getBrowserLang() {
|
|||
}
|
||||
|
||||
export function loadUpTime(timeSince: string) {
|
||||
if (!timeSince) {
|
||||
return '';
|
||||
}
|
||||
const targetTime = new Date(timeSince);
|
||||
const currentTime = new Date();
|
||||
const uptime = (currentTime.getTime() - targetTime.getTime()) / 1000;
|
||||
if (uptime <= 0) {
|
||||
return '-';
|
||||
return '';
|
||||
}
|
||||
let days = Math.floor(uptime / 86400);
|
||||
let hours = Math.floor((uptime % 86400) / 3600);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue