| ";
else
s = " | ";
s +=
"Server | " +
"Version: " +
san(jso.i.version) + " " +
"Uptime: " +
((u / (24 * 3600)) | 0) + "d " +
(((u % (24 * 3600)) / 3600) | 0) + "h " +
(((u % 3600) / 60) | 0) + "m";
if (jso.i.l1)
s = s + ", Load: " + san(jso.i.l1) + " ";
if (jso.i.l2)
s = s + san(jso.i.l2) + " ";
if (jso.i.l3)
s = s + san(jso.i.l3);
if (jso.i.l1)
s =s + "";
for (n = 0; n < jso.files.length; n++) {
s += " " + san(jso.files[n].path) + ": " + san(jso.files[n].val);
}
s += " | ";
for (ci = 0; ci < jso.i.contexts.length; ci++) {
if (parseInt(jso.i.contexts[ci].deprecated) == 0)
s += " | " +
"Active Context | ";
else
s += " | | " +
"Deprecated Context " + ci + " | ";
u = parseInt(san(jso.i.contexts[ci].context_uptime));
s += "Uptime: " +
((u / (24 * 3600)) | 0) + "d " +
(((u % (24 * 3600)) / 3600) | 0) + "h " +
(((u % 3600) / 60) | 0) + "m";
s = s +
" " +
"Listening wsi: " + san(jso.i.contexts[ci].listen_wsi) + ", " +
"Current wsi alive: " + (parseInt(san(jso.i.contexts[ci].wsi_alive)) -
parseInt(san(jso.i.contexts[ci].listen_wsi))) + " " +
"Total Rx: " + humanize(san(jso.i.contexts[ci].rx)) +", " +
"Total Tx: " + humanize(san(jso.i.contexts[ci].tx)) +" " +
"CONNECTIONS: HTTP/1.x: " + san(jso.i.contexts[ci].h1_conn) +", " +
"Websocket: " + san(jso.i.contexts[ci].ws_upg) +", " +
"H2 upgrade: " + san(jso.i.contexts[ci].h2_upg) +", " +
"H2 ALPN: " + san(jso.i.contexts[ci].h2_alpn) +", " +
"Rejected: " + san(jso.i.contexts[ci].rejected) +" " +
"TRANSACTIONS: HTTP/1.x: " + san(jso.i.contexts[ci].h1_trans) + ", " +
"H2: " + san(jso.i.contexts[ci].h2_trans) +", " +
"Total H2 substreams: " + san(jso.i.contexts[ci].h2_subs) +" " +
"CGI: alive: " + san(jso.i.contexts[ci].cgi_alive) + ", " +
"spawned: " + san(jso.i.contexts[ci].cgi_spawned) +
"";
for (n = 0; n < jso.i.contexts[ci].pt.length; n++) {
if (parseInt(jso.i.contexts[ci].deprecated) == 0)
s += " | service thread " + (n + 1);
else
s += " | | service thread " + (n + 1);
s += " | " +
"fds: " + san(jso.i.contexts[ci].pt[n].fds_count) + " / " +
san(jso.i.contexts[ci].pt_fd_max) + ", ";
s = s + "ah pool: " + san(jso.i.contexts[ci].pt[n].ah_pool_inuse) + " / " +
san(jso.i.contexts[ci].ah_pool_max) + ", " +
"ah waiting list: " + san(jso.i.contexts[ci].pt[n].ah_wait_list);
s = s + " | ";
}
for (n = 0; n < jso.i.contexts[ci].vhosts.length; n++) {
if (parseInt(jso.i.contexts[ci].deprecated) == 0)
s += " | vhost " + (n + 1);
else
s += " | | vhost " + (n + 1);
s += " | ";
if (jso.i.contexts[ci].vhosts[n].use_ssl == '1')
s = s + "https://";
else
s = s + "http://";
s = s + san(jso.i.contexts[ci].vhosts[n].name) + ":" +
san(jso.i.contexts[ci].vhosts[n].port) + "";
if (jso.i.contexts[ci].vhosts[n].sts == '1')
s = s + " (STS)";
s = s +" " +
"Total Rx: " + humanize(san(jso.i.contexts[ci].vhosts[n].rx)) +", " +
"Total Tx: " + humanize(san(jso.i.contexts[ci].vhosts[n].tx)) +" " +
"CONNECTIONS: HTTP/1.x: " + san(jso.i.contexts[ci].vhosts[n].h1_conn) +", " +
"Websocket: " + san(jso.i.contexts[ci].vhosts[n].ws_upg) +", " +
"H2 upgrade: " + san(jso.i.contexts[ci].vhosts[n].h2_upg) +", " +
"H2 ALPN: " + san(jso.i.contexts[ci].vhosts[n].h2_alpn) +", " +
"Rejected: " + san(jso.i.contexts[ci].vhosts[n].rejected) +" " +
"TRANSACTIONS: HTTP/1.x: " + san(jso.i.contexts[ci].vhosts[n].h1_trans) + ", " +
"H2: " + san(jso.i.contexts[ci].vhosts[n].h2_trans) +", " +
"Total H2 substreams: " + san(jso.i.contexts[ci].vhosts[n].h2_subs) +" " +
"Mountpoint | Origin | Cache Policy | ";
var m;
for (m = 0; m < jso.i.contexts[ci].vhosts[n].mounts.length; m++) {
s = s + "";
s = s + "" + san(jso.i.contexts[ci].vhosts[n].mounts[m].mountpoint) +
" | " +
san(jso.i.contexts[ci].vhosts[n].mounts[m].origin) +
" | ";
if (parseInt(san(jso.i.contexts[ci].vhosts[n].mounts[m].cache_max_age)))
s = s + "max-age: " +
san(jso.i.contexts[ci].vhosts[n].mounts[m].cache_max_age) +
", reuse: " +
san(jso.i.contexts[ci].vhosts[n].mounts[m].cache_reuse) +
", reval: " +
san(jso.i.contexts[ci].vhosts[n].mounts[m].cache_revalidate) +
", inter: " +
san(jso.i.contexts[ci].vhosts[n].mounts[m].cache_intermediaries);
s = s + " | "
}
s = s + " ";
s = s + " | ";
}
s += " | ";
} // context
s = s + " ";
document.getElementById("conninfo").innerHTML = s;
}
socket_status.onclose = function(){
document.getElementById("title").innerHTML = "Server Status (Disconnected)";
lws_gray_out(true,{'zindex':'499'});
}
} catch(exception) {
alert('Error' + exception);
}
}
/* stuff that has to be delayed until all the page assets are loaded */
window.addEventListener("load", function() {
lws_gray_out(true,{'zindex':'499'});
ws_open_server_status();
}, false);
})();
|