You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airavata.apache.org by sc...@apache.org on 2016/01/14 16:43:30 UTC
[34/50] [abbrv] airavata-php-gateway git commit: modifying the auto
refreshing logic in experiment summary
modifying the auto refreshing logic in experiment summary
Project: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/repo
Commit: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/commit/961aabc4
Tree: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/tree/961aabc4
Diff: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/diff/961aabc4
Branch: refs/heads/develop
Commit: 961aabc4822c563f22d0dddd6b1563ad39aed017
Parents: 5c1a773
Author: scnakandala <su...@gmail.com>
Authored: Fri Jan 8 14:26:46 2016 -0500
Committer: scnakandala <su...@gmail.com>
Committed: Fri Jan 8 14:26:46 2016 -0500
----------------------------------------------------------------------
app/views/experiment/summary.blade.php | 22 ++++++++++++++++++----
app/views/partials/experiment-info.blade.php | 5 +++++
2 files changed, 23 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/961aabc4/app/views/experiment/summary.blade.php
----------------------------------------------------------------------
diff --git a/app/views/experiment/summary.blade.php b/app/views/experiment/summary.blade.php
index cefc532..1643640 100755
--- a/app/views/experiment/summary.blade.php
+++ b/app/views/experiment/summary.blade.php
@@ -12,9 +12,10 @@
@section('scripts')
@parent
<script>
- var $continue = true;
+ var autoRefresh = false;
setInterval(function () {
- //if ($.trim($(".exp-status").html()) != "COMPLETED" && $continue) {
+ if (($.trim($(".exp-status").html()) != "COMPLETED" && $.trim($(".exp-status").html()) != "FAILED"
+ && $.trim($(".exp-status").html()) != "CANCELLED") && autoRefresh) {
$.ajax({
type: "GET",
url: "{{URL::to('/') }}/experiment/summary",
@@ -23,12 +24,25 @@
data = $.parseJSON( data);
//if ($.trim($("#expObj").val()) != $.trim(exp)) {
if ($.trim($("#lastModifiedTime").val()) != $.trim( data.expVal["experimentTimeOfStateChange"])) {
- $continue = false;
$(".refresh-exp").click();
}
}
});
- // }
+ }
}, 3000);
+
+ $('.btn-toggle').click(function() {
+ if(autoRefresh){
+ autoRefresh = false;
+ }else{
+ autoRefresh = true;
+ }
+
+ $(this).find('.btn').toggleClass('active');
+ if ($(this).find('.btn-primary').size()>0) {
+ $(this).find('.btn').toggleClass('btn-primary');
+ }
+ $(this).find('.btn').toggleClass('btn-default');
+ });
</script>
@stop
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/961aabc4/app/views/partials/experiment-info.blade.php
----------------------------------------------------------------------
diff --git a/app/views/partials/experiment-info.blade.php b/app/views/partials/experiment-info.blade.php
index cb6ec26..b039371 100644
--- a/app/views/partials/experiment-info.blade.php
+++ b/app/views/partials/experiment-info.blade.php
@@ -10,6 +10,11 @@
@if( !isset($dashboard))
<small><a href="{{ URL::to('/') }}/experiment/summary?expId={{ $experiment->experimentId }}"
title="Refresh"><span class="glyphicon glyphicon-refresh refresh-exp"></span></a></small>
+ <small><small>Enable Auto Refresh </small></small>
+ <div class="btn-group btn-toggle">
+ <button class="btn btn-xs btn-default">ON</button>
+ <button class="btn btn-xs btn-primary active">OFF</button>
+ </div>
@endif
</h1>