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 createSessionsTable(List<Session> sessions) { table().attr("cellpadding", "0", "cellspacing", "0", "border", "0", "class", "display"); thead(); tr(); createThs("Id", "Last Used"); end(); end(); tbody(); for (Session s : sessions) { tr(); createTds(s.getId(), formatDurationHMS(System.currentTimeMillis() - s.getLastUsed())); end(); } end(); end(); }