int numberOfNeverConnected, int numberOfDisabled, int numberOfBursting, int numberOfListening,
int numberOfListenOnly, int numberOfSeedServers, int numberOfSeedClients, int numberOfRoutingDisabled,
int numberOfClockProblem, int numberOfConnError, int numberOfDisconnecting, int numberOfNoLoadStats, Node node) {
peerStatsInfobox.addChild("div", "class", "infobox-header", l10n("peerStatsTitle"));
HTMLNode peerStatsContent = peerStatsInfobox.addChild("div", "class", "infobox-content");
HTMLNode peerStatsList = peerStatsContent.addChild("ul");
if (numberOfConnected > 0) {
HTMLNode peerStatsConnectedListItem = peerStatsList.addChild("li").addChild("span");
peerStatsConnectedListItem.addChild("span", new String[] { "class", "title", "style" },
new String[] { "peer_connected", l10nDark("connected"), "border-bottom: 1px dotted; cursor: help;" }, l10nDark("connectedShort"));
peerStatsConnectedListItem.addChild("span", ":\u00a0" + numberOfConnected);
}
if (numberOfRoutingBackedOff > 0) {
HTMLNode peerStatsRoutingBackedOffListItem = peerStatsList.addChild("li").addChild("span");
peerStatsRoutingBackedOffListItem.addChild("span", new String[] { "class", "title", "style" },
new String[] { "peer_backed_off", l10nDark(advancedModeEnabled ? "backedOff" : "busy"),
"border-bottom: 1px dotted; cursor: help;" }, l10nDark((advancedModeEnabled ? "backedOff" : "busy")+"Short"));
peerStatsRoutingBackedOffListItem.addChild("span", ":\u00a0" + numberOfRoutingBackedOff);
}
if (numberOfTooNew > 0) {
HTMLNode peerStatsTooNewListItem = peerStatsList.addChild("li").addChild("span");
peerStatsTooNewListItem.addChild("span", new String[] { "class", "title", "style" },
new String[] { "peer_too_new", l10nDark("tooNew"), "border-bottom: 1px dotted; cursor: help;" }, l10nDark("tooNewShort"));
peerStatsTooNewListItem.addChild("span", ":\u00a0" + numberOfTooNew);
}
if (numberOfTooOld > 0) {
HTMLNode peerStatsTooOldListItem = peerStatsList.addChild("li").addChild("span");
peerStatsTooOldListItem.addChild("span", new String[] { "class", "title", "style" },
new String[] { "peer_too_old", l10nDark("tooOld"), "border-bottom: 1px dotted; cursor: help;" }, l10nDark("tooOldShort"));
peerStatsTooOldListItem.addChild("span", ":\u00a0" + numberOfTooOld);
}
if (numberOfDisconnected > 0) {
HTMLNode peerStatsDisconnectedListItem = peerStatsList.addChild("li").addChild("span");
peerStatsDisconnectedListItem.addChild("span", new String[] { "class", "title", "style" },
new String[] { "peer_disconnected", l10nDark("notConnected"), "border-bottom: 1px dotted; cursor: help;" }, l10nDark("notConnectedShort"));
peerStatsDisconnectedListItem.addChild("span", ":\u00a0" + numberOfDisconnected);
}
if (numberOfNeverConnected > 0) {
HTMLNode peerStatsNeverConnectedListItem = peerStatsList.addChild("li").addChild("span");
peerStatsNeverConnectedListItem.addChild("span", new String[] { "class", "title", "style" },
new String[] { "peer_never_connected", l10nDark("neverConnected"), "border-bottom: 1px dotted; cursor: help;" }, l10nDark("neverConnectedShort"));
peerStatsNeverConnectedListItem.addChild("span", ":\u00a0" + numberOfNeverConnected);
}
if (numberOfDisabled > 0) {
HTMLNode peerStatsDisabledListItem = peerStatsList.addChild("li").addChild("span");
peerStatsDisabledListItem.addChild("span", new String[] { "class", "title", "style" },
new String[] { "peer_disabled", l10nDark("disabled"), "border-bottom: 1px dotted; cursor: help;" }, l10nDark("disabledShort"));
peerStatsDisabledListItem.addChild("span", ":\u00a0" + numberOfDisabled);
}
if (numberOfBursting > 0) {
HTMLNode peerStatsBurstingListItem = peerStatsList.addChild("li").addChild("span");
peerStatsBurstingListItem.addChild("span", new String[] { "class", "title", "style" },
new String[] { "peer_bursting", l10nDark("bursting"), "border-bottom: 1px dotted; cursor: help;" }, l10nDark("burstingShort"));
peerStatsBurstingListItem.addChild("span", ":\u00a0" + numberOfBursting);
}
if (numberOfListening > 0) {
HTMLNode peerStatsListeningListItem = peerStatsList.addChild("li").addChild("span");
peerStatsListeningListItem.addChild("span", new String[] { "class", "title", "style" },
new String[] { "peer_listening", l10nDark("listening"), "border-bottom: 1px dotted; cursor: help;" }, l10nDark("listeningShort"));
peerStatsListeningListItem.addChild("span", ":\u00a0" + numberOfListening);
}
if (numberOfListenOnly > 0) {
HTMLNode peerStatsListenOnlyListItem = peerStatsList.addChild("li").addChild("span");
peerStatsListenOnlyListItem.addChild("span", new String[] { "class", "title", "style" },
new String[] { "peer_listen_only", l10nDark("listenOnly"), "border-bottom: 1px dotted; cursor: help;" }, l10nDark("listenOnlyShort"));
peerStatsListenOnlyListItem.addChild("span", ":\u00a0" + numberOfListenOnly);
}
if (numberOfClockProblem > 0) {
HTMLNode peerStatsRoutingDisabledListItem = peerStatsList.addChild("li").addChild("span");
peerStatsRoutingDisabledListItem.addChild("span", new String[] { "class", "title", "style" }, new String[] { "peer_clock_problem", l10nDark("clockProblem"), "border-bottom: 1px dotted; cursor: help;" }, l10nDark("clockProblemShort"));
peerStatsRoutingDisabledListItem.addChild("span", ":\u00a0" + numberOfClockProblem);
}
if (numberOfConnError > 0) {
HTMLNode peerStatsRoutingDisabledListItem = peerStatsList.addChild("li").addChild("span");
peerStatsRoutingDisabledListItem.addChild("span", new String[] { "class", "title", "style" }, new String[] { "peer_routing_disabled", l10nDark("connError"), "border-bottom: 1px dotted; cursor: help;" }, l10nDark("connErrorShort"));
peerStatsRoutingDisabledListItem.addChild("span", ":\u00a0" + numberOfClockProblem);
}
if (numberOfDisconnecting > 0) {
HTMLNode peerStatsListenOnlyListItem = peerStatsList.addChild("li").addChild("span");
peerStatsListenOnlyListItem.addChild("span", new String[] { "class", "title", "style" }, new String[] { "peer_disconnecting", l10nDark("disconnecting"), "border-bottom: 1px dotted; cursor: help;" }, l10nDark("disconnectingShort"));
peerStatsListenOnlyListItem.addChild("span", ":\u00a0" + numberOfDisconnecting);
}
if (numberOfSeedServers > 0) {
HTMLNode peerStatsSeedServersListItem = peerStatsList.addChild("li").addChild("span");
peerStatsSeedServersListItem.addChild("span", new String[] { "class", "title", "style" },
new String[] { "peer_listening" /* FIXME */, l10nDark("seedServers"), "border-bottom: 1px dotted; cursor: help;" }, l10nDark("seedServersShort"));
peerStatsSeedServersListItem.addChild("span", ":\u00a0" + numberOfSeedServers);
}
if (numberOfSeedClients > 0) {
HTMLNode peerStatsSeedClientsListItem = peerStatsList.addChild("li").addChild("span");
peerStatsSeedClientsListItem.addChild("span", new String[] { "class", "title", "style" },
new String[] { "peer_listening" /* FIXME */, l10nDark("seedClients"), "border-bottom: 1px dotted; cursor: help;" }, l10nDark("seedClientsShort"));
peerStatsSeedClientsListItem.addChild("span", ":\u00a0" + numberOfSeedClients);
}
if (numberOfRoutingDisabled > 0) {
HTMLNode peerStatsRoutingDisabledListItem = peerStatsList.addChild("li").addChild("span");
peerStatsRoutingDisabledListItem.addChild("span", new String[] { "class", "title", "style" }, new String[] { "peer_routing_disabled", l10nDark("routingDisabled"), "border-bottom: 1px dotted; cursor: help;" }, l10nDark("routingDisabledShort"));
peerStatsRoutingDisabledListItem.addChild("span", ":\u00a0" + numberOfRoutingDisabled);
}
if (numberOfNoLoadStats > 0) {
HTMLNode peerStatsNoLoadStatsListItem = peerStatsList.addChild("li").addChild("span");
peerStatsNoLoadStatsListItem.addChild("span", new String[] { "class", "title", "style" }, new String[] { "peer_no_load_stats", l10nDark("noLoadStats"), "border-bottom: 1px dotted; cursor: help;" }, l10nDark("noLoadStatsShort"));
peerStatsNoLoadStatsListItem.addChild("span", ":\u00a0" + numberOfNoLoadStats);
}
OpennetManager om = node.getOpennet();
if(om != null) {
peerStatsList.addChild("li", l10n("maxTotalPeers")+": "+om.getNumberOfConnectedPeersToAimIncludingDarknet());
peerStatsList.addChild("li", l10n("maxOpennetPeers")+": "+om.getNumberOfConnectedPeersToAim());