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(); }
protected void createProxyRulesTable() throws UnsupportedEncodingException { table().attr("cellpadding", "0", "cellspacing", "0", "border", "0", "class", "display"); thead(); tr(); createThs("Name", "Listen Port", "Actions"); end(); end(); tbody(); for (ProxyRule rule : getProxyRules()) { tr(); td(); createLink( rule.toString(), "prule", "show", createQueryString("name", RuleUtil.getRuleIdentifier(rule))); end(); createTds("" + rule.getKey().getPort()); td().a() .href( "/admin/rule/delete?name=" + URLEncoder.encode(RuleUtil.getRuleIdentifier(rule), "UTF-8")) .span() .classAttr("ui-icon ui-icon-trash") .end(3); end(); } end(); end(); }
protected void createClustersTable() throws UnsupportedEncodingException { table().attr("cellpadding", "0", "cellspacing", "0", "border", "0", "class", "display"); thead(); tr(); createThs("Name", "#Nodes", "Health"); end(); end(); tbody(); for (Cluster c : router.getClusterManager().getClusters()) { tr(); td(); createLink(c.getName(), "clusters", "show", createQueryString("cluster", c.getName())); end(); createTds( String.valueOf(router.getClusterManager().getAllNodesByCluster(c.getName()).size()), getFormatedHealth(c.getName())); end(); } end(); end(); }