summaryrefslogtreecommitdiff
path: root/views/batch.haml
diff options
context:
space:
mode:
Diffstat (limited to 'views/batch.haml')
-rw-r--r--views/batch.haml34
1 files changed, 19 insertions, 15 deletions
diff --git a/views/batch.haml b/views/batch.haml
index efb9b71..2e48ec0 100644
--- a/views/batch.haml
+++ b/views/batch.haml
@@ -11,24 +11,26 @@
%a.btn.btn-outline-info{:href => to("/predict?tpid=#{@pid}")}
%span.fa.fa-caret-left{:aria=>{:hidden=>"true"}}
New Prediction
+%div.card.bg-light{:id=>"uploadDataset"}
+ %div.card-body
+ %h3.card-title="Processing file #{@filename} to dataset."
+ %img.h2{:src=>"/images/wait30trans.gif", :id=>"circle_upload", :class=>"circle", :alt=>"processing"}
+ :javascript
+ uploadInterval = setInterval(function(){
+ uploadDataset('#{to("/prediction/task/?turi=#{@upid}")}');
+ }, 1000 );
+
%div.card.bg-light
%div.card-body
%h3.card-title="Batch prediction results for: #{@filename}"
// prepare variable values for javascript
// increase timer interval for large datasets
- - ctimer = ((@compounds_size/1000) == 0 ? 1000 : ((@compounds_size/1000)*1000))
- //- approx = {}
- //- sum_approx = 0
+ - ctimer = 1000#((@compounds_size/1000) == 0 ? 1000 : ((@compounds_size/1000)*1000))
// process batch predictions
- @models.each_with_index do |model,idx|
- m = Model::Validation.find model
- task = @tasks[idx].id
- //- tasktime = task.generation_time.to_i
- // assume single compound prediction time: classification=0.1s,regression=0.5s
- //- task_approx = m.classification? ? (tasktime*1000 + @compounds_size*100) : (tasktime*1000 + @compounds_size*500)
- //- approx[idx] = task_approx + sum_approx
- //- sum_approx += (m.classification? ? @compounds_size*100 : @compounds_size*500)
#result.card.bg-light{:id=>idx}
%div.card-body
%div.row
@@ -36,14 +38,12 @@
%h5.card-title="#{m.endpoint} (#{m.species})"
#pager{:id=>idx}
%div.col-6
- %a.btn.btn-outline-info.btn-sm.disabled{:id => "detailsbutton_#{idx}", :data=>{:toggle=>"collapse"}, :href=>"javascript:void(0)", :onclick=>"pagePredictions('#{to("/prediction/task/?predictions=#{task}")}','#{model}','#{idx}','#{@compounds_size}')"}
+ %a.btn.btn-outline-info.btn-sm.disabled{:id => "detailsbutton_#{idx}", :data=>{:toggle=>"collapse"}, :href=>"javascript:void(0)", :onclick=>"pagePredictions('#{to("/prediction/task/?predictions=#{task}")}','#{model}','#{idx}','#{to("/prediction/task/?turi=#{task}")}')"}
%span.fa.fa-caret-right
Details
%a.btn.btn-outline-info.btn-sm.disabled{:id => "downbutton_#{idx}", :href=>"#{to("/predict/batch/download?tid=#{task}")}", :title=>"download"}
%span.fa.fa-download
CSV
- -#%div{:id=>"progress_#{idx}", :style=>"width:100%;height:3px;position:relative;background-color:#ccc;"}
- %div{:id=>"bar_#{idx}", :style=>"background-color: #4CAF50;width:10px;height:3px;position:absolute;"}
%p{:id=>"est_#{idx}"}
waiting ...
%img.h2{:src=>"/images/wait30trans.gif", :id=>"circle_#{idx}", :class=>"circle", :alt=>"wait", :style=>"display:none;"}
@@ -60,7 +60,6 @@
var button = document.getElementById("detailsbutton_"+(idx-1));
if(!button.classList.contains('disabled')){
renderTask(task_uri,idx);
- //remaining(idx,approximate);
$("#est_"+idx).hide();
$("#circle_"+idx).show();
}
@@ -68,9 +67,14 @@
}else{
markers[idx] = setInterval(function(){
renderTask(task_uri,idx);
- //remaining(idx,approximate);
- $("#est_"+idx).hide();
- $("#circle_"+idx).show();
+ // check that dataset parsing is completed
+ if (document.getElementById("uploadDataset")){
+ $("#est_"+idx).show();
+ $("#circle_"+idx).hide();
+ } else {
+ $("#est_"+idx).hide();
+ $("#circle_"+idx).show();
+ }
}, timer );
};
};