X-Git-Url: https://git.wpitchoune.net/gitweb/?a=blobdiff_plain;f=www%2Fpsensor.js;h=3e902853faa99053eb469f835de90d936cdcdd7c;hb=c1e20f2631a1249720e9c75d753eacfcb0f6c7b9;hp=01ab6b3a4aec4b9df9b70acc3cbe32d1f65ffa1c;hpb=c2072c6718098b3f620b6a7ecfb1683f5f7f690d;p=psensor.git diff --git a/www/psensor.js b/www/psensor.js index 01ab6b3..3e90285 100644 --- a/www/psensor.js +++ b/www/psensor.js @@ -46,23 +46,28 @@ function format_mem_size(s) { function type_to_str(stype) { var stype_str; - stype_str = "N/A"; - - if (stype & 0x0100) - stype_str = "Sensor"; - else if (stype & 0x0200) - stype_str = "NVidia"; - else if (stype & 0x0400) - stype_str = "HDD"; + if (stype & 0x0200) + stype_str = "NVidia "; else if (stype & 0x0800) - stype_str = "CPU Usage Percentage"; - else if (stype & 0x1000) - stype_str = "AMD"; + stype_str = "ATI/AMD "; + else + stype_str = ""; - if (stype & 0x0001) - stype_str += " Temperature"; + if (stype & 0x04000) + stype_str += "HDD "; + else if (stype & 0x08000) + stype_str += "CPU "; + else if (stype & 0x10000) + stype_str += "GPU "; + else if (stype & 0x20000) + stype_str += "Fan "; + + if (stype & 0x0001) + stype_str += "Temperature"; else if (stype & 0x0002) - stype_str += " Fan"; + stype_str += "RPM"; + else if (stype & 0x0004) + stype_str += "Load"; return stype_str; } @@ -100,11 +105,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 +159,7 @@ function update_chart(chart_id, title, data) { } ] }; + $.jqplot (chart_id, [data_chart], style); } @@ -154,23 +168,25 @@ function update_menu() { str = ""; - $.getJSON("/api/1.0/sensors", function(data) { - str += "
  • Sensors\n