Browse Source

feat: add slash to end of dir href

pull/51/head
sigoden 3 years ago
parent
commit
68d238d34d
  1. 4
      assets/index.js

4
assets/index.js

@ -1,7 +1,6 @@
/** /**
* @typedef {object} PathItem * @typedef {object} PathItem
* @property {"Dir"|"SymlinkDir"|"File"|"SymlinkFile"} path_type * @property {"Dir"|"SymlinkDir"|"File"|"SymlinkFile"} path_type
* @property {boolean} is_symlink
* @property {string} name * @property {string} name
* @property {number} mtime * @property {number} mtime
* @property {number} size * @property {number} size
@ -153,10 +152,11 @@ function addBreadcrumb(value) {
* @param {number} index * @param {number} index
*/ */
function addPath(file, index) { function addPath(file, index) {
const url = getUrl(file.name) let url = getUrl(file.name)
let actionDelete = ""; let actionDelete = "";
let actionDownload = ""; let actionDownload = "";
if (file.path_type.endsWith("Dir")) { if (file.path_type.endsWith("Dir")) {
url += "/";
actionDownload = ` actionDownload = `
<div class="action-btn"> <div class="action-btn">
<a href="${url}?zip" title="Download folder as a .zip file"> <a href="${url}?zip" title="Download folder as a .zip file">

Loading…
Cancel
Save