X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/c025baa77d3d077bc79283cce71e91c3aef06e4b..2a7fd99c212c33a1ec9911f8529fa5afc59a7bb2:/src/views-components/webdav-s3-dialog/webdav-s3-dialog.tsx diff --git a/src/views-components/webdav-s3-dialog/webdav-s3-dialog.tsx b/src/views-components/webdav-s3-dialog/webdav-s3-dialog.tsx index 16fe252601..a32044a711 100644 --- a/src/views-components/webdav-s3-dialog/webdav-s3-dialog.tsx +++ b/src/views-components/webdav-s3-dialog/webdav-s3-dialog.tsx @@ -10,8 +10,9 @@ import { WithDialogProps } from 'store/dialog/with-dialog'; import { compose } from 'redux'; import { DetailsAttribute } from "components/details-attribute/details-attribute"; import { DownloadIcon } from "components/icon/icon"; +import { DefaultCodeSnippet } from "components/default-code-snippet/default-code-snippet"; -export type CssRules = 'details' | 'downloadButton'; +export type CssRules = 'details' | 'downloadButton' | 'detailsAttrValWithCode'; const styles: StyleRulesCallback = theme => ({ details: { @@ -20,6 +21,10 @@ const styles: StyleRulesCallback = theme => ({ }, downloadButton: { marginTop: theme.spacing.unit * 2, + }, + detailsAttrValWithCode: { + display: "flex", + alignItems: "center", } }); @@ -74,7 +79,7 @@ const mountainduckTemplate = ({ Port ${(cyberDavStr.split(':')[2] || '443').split('/')[0]} Username - ${username}${isValidIpAddress(collectionsUrl.replace('https://', ``).split(':')[0])? + ${username}${isValidIpAddress(collectionsUrl.replace('https://', ``).split(':')[0]) ? ` Path /c=${uuid}` : ''} @@ -115,8 +120,8 @@ export const WebDavS3InfoDialog = compose( } else { winDav = new URL(props.data.downloadUrl); cyberDav = new URL(props.data.downloadUrl); - winDav.pathname = `/by_id/${props.data.uuid}`; - cyberDav.pathname = `/by_id/${props.data.uuid}`; + winDav.pathname = `/c=${props.data.uuid}`; + cyberDav.pathname = `/c=${props.data.uuid}`; } cyberDav.username = props.data.username; @@ -135,13 +140,16 @@ export const WebDavS3InfoDialog = compose( tokenSecret = tokenUuid; } - const supportsWebdav = (props.data.uuid.indexOf("-4zz18-") === 5); + const isCollection = (props.data.uuid.indexOf("-4zz18-") === 5); let activeTab = props.data.activeTab; - if (!supportsWebdav) { + if (!isCollection) { activeTab = 2; } + const wgetCommand = `wget --http-user=${props.data.username} --http-passwd=${props.data.token} --mirror --no-parent --no-host --cut-dirs=0 ${winDav.toString()}`; + const curlCommand = `curl -O -u ${props.data.username}:${props.data.token} ${winDav.toString()}`; + return
- {supportsWebdav && } - {supportsWebdav && } + {isCollection && } + {isCollection && } - {supportsWebdav && } + {isCollection && } @@ -220,7 +228,7 @@ export const WebDavS3InfoDialog = compose( Download Cyber/Mountain Duck bookmark -

Gnome

+

GNOME

  1. Open Files
  2. Select +Other Locations
  3. @@ -256,18 +264,24 @@ export const WebDavS3InfoDialog = compose( + copyValue={wgetCommand} + classValue={props.classes.detailsAttrValWithCode}> + + - - + label='Curl command' + copyValue={curlCommand} + classValue={props.classes.detailsAttrValWithCode}> + + + +

    + Note: This curl command downloads single files. + Append the desired filename to the end of the URL. +

    @@ -278,7 +292,7 @@ export const WebDavS3InfoDialog = compose( color='primary' onClick={props.closeDialog}> Close - +
;