Config: Add option to show filesystem usage in sidebar navigation #4266

Signed-off-by: Michael Mayer <michael@photoprism.app>
This commit is contained in:
Michael Mayer
2025-03-03 20:05:56 +01:00
parent abfb19bd63
commit c2cc50b670
27 changed files with 469 additions and 55 deletions

View File

@@ -7,6 +7,18 @@ let chai = require("chai/chai");
let assert = chai.assert;
describe("common/util", () => {
it("should return size in KB", () => {
const s = $util.formatBytes(10 * 1024);
assert.equal(s, "10 KB");
});
it("should return size in GB", () => {
const s = $util.formatBytes(10 * 1024 * 1024 * 1024);
assert.equal(s, "10.0 GB");
});
it("should convert bytes in GB", () => {
const b = $util.gigaBytes(10 * 1024 * 1024 * 1024);
assert.equal(b, 10);
});
it("should return duration 3ns", () => {
const duration = $util.formatDuration(-3);
assert.equal(duration, "3ns");