Package freenet.support

Examples of freenet.support.HTMLNode.addChild()


    int totalSSKRS = 0;
    int totalSSKT = 0;
    synchronized(this) {
      for(int htl = byHTL.length - 1; htl >= 0; htl--) {
        row = table.addChild("tr");
        row.addChild("td", Integer.toString(htl));
        StatsLine line = byHTL[htl];
        int chkLS = (int)line.chkLocalSuccess.countReports();
        int chkRS = (int)line.chkRemoteSuccess.countReports();
        int chkF = (int)line.chkFailure.countReports();
        int chkT = chkLS + chkRS + chkF;
View Full Code Here


        double chkRate = 0.;
        double sskRate = 0.;
        if (chkT > 0) chkRate = ((double)(chkLS + chkRS)) / (chkT);
        if (sskT > 0) sskRate = ((double)(sskLS + sskRS)) / (sskT);

        row.addChild("td", fix3p3pct.format(chkRate) + nbsp + "(" + chkLS + "," + chkRS + "," + chkT + ")"+nbsp+"("+fix4p.format(locdiffCHK)+")");
        row.addChild("td", fix3p3pct.format(sskRate) + nbsp + "(" + sskLS + "," + sskRS + "," + sskT + ")"+nbsp+"("+fix4p.format(locdiffSSK)+")");

        totalCHKLS += chkLS;
        totalCHKRS+= chkRS;
        totalCHKT += chkT;
View Full Code Here

        double sskRate = 0.;
        if (chkT > 0) chkRate = ((double)(chkLS + chkRS)) / (chkT);
        if (sskT > 0) sskRate = ((double)(sskLS + sskRS)) / (sskT);

        row.addChild("td", fix3p3pct.format(chkRate) + nbsp + "(" + chkLS + "," + chkRS + "," + chkT + ")"+nbsp+"("+fix4p.format(locdiffCHK)+")");
        row.addChild("td", fix3p3pct.format(sskRate) + nbsp + "(" + sskLS + "," + sskRS + "," + sskT + ")"+nbsp+"("+fix4p.format(locdiffSSK)+")");

        totalCHKLS += chkLS;
        totalCHKRS+= chkRS;
        totalCHKT += chkT;
        totalSSKLS += sskLS;
View Full Code Here

      double totalSSKRate = 0.0;
      if (totalCHKT > 0) totalCHKRate = ((double)(totalCHKLS + totalCHKRS)) / totalCHKT;
      if (totalSSKT > 0) totalSSKRate = ((double)(totalSSKLS + totalSSKRS)) / totalSSKT;

      row = table.addChild("tr");
      row.addChild("td", "Total");
      row.addChild("td", fix3p3pct.format(totalCHKRate) + nbsp + "("+ totalCHKLS + "," + totalCHKRS + "," + totalCHKT + ")");
      row.addChild("td", fix3p3pct.format(totalSSKRate) + nbsp + "("+ totalSSKLS + "," + totalSSKRS + "," + totalSSKT + ")");
    }
  }
View Full Code Here

      if (totalCHKT > 0) totalCHKRate = ((double)(totalCHKLS + totalCHKRS)) / totalCHKT;
      if (totalSSKT > 0) totalSSKRate = ((double)(totalSSKLS + totalSSKRS)) / totalSSKT;

      row = table.addChild("tr");
      row.addChild("td", "Total");
      row.addChild("td", fix3p3pct.format(totalCHKRate) + nbsp + "("+ totalCHKLS + "," + totalCHKRS + "," + totalCHKT + ")");
      row.addChild("td", fix3p3pct.format(totalSSKRate) + nbsp + "("+ totalSSKLS + "," + totalSSKRS + "," + totalSSKT + ")");
    }
  }

  private class StatsLine {
View Full Code Here

      if (totalSSKT > 0) totalSSKRate = ((double)(totalSSKLS + totalSSKRS)) / totalSSKT;

      row = table.addChild("tr");
      row.addChild("td", "Total");
      row.addChild("td", fix3p3pct.format(totalCHKRate) + nbsp + "("+ totalCHKLS + "," + totalCHKRS + "," + totalCHKT + ")");
      row.addChild("td", fix3p3pct.format(totalSSKRate) + nbsp + "("+ totalSSKLS + "," + totalSSKRS + "," + totalSSKT + ")");
    }
  }

  private class StatsLine {
    TrivialRunningAverage chkLocalSuccess;
View Full Code Here

      if(showOnlyErrors && alert.getPriorityClass() > UserAlert.ERROR)
        continue;
      if (!alert.isValid())
        continue;
      totalNumber++;
      alertsNode.addChild("a", "name", alert.anchor());
      if(showOnlyErrors) {
        // Paranoia. Don't break the web interface no matter what.
        try {
          alertsNode.addChild(renderAlert(alert));
        } catch (Throwable t) {
View Full Code Here

      totalNumber++;
      alertsNode.addChild("a", "name", alert.anchor());
      if(showOnlyErrors) {
        // Paranoia. Don't break the web interface no matter what.
        try {
          alertsNode.addChild(renderAlert(alert));
        } catch (Throwable t) {
          Logger.error(this, "FAILED TO RENDER ALERT: "+alert+" : "+t, t);
        }
      } else {
        // Alerts toadlet itself can error, that's OK.
View Full Code Here

        } catch (Throwable t) {
          Logger.error(this, "FAILED TO RENDER ALERT: "+alert+" : "+t, t);
        }
      } else {
        // Alerts toadlet itself can error, that's OK.
        alertsNode.addChild(renderAlert(alert));
      }
    }
    if (totalNumber == 0) {
      return new HTMLNode("#", "");
    }
View Full Code Here

  public HTMLNode renderAlert(UserAlert userAlert) {
    HTMLNode userAlertNode = null;
    short level = userAlert.getPriorityClass();
    userAlertNode = new HTMLNode("div", "class", "infobox infobox-"+getAlertLevelName(level));

    userAlertNode.addChild("div", "class", "infobox-header", userAlert.getTitle());
    HTMLNode alertContentNode = userAlertNode.addChild("div", "class", "infobox-content");
    alertContentNode.addChild(userAlert.getHTMLText());
    if (userAlert.userCanDismiss()) {
      HTMLNode dismissFormNode = alertContentNode.addChild("form", new String[] { "action", "method" }, new String[] { "/alerts/", "post" }).addChild("div");
      dismissFormNode.addChild("input", new String[] { "type", "name", "value" }, new String[] { "hidden", "disable", String.valueOf(userAlert.hashCode()) });
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.