X-Git-Url: https://git.wpitchoune.net/gitweb/?a=blobdiff_plain;f=www%2Fpsensor.js;h=3e902853faa99053eb469f835de90d936cdcdd7c;hb=c1e20f2631a1249720e9c75d753eacfcb0f6c7b9;hp=5e9d91f58cb2d9128e3b4ef90ffbb70f67e7917b;hpb=3baefd57585a838044d9ad459156fd39d9f05918;p=psensor.git
diff --git a/www/psensor.js b/www/psensor.js
index 5e9d91f..3e90285 100644
--- a/www/psensor.js
+++ b/www/psensor.js
@@ -168,23 +168,25 @@ function update_menu() {
str = "";
- $.getJSON("/api/1.0/sensors", function(data) {
- str += "
Sensors\n";
+ $.getJSON("/api/1.1/sensors", function(data) {
+ str += "- CPU
";
+ url = "details.html?id="+escape("/api/1.1/cpu/usage");
+ link = "usage";
+ str += "- "+link+"
";
+ str += "
";
+
+ str += "Network";
+ str += "Memory";
+
+ str += "Sensors\n";
$.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 = ""+name+"";
str += "- "+link+"
";
});
str += "
";
-
- str += "CPU";
- url = "details.html?id="+escape("/api/1.0/cpu/usage");
- link = "usage";
- str += "- "+link+"
";
-
- str += "
";
$("#menu-list").append(str);
@@ -195,7 +197,7 @@ function update_menu() {
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) {
@@ -205,7 +207,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);
- 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(""
+""+name+" | "
@@ -219,7 +221,7 @@ function update_summary_sensors() {
}
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("");
@@ -236,7 +238,7 @@ function update_summary_sysinfo() {
var uptime_h = Math.floor((uptime / (60*60)) % 24);
var uptime_d = Math.floor(uptime / (60*60*24));
- $("#cpu").append("
"+load+"% | "
+ $("#cpu").append(" |
"+load+"% | "
+load_1+" | "
+load_5+" | "
+load_15+" |
");