]> OzVa Git service - ozva-cloud/commitdiff
refactor: do not show size for Dir (#447)
authorfreedit-dev <dev@freedit.eu>
Thu, 5 Sep 2024 23:36:15 +0000 (07:36 +0800)
committerGitHub <noreply@github.com>
Thu, 5 Sep 2024 23:36:15 +0000 (07:36 +0800)
assets/index.js

index 2b51d2ad4e0cd7b34fedddf9e289226c48f96f25..91d2cba6d56f3d34cd4148e4ee1790209f2ecfd4 100644 (file)
@@ -477,6 +477,8 @@ function addPath(file, index) {
     ${actionDelete}
     ${actionEdit}
   </td>`;
+  
+  let sizeDisplay = isDir ? "" : formatSize(file.size).join(" ");
 
   $pathsTableBody.insertAdjacentHTML("beforeend", `
 <tr id="addPath${index}">
@@ -487,7 +489,7 @@ function addPath(file, index) {
     <a href="${url}" ${isDir ? "" : `target="_blank"`}>${encodedName}</a>
   </td>
   <td class="cell-mtime">${formatMtime(file.mtime)}</td>
-  <td class="cell-size">${formatSize(file.size).join(" ")}</td>
+  <td class="cell-size">${sizeDisplay}</td>
   ${actionCell}
 </tr>`);
 }