Skip to content

Commit

Permalink
Load archive data on archive login
Browse files Browse the repository at this point in the history
  • Loading branch information
eheinrich committed Jul 11, 2019
1 parent 22d71d2 commit 1bcf6d0
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 4 deletions.
1 change: 1 addition & 0 deletions static/js/archive.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ function archiveAjaxSetup(){
jqXHR.setRequestHeader('Authorization', 'Token ' + sessionStorage.getItem('archiveAuthToken'));
}
});
$(document).trigger('archivelogin');
});
}

Expand Down
14 changes: 11 additions & 3 deletions static/js/components/archivetable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,7 @@
],
watch: {
requestid: function(){
$('#archive-table').bootstrapTable('refresh',
{url: archiveRoot + 'frames/?limit=1000&REQNUM=' + this.requestid}
);
this.refreshTable();
}
},
methods: {
Expand All @@ -58,6 +56,13 @@
},
downloadAll: function(){
downloadAll(this.requestid);
},
refreshTable: function() {
if (this.requestid) {
$('#archive-table').bootstrapTable('refresh',
{url: archiveRoot + 'frames/?limit=1000&REQNUM=' + this.requestid}
);
}
}
},
computed: {
Expand Down Expand Up @@ -132,6 +137,9 @@
}
}]
});
$(document).on('archivelogin', function() {
that.refreshTable();
})
}
};
</script>
Expand Down
10 changes: 9 additions & 1 deletion static/js/request_row.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ $('.downloadall').click(function(){
downloadAll($(this).data('requestid'));
});

$(document).ready(function() {
function loadThumbnail() {
$('.thumbnail-small').each(function(idx, elem) {
getLatestFrame($(elem).data('request'), function(frame) {
if (!frame) {
Expand All @@ -21,6 +21,7 @@ $(document).ready(function() {
$(elem).attr('alt', frame.filename);
$(elem).attr('title', frame.filename);
$(elem).prev().show().html('<center><span class="fa fa-spinner fa-spin"></span></center>');
$('button[data-requestid="' + $(elem).data('request') +'"]').prop('disabled', false);
getThumbnail(frame.id, 75, function(data) {
if (data.error) {
$(elem).prev().html(data.error);
Expand All @@ -32,7 +33,14 @@ $(document).ready(function() {
}
});
});
}

$(document).on('archivelogin', function() {
loadThumbnail();
});

$(document).ready(function() {
loadThumbnail();
$('.pending-details').each(function() {
let that = $(this);
let requestId = $(this).data('request');
Expand Down

0 comments on commit 1bcf6d0

Please sign in to comment.