projects
/
psensor-pkg-debian.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'upstream'
[psensor-pkg-debian.git]
/
www
/
psensor.js
diff --git
a/www/psensor.js
b/www/psensor.js
index
5870b2b
..
6f4ef7e
100644
(file)
--- a/
www/psensor.js
+++ b/
www/psensor.js
@@
-1,5
+1,5
@@
/*
/*
- * Copyright (C) 2010-201
2
jeanfi@gmail.com
+ * Copyright (C) 2010-201
1
jeanfi@gmail.com
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
@@
-46,23
+46,28
@@
function format_mem_size(s) {
function type_to_str(stype) {
var stype_str;
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)
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)
else if (stype & 0x0002)
- stype_str += " Fan";
+ stype_str += "RPM";
+ else if (stype & 0x0004)
+ stype_str += "Load";
return stype_str;
}
return stype_str;
}
@@
-163,19
+168,19
@@
function update_menu() {
str = "";
str = "";
- $.getJSON("/api/1.
0
/sensors", function(data) {
+ $.getJSON("/api/1.
1
/sensors", function(data) {
str += "<li><em>Sensors</em>\n<ul>";
$.each(data, function(i, item) {
name = item["name"];
str += "<li><em>Sensors</em>\n<ul>";
$.each(data, function(i, item) {
name = item["name"];
- url = "details.html?id="+escape("/api/1.
0
/sensors/"+item["id"]);
+ url = "details.html?id="+escape("/api/1.
1
/sensors/"+item["id"]);
link = "<a href='"+url+"'>"+name+"</a>";
str += "<li>"+link+"</li>";
});
str += "</li></ul>";
str += "<li><em>CPU</em><ul>";
link = "<a href='"+url+"'>"+name+"</a>";
str += "<li>"+link+"</li>";
});
str += "</li></ul>";
str += "<li><em>CPU</em><ul>";
- url = "details.html?id="+escape("/api/1.
0
/cpu/usage");
+ url = "details.html?id="+escape("/api/1.
1
/cpu/usage");
link = "<a href='"+url+"'>usage</a>";
str += "<li>"+link+"</li>";
link = "<a href='"+url+"'>usage</a>";
str += "<li>"+link+"</li>";
@@
-190,7
+195,7
@@
function update_menu() {
function update_summary_sensors() {
var name, value_str, min_str, max_str, type, type_str, url;
function update_summary_sensors() {
var name, value_str, min_str, max_str, type, type_str, url;
- $.getJSON("/api/1.
0
/sensors", function(data) {
+ $.getJSON("/api/1.
1
/sensors", function(data) {
$("#sensors tbody").html("");
$.each(data, function(i, item) {
$("#sensors tbody").html("");
$.each(data, function(i, item) {
@@
-200,7
+205,7
@@
function update_summary_sensors() {
min_str = value_to_str(item["min"], type);
max_str = value_to_str(item["max"], type);
type_str = type_to_str(type);
min_str = value_to_str(item["min"], type);
max_str = value_to_str(item["max"], type);
type_str = type_to_str(type);
- url = "details.html?id="+escape("/api/1.
0
/sensors/"+item["id"]);
+ url = "details.html?id="+escape("/api/1.
1
/sensors/"+item["id"]);
$("#sensors tbody").append("<tr>"
+"<td><a href='"+url+"'>"+name+"</a></td>"
$("#sensors tbody").append("<tr>"
+"<td><a href='"+url+"'>"+name+"</a></td>"
@@
-214,7
+219,7
@@
function update_summary_sensors() {
}
function update_summary_sysinfo() {
}
function update_summary_sysinfo() {
- $.getJSON("/api/1.
0
/sysinfo", function(data) {
+ $.getJSON("/api/1.
1
/sysinfo", function(data) {
$("#uptime").html("");
$("#cpu tbody").html("");
$("#memory").html("");
$("#uptime").html("");
$("#cpu tbody").html("");
$("#memory").html("");
@@
-231,7
+236,7
@@
function update_summary_sysinfo() {
var uptime_h = Math.floor((uptime / (60*60)) % 24);
var uptime_d = Math.floor(uptime / (60*60*24));
var uptime_h = Math.floor((uptime / (60*60)) % 24);
var uptime_d = Math.floor(uptime / (60*60*24));
- $("#cpu").append("<tr><td><a href='details.html?id=/api/1.
0
/cpu/usage'>"+load+"%</a></td><td>"
+ $("#cpu").append("<tr><td><a href='details.html?id=/api/1.
1
/cpu/usage'>"+load+"%</a></td><td>"
+load_1+"</td><td>"
+load_5+"</td><td>"
+load_15+"</td></tr>");
+load_1+"</td><td>"
+load_5+"</td><td>"
+load_15+"</td></tr>");