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

    https://github.com/apache/drill/pull/963#discussion_r142240395
  
    --- Diff: exec/java-exec/src/main/resources/rest/profile/list.ftl ---
    @@ -37,7 +37,42 @@
           <strong>No running queries.</strong>
         </div>
       </#if>
    -  <h3>Completed Queries</h3>
    +  <table width="100%">
    +    <script type="text/javascript" language="javascript">
    +    //Validate that the fetch number is valid
    +    function checkMaxFetch() {
    +      var maxFetch = document.forms["profileFetch"]["max"].value;
    +      console.log("maxFetch: " + maxFetch);
    +      if (isNaN(maxFetch) || (maxFetch < 1) || (maxFetch > 100000) ) {
    +        alert("Invalid Entry: " + maxFetch + "\n" +
    +               Please enter a valid number of profiles to fetch (1 to 
100000) ");
    +        return false;
    +      }
    +      return true;
    +    }
    +    </script>
    +    <tr>
    +      <td><h3>Completed Queries</h3></td>
    +      <td align="right">
    +        <form name="profileFetch" action="/profiles" onsubmit="return 
checkMaxFetch();" method="get"><span title="Max number of profiles to 
list">Showing <b>${model.getFinishedQueries()?size}</b> profiles. Max: </span>
    +        <input id="fetchMax" type="text" size="7" name="max" value="">
    --- End diff --
    
    Done. 
    1. The keyword is now 'Refresh'.
    2. The default fetch is populated into the textbox. Any subsequent changes 
are retained, so the user does not have to re-enter a value to trigger a 
reload. Only click on Refresh. 



---

Reply via email to