drill-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kkhatua <...@git.apache.org>
Subject [GitHub] drill pull request #756: DRILL-5195: Publish Operator and MajorFragment Stat...
Date Thu, 23 Feb 2017 22:31:18 GMT
Github user kkhatua commented on a diff in the pull request:

    https://github.com/apache/drill/pull/756#discussion_r102836154
  
    --- Diff: exec/java-exec/src/main/java/org/apache/drill/exec/server/rest/profile/TableBuilder.java
---
    @@ -33,62 +33,91 @@
       private int w = 0;
       private int width;
     
    -  public TableBuilder(final String[] columns) {
    +  public TableBuilder(final String[] columns, final String[] columnTooltip) {
         sb = new StringBuilder();
         width = columns.length;
     
         format.setMaximumFractionDigits(3);
     
         sb.append("<table class=\"table table-bordered text-right\">\n<tr>");
    -    for (final String cn : columns) {
    -      sb.append("<th>" + cn + "</th>");
    +    for (int i = 0; i < columns.length; i++) {
    +      String cn = columns[i];
    +      String ctt = "";
    +      if (columnTooltip != null) {
    +        String tooltip = columnTooltip[i];
    +        if (tooltip != null) {
    +          ctt = " title=\""+tooltip+"\" style=\"color:#00008B;\"";
    +        }
    +      }
    +      sb.append("<th" + ctt + ">" + cn + "</th>");
         }
         sb.append("</tr>\n");
       }
     
    -  public void appendCell(final String s, final String link) {
    +  public void appendCell(final String s, final String link, final String titleText) {
         if (w == 0) {
           sb.append("<tr>");
         }
    -    sb.append(String.format("<td>%s%s</td>", s, link != null ? link : ""));
    +    if (titleText != null && titleText.length() > 0) {
    +      sb.append(String.format("<td title=\""+titleText+"\">%s%s</td>", s,
link != null ? link : ""));
    +    } else {
    +      sb.append(String.format("<td>%s%s</td>", s, link != null ? link : ""));
    +    }
         if (++w >= width) {
           sb.append("</tr>\n");
           w = 0;
    +    }  }
    +
    +  public void appendCellWithBgColor(final String s, final String link, final String titleText,
final String backgroundColor) {
    +    if (w == 0) {
    +      sb.append("<tr bgcolor=\""+backgroundColor+"\">");
    --- End diff --
    
    Just keeping it simple. Added this so that we can create alternating bands where needed.

    The `profile.ftl` file also uses in-place style formatting in a lot of places. 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message