Github user dvjyothsna commented on a diff in the pull request:

    https://github.com/apache/drill/pull/1203#discussion_r180238126
  
    --- Diff: exec/java-exec/src/main/resources/rest/index.ftl ---
    @@ -289,14 +314,94 @@
                       });
                   }
               }
    -      </#if>
    +
    +          function remoteShutdown(button,host) {
    +              var url = location.protocol + "//" + host + 
"/gracefulShutdown";
    +              var result = $.ajax({
    +                    type: 'POST',
    +                    url: url,
    +                    contentType : 'text/plain',
    +                    complete: function(data) {
    +                        alert(data.responseJSON["response"]);
    +                        button.prop('disabled',true).css('opacity',0.5);
    +                    }
    +              });
    +          }
    +          </#if>
           function getRequestUrl(requestPath) {
                 var protocol = location.protocol;
                 var host = location.host;
                 var url = protocol + "//" + host + requestPath;
                 return url;
           }
    -    </script>
    +
    +      //Iterates through all the nodes for update
    +      function reloadMetrics() {
    +          for (i = 1; i <= size; i++) {
    +              var address = 
$("#row-"+i).find("#address").contents().get(0).nodeValue.trim();
    +              var httpPort = 
$("#row-"+i).find("#httpPort").contents().get(0).nodeValue.trim();
    +              updateMetricsHtml(address, httpPort, i);
    +          }
    +      }
    +
    +      //Update memory
    +      //TODO: HTTPS?
    +      function updateMetricsHtml(drillbit,webport,idx) {
    +        var result = $.ajax({
    +          type: 'GET',
    --- End diff --
    
    I think its safe to not make any remote ajax requests until we figure out a 
way to perform them with BOTH ssl and auth enabled. The user might not notice 
the ajax failures and assume that we are displaying wrong info (The default 
values i.e., zero).


---

Reply via email to