mirror of https://github.com/zlatinb/muwire
move connection count refreshing into the header
parent
54b8628435
commit
06bd9c80e8
|
@ -31,21 +31,6 @@
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
|
||||||
function refreshConnectionsCount() {
|
|
||||||
var xmlhttp = new XMLHttpRequest();
|
|
||||||
xmlhttp.onreadystatechange = function() {
|
|
||||||
if (this.readyState == 4 && this.status == 200) {
|
|
||||||
var connections = this.responseXML.getElementsByTagName("Connections");
|
|
||||||
var count = connections[0].childNodes[0].nodeValue
|
|
||||||
var connectionCountSpan = document.getElementById("connectionsCount");
|
|
||||||
var countString = "Connections: "+count;
|
|
||||||
connectionCountSpan.innerHTML = countString;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
xmlhttp.open("GET", "/MuWire/Search?section=connectionsCount", true);
|
|
||||||
xmlhttp.send();
|
|
||||||
}
|
|
||||||
|
|
||||||
class Downloader {
|
class Downloader {
|
||||||
constructor(xmlNode) {
|
constructor(xmlNode) {
|
||||||
this.name = xmlNode.getElementsByTagName("Name")[0].childNodes[0].nodeValue;
|
this.name = xmlNode.getElementsByTagName("Name")[0].childNodes[0].nodeValue;
|
||||||
|
@ -107,8 +92,6 @@
|
||||||
xmlhttp.send();
|
xmlhttp.send();
|
||||||
}
|
}
|
||||||
|
|
||||||
setInterval(refreshConnectionsCount, 3000);
|
|
||||||
setTimeout(refreshConnectionsCount, 1);
|
|
||||||
setInterval(refreshDownloader, 3000)
|
setInterval(refreshDownloader, 3000)
|
||||||
setTimeout(refreshDownloader,1);
|
setTimeout(refreshDownloader,1);
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -184,21 +184,6 @@
|
||||||
var lastXML = null;
|
var lastXML = null;
|
||||||
var infoHash = null;
|
var infoHash = null;
|
||||||
|
|
||||||
function refreshConnectionsCount() {
|
|
||||||
var xmlhttp = new XMLHttpRequest();
|
|
||||||
xmlhttp.onreadystatechange = function() {
|
|
||||||
if (this.readyState == 4 && this.status == 200) {
|
|
||||||
var connections = this.responseXML.getElementsByTagName("Connections");
|
|
||||||
var count = connections[0].childNodes[0].nodeValue
|
|
||||||
var connectionCountSpan = document.getElementById("connectionsCount");
|
|
||||||
var countString = "Connections: "+count;
|
|
||||||
connectionCountSpan.innerHTML = countString;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
xmlhttp.open("GET", "/MuWire/Search?section=connectionsCount", true);
|
|
||||||
xmlhttp.send();
|
|
||||||
}
|
|
||||||
|
|
||||||
function updateSender(senderName) {
|
function updateSender(senderName) {
|
||||||
sender = senderName;
|
sender = senderName;
|
||||||
|
|
||||||
|
@ -402,9 +387,6 @@
|
||||||
setInterval(refreshGroupByFile, 3000);
|
setInterval(refreshGroupByFile, 3000);
|
||||||
setTimeout(refreshGroupByFile, 1);
|
setTimeout(refreshGroupByFile, 1);
|
||||||
<% } %>
|
<% } %>
|
||||||
|
|
||||||
setInterval(refreshConnectionsCount, 3000);
|
|
||||||
setTimeout(refreshConnectionsCount, 1);
|
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
|
@ -6,8 +6,27 @@
|
||||||
<div class="subtitle">
|
<div class="subtitle">
|
||||||
${persona}
|
${persona}
|
||||||
<br>
|
<br>
|
||||||
Connections: <%=connectionCounter.getConnections() %>
|
<span id="connectionsCount">Connections : 0</span>
|
||||||
<br>
|
<br>
|
||||||
|
<script>
|
||||||
|
function refreshConnectionsCount() {
|
||||||
|
var xmlhttp = new XMLHttpRequest();
|
||||||
|
xmlhttp.onreadystatechange = function() {
|
||||||
|
if (this.readyState == 4 && this.status == 200) {
|
||||||
|
var connections = this.responseXML.getElementsByTagName("Connections");
|
||||||
|
var count = connections[0].childNodes[0].nodeValue
|
||||||
|
var connectionCountSpan = document.getElementById("connectionsCount");
|
||||||
|
var countString = "Connections: "+count;
|
||||||
|
connectionCountSpan.innerHTML = countString;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
xmlhttp.open("GET", "/MuWire/Search?section=connectionsCount", true);
|
||||||
|
xmlhttp.send();
|
||||||
|
}
|
||||||
|
|
||||||
|
setInterval(refreshConnectionsCount, 3000);
|
||||||
|
setTimeout(refreshConnectionsCount, 1);
|
||||||
|
</script>
|
||||||
<% if ("Home".equals(pagetitle)) { %>
|
<% if ("Home".equals(pagetitle)) { %>
|
||||||
<form action="/MuWire/Search" method="post">
|
<form action="/MuWire/Search" method="post">
|
||||||
<input type="text" name="search" />
|
<input type="text" name="search" />
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
<%
|
<%
|
||||||
MuWireClient client = (MuWireClient) application.getAttribute("mwClient");
|
MuWireClient client = (MuWireClient) application.getAttribute("mwClient");
|
||||||
ConnectionCounter connectionCounter = (ConnectionCounter) client.getServletContext().getAttribute("connectionCounter");
|
|
||||||
String persona = client.getCore().getMe().getHumanReadableName();
|
String persona = client.getCore().getMe().getHumanReadableName();
|
||||||
String version = client.getCore().getVersion();
|
String version = client.getCore().getVersion();
|
||||||
%>
|
%>
|
||||||
|
|
Loading…
Reference in New Issue