pinokiod 2.15.30 → 2.15.31

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pinokiod",
3
- "version": "2.15.30",
3
+ "version": "2.15.31",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -1498,15 +1498,16 @@ fetch("/du/<%=name%>").then((res) => {
1498
1498
  return res.json()
1499
1499
  }).then((res) => {
1500
1500
  let val
1501
- if (res.du > 1000 * 1000 * 1000) {
1501
+ let k = 1024
1502
+ if (res.du > k * k * k) {
1502
1503
  // GB
1503
- val = `${Math.floor(res.du/1000/1000/1000 * 100) / 100} GB`
1504
- } else if (res.du > 1000 * 1000) {
1504
+ val = `${Math.floor(res.du/k/k/k * 100) / 100} GB`
1505
+ } else if (res.du > k * k) {
1505
1506
  // MB
1506
- val = `${Math.floor(res.du/1000/1000 * 100) / 100} MB`
1507
+ val = `${Math.floor(res.du/k/k * 100) / 100} MB`
1507
1508
  } else {
1508
1509
  // KB
1509
- val = `${Math.floor(res.du/1000 * 100) / 100} KB`
1510
+ val = `${Math.floor(res.du/k * 100) / 100} KB`
1510
1511
  }
1511
1512
  //document.querySelector(".disk-usage").innerHTML = `<i class="fa-regular fa-hard-drive"></i> ${val}`
1512
1513
  document.querySelector(".disk-usage").innerHTML = val