From 87af9d7482a493cd57b17e9eede9ee0b59f17d71 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Orsini Date: Mon, 19 Sep 2011 18:30:08 +0000 Subject: [PATCH] fixed IE8 bug (page title change not allowed). dynamic refresh of the graph. --- NEWS | 3 +++ www/details.html | 21 +++++++++++++-------- www/psensor.js | 11 ++++++++++- www/style.css | 4 +++- 4 files changed, 29 insertions(+), 10 deletions(-) diff --git a/NEWS b/NEWS index dd7dcd3..e6622a2 100644 --- a/NEWS +++ b/NEWS @@ -4,6 +4,9 @@ ** psensor-server/web interface: automatic update of the monitoring page. ** psensor-server/web interface: improved styling and navigation. ** psensor-server/web interface: added graph for cpu usage. +** psensor-server/web interface: fixed IE8 bug (page title change not + allowed). +** psensor-server/web interface: dynamic refresh of the graph. * v0.6.2.10 ** psensor-server: added network, cpu load and memory information in diff --git a/www/details.html b/www/details.html index 52725b5..83a750a 100644 --- a/www/details.html +++ b/www/details.html @@ -1,7 +1,7 @@ - Sensor + Sensor diff --git a/www/psensor.js b/www/psensor.js index 01ab6b3..b002c41 100644 --- a/www/psensor.js +++ b/www/psensor.js @@ -100,11 +100,19 @@ function update_chart(chart_id, title, data) { var measures, data_chart, date, entry; var style; + $("#"+chart_id).html(""); + measures = data["measures"]; data_chart = []; + $("h1").html(""); $("h1").append(data["name"]); - $("title").append(data["name"]); + + try { + $("title").html(data["name"]); + } catch(ignore) { + // IE8 doesn't allow to modify the page title + } $.each(measures, function(i, item) { value = item["value"]; @@ -146,6 +154,7 @@ function update_chart(chart_id, title, data) { } ] }; + $.jqplot (chart_id, [data_chart], style); } diff --git a/www/style.css b/www/style.css index b1bc42b..3fbf003 100644 --- a/www/style.css +++ b/www/style.css @@ -79,10 +79,12 @@ td { padding: 0.25em 0.25em 0em 0.25em; } -.chart { +#chart { color: #000; font-style: normal; font-weight: normal; + width: 100%; + height: 300px; } ul { -- 2.7.4