From: sigoden Date: Sat, 4 Jun 2022 05:13:37 +0000 (+0800) Subject: chore: incorrect icon of uploaded file X-Git-Url: https://git.ozva.co.uk/?a=commitdiff_plain;h=fff8fc3ac57d89d9be26f6f90a0181f259795d20;p=ozva-cloud chore: incorrect icon of uploaded file --- diff --git a/assets/index.js b/assets/index.js index 320c7d4..788d688 100644 --- a/assets/index.js +++ b/assets/index.js @@ -2,7 +2,6 @@ * @typedef {object} PathItem * @property {"Dir"|"SymlinkDir"|"File"|"SymlinkFile"} path_type * @property {boolean} is_symlink - * @property {string} base_name * @property {string} name * @property {number} mtime * @property {number} size @@ -152,7 +151,7 @@ function addPath(file, index) { $pathsTableBody.insertAdjacentHTML("beforeend", ` -
${getSvg(file)}
+
${getSvg(file.path_type)}
${file.name} ${formatMtime(file.mtime)} @@ -235,13 +234,8 @@ function getUrl(name) { return url; } -/** - * Get svg icon - * @param {PathItem} file - * @returns - */ -function getSvg(file) { - switch (file.path_type) { +function getSvg(path_type) { + switch (path_type) { case "Dir": return ``; case "File":