You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airavata.apache.org by sm...@apache.org on 2015/03/12 04:55:03 UTC

[31/51] [partial] airavata-php-gateway git commit: importing PGA into new repo - details are discussed at AIRAVATA-1627

http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/a325e292/public/js/script.js
----------------------------------------------------------------------
diff --git a/public/js/script.js b/public/js/script.js
new file mode 100644
index 0000000..be0826e
--- /dev/null
+++ b/public/js/script.js
@@ -0,0 +1,323 @@
+function getAccodrionCode()
+{
+	return '<div class="panel-group" id="accordion"> \
+  <div class="panel panel-default"> \
+    <div class="panel-heading">\
+      <h4 class="panel-title">\
+        <a data-toggle="collapse" data-parent="#accordion" href="#collapseOne">\
+          Collapsible Group Item #1\
+        </a>\
+      </h4>\
+    </div>\
+    <div id="collapseOne" class="panel-collapse collapse in">\
+      <div class="panel-body">\
+        Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia aute, non cupidatat skateboard dolor brunch. Food truck quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor, sunt aliqua put a bird on it squid single-origin coffee nulla assumenda shoreditch et. Nihil anim keffiyeh helvetica, craft beer labore wes anderson cred nesciunt sapiente ea proident. Ad vegan excepteur butcher vice lomo. Leggings occaecat craft beer farm-to-table, raw denim aesthetic synth nesciunt you probably havent heard of them accusamus labore sustainable VHS.\
+      </div>\
+    </div>\
+  </div>';
+}
+
+$(document).ready( function(){
+
+  //making the previously opened tab open again on page reload/modifications.
+  var urlArray = window.location.href.split("#");
+  var openTab = urlArray[1];
+  $('a[href="#' + openTab + '"]').click();
+  //tab open code ends here.
+
+	$(".add-queue").click( function(){
+		$(this).before( $(".queue-block").html() );
+	});
+
+  $(".add-alias").click( function(){
+    $(this).before( '<input class="form-control" maxlength="30" name="hostaliases[]"/>');
+  });
+
+  $(".add-ip").click( function(){
+    $(this).before( '<input class="form-control" maxlength="30" name="ips[]"/>');
+  })
+
+  /* 
+   * code that relates to Job Submission Protocol Interface starts here.
+  */
+
+  $(".add-job-submission").click( function(){
+    /*$(".job-submission-info").removeClass("hide").append( "<div class='job-protocol-block col-md-12'>" + $(".select-job-protocol").html() + "</div><hr/>");
+  	
+  	$('html, body').animate({
+        scrollTop: $(this).position().top + 500
+    }, 200);
+    */
+    $(".add-jsi-body").html( "<div class='job-protocol-block col-md-12'>" + $(".select-job-protocol").html() + "</div><hr/>");
+    $("#add-jsi").modal("show");
+  });
+
+  $("body").on("change", ".selected-job-protocol", function(){
+
+    var selectedVal = $(this).children("option:selected").html().toLowerCase();
+
+    $(this).parent().find("div[class*='resourcemanager-']").remove();
+
+    var parentResDiv = "<div class='resourcemanager-" + selectedVal + "'>"
+                + "<hr/>" 
+                + "Resource Manager: <h4>" + selectedVal + "</h4>"
+                + "<hr/>";
+
+    if( selectedVal == "local")
+    {
+      $(this).after(  parentResDiv + $(".resource-manager-block").html() + "</div>" );
+    }
+    else if( selectedVal == "ssh")
+    {
+      $(this).after(  parentResDiv 
+                      + $(".ssh-block").html()
+                      + $(".resource-manager-block").html() 
+                      + "</div>" );
+      $(this).parent().find(".addedScpValue").removeClass("hide");
+    }
+    else if( selectedVal == "globus")
+    {
+    	alert("Globus Protool is not being setup right now. Please choose another option.");
+    	/*	
+      $(this).parent().append(  parentResDiv 
+                      + $(".ssh-block").html()
+                      + "<h5>Globus Gate Keeper End Point</h5>" 
+                      + "<input class='form-control' name='globusGateKeeperEndPoint'/>"
+                      + "</div>" );
+         */
+    }
+    else if( selectedVal == "unicore")
+    {
+      $(this).parent().append(  parentResDiv 
+                      + $(".ssh-block").html()
+                      + "<h5>Unicore End Point Url</h5>" 
+                      + "<input class='form-control' name='unicoreEndPointURL'/>"
+                      + "</div>" );
+    }
+    else if( selectedVal == "cloud")
+    {
+      alert("Cloud Protool is not being setup right now. Please choose another option.");
+      /*
+      $(this).parent().append(  parentResDiv 
+                      + $(".ssh-block").html()
+                      + $(".cloud-block").html()
+                      );
+      */
+    }
+    else{
+      alert("Something went wrong. Please try again");
+      $(".jspSubmit").addClass("hide");
+    }
+
+    //temporary till all protocols are not setup
+    if( selectedVal == "local" || selectedVal == "ssh" || selectedVal == "unicore" )
+      $(".jspSubmit").removeClass("hide");
+    else
+      $(".jspSubmit").addClass("hide");
+
+  });
+  
+  /* 
+   * code that relates to Job Submission Protocol Interface ends here.
+  */
+
+
+  /* 
+   * code that relates to Data Movement Interface starts here.
+  */
+
+  $(".add-data-movement").click( function(){
+    //$(".data-movement-info").removeClass("hide").append( "<div class='data-movement-block col-md-12'>" + $(".select-data-movement").html() + "</div><hr/>");
+    $(".add-dmi-body").html("<div class='data-movement-block col-md-12'>" + $(".select-data-movement").html() + "</div><hr/>");
+    $("#add-dmi").modal("show");
+  });
+
+
+  $("body").on("change", ".selected-data-movement-protocol", function(){
+
+    var selectedVal = $(this).children("option:selected").html().toLowerCase();
+
+    $(this).parent().find("div[class*='dataprotocol-']").remove();
+    var parentDataDiv = "<div class='dataprotocol-" + selectedVal + "'>"
+                + "<hr/>" 
+                + "Data Management Protocol: <h4>" + selectedVal + "</h4>"
+                + "<hr/>";
+    if( selectedVal == "local")
+    {
+      // to find out what goes here.
+    }
+    else if( selectedVal == "scp" )
+    {
+      $(this).after(  parentDataDiv 
+                      + $(".ssh-block").html()
+                      + "</div>" );
+      $(this).parent().find(".addedScpValue").removeClass("hide");
+    }
+    else if( selectedVal == "sftp")
+    {
+      alert( "SFTP has not been setup yet. Please choose another Data Movement Protocol");
+    }
+    else if( selectedVal == "gridftp")
+    {
+      $(this).after(  parentDataDiv 
+                      + $(".ssh-block").html()
+                      + $(".dm-gridftp").html()
+                      + "</div>" );
+    }
+    else if( selectedVal == "unicore_storage_service")
+    {
+      $(this).after(  parentDataDiv 
+                      + $(".ssh-block").html()
+                      + "<h5>Unicore End Point Url</h5>" 
+                      + "<input class='form-control' name='unicoreEndPointURL'/>"
+                      + "</div>" );
+    }
+    else{
+      alert("Something went wrong. Please try again");
+      $(".dmpSubmit").addClass("hide");
+    }
+    $(".dmpSubmit").removeClass("hide");
+
+  });
+
+  $("body").on("click", ".add-gridFTPEndPoint", function(){
+        $(this).before( '<input class="form-control" maxlength="30" name="gridFTPEndPoints[]"/>');
+  });
+
+   $(".delete-jsi").click( function(){
+      $(".delete-jsi-confirm").val( $(this).data("jsi-id"));
+   });
+
+  $(".delete-jsi-confirm").click( function(){
+
+    var jsiId = $(this).data("jsi-id");
+    $.ajax({
+      type: "POST",
+      url: $(".base-url").val() + "/cr/delete-jsi",
+      data: { 
+              crId : $(".crId").val(), 
+              jsiId : jsiId 
+            }
+    })
+    .complete(function( data ) {
+      $("#confirm-delete-jsi").modal("hide");
+      if( data.responseText == 1)
+      {
+        $(".job-protocol-block").each( function(i, elem){
+          var toBeRemovedChild = $(elem).find(".delete-jsi");
+          if( toBeRemovedChild.data("jsi-id") == jsiId )
+          {
+            $(elem).before("<div class='alert alert-success'>The Job Submission Interface has been successfully deleted.</div>");
+            $(elem).fadeOut().remove();
+          }
+        });
+      }
+    });
+
+  });
+
+  $(".delete-dmi").click( function(){
+      $(".delete-dmi-confirm").val($(this).data("dmi-id"));
+   });
+
+  $(".delete-dmi-confirm").click( function(){
+
+    var dmiId = $(this).data("dmi-id");
+    $.ajax({
+      type: "POST",
+      url: $(".base-url").val() + "/cr/delete-dmi",
+      data: {
+              crId : $(".crId").val(), 
+              dmiId : dmiId 
+            }
+    })
+    .complete(function( data ) {
+      $("#confirm-delete-dmi").modal("hide");
+      if( data.responseText == 1)
+      {
+        $(".data-movement-block").each( function(i, elem){
+          var toBeRemovedChild = $(elem).find(".delete-dmi");
+          if( toBeRemovedChild.data("dmi-id") == dmiId )
+          {
+            $(elem).before("<div class='alert alert-success'>The Data Movement Interface has been successfully deleted.</div>");
+            $(elem).fadeOut().remove();
+          }
+        });
+      }
+
+    });
+  });
+
+  $("#jsi-priority-form").submit( function( event ){
+    event.preventDefault();
+    $.ajax({
+        url: $(this).attr("action"),
+        type: 'post',
+        data: $('#jsi-priority-form').serialize(),
+        success: function(data) {
+                  if( data == 1)
+                  {
+                    $(".priority-updated").removeClass("hide");
+                    $(".priority-updated").fadeIn();
+                    setTimeout( function(){
+                      $(".priority-updated").addClass("hide");
+                      $("#update-jsi-priority").modal("hide");
+
+                    }, 3000);
+                    
+                  }
+        }
+    });
+  });
+
+  $("#dmi-priority-form").submit( function( event ){
+    event.preventDefault();
+    $.ajax({
+        url: $(this).attr("action"),
+        type: 'post',
+        data: $('#dmi-priority-form').serialize(),
+        success: function(data) {
+                  if( data == 1)
+                  {
+                    $(".priority-updated").removeClass("hide");
+                    $(".priority-updated").fadeIn();
+                    setTimeout( function(){
+                      $(".priority-updated").addClass("hide");
+                      $("#update-dmi-priority").modal("hide");
+
+                    }, 3000);
+                    
+                  }
+        }
+    });
+  });
+
+  $(".add-queue-block").on("click", ".create-queue-form", function(){
+    var newQueueName = $(this).parent().parent().find(".create-queue-name").val();
+
+    if (newQueueName.length > 0) {
+        children = ($("#accordion").children());
+
+        queueNameExists = false;
+        children.each( function(index, elem){
+          var existingQueueName = $(elem).find(".existing-queue-name").html();
+          if( existingQueueName == newQueueName)
+          {
+            queueNameExists = true;
+            return false;
+          }
+        });
+
+        if( queueNameExists)
+          alert( "This queue name already exists. Please choose another name.");
+        else
+          $(this).parent().parent().parent().submit();
+        
+    } else {
+        alert("Please enter queue name before submitting");
+    }
+
+  });
+
+  
+});
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/a325e292/public/robots.txt
----------------------------------------------------------------------
diff --git a/public/robots.txt b/public/robots.txt
new file mode 100755
index 0000000..eb05362
--- /dev/null
+++ b/public/robots.txt
@@ -0,0 +1,2 @@
+User-agent: *
+Disallow:

http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/a325e292/public/ultrascan-dashboard-gw111/css/bootstrap-datetimepicker.min.css
----------------------------------------------------------------------
diff --git a/public/ultrascan-dashboard-gw111/css/bootstrap-datetimepicker.min.css b/public/ultrascan-dashboard-gw111/css/bootstrap-datetimepicker.min.css
new file mode 100755
index 0000000..cf838a3
--- /dev/null
+++ b/public/ultrascan-dashboard-gw111/css/bootstrap-datetimepicker.min.css
@@ -0,0 +1,5 @@
+/*!
+ * Datetimepicker for Bootstrap v3
+//! version : 3.1.3
+ * https://github.com/Eonasdan/bootstrap-datetimepicker/
+ */.bootstrap-datetimepicker-widget{top:0;left:0;width:250px;padding:4px;margin-top:1px;z-index:99999!important;border-radius:4px}.bootstrap-datetimepicker-widget.timepicker-sbs{width:600px}.bootstrap-datetimepicker-widget.bottom:before{content:'';display:inline-block;border-left:7px solid transparent;border-right:7px solid transparent;border-bottom:7px solid #ccc;border-bottom-color:rgba(0,0,0,.2);position:absolute;top:-7px;left:7px}.bootstrap-datetimepicker-widget.bottom:after{content:'';display:inline-block;border-left:6px solid transparent;border-right:6px solid transparent;border-bottom:6px solid #fff;position:absolute;top:-6px;left:8px}.bootstrap-datetimepicker-widget.top:before{content:'';display:inline-block;border-left:7px solid transparent;border-right:7px solid transparent;border-top:7px solid #ccc;border-top-color:rgba(0,0,0,.2);position:absolute;bottom:-7px;left:6px}.bootstrap-datetimepicker-widget.top:after{content:'';display:inline-block;border-left:6px solid transpar
 ent;border-right:6px solid transparent;border-top:6px solid #fff;position:absolute;bottom:-6px;left:7px}.bootstrap-datetimepicker-widget .dow{width:14.2857%}.bootstrap-datetimepicker-widget.pull-right:before{left:auto;right:6px}.bootstrap-datetimepicker-widget.pull-right:after{left:auto;right:7px}.bootstrap-datetimepicker-widget>ul{list-style-type:none;margin:0}.bootstrap-datetimepicker-widget a[data-action]{padding:6px 0}.bootstrap-datetimepicker-widget a[data-action]:active{box-shadow:none}.bootstrap-datetimepicker-widget .timepicker-hour,.bootstrap-datetimepicker-widget .timepicker-minute,.bootstrap-datetimepicker-widget .timepicker-second{width:54px;font-weight:700;font-size:1.2em;margin:0}.bootstrap-datetimepicker-widget button[data-action]{padding:6px}.bootstrap-datetimepicker-widget table[data-hour-format="12"] .separator{width:4px;padding:0;margin:0}.bootstrap-datetimepicker-widget .datepicker>div{display:none}.bootstrap-datetimepicker-widget .picker-switch{text-align:center
 }.bootstrap-datetimepicker-widget table{width:100%;margin:0}.bootstrap-datetimepicker-widget td,.bootstrap-datetimepicker-widget th{text-align:center;border-radius:4px}.bootstrap-datetimepicker-widget td{height:54px;line-height:54px;width:54px}.bootstrap-datetimepicker-widget td.cw{font-size:10px;height:20px;line-height:20px;color:#777}.bootstrap-datetimepicker-widget td.day{height:20px;line-height:20px;width:20px}.bootstrap-datetimepicker-widget td.day:hover,.bootstrap-datetimepicker-widget td.hour:hover,.bootstrap-datetimepicker-widget td.minute:hover,.bootstrap-datetimepicker-widget td.second:hover{background:#eee;cursor:pointer}.bootstrap-datetimepicker-widget td.old,.bootstrap-datetimepicker-widget td.new{color:#777}.bootstrap-datetimepicker-widget td.today{position:relative}.bootstrap-datetimepicker-widget td.today:before{content:'';display:inline-block;border-left:7px solid transparent;border-bottom:7px solid #428bca;border-top-color:rgba(0,0,0,.2);position:absolute;bottom:4p
 x;right:4px}.bootstrap-datetimepicker-widget td.active,.bootstrap-datetimepicker-widget td.active:hover{background-color:#428bca;color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,.25)}.bootstrap-datetimepicker-widget td.active.today:before{border-bottom-color:#fff}.bootstrap-datetimepicker-widget td.disabled,.bootstrap-datetimepicker-widget td.disabled:hover{background:0 0;color:#777;cursor:not-allowed}.bootstrap-datetimepicker-widget td span{display:inline-block;width:54px;height:54px;line-height:54px;margin:2px 1.5px;cursor:pointer;border-radius:4px}.bootstrap-datetimepicker-widget td span:hover{background:#eee}.bootstrap-datetimepicker-widget td span.active{background-color:#428bca;color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,.25)}.bootstrap-datetimepicker-widget td span.old{color:#777}.bootstrap-datetimepicker-widget td span.disabled,.bootstrap-datetimepicker-widget td span.disabled:hover{background:0 0;color:#777;cursor:not-allowed}.bootstrap-datetimepicker-widget th{height:20px;line-he
 ight:20px;width:20px}.bootstrap-datetimepicker-widget th.picker-switch{width:145px}.bootstrap-datetimepicker-widget th.next,.bootstrap-datetimepicker-widget th.prev{font-size:21px}.bootstrap-datetimepicker-widget th.disabled,.bootstrap-datetimepicker-widget th.disabled:hover{background:0 0;color:#777;cursor:not-allowed}.bootstrap-datetimepicker-widget thead tr:first-child th{cursor:pointer}.bootstrap-datetimepicker-widget thead tr:first-child th:hover{background:#eee}.input-group.date .input-group-addon span{display:block;cursor:pointer;width:16px;height:16px}.bootstrap-datetimepicker-widget.left-oriented:before{left:auto;right:6px}.bootstrap-datetimepicker-widget.left-oriented:after{left:auto;right:7px}.bootstrap-datetimepicker-widget ul.list-unstyled li div.timepicker div.timepicker-picker table.table-condensed tbody>tr>td{padding:0!important}@media screen and (max-width:767px){.bootstrap-datetimepicker-widget.timepicker-sbs{width:283px}}
\ No newline at end of file