airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From machris...@apache.org
Subject [2/3] airavata-php-gateway git commit: Fixed the client side validation issue for experiment edit mode issue #2520 Included a jquery script for edit page as it seems to be missing it Added changes to load previously set values through jquery
Date Fri, 29 Sep 2017 20:37:59 GMT
Fixed the client side validation issue for experiment edit mode
issue #2520
Included a jquery script for edit page as it seems to be missing it
Added changes to load previously set values through jquery


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/33b1b88f
Tree: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/tree/33b1b88f
Diff: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/diff/33b1b88f

Branch: refs/heads/AIRAVATA-2520-bugfix
Commit: 33b1b88ff16e998bc8d36a2683619732e30bcb6f
Parents: 89547b3
Author: stephenpaul2727 <stephenpaul2727@gmail.com>
Authored: Tue Sep 26 21:27:06 2017 -0400
Committer: Marcus Christie <machrist@iu.edu>
Committed: Fri Sep 29 16:03:38 2017 -0400

----------------------------------------------------------------------
 app/views/experiment/edit.blade.php             |  3 +-
 .../partials/experiment-queue-block.blade.php   | 70 ++++++++++++++++++--
 2 files changed, 65 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/33b1b88f/app/views/experiment/edit.blade.php
----------------------------------------------------------------------
diff --git a/app/views/experiment/edit.blade.php b/app/views/experiment/edit.blade.php
index 9e6b156..aeeb620 100755
--- a/app/views/experiment/edit.blade.php
+++ b/app/views/experiment/edit.blade.php
@@ -13,7 +13,8 @@
 
 //$appResources = array('Echo' => $echoResources, 'WRF' => $wrfResources);
 ?>
-
+<!-- Included the jquery script here! -->
+<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
 
 <div class="container">
 

http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/33b1b88f/app/views/partials/experiment-queue-block.blade.php
----------------------------------------------------------------------
diff --git a/app/views/partials/experiment-queue-block.blade.php b/app/views/partials/experiment-queue-block.blade.php
index b78d391..8935ff1 100644
--- a/app/views/partials/experiment-queue-block.blade.php
+++ b/app/views/partials/experiment-queue-block.blade.php
@@ -10,6 +10,35 @@
 <input type="hidden" id="queue-array" value="{{ htmlentities( json_encode( $queues ) )
}}"/>
 <input type="hidden" id="app-deployment-defaults-array" value="{{ htmlentities( json_encode(
$appDeploymentDefaults ) ) }}"/>
 <input type="hidden" id="queue-defaults-array" value="{{ htmlentities( json_encode( $queueDefaults
) ) }}"/>
+
+<!-- Setting the node count we got from previous page to a hidden field for jquery -->
+@if(isset($expVal['scheduling']->nodeCount))
+<input type="hidden" id="passed-nodeCount" value="{{ $expVal['scheduling']->nodeCount
}}"/>
+@else
+<input type="hidden" id="passed-nodeCount" value="0"/>
+@endif
+
+<!-- Setting the cpu count we got from previous page to a hidden field for jquery -->
+@if(isset($expVal['scheduling']->totalCPUCount))
+<input type="hidden" id="passed-cpuCount" value="{{ $expVal['scheduling']->totalCPUCount
}}"/>
+@else
+<input type="hidden" id="passed-cpuCount" value="0"/>
+@endif
+
+<!-- Setting the wall time limit we got from previous page to a hidden field for jquery
-->
+@if(isset($expVal['scheduling']->wallTimeLimit))
+<input type="hidden" id="passed-wallTime" value="{{ $expVal['scheduling']->wallTimeLimit
}}"/>
+@else
+<input type="hidden" id="passed-wallTime" value="0"/>
+@endif
+
+<!-- Setting the physical memory we got from previous page to a hidden field for jquery
-->
+@if(isset($expVal['scheduling']->totalPhysicalMemory))
+<input type="hidden" id="passed-physicalmem" value="{{ $expVal['scheduling']->totalPhysicalMemory
}}"/>
+@else
+<input type="hidden" id="passed-physicalmem" value="0"/>
+@endif
+
 <div class="form-group required">
     @if( count( $queues) > 0 )
     <label class="control-label" for="node-count">Select a Queue</label>
@@ -148,14 +177,16 @@
             readBlob(startByte, endByte, fileId);
         });
     });
+    
+    //I commented this as I see this as repeated code!
 
     //To work work with experiment create (Ajax)
-    var selectedQueue = $("#select-queue").val();
-    getQueueData(selectedQueue);
-    $("#select-queue").change(function () {
-        var selectedQueue = $(this).val();
-        getQueueData(selectedQueue);
-    });
+    // var selectedQueue = $("#select-queue").val();
+    // getQueueData(selectedQueue);
+    // $("#select-queue").change(function () {
+    //     var selectedQueue = $(this).val();
+    //     getQueueData(selectedQueue);
+    // });
 
     $("#enable-auto-scheduling").change(function () {
         var selectedQueue = $("#select-queue").val();
@@ -166,8 +197,13 @@
         var queues = $.parseJSON($("#queue-array").val());
         var queueDefaults = $.parseJSON($("#queue-defaults-array").val());
         var appDefaults = $.parseJSON($("#app-deployment-defaults-array").val());
-
+        //getting the html values we set to hidden fields above!
+        var nodeCount = parseInt($("#passed-nodeCount").val());
+        var cpuCount = parseInt($('#passed-cpuCount').val());
+        var wallTime = parseInt($('#passed-wallTime').val());
+        var physicalMemory = parseInt($('#passed-physicalmem').val());
         var veryLargeValue = 9999999;
+
         console.log(queues);
         $(".queue-view").addClass("hide");
         for (var i = 0; i < queues.length; i++) {
@@ -192,6 +228,10 @@
                 }else{
                     $("#node-count").val(queueDefaults['nodeCount']);
                 }
+                // load previously set values on page load.
+                if(nodeCount!=0){
+                    $("#node-count").val(nodeCount);
+                }
 
                 //core-count
                 if (queues[i]['maxProcessors'] != 0 && queues[i]['maxProcessors']
!= null) {
@@ -214,6 +254,11 @@
                     $("#cpu-count").val(queueDefaults['cpuCount']);
                 }
 
+                // load previously set values on page load.
+                if(cpuCount!=0){
+                    $("#cpu-count").val(cpuCount);
+                }
+
 
                 //walltime-count
                 if (queues[i]['maxRunTime'] != null && queues[i]['maxRunTime'] !=
0) {
@@ -234,6 +279,11 @@
                     $("#wall-time").val(queueDefaults['wallTimeLimit']);
                 }
 
+                // load previously set values on page load.
+                if(wallTime!=0){
+                    $("#wall-time").val(wallTime);
+                }
+
                 //memory-count
                 if (queues[i]['maxMemory'] != 0 && queues[i]['maxMemory'] != null)
{
                     if($('#enable-auto-scheduling').prop('checked')){
@@ -253,6 +303,12 @@
                     var cpusPerNode = queueDefaults['cpusPerNode'];
                 }
 
+                // load previously set values on page load.
+                if(physicalMemory!=0){
+                    $("#memory-count").val(physicalMemory);
+                }
+
+
                 var nodeCount=$("#node-count");
                 var cpuCount=$("#cpu-count");
 


Mime
View raw message