summaryrefslogtreecommitdiffstats
path: root/usr/local/www/javascript/index/sajax.js
blob: 110812dec7ebcc20d3dcce66a6c41753e59d3cd0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
function updateMeters()
{
	x_cpu_usage(updateCPU);
	x_mem_usage(updateMemory);
	x_get_uptime(updateUptime);
	x_get_pfstate(updateState);

	window.setTimeout('updateMeters()', 5000);
}

function updateMemory(x)
{
	document.getElementById("memusagemeter").value = x + '%';

	document.getElementById("memwidtha").style.width = x + 'px';
	document.getElementById("memwidthb").style.width = (100 - x) + 'px';
}

function updateCPU(x)
{
	document.getElementById("cpumeter").value = x + '%';
	
	document.getElementById("cpuwidtha").style.width = x + 'px';
	document.getElementById("cpuwidthb").style.width = (100 - x) + 'px';
}

function updateUptime(x)
{
	document.getElementById("uptime").value = x;
}

function updateState(x)
{
	document.getElementById("pfstate").value = x;
}

window.setTimeout('updateMeters()', 5000);
OpenPOWER on IntegriCloud