mirror of
https://github.com/gurucomputing/headscale-ui.git
synced 2026-08-04 21:52:41 +00:00
minor fixups
This commit is contained in:
parent
d91cda082a
commit
7e4aab06ad
1 changed files with 4 additions and 4 deletions
|
|
@ -14,7 +14,7 @@
|
|||
// match up the current apikey to the keylist
|
||||
keyList.forEach(key => {
|
||||
if($APIKeyStore.includes(key.prefix)) {
|
||||
timeLeftTip = timeLeft(new Date(key.expiration));
|
||||
timeLeft(new Date(key.expiration));
|
||||
}
|
||||
});
|
||||
})
|
||||
|
|
@ -23,8 +23,8 @@
|
|||
});
|
||||
}
|
||||
|
||||
// returns time last seen in human readable format
|
||||
function timeLeft(date: Date) {
|
||||
// sets time expiry in human readable format
|
||||
function timeLeft(date: Date): void {
|
||||
let currentTime = new Date();
|
||||
// gets time difference in seconds
|
||||
let timeDifferenceDays = Math.round((date.getTime() - currentTime.getTime()) / 1000 / 60 / 60 / 24);
|
||||
|
|
@ -32,7 +32,7 @@
|
|||
$alertStore = `${timeDifferenceDays} days left before expiry, consider rolling your key`
|
||||
timeLeftWarning = true;
|
||||
}
|
||||
return `${timeDifferenceDays} days left before expiry`;
|
||||
timeLeftTip = `${timeDifferenceDays} days left before expiry`;
|
||||
}
|
||||
|
||||
onMount(() => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue