$(document).ready(function(){
  $(document).ajaxStart(function(){
    $("#wait").css("display", "block");
  });
  $(document).ajaxComplete(function(){
    $("#wait").css("display", "none");
  });
 
    //make sure change to your own machine ip or dmain url
    var urlBase = "http://0.0.0.0:30001";
   // var urlBase = "http://10.0.2.2:30001";
 
    
   $("#login").click(function(){
    console.log("1")
    var logInUrl = urlBase+"/login";
     userName=$('#employeeID').val(),
    $.ajax({
      type: 'POST',
      url: logInUrl,
      data: { userName: userName },
      success: function(data, status, jqXHR){
        let urlhome=urlBase+"/home"
        window.location.replace(urlhome);
        
      },
      error: function(xhr, textStatus, error){
       console.log("EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE");
       console.log( xhr.responseText);
          console.log(xhr.statusText);
          console.log(textStatus);
          console.log(error);
          alert("Error: "+ "Fack Identity please add  your certificate to the wallit");
      }
    });
  })





});
