From 92cfcabddefcfed37814bb6b7c4e7584d74fe5c1 Mon Sep 17 00:00:00 2001 From: Codesamp-Rohan <22ebkcs104.rohan.chaudhary@bkbiet.ac.in> Date: Wed, 10 Dec 2025 19:15:03 +0530 Subject: [PATCH 1/4] improved UI of livefiles --- example.mjs | 2 +- index.js | 119 ++++++++++++++++++++++++++++++++++++---------------- 2 files changed, 84 insertions(+), 37 deletions(-) diff --git a/example.mjs b/example.mjs index 2c3bd33..7d8c7bf 100644 --- a/example.mjs +++ b/example.mjs @@ -10,4 +10,4 @@ const filemanager = new Livefiles({ }) await filemanager.ready() -await filemanager.close() +// await filemanager.close() \ No newline at end of file diff --git a/index.js b/index.js index 9822fc1..02104c2 100644 --- a/index.js +++ b/index.js @@ -245,8 +245,8 @@ class Livefiles extends ReadyResource { const filePath = path.join(urlPath, file.name) const safeFileName = this.escapeHtml(file.name) const iconHtml = file.isDirectory() - ? '' - : '' + ? '' + : '' const downloadButton = file.isDirectory() ? `Enter` @@ -256,14 +256,14 @@ class Livefiles extends ReadyResource { let size if (file.isDirectory()) { // For directories, calculate size asynchronously - const dirSize = await this.calculateDirectorySize(path.join(fullPath, file.name)) - size = this.formatBytes(dirSize) + // const dirSize = await this.calculateDirectorySize(path.join(fullPath, file.name)) + size = '' } else { const stats = await stat(path.join(fullPath, file.name)) size = this.formatBytes(stats.size) } - return `
${size}