From 0908895b1ebc9d85a96b0d848dc357ba25e0e763 Mon Sep 17 00:00:00 2001 From: gebele Date: Fri, 12 Jul 2019 12:07:51 +0000 Subject: use wait animation instead approx prediction time --- public/javascripts/lazar-gui.js | 3 ++- views/batch.haml | 11 ++++++++--- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/public/javascripts/lazar-gui.js b/public/javascripts/lazar-gui.js index 585f2ac..f9d8255 100644 --- a/public/javascripts/lazar-gui.js +++ b/public/javascripts/lazar-gui.js @@ -209,7 +209,7 @@ renderTask = function(task_uri,id) { var aClient = new HttpClient(); aClient.get(uri, function(res) { var response = JSON.parse(res); - progress(response['percent'],id); + //progress(response['percent'],id); if (response['percent'] == 100){ window.clearInterval(markers[id]); $("a#downbutton_"+id).removeClass("disabled"); @@ -218,6 +218,7 @@ renderTask = function(task_uri,id) { $("a#detailsbutton_"+id).removeClass("btn-outline-info"); $("a#downbutton_"+id).addClass("btn-info"); $("a#detailsbutton_"+id).addClass("btn-info"); + $("#circle_"+id).hide(); }; }); }; diff --git a/views/batch.haml b/views/batch.haml index 4f82312..f161125 100644 --- a/views/batch.haml +++ b/views/batch.haml @@ -42,10 +42,11 @@ %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=>"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;"} :javascript $(document).ready(function() { taskProgress('#{idx}','#{ctimer}','#{approx[idx]}','#{to("/prediction/task/?turi=#{task}")}'); @@ -59,13 +60,17 @@ var button = document.getElementById("detailsbutton_"+(idx-1)); if(!button.classList.contains('disabled')){ renderTask(task_uri,idx); - remaining(idx,approximate); + //remaining(idx,approximate); + $("#est_"+idx).hide(); + $("#circle_"+idx).show(); } }, timer ); }else{ markers[idx] = setInterval(function(){ renderTask(task_uri,idx); - remaining(idx,approximate); + //remaining(idx,approximate); + $("#est_"+idx).hide(); + $("#circle_"+idx).show(); }, timer ); }; }; -- cgit v1.2.3