resp.headers["Content-Type"] = "application/json";
resp.body=my_json.dump();
}
+ else if(command=="dynblocklist") {
+ resp.status=200;
+
+ Json::object obj;
+ auto slow = g_dynblockNMG.getCopy();
+ for(const auto& e: slow) {
+ obj.insert({e->first.toString(), e->second});
+ }
+ Json my_json=obj;
+
+ resp.headers["Content-Type"] = "application/json";
+ resp.body=my_json.dump();
+ }
else if(req.url.path=="/servers/localhost") {
resp.status=200;
resp.body = callback + "(" + resp.body + ");";
}
-
-
std::ostringstream ofs;
ofs << resp;
string done;
return;
// updateRingBuffers();
+ $.ajax({ url: 'jsonstat?command=dynblocklist', type: 'GET', dataType: 'json',
+ success: function(data) {
+ var bouw="<table><tr align=left><th>Netmask</th><th align=left>Reason</th></tr>";
+ $.each(data, function(a,b) {
+ bouw=bouw+("<tr><td>"+a+"</td><td>"+b+"</td></tr>");
+ });
+ bouw=bouw+"</table>";
+ $("#dynblock").html(bouw);
+
+ }});
+
};