diff --git a/config/lib/common.js b/config/lib/common.js index 4fe6bea6..d47454d3 100644 --- a/config/lib/common.js +++ b/config/lib/common.js @@ -2,7 +2,7 @@ var querystring = require('querystring'); - /** +/** * binaryToHex * @param str */ @@ -32,3 +32,18 @@ module.exports.hexToBinary = function (str) { module.exports.querystringParse = function (q) { return querystring.parse(q, null, null, {decodeURIComponent: unescape}); }; + +/** + * fileSizeFormat + * @param bytes + * @param precision + * @returns {*} + */ +module.exports.fileSizeFormat = function (bytes, precision) { + if (bytes === 0 || isNaN(parseFloat(bytes)) || !isFinite(bytes)) return '-'; + if (typeof precision === 'undefined') precision = 1; + //var units = ['bytes', 'kB', 'MB', 'GB', 'TB', 'PB'], + var units = ['b', 'K', 'M', 'G', 'T', 'P'], + number = Math.floor(Math.log(bytes) / Math.log(1024)); + return (bytes / Math.pow(1024, Math.floor(number))).toFixed(precision) + units[number]; +}; diff --git a/modules/core/client/app/trans-string-en.js b/modules/core/client/app/trans-string-en.js index 65acd00c..bb617c89 100644 --- a/modules/core/client/app/trans-string-en.js +++ b/modules/core/client/app/trans-string-en.js @@ -287,6 +287,7 @@ TORRENT_FILENAME: 'Torrent Filename', ATTRIBUTE_TAGS: 'Video Attribute (tags)', VIDEO_NFO: 'Video NFO', + ALL_FILES_LIST: 'Files List', VIDEO_SIZE: 'Video Size', VIDEO_SALE_INFO: 'Video Sale Info', SALE_EXPIRES_TIME: 'expires', diff --git a/modules/core/client/app/trans-string-zh.js b/modules/core/client/app/trans-string-zh.js index 11537264..230ec73b 100644 --- a/modules/core/client/app/trans-string-zh.js +++ b/modules/core/client/app/trans-string-zh.js @@ -287,6 +287,7 @@ TORRENT_FILENAME: '种子文件名', ATTRIBUTE_TAGS: '视频属性(标签)', VIDEO_NFO: '视频 NFO', + ALL_FILES_LIST: '文件清单', VIDEO_SIZE: '视频文件大小', VIDEO_SALE_INFO: '视频促销信息', SALE_EXPIRES_TIME: '过期', diff --git a/modules/core/client/less/mt.less b/modules/core/client/less/mt.less index af15d605..f8a825d9 100644 --- a/modules/core/client/less/mt.less +++ b/modules/core/client/less/mt.less @@ -1363,6 +1363,32 @@ body { background-color: #fff !important; } +.all-files { + json-tree { + json-node.expandable { + &::before { + content: '\25b6'; + position: absolute; + left: 0; + top: -2px; + font-size: 10px; + transition: transform .1s ease; + } + } + .branch-preview { + max-width: 80%; + height: 2em; + } + .branch-value { + background-color: #fff; + max-height: 300px; + overflow: auto; + border: solid 1px #ccc; + border-radius: 4px; + padding: 2px 20px; + } + } +} .subtitle-list { padding-left: 0; .glyphicon { diff --git a/modules/torrents/client/views/view-torrent.client.view.html b/modules/torrents/client/views/view-torrent.client.view.html index 4819da84..3cc439d8 100644 --- a/modules/torrents/client/views/view-torrent.client.view.html +++ b/modules/torrents/client/views/view-torrent.client.view.html @@ -608,6 +608,15 @@ +