From b34294fbefa83bee10b562c5a4437a40ab64f871 Mon Sep 17 00:00:00 2001 From: Bryan Ashby Date: Sun, 18 Nov 2018 12:02:57 -0700 Subject: [PATCH] * Docs + itemFormat/focusItem format for web download manager * Fix some typos --- art/themes/luciano_blocktronics/theme.hjson | 4 +-- core/file_base_web_download_manager.js | 6 +---- docs/_includes/nav.md | 3 ++- docs/modding/file-base-download-manager.md | 7 ++--- .../modding/file-base-web-download-manager.md | 26 +++++++++++++++++++ 5 files changed, 35 insertions(+), 11 deletions(-) create mode 100644 docs/modding/file-base-web-download-manager.md diff --git a/art/themes/luciano_blocktronics/theme.hjson b/art/themes/luciano_blocktronics/theme.hjson index acc3c845..2316eac9 100644 --- a/art/themes/luciano_blocktronics/theme.hjson +++ b/art/themes/luciano_blocktronics/theme.hjson @@ -801,8 +801,6 @@ fileBaseWebDownloadManager: { config: { - queueListFormat: "|00|03{webDlLink:<36.35} {fileName:<26.25} {byteSize!sizeWithoutAbbr:>7.6} |11{byteSize!sizeAbbr}" - focusQueueListFormat: "|00|19|15{webDlLink:<36.35} {fileName:<26.25} {byteSize!sizeWithoutAbbr:>7.6} {byteSize!sizeAbbr}" queueManagerInfoFormat10: "|03batch|08: |03{webBatchDlLink}" queueManagerInfoFormat11: "|03exp |08: |03{webBatchDlExpire}" } @@ -811,6 +809,8 @@ mci: { VM1: { height: 8 + itemFormat: "|00|03{webDlLink:<36.35} {fileName:<26.25} {byteSize!sizeWithoutAbbr:>7.6} |11{byteSize!sizeAbbr}" + focusItemFormat: "|00|19|15{webDlLink:<36.35} {fileName:<26.25} {byteSize!sizeWithoutAbbr:>7.6} {byteSize!sizeAbbr}" } HM2: { width: 50 diff --git a/core/file_base_web_download_manager.js b/core/file_base_web_download_manager.js index 02bffa3e..62ee02eb 100644 --- a/core/file_base_web_download_manager.js +++ b/core/file_base_web_download_manager.js @@ -121,11 +121,7 @@ exports.getModule = class FileBaseWebDownloadQueueManager extends MenuModule { return cb(Errors.DoesNotExist('Queue view does not exist')); } - const queueListFormat = this.menuConfig.config.queueListFormat || '{webDlLink}'; - const focusQueueListFormat = this.menuConfig.config.focusQueueListFormat || queueListFormat; - - queueView.setItems(this.dlQueue.items.map( queueItem => stringFormat(queueListFormat, queueItem) ) ); - queueView.setFocusItems(this.dlQueue.items.map( queueItem => stringFormat(focusQueueListFormat, queueItem) ) ); + queueView.setItems(this.dlQueue.items); queueView.on('index update', idx => { const fileEntry = this.dlQueue.items[idx]; diff --git a/docs/_includes/nav.md b/docs/_includes/nav.md index d0a4e7eb..a42520bb 100644 --- a/docs/_includes/nav.md +++ b/docs/_includes/nav.md @@ -74,7 +74,8 @@ - [File Transfer Protocol Select]({{ site.baseurl }}{% link modding/file-transfer-protocol-select.md %}) - [Onelinerz]({{ site.baseurl }}{% link modding/onelinerz.md %}) - [Show Art]({{ site.baseurl }}{% link modding/show-art.md %}) - - [Download Manager]({{ site.baseurl }}{% link modding/file_base_download_manager.md %}) + - [Download Manager]({{ site.baseurl }}{% link modding/file-base-download-manager.md %}) + - [Web Download Manager]({{ site.baseurl }}{% link modding/file-base-web-download-manager.md %}) - Administration - [oputil]({{ site.baseurl }}{% link admin/oputil.md %}) diff --git a/docs/modding/file-base-download-manager.md b/docs/modding/file-base-download-manager.md index c454de8a..22d634a0 100644 --- a/docs/modding/file-base-download-manager.md +++ b/docs/modding/file-base-download-manager.md @@ -1,9 +1,9 @@ --- layout: page -title: File Transfer Protocol Select +title: File Base Download Manager --- ## File Base Download Manager Module -The `file_base_download_manager` module provides a download queue manager for "legacy" (X/Y/Z-Modem, etc.) downloads. +The `file_base_download_manager` module provides a download queue manager for "legacy" (X/Y/Z-Modem, etc.) downloads. Web (HTTP/HTTPS) download functionality can be optionally available when the web content server is enabled. ## Configuration ### Configuration Block @@ -19,4 +19,5 @@ The following `itemFormat` object is provided to MCI 1 (ie: `%VM1`) and MCI 10+ * `fileName`: Entry filename. * `path`: Full file path. * `byteSize`: Size in bytes of file. - +* `webDlLink`: Web download link including VTX style ANSI ESC sequences. +* `webDlExpire`: Expiration date/time for this link. Formatted using `webDlExpireTimeFormat`. \ No newline at end of file diff --git a/docs/modding/file-base-web-download-manager.md b/docs/modding/file-base-web-download-manager.md new file mode 100644 index 00000000..09b8f22c --- /dev/null +++ b/docs/modding/file-base-web-download-manager.md @@ -0,0 +1,26 @@ +--- +layout: page +title: File Base Web Download Manager +--- +## File Base Web Download Manager Module +The `file_base_web_download_manager` module provides a download queue manager for web (HTTP/HTTPS) based downloads. This module relies on having the web server enabled at a minimum. + +Web downloads can be a convienent way for users to download larger (100+ MiB) files where legacy protocols often have trouble. Additionally, batch downloads can be streamed to users in a single zip archive. + +## Configuration +### Configuration Block +Available `config` block entries: +* `webDlExpireTimeFormat`: Sets the moment.js style format for web download expiration date/time. +* `emptyQueueMenu`: Overrides the default `fileBaseDownloadManagerEmptyQueue` target for menu to show when the users D/L queue is empty. + +### Theming +The following `itemFormat` object is provided to MCI 1 (ie: `%VM1`) and custom range MCI 10+ custom fields: +* `fileId`: File ID. +* `areaTag`: Area tag. +* `fileName`: Entry filename. +* `path`: Full file path. +* `byteSize`: Size in bytes of file. +* `webDlLinkRaw`: Web download link. +* `webDlLink`: Web download link including VTX style ANSI ESC sequences. +* `webDlExpire`: Expiration date/time for this link. Formatted using `webDlExpireTimeFormat`. +