Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 3 additions & 10 deletions share/status.template.html
Original file line number Diff line number Diff line change
Expand Up @@ -818,17 +818,10 @@ <h1>
return out;
}

function vtsGetData() {
async function vtsGetData() {
var monitor = document.getElementById('monitor');
var request = new XMLHttpRequest;
request.onload = function() {
if (this.status != 200) {
return;
}
monitor.innerHTML = template(JSON.parse(this.responseText));
}
request.open('GET', vtsStatusURI);
request.send();
var response = await fetch(vtsStatusURI);
monitor.innerHTML = template(JSON.parse(await response.text()));
};

function vtsSetInterval(msec) {
Expand Down
88 changes: 37 additions & 51 deletions src/ngx_http_vhost_traffic_status_module_html.h
Original file line number Diff line number Diff line change
Expand Up @@ -4369,55 +4369,41 @@
"\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x72\x65\x74\x75" \
"\x72\x6e\x20\x6f\x75\x74\x3b\x0a\x20\x20\x20\x20\x20\x20\x20\x20" \
"\x20\x20\x20\x20\x7d\x0a\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20" \
"\x20\x20\x20\x66\x75\x6e\x63\x74\x69\x6f\x6e\x20\x76\x74\x73\x47" \
"\x65\x74\x44\x61\x74\x61\x28\x29\x20\x7b\x0a\x20\x20\x20\x20\x20" \
"\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x76\x61\x72\x20\x6d" \
"\x6f\x6e\x69\x74\x6f\x72\x20\x3d\x20\x64\x6f\x63\x75\x6d\x65\x6e" \
"\x74\x2e\x67\x65\x74\x45\x6c\x65\x6d\x65\x6e\x74\x42\x79\x49\x64" \
"\x28\x27\x6d\x6f\x6e\x69\x74\x6f\x72\x27\x29\x3b\x0a\x20\x20\x20" \
"\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x76\x61\x72" \
"\x20\x72\x65\x71\x75\x65\x73\x74\x20\x3d\x20\x6e\x65\x77\x20\x58" \
"\x4d\x4c\x48\x74\x74\x70\x52\x65\x71\x75\x65\x73\x74\x3b\x0a\x20" \
"\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x72" \
"\x65\x71\x75\x65\x73\x74\x2e\x6f\x6e\x6c\x6f\x61\x64\x20\x3d\x20" \
"\x66\x75\x6e\x63\x74\x69\x6f\x6e\x28\x29\x20\x7b\x0a\x20\x20\x20" \
"\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20" \
"\x20\x69\x66\x20\x28\x74\x68\x69\x73\x2e\x73\x74\x61\x74\x75\x73" \
"\x20\x21\x3d\x20\x32\x30\x30\x29\x20\x7b\x0a\x20\x20\x20\x20\x20" \
"\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20" \
"\x20\x20\x20\x72\x65\x74\x75\x72\x6e\x3b\x0a\x20\x20\x20\x20\x20" \
"\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x7d" \
"\x20\x20\x20\x61\x73\x79\x6e\x63\x20\x66\x75\x6e\x63\x74\x69\x6f" \
"\x6e\x20\x76\x74\x73\x47\x65\x74\x44\x61\x74\x61\x28\x29\x20\x7b" \
"\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20" \
"\x20\x20\x20\x20\x20\x6d\x6f\x6e\x69\x74\x6f\x72\x2e\x69\x6e\x6e" \
"\x65\x72\x48\x54\x4d\x4c\x20\x3d\x20\x74\x65\x6d\x70\x6c\x61\x74" \
"\x65\x28\x4a\x53\x4f\x4e\x2e\x70\x61\x72\x73\x65\x28\x74\x68\x69" \
"\x73\x2e\x72\x65\x73\x70\x6f\x6e\x73\x65\x54\x65\x78\x74\x29\x29" \
"\x3b\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20" \
"\x20\x20\x7d\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20" \
"\x20\x20\x20\x20\x72\x65\x71\x75\x65\x73\x74\x2e\x6f\x70\x65\x6e" \
"\x28\x27\x47\x45\x54\x27\x2c\x20\x76\x74\x73\x53\x74\x61\x74\x75" \
"\x73\x55\x52\x49\x29\x3b\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20" \
"\x20\x20\x20\x20\x20\x20\x20\x72\x65\x71\x75\x65\x73\x74\x2e\x73" \
"\x65\x6e\x64\x28\x29\x3b\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20" \
"\x20\x20\x20\x7d\x3b\x0a\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20" \
"\x20\x20\x20\x66\x75\x6e\x63\x74\x69\x6f\x6e\x20\x76\x74\x73\x53" \
"\x65\x74\x49\x6e\x74\x65\x72\x76\x61\x6c\x28\x6d\x73\x65\x63\x29" \
"\x20\x7b\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20" \
"\x20\x20\x20\x63\x6c\x65\x61\x72\x49\x6e\x74\x65\x72\x76\x61\x6c" \
"\x28\x76\x74\x73\x55\x70\x64\x61\x74\x65\x29\x3b\x0a\x20\x20\x20" \
"\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x76\x74\x73" \
"\x55\x70\x64\x61\x74\x65\x20\x3d\x20\x73\x65\x74\x49\x6e\x74\x65" \
"\x72\x76\x61\x6c\x28\x76\x74\x73\x47\x65\x74\x44\x61\x74\x61\x2c" \
"\x20\x6d\x73\x65\x63\x29\x3b\x0a\x20\x20\x20\x20\x20\x20\x20\x20" \
"\x20\x20\x20\x20\x7d\x0a\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20" \
"\x20\x20\x20\x64\x6f\x63\x75\x6d\x65\x6e\x74\x2e\x67\x65\x74\x45" \
"\x6c\x65\x6d\x65\x6e\x74\x42\x79\x49\x64\x28\x27\x6a\x73\x6f\x6e" \
"\x55\x72\x69\x27\x29\x2e\x68\x72\x65\x66\x20\x3d\x20\x76\x74\x73" \
"\x53\x74\x61\x74\x75\x73\x55\x52\x49\x3b\x0a\x0a\x20\x20\x20\x20" \
"\x20\x20\x20\x20\x20\x20\x20\x20\x76\x74\x73\x47\x65\x74\x44\x61" \
"\x74\x61\x28\x29\x3b\x0a\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20" \
"\x20\x20\x20\x76\x74\x73\x53\x65\x74\x49\x6e\x74\x65\x72\x76\x61" \
"\x6c\x28\x76\x74\x73\x55\x70\x64\x61\x74\x65\x49\x6e\x74\x65\x72" \
"\x76\x61\x6c\x29\x3b\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x3c\x2f" \
"\x73\x63\x72\x69\x70\x74\x3e\x0a\x20\x20\x20\x20\x3c\x2f\x62\x6f" \
"\x64\x79\x3e\x0a\x3c\x2f\x68\x74\x6d\x6c\x3e\x0a"
"\x20\x76\x61\x72\x20\x6d\x6f\x6e\x69\x74\x6f\x72\x20\x3d\x20\x64" \
"\x6f\x63\x75\x6d\x65\x6e\x74\x2e\x67\x65\x74\x45\x6c\x65\x6d\x65" \
"\x6e\x74\x42\x79\x49\x64\x28\x27\x6d\x6f\x6e\x69\x74\x6f\x72\x27" \
"\x29\x3b\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20" \
"\x20\x20\x20\x76\x61\x72\x20\x72\x65\x73\x70\x6f\x6e\x73\x65\x20" \
"\x3d\x20\x61\x77\x61\x69\x74\x20\x66\x65\x74\x63\x68\x28\x76\x74" \
"\x73\x53\x74\x61\x74\x75\x73\x55\x52\x49\x29\x3b\x0a\x20\x20\x20" \
"\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x6d\x6f\x6e" \
"\x69\x74\x6f\x72\x2e\x69\x6e\x6e\x65\x72\x48\x54\x4d\x4c\x20\x3d" \
"\x20\x74\x65\x6d\x70\x6c\x61\x74\x65\x28\x4a\x53\x4f\x4e\x2e\x70" \
"\x61\x72\x73\x65\x28\x61\x77\x61\x69\x74\x20\x72\x65\x73\x70\x6f" \
"\x6e\x73\x65\x2e\x74\x65\x78\x74\x28\x29\x29\x29\x3b\x0a\x20\x20" \
"\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x7d\x3b\x0a\x0a\x20\x20" \
"\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x66\x75\x6e\x63\x74\x69" \
"\x6f\x6e\x20\x76\x74\x73\x53\x65\x74\x49\x6e\x74\x65\x72\x76\x61" \
"\x6c\x28\x6d\x73\x65\x63\x29\x20\x7b\x0a\x20\x20\x20\x20\x20\x20" \
"\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x63\x6c\x65\x61\x72\x49" \
"\x6e\x74\x65\x72\x76\x61\x6c\x28\x76\x74\x73\x55\x70\x64\x61\x74" \
"\x65\x29\x3b\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20" \
"\x20\x20\x20\x20\x76\x74\x73\x55\x70\x64\x61\x74\x65\x20\x3d\x20" \
"\x73\x65\x74\x49\x6e\x74\x65\x72\x76\x61\x6c\x28\x76\x74\x73\x47" \
"\x65\x74\x44\x61\x74\x61\x2c\x20\x6d\x73\x65\x63\x29\x3b\x0a\x20" \
"\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x7d\x0a\x0a\x20\x20" \
"\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x64\x6f\x63\x75\x6d\x65" \
"\x6e\x74\x2e\x67\x65\x74\x45\x6c\x65\x6d\x65\x6e\x74\x42\x79\x49" \
"\x64\x28\x27\x6a\x73\x6f\x6e\x55\x72\x69\x27\x29\x2e\x68\x72\x65" \
"\x66\x20\x3d\x20\x76\x74\x73\x53\x74\x61\x74\x75\x73\x55\x52\x49" \
"\x3b\x0a\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x76" \
"\x74\x73\x47\x65\x74\x44\x61\x74\x61\x28\x29\x3b\x0a\x0a\x20\x20" \
"\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x76\x74\x73\x53\x65\x74" \
"\x49\x6e\x74\x65\x72\x76\x61\x6c\x28\x76\x74\x73\x55\x70\x64\x61" \
"\x74\x65\x49\x6e\x74\x65\x72\x76\x61\x6c\x29\x3b\x0a\x20\x20\x20" \
"\x20\x20\x20\x20\x20\x3c\x2f\x73\x63\x72\x69\x70\x74\x3e\x0a\x20" \
"\x20\x20\x20\x3c\x2f\x62\x6f\x64\x79\x3e\x0a\x3c\x2f\x68\x74\x6d" \
"\x6c\x3e\x0a"
Loading