X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/27d2ca4c2691cad55993f25a4427d48e86ec6166..a353970c1fcfc61ebac8b3587f4b16b6c25b62e1:/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 2c92e28de4..018a0ef096 100644 --- a/src/views-components/webdav-s3-dialog/webdav-s3-dialog.tsx +++ b/src/views-components/webdav-s3-dialog/webdav-s3-dialog.tsx @@ -10,7 +10,7 @@ import { WithDialogProps } from '~/store/dialog/with-dialog'; import { compose } from 'redux'; import { DetailsAttribute } from "~/components/details-attribute/details-attribute"; -type CssRules = 'details'; +export type CssRules = 'details'; const styles: StyleRulesCallback = theme => ({ details: { @@ -47,21 +47,29 @@ export const WebDavS3InfoDialog = compose( (props: WithDialogProps & WithStyles) => { if (!props.data.downloadUrl) { return null; } - const keepwebUrl = props.data.downloadUrl.replace(/\/\*(--[^.]+)?\./, "/"); + let winDav; + let cyberDav; - const winDav = new URL(props.data.downloadUrl.replace("*", props.data.uuid)); + if (props.data.collectionsUrl.indexOf("*") > -1) { + const withuuid = props.data.collectionsUrl.replace("*", props.data.uuid); + winDav = new URL(withuuid); + cyberDav = new URL(withuuid); + } 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}`; + } - const gnomeDav = new URL(keepwebUrl); - gnomeDav.username = props.data.username; - gnomeDav.pathname = `/c=${props.data.uuid}/`; - gnomeDav.protocol = "davs:"; + cyberDav.username = props.data.username; + const cyberDavStr = "dav" + cyberDav.toString().slice(4); - const s3endpoint = new URL(keepwebUrl); + const s3endpoint = new URL(props.data.collectionsUrl.replace(/\/\*(--[^.]+)?\./, "/")); const sp = props.data.token.split("/"); let tokenUuid; let tokenSecret; - if (sp.length === 3 && sp[0] === "v2" && props.data.homeCluster === props.data.localCluster) { + if (sp.length === 3 && sp[0] === "v2" && sp[1].slice(0, 5) === props.data.localCluster) { tokenUuid = sp[1]; tokenSecret = sp[2]; } else { @@ -69,30 +77,33 @@ export const WebDavS3InfoDialog = compose( tokenSecret = tokenUuid; } + const supportsWebdav = (props.data.uuid.indexOf("-4zz18-") === 5); + + let activeTab = props.data.activeTab; + if (!supportsWebdav) { + activeTab = 2; + } + return + title={`Open as Network Folder or S3 Bucket`} />
- - - - + + {supportsWebdav && } + {supportsWebdav && } + - -
    -
  1. Open File Explorer
  2. -
  3. Click on "This PC", then go to Computer → Add a Network Location
  4. -
  5. Click Next, then choose "Add a custom network location", then click Next
  6. -
+ +

Settings

{winDav.toString()}} copyValue={winDav.toString()} /> -
- +

Windows

    -
  1. Open Files
  2. -
  3. Select +Other Locations
  4. -
  5. Connect to Server → Enter server address
  6. +
  7. Open File Explorer
  8. +
  9. Click on "This PC", then go to Computer → Add a Network Location
  10. +
  11. Click Next, then choose "Add a custom network location", then click Next
+

MacOS

+
    +
  1. Open Finder
  2. +
  3. Click Go → Connect to server
  4. +
+
+ + + label='Server' + value={{cyberDavStr}} + copyValue={cyberDavStr} /> + + + +

Gnome

+
    +
  1. Open Files
  2. +
  3. Select +Other Locations
  4. +
  5. Connect to Server → Enter server address
  6. +
+
- +