You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airavata.apache.org by ma...@apache.org on 2021/06/25 19:59:42 UTC

[airavata-django-portal] 09/10: AIRAVATA-3469 UI for downloading directory

This is an automated email from the ASF dual-hosted git repository.

machristie pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/airavata-django-portal.git

commit 19e301684a7712bed0eaf75455e478f1f51e6675
Author: Marcus Christie <ma...@apache.org>
AuthorDate: Fri Jun 25 15:57:15 2021 -0400

    AIRAVATA-3469 UI for downloading directory
---
 .../storage/ExperimentStoragePathViewer.vue         | 21 ++++++++++++++++++++-
 .../storage/ExperimentStorageViewContainer.vue      | 16 +++++++++++++++-
 .../js/components/storage/UserStoragePathViewer.vue | 21 ++++++++++++++++-----
 3 files changed, 51 insertions(+), 7 deletions(-)

diff --git a/django_airavata/apps/workspace/static/django_airavata_workspace/js/components/storage/ExperimentStoragePathViewer.vue b/django_airavata/apps/workspace/static/django_airavata_workspace/js/components/storage/ExperimentStoragePathViewer.vue
index 31f5a44..44d46ac 100644
--- a/django_airavata/apps/workspace/static/django_airavata_workspace/js/components/storage/ExperimentStoragePathViewer.vue
+++ b/django_airavata/apps/workspace/static/django_airavata_workspace/js/components/storage/ExperimentStoragePathViewer.vue
@@ -27,6 +27,18 @@
       <template slot="createdTimestamp" slot-scope="data">
         <human-date :date="data.item.createdTime" />
       </template>
+      <template slot="actions" slot-scope="data">
+        <b-link
+          v-if="data.item.type === 'dir'"
+          class="action-link"
+          :href="`/sdk/download-experiment-dir/${encodeURIComponent(
+            experimentId
+          )}?path=${data.item.path}`"
+        >
+          Download Zip
+          <i class="fa fa-file-archive" aria-hidden="true"></i>
+        </b-link>
+      </template>
     </b-table>
   </div>
 </template>
@@ -35,7 +47,7 @@ import StoragePathBreadcrumb from "./StoragePathBreadcrumb.vue";
 import { components } from "django-airavata-common-ui";
 
 export default {
-  name: "user-storage-path-viewer",
+  name: "experiment-storage-path-viewer",
   props: {
     experimentStoragePath: {
       required: true,
@@ -44,6 +56,9 @@ export default {
       type: Boolean,
       default: false,
     },
+    experimentId: {
+      required: true,
+    },
   },
   components: {
     "human-date": components.HumanDate,
@@ -68,6 +83,10 @@ export default {
           key: "createdTimestamp",
           sortable: true,
         },
+        {
+          label: "Actions",
+          key: "actions",
+        },
       ];
     },
     items() {
diff --git a/django_airavata/apps/workspace/static/django_airavata_workspace/js/components/storage/ExperimentStorageViewContainer.vue b/django_airavata/apps/workspace/static/django_airavata_workspace/js/components/storage/ExperimentStorageViewContainer.vue
index 7241649..a9edc15 100644
--- a/django_airavata/apps/workspace/static/django_airavata_workspace/js/components/storage/ExperimentStorageViewContainer.vue
+++ b/django_airavata/apps/workspace/static/django_airavata_workspace/js/components/storage/ExperimentStorageViewContainer.vue
@@ -1,8 +1,22 @@
 <template>
-  <b-card header="Experiment Data Directory">
+  <b-card>
+    <template #header>
+      <div class="d-flex justify-content-between">
+        <h6 class="mb-0">Experiment Data Directory</h6>
+        <b-link
+          :href="`/sdk/download-experiment-dir/${encodeURIComponent(
+            experimentId
+          )}`"
+        >
+          Download Zip
+          <i class="fa fa-file-archive" aria-hidden="true"></i>
+        </b-link>
+      </div>
+    </template>
     <experiment-storage-path-viewer
       v-if="experimentStoragePath"
       :experiment-storage-path="experimentStoragePath"
+      :experiment-id="experimentId"
       @directory-selected="directorySelected"
       :download-in-new-window="true"
     ></experiment-storage-path-viewer>
diff --git a/django_airavata/apps/workspace/static/django_airavata_workspace/js/components/storage/UserStoragePathViewer.vue b/django_airavata/apps/workspace/static/django_airavata_workspace/js/components/storage/UserStoragePathViewer.vue
index 975af26..f26539f 100644
--- a/django_airavata/apps/workspace/static/django_airavata_workspace/js/components/storage/UserStoragePathViewer.vue
+++ b/django_airavata/apps/workspace/static/django_airavata_workspace/js/components/storage/UserStoragePathViewer.vue
@@ -56,13 +56,19 @@
         >
           Select
         </b-button>
-        <delete-button
-          v-if="includeDeleteAction"
-          @delete="deleteItem(data.item)"
+
+        <b-link
+          v-if="data.item.type === 'dir'"
+          class="action-link"
+          :href="`/sdk/download-dir?path=${data.item.path}`"
         >
+          Download Zip
+          <i class="fa fa-file-archive" aria-hidden="true"></i>
+        </b-link>
+        <delete-link v-if="includeDeleteAction" @delete="deleteItem(data.item)">
           Are you sure you want to delete <strong>{{ data.item.name }}</strong
           >?
-        </delete-button>
+        </delete-link>
       </template>
     </b-table>
   </div>
@@ -110,7 +116,7 @@ export default {
   },
   components: {
     UserStorageLink,
-    "delete-button": components.DeleteButton,
+    "delete-link": components.DeleteLink,
     "human-date": components.HumanDate,
     UserStoragePathBreadcrumb,
     UserStorageCreateView,
@@ -220,3 +226,8 @@ export default {
   },
 };
 </script>
+<style scoped>
+.action-link + .delete-link {
+  margin-left: 0.25rem;
+}
+</style>