aboutsummaryrefslogtreecommitdiff
path: root/src/zenserver/frontend/html/util/friendly.js
diff options
context:
space:
mode:
authorMartin Ridgers <[email protected]>2024-11-26 08:53:06 +0100
committerGitHub Enterprise <[email protected]>2024-11-26 08:53:06 +0100
commit642ef2d3606b6a89d0750a88d0f40585965b989d (patch)
tree253f58083014ee902016e42cfe7bda93ea778200 /src/zenserver/frontend/html/util/friendly.js
parent5.5.14-pre1 (diff)
downloadzen-642ef2d3606b6a89d0750a88d0f40585965b989d.tar.xz
zen-642ef2d3606b6a89d0750a88d0f40585965b989d.zip
Dashboard: display package data sizes in oplog entry and tree views. (#232)
* Wrong divisor for friendly giga-values * We want Explorer style for kilo/kibi units; round up * var -> const - zero idea if this matters * Include sum of an entry's package data sizes in index * Method to enurate all properties of a loaded oplog index * Include bulkdata size in an oplog index * Found a space that was missing * Show package data sizes when viewing an oplog entry * Navigating a component tree would error out at the end of the chain * Parameterise friendly rounding * Added size and rawsize columns to oplog tree view * Sort of parameterised indexer's worker count and page size * Right-align size columns on entry view page * Updated frontend .zip archive * A changelog update
Diffstat (limited to 'src/zenserver/frontend/html/util/friendly.js')
-rw-r--r--src/zenserver/frontend/html/util/friendly.js12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/zenserver/frontend/html/util/friendly.js b/src/zenserver/frontend/html/util/friendly.js
index 6eee3a5b8..b27721964 100644
--- a/src/zenserver/frontend/html/util/friendly.js
+++ b/src/zenserver/frontend/html/util/friendly.js
@@ -14,10 +14,10 @@ export class Friendly
});
}
- static k(x) { return Friendly.sep((x + 999) / Math.pow(10, 3), 0) + "K"; }
- static m(x) { return Friendly.sep( x / Math.pow(10, 6), 1) + "M"; }
- static g(x) { return Friendly.sep( x / Math.pow(10, 6), 2) + "G"; }
- static kib(x) { return Friendly.sep((x + 1023) / (1 << 10), 0) + " KiB"; }
- static mib(x) { return Friendly.sep( x / (1 << 20), 1) + " MiB"; }
- static gib(x) { return Friendly.sep( x / (1 << 30), 2) + " GiB"; }
+ static k(x, p=0) { return Friendly.sep((x + 999) / Math.pow(10, 3)|0, p) + "K"; }
+ static m(x, p=1) { return Friendly.sep( x / Math.pow(10, 6), p) + "M"; }
+ static g(x, p=2) { return Friendly.sep( x / Math.pow(10, 9), p) + "G"; }
+ static kib(x, p=0) { return Friendly.sep((x + 1023) / (1 << 10)|0, p) + " KiB"; }
+ static mib(x, p=1) { return Friendly.sep( x / (1 << 20), p) + " MiB"; }
+ static gib(x, p=2) { return Friendly.sep( x / (1 << 30), p) + " GiB"; }
}