From 9c0fa9d56f092e92ea10f4c904fdfad26f7e3848 Mon Sep 17 00:00:00 2001 From: Scott Dale Date: Sun, 30 Dec 2007 21:07:15 +0000 Subject: new ajax functions for dashboard --- usr/local/www/javascript/index/sajax.js | 48 +++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) (limited to 'usr/local/www/javascript/index') diff --git a/usr/local/www/javascript/index/sajax.js b/usr/local/www/javascript/index/sajax.js index b15aa2c..fd9b00a 100644 --- a/usr/local/www/javascript/index/sajax.js +++ b/usr/local/www/javascript/index/sajax.js @@ -24,6 +24,10 @@ function stats(x) { updateUptime(values[2]); updateState(values[3]); updateTemp(values[4]); + updateDateTime(values[5]); + updateInterfaceStats(values[6]); + updateInterfaces(values[7]); + } function updateMemory(x) @@ -51,6 +55,14 @@ function updateTemp(x) } } +function updateDateTime(x) { + if(!$('datetime')) + return; + if(document.getElementById("datetime") == null) + return; + document.getElementById("datetime").firstChild.data = x; +} + function updateUptime(x) { document.getElementById("uptime").value = x; @@ -61,6 +73,42 @@ function updateState(x) document.getElementById("pfstate").value = x; } +function updateInterfaceStats(x){ + var widget = document.getElementById("interface_statistics-container"); + if (widget.style.display != "none"){ + statistics_split = x.split(","); + var counter = 1; + for (var y=0; y