Fix byte count labels (#998)
* Add 'TB' label * Prevent overflow * Fix storage information on the old settings page
This commit is contained in:
parent
9c6ff387a0
commit
f4325b7db9
@ -148,9 +148,10 @@ class StorageController {
|
|||||||
|
|
||||||
_bytesToLabeledString(size) {
|
_bytesToLabeledString(size) {
|
||||||
const base = 1000;
|
const base = 1000;
|
||||||
const labels = [' bytes', 'KB', 'MB', 'GB'];
|
const labels = [' bytes', 'KB', 'MB', 'GB', 'TB'];
|
||||||
|
const maxLabelIndex = labels.length - 1;
|
||||||
let labelIndex = 0;
|
let labelIndex = 0;
|
||||||
while (size >= base) {
|
while (size >= base && labelIndex < maxLabelIndex) {
|
||||||
size /= base;
|
size /= base;
|
||||||
++labelIndex;
|
++labelIndex;
|
||||||
}
|
}
|
||||||
|
@ -818,14 +818,14 @@
|
|||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="storage-use" hidden>
|
<div id="storage-use">
|
||||||
<p class="help-block" class="storage-use-invalid">
|
<p class="help-block storage-use-invalid">
|
||||||
Yomichan is using an indeterminate amount of storage.
|
Yomichan is using an indeterminate amount of storage.
|
||||||
</p>
|
</p>
|
||||||
<p class="help-block" class="storage-use-finite" hidden>
|
<p class="help-block storage-use-finite" hidden>
|
||||||
Yomichan is using approximately <strong class="storage-usage"></strong> of <strong class="storage-quota"></strong>.
|
Yomichan is using approximately <strong class="storage-usage"></strong> of <strong class="storage-quota"></strong>.
|
||||||
</p>
|
</p>
|
||||||
<p class="help-block" class="storage-use-infinite" hidden>
|
<p class="help-block storage-use-infinite" hidden>
|
||||||
Yomichan is permitted <strong>unlimited storage</strong>.
|
Yomichan is permitted <strong>unlimited storage</strong>.
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
Reference in New Issue
Block a user