From: Peter Amstutz Date: Tue, 5 Jan 2021 20:44:08 +0000 (-0500) Subject: 16622: Use /by_id/, add Cyberduck and MacOS to popup. X-Git-Tag: 2.1.2~20^2~4 X-Git-Url: https://git.arvados.org/arvados-workbench2.git/commitdiff_plain/174b16ceaab670db4e903c4e9eb544f374a19dd0?ds=sidebyside 16622: Use /by_id/, add Cyberduck and MacOS to popup. Correctly select between collections and download endpoints depending on whether wildcard DNS is configured. Arvados-DCO-1.1-Signed-off-by: Peter Amstutz --- diff --git a/src/store/collections/collection-info-actions.ts b/src/store/collections/collection-info-actions.ts index 1509206d..5b7154e2 100644 --- a/src/store/collections/collection-info-actions.ts +++ b/src/store/collections/collection-info-actions.ts @@ -13,6 +13,7 @@ export interface WebDavS3InfoDialogData { uuid: string; token: string; downloadUrl: string; + collectionsUrl: string; homeCluster: string; localCluster: string; username: string; @@ -27,7 +28,8 @@ export const openWebDavS3InfoDialog = (uuid: string, activeTab?: number) => data: { title: 'Access Collection using WebDAV or S3', token: getState().auth.apiToken, - downloadUrl: getState().auth.config.keepWebInlineServiceUrl, + downloadUrl: getState().auth.config.keepWebServiceUrl, + collectionsUrl: getState().auth.config.keepWebInlineServiceUrl, homeCluster: getState().auth.homeCluster, localCluster: getState().auth.localCluster, username: getState().auth.user!.username, 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 2c92e28d..cd388848 100644 --- a/src/views-components/webdav-s3-dialog/webdav-s3-dialog.tsx +++ b/src/views-components/webdav-s3-dialog/webdav-s3-dialog.tsx @@ -47,16 +47,23 @@ 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.protocol = { "http:": "dav:", "https:": "davs:" }[cyberDav.protocol]; - const s3endpoint = new URL(keepwebUrl); + const s3endpoint = new URL(props.data.collectionsUrl.replace(/\/\*(--[^.]+)?\./, "/")); const sp = props.data.token.split("/"); let tokenUuid; @@ -78,17 +85,13 @@ export const WebDavS3InfoDialog = compose( title={`WebDAV and S3`} />
- - + + - -
    -
  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

-
- +

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={{cyberDav.toString()}} + copyValue={cyberDav.toString()} /> + + + +

Gnome

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