Skip to content

Commit

Permalink
For data export, show a message box with the link to download the gen…
Browse files Browse the repository at this point in the history
…erate file
  • Loading branch information
mah0001 committed Nov 14, 2024
1 parent 3a9b9e5 commit 0d8ae4e
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
3 changes: 2 additions & 1 deletion application/language/english/project_lang.php
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,8 @@
$lang['rows']="Rows";
$lang['no_data_available']="No data is available";
$lang['note_data_stored_on_server']="Data is stored on the server for summary statistics, data exports and other operations.";
$lang['']="";
$lang['file_generated_success']="File has been generated successfully";
$lang['download_file']="Download file";



Expand Down
16 changes: 14 additions & 2 deletions application/views/metadata_editor/vue-datafiles-component.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ Vue.component('datafiles', {
title:'',
loading_message:'',
message_success:'',
message_success_html:'',
download_links:[],
message_error:'',
is_loading:false
},
Expand Down Expand Up @@ -184,8 +186,10 @@ Vue.component('datafiles', {
}else if (result.data.job_status==='done'){
this.dialog.is_loading=false;
let download_url=CI.base_url + '/api/datafiles/download_tmp_file/'+this.dataset_id + '/' + file_id + '/' + format;
this.dialog.message_success=this.$t('finished_processing') + " <a href='"+download_url+"'>Download file</a>";
window.open(download_url, '_blank').focus();
this.dialog.message_success=this.$t('file_generated_success');
this.dialog.download_links=[];
this.dialog.download_links.push({url:download_url,title:this.$t('download_file') + ' [' + format + ']'});
//window.open(download_url, '_blank').focus();
}

}catch(e){
Expand Down Expand Up @@ -633,6 +637,14 @@ Vue.component('datafiles', {
{{dialog.message_success}}
</div>
<div v-html="dialog.message_success_html" v-if="dialog.message_success_html"></div>
<div v-if="dialog.download_links">
<div v-for="link in dialog.download_links">
<v-btn color="primary" outlined block text><a :href="link.url">{{link.title}}</a></v-btn>
</div>
</div>
<div class="alert alert-danger" v-if="dialog.message_error" type="error">
{{dialog.message_error}}
</div>
Expand Down

0 comments on commit 0d8ae4e

Please sign in to comment.