diff --git a/src/http/gateway/utils/html.js b/src/http/gateway/dir-view/index.js similarity index 74% rename from src/http/gateway/utils/html.js rename to src/http/gateway/dir-view/index.js index dd5abe6b4f..83ca95f1a8 100644 --- a/src/http/gateway/utils/html.js +++ b/src/http/gateway/dir-view/index.js @@ -2,10 +2,10 @@ const filesize = require('filesize') -const HTML_PAGE_STYLE = require('./style') -const PathUtil = require('./path') +const mainStyle = require('./style') +const pathUtil = require('../utils/path') -const getParentDirectoryURL = (originalParts) => { +function getParentDirectoryURL (originalParts) { const parts = originalParts.splice() if (parts.length > 1) { @@ -15,11 +15,11 @@ const getParentDirectoryURL = (originalParts) => { return [ '', 'ipfs' ].concat(parts).join('/') } -const buildFilesList = (path, links) => { +function buildFilesList (path, links) { const rows = links.map((link) => { let row = [ `
`, - `${link.name}`, + `${link.name}`, filesize(link.size) ] @@ -31,9 +31,9 @@ const buildFilesList = (path, links) => { return rows.join('') } -const buildTable = (path, links) => { - const parts = PathUtil.splitPath(path) - let parentDirectoryURL = getParentDirectoryURL(parts) +function buildTable (path, links) { + const parts = pathUtil.splitPath(path) + const parentDirectoryURL = getParentDirectoryURL(parts) return `