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 2019/07/18 21:26:12 UTC
[airavata-django-portal] 01/02: AIRAVATA-3066 View content of input
file
This is an automated email from the ASF dual-hosted git repository.
machristie pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/airavata-django-portal.git
commit c299a2d6283679d1798a4ef44267428c80a04668
Author: Marcus Christie <ma...@apache.org>
AuthorDate: Thu Jul 18 17:25:17 2019 -0400
AIRAVATA-3066 View content of input file
---
.../experiment/input-editors/FileInputEditor.vue | 25 +++++++++++++++++++++-
1 file changed, 24 insertions(+), 1 deletion(-)
diff --git a/django_airavata/apps/workspace/static/django_airavata_workspace/js/components/experiment/input-editors/FileInputEditor.vue b/django_airavata/apps/workspace/static/django_airavata_workspace/js/components/experiment/input-editors/FileInputEditor.vue
index 6aec649..2ae5420 100644
--- a/django_airavata/apps/workspace/static/django_airavata_workspace/js/components/experiment/input-editors/FileInputEditor.vue
+++ b/django_airavata/apps/workspace/static/django_airavata_workspace/js/components/experiment/input-editors/FileInputEditor.vue
@@ -9,6 +9,17 @@
:data-product="dataProduct"
:input-file="true"
/>
+ <b-link @click="viewFile">
+ View File <i class="fa fa-eye"></i>
+ <span class="sr-only">View file</span>
+ </b-link>
+ <b-modal
+ :title="dataProduct.productName"
+ ref="modal"
+ ok-only
+ >
+ <pre>{{ fileContent }}</pre>
+ </b-modal>
<delete-link
v-if="dataProduct.isInputFileUpload"
class="ml-2"
@@ -145,7 +156,8 @@ export default {
dataProduct: null,
file: null,
isSelectingFile: false,
- settings: null
+ settings: null,
+ fileContent: null
};
},
created() {
@@ -209,6 +221,17 @@ export default {
cancelFileSelection() {
this.isSelectingFile = false;
this.unselect();
+ },
+ viewFile() {
+ this.fileContent = null;
+ fetch(this.dataProduct.downloadURL, {
+ credentials: "same-origin"
+ })
+ .then(result => result.text())
+ .then(text => {
+ this.fileContent = text;
+ this.$refs.modal.show();
+ });
}
}
};