forked from MapComplete/MapComplete
Feature: show quota in debug panel
This commit is contained in:
parent
c4f0e18b9e
commit
722f7e86cc
2 changed files with 24 additions and 4 deletions
10
src/Utils.ts
10
src/Utils.ts
|
@ -1150,6 +1150,16 @@ In the case that MapComplete is pointed to the testing grounds, the edit will be
|
|||
return hours + ":" + Utils.TwoDigits(minutes) + ":" + Utils.TwoDigits(seconds)
|
||||
}
|
||||
|
||||
public static toHumanByteSize(bytes: number): string {
|
||||
const scale = ["b", "KB", "MB", "GB", "TB"] as const
|
||||
let i = 0
|
||||
while (bytes > 1000) {
|
||||
bytes = bytes / 1000
|
||||
i++
|
||||
}
|
||||
return Math.round(bytes) + scale[i]
|
||||
}
|
||||
|
||||
public static HomepageLink(): string {
|
||||
if (typeof window === "undefined") {
|
||||
return "https://mapcomplete.org"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue