コード例 #1
0
 protected void createNodesTable() throws Exception {
   table().attr("cellpadding", "0", "cellspacing", "0", "border", "0", "class", "display");
   thead();
   tr();
   createThs(
       "Node", "Health", "Count", "Errors", "Time since last up", "Current Threads", "Action");
   end();
   end();
   tbody();
   for (Node n : router.getClusterManager().getAllNodesByCluster(params.get("cluster"))) {
     tr();
     td();
     createLink(
         "" + n.getHost() + ":" + n.getPort(),
         "node",
         "show",
         createQueryString(
             "cluster", params.get("cluster"), "host", n.getHost(), "port", "" + n.getPort()));
     end();
     createTds(
         n.isUp() ? "Up" : "Down",
         "" + n.getCounter(),
         String.format("%1$.2f%%", n.getErrors() * 100),
         formatDurationHMS(System.currentTimeMillis() - n.getLastUpTime()),
         "" + n.getThreads());
     td();
     createIcon("ui-icon-trash", "node", "delete", createQuery4Node(n));
     createIcon("ui-icon-circle-arrow-n", "node", "up", createQuery4Node(n));
     createIcon("ui-icon-circle-arrow-s", "node", "down", createQuery4Node(n));
     end();
     end();
   }
   end();
   end();
 }
コード例 #2
0
 protected void createAddNodeForm() {
   form().id("addNodeForm").action("/admin/node/save").method("POST");
   input().type("hidden").name("cluster").value(params.get("cluster")).end();
   div()
       .span()
       .text("Host")
       .end()
       .span()
       .input()
       .type("text")
       .id("host")
       .name("host")
       .classAttr("validate[required]")
       .end(2)
       .span()
       .text("Port")
       .end()
       .span()
       .input()
       .type("text")
       .id("port")
       .name("port")
       .size("5")
       .classAttr("validate[required,custom[integer]]")
       .end(2)
       .span()
       .input()
       .value("Add Node")
       .type("submit")
       .classAttr("mb-button")
       .end(2);
   end();
   end();
 }
コード例 #3
0
 private String createQuery4Node(Node n) throws UnsupportedEncodingException {
   return createQueryString(
       "cluster", params.get("cluster"), "host", n.getHost(), "port", "" + n.getPort());
 }