added last update of workers info
This commit is contained in:
parent
2810fb8b24
commit
81ce678364
@ -2,7 +2,8 @@ package cz.kamma.mining;
|
|||||||
|
|
||||||
public interface Constants {
|
public interface Constants {
|
||||||
|
|
||||||
public static final String APP_VERSION = "v0.7";
|
public static final String APP_VERSION = "v0.8";
|
||||||
public static final String COPYRIGHT = "2021";
|
public static final String COPYRIGHT = "2021";
|
||||||
public static final int DEFAULT_HTTP_TIMEOUT = 2000;
|
public static final int DEFAULT_HTTP_TIMEOUT = 2000;
|
||||||
|
public static final int RELOAD_TIME = 20000;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,8 +1,6 @@
|
|||||||
package cz.kamma.mining.bean;
|
package cz.kamma.mining.bean;
|
||||||
|
|
||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
import java.time.Instant;
|
|
||||||
import java.time.format.DateTimeFormatter;
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
@ -21,6 +19,7 @@ import cz.kamma.mining.vo.KeyValue;
|
|||||||
public class MiningBean {
|
public class MiningBean {
|
||||||
|
|
||||||
public static String updateAll(HttpServletRequest request, HttpServletResponse response) throws Exception {
|
public static String updateAll(HttpServletRequest request, HttpServletResponse response) throws Exception {
|
||||||
|
SimpleDateFormat sdf = new SimpleDateFormat("dd.MM.yyyy HH:mm:ss");
|
||||||
java.lang.System.setProperty("https.protocols", "TLSv1,TLSv1.1,TLSv1.2");
|
java.lang.System.setProperty("https.protocols", "TLSv1,TLSv1.1,TLSv1.2");
|
||||||
List<KeyValue> prices = new ArrayList<>();
|
List<KeyValue> prices = new ArrayList<>();
|
||||||
List<KeyValue> workers = new ArrayList<>();
|
List<KeyValue> workers = new ArrayList<>();
|
||||||
@ -314,7 +313,6 @@ public class MiningBean {
|
|||||||
long time = block.getLong("time");
|
long time = block.getLong("time");
|
||||||
String finder = block.getString("finder");
|
String finder = block.getString("finder");
|
||||||
double amount = block.getDouble("amount");
|
double amount = block.getDouble("amount");
|
||||||
SimpleDateFormat sdf = new SimpleDateFormat("dd.MM.yyyy HH:mm:ss");
|
|
||||||
wi.setValue("" + sdf.format(new Date(time*1000)) + " - "+finder + " - "+amount);
|
wi.setValue("" + sdf.format(new Date(time*1000)) + " - "+finder + " - "+amount);
|
||||||
} else
|
} else
|
||||||
wi.setValue("Unknown");
|
wi.setValue("Unknown");
|
||||||
@ -389,6 +387,11 @@ public class MiningBean {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
KeyValue wi = new KeyValue();
|
||||||
|
wi.setKey("Last Update");
|
||||||
|
wi.setValue("" + sdf.format(new Date(System.currentTimeMillis())));
|
||||||
|
workers.add(0, wi);
|
||||||
|
|
||||||
String res = "<response><prices>#PRICES#</prices><workers>#WORKERS#</workers><pool>#POOL#</pool><network>#NETWORK#</network></response>";
|
String res = "<response><prices>#PRICES#</prices><workers>#WORKERS#</workers><pool>#POOL#</pool><network>#NETWORK#</network></response>";
|
||||||
|
|
||||||
String tmp = "";
|
String tmp = "";
|
||||||
|
|||||||
@ -25,7 +25,7 @@
|
|||||||
<script language=javascript type='text/javascript'>
|
<script language=javascript type='text/javascript'>
|
||||||
function asynchUpdate() {
|
function asynchUpdate() {
|
||||||
AX_asynchUpdate("<%=request.getParameter("ltcapikey")%>", "<%=request.getParameter("dogapikey")%>", "<%=request.getParameter("ltc")%>", "<%=request.getParameter("eth")%>", "<%=request.getParameter("xrp")%>", "<%=request.getParameter("cur")%>");
|
AX_asynchUpdate("<%=request.getParameter("ltcapikey")%>", "<%=request.getParameter("dogapikey")%>", "<%=request.getParameter("ltc")%>", "<%=request.getParameter("eth")%>", "<%=request.getParameter("xrp")%>", "<%=request.getParameter("cur")%>");
|
||||||
setTimeout('asynchUpdate();', 15000);
|
setTimeout('asynchUpdate();', <%=Constants.RELOAD_TIME%>);
|
||||||
}
|
}
|
||||||
asynchUpdate();
|
asynchUpdate();
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user