stype_str = "NVidia";
else if (stype & 0x0400)
stype_str = "HDD";
+ else if (stype & 0x0800)
+ stype_str = "CPU Usage Percentage";
else if (stype & 0x1000)
stype_str = "AMD";
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"];
} ]
};
+
$.jqplot (chart_id, [data_chart], style);
}
function update_menu() {
var name, link, url, str;
+ str = "";
+
$.getJSON("/api/1.0/sensors", function(data) {
- str = "<li><em>Sensors</em>\n<ul>";
+ str += "<li><em>Sensors</em>\n<ul>";
$.each(data, function(i, item) {
name = item["name"];
link = "<a href='"+url+"'>"+name+"</a>";
str += "<li>"+link+"</li>";
});
+ str += "</li></ul>";
- str += "</ul>";
-
+ str += "<li><em>CPU</em><ul>";
+ url = "details.html?id="+escape("/api/1.0/cpu/usage");
+ link = "<a href='"+url+"'>usage</a>";
+ str += "<li>"+link+"</li>";
+
+ str += "</li></ul>";
+
$("#menu-list").append(str);
+
});
}
var uptime_h = Math.floor((uptime / (60*60)) % 24);
var uptime_d = Math.floor(uptime / (60*60*24));
- $("#cpu").append("<tr><td>"+load+"%</td><td>"
+ $("#cpu").append("<tr><td><a href='details.html?id=/api/1.0/cpu/usage'>"+load+"%</a></td><td>"
+load_1+"</td><td>"
+load_5+"</td><td>"
+load_15+"</td></tr>");