From d1a40112f45d7cd3f20b1361bd1dce1373596581 Mon Sep 17 00:00:00 2001 From: dmacias72 Date: Mon, 22 Feb 2016 07:41:46 -0700 Subject: [PATCH] change advanced view from toggle to fixed --- .../js/jquery.ipmitool-plugin.js | 46 ++++++++++--------- 1 file changed, 25 insertions(+), 21 deletions(-) diff --git a/source/ipmitool-plugin/usr/local/emhttp/plugins/ipmitool-plugin/js/jquery.ipmitool-plugin.js b/source/ipmitool-plugin/usr/local/emhttp/plugins/ipmitool-plugin/js/jquery.ipmitool-plugin.js index 081167f9..945c540b 100644 --- a/source/ipmitool-plugin/usr/local/emhttp/plugins/ipmitool-plugin/js/jquery.ipmitool-plugin.js +++ b/source/ipmitool-plugin/usr/local/emhttp/plugins/ipmitool-plugin/js/jquery.ipmitool-plugin.js @@ -43,13 +43,17 @@ $(function(){ labels_placement: "left", on_label: 'Advanced View', off_label: 'Basic View', - checked: $.cookie('ipmitool_sensor_mode') == 'advanced' + checked: ($.cookie('ipmitool_sensor_mode') == 'advanced') }); //set cookie and toggle advanced columns $('.advancedview').change(function () { - $('.advanced').toggle('slow'); - $.cookie('ipmitool_sensor_mode', $('.advancedview').prop('checked') ? 'advanced' : 'basic', { expires: 3650 }); + var myval = $(this).prop("checked"); + $.cookie('ipmitool_sensor_mode', myval ? "advanced" : "basic", { expires: 3650 }); + if (myval) + $('.advanced').show('slow'); + else + $('.advanced').hide('slow'); }); sensorRefresh(); @@ -68,12 +72,12 @@ function sensorArray(Refresh){ $.each(data, function (i, val) { if (data[i].Status != "ns") { var Reading = parseFloat(data[i].Reading); - var LowerNonRec = parseFloat(data[i].LowerNonRec); - var LowerCritical = parseFloat(data[i].LowerCritical); - var LowerNonCrit = parseFloat(data[i].LowerNonCrit); - var UpperNonCrit = parseFloat(data[i].UpperNonCrit); - var UpperCritical = parseFloat(data[i].UpperCritical); - var UpperNonRec = parseFloat(data[i].UpperNonRec); + var LowerNR = parseFloat(data[i].LowerNR); + var LowerC = parseFloat(data[i].LowerC); + var LowerNC = parseFloat(data[i].LowerNC); + var UpperNC = parseFloat(data[i].UpperNC); + var UpperC = parseFloat(data[i].UpperC); + var UpperNR = parseFloat(data[i].UpperNR); var Color = "green"; // replace invalid characters @@ -83,42 +87,42 @@ function sensorArray(Refresh){ // if voltage is less than lower non-critical // or voltage is greater than upper non-critical show critical - if (Reading < LowerNonCrit && Reading > UpperNonCrit) + if (Reading < LowerNC && Reading > UpperNC) Color = "orange"; // if voltage is less than lower critical // or voltage is greater than upper critical show non-recoverable - if (Reading < LowerCritical || Reading > UpperCritical) + if (Reading < LowerC || Reading > UpperC) Color = "red"; } else if (data[i].Type=="Fan"){ // if Fan RPMs are less than lower non-critical - if (Reading < LowerNonCrit || Reading < LowerCritical || Reading < LowerNonRec) + if (Reading < LowerNC || Reading < LowerC || Reading < LowerNR) Color = "red"; } else if (data[i].Type=="Temperature"){ // if Temperature is greater than upper non-critical - if (Reading > UpperNonCrit || Reading > UpperCritical || Reading > UpperNonRec) + if (Reading > UpperNC || Reading > UpperC || Reading > UpperNR) Color = "red"; } if (Refresh) { - $("#" + Name + " td.reading").html("" + Reading + ""); + $("#"+Name+" td.reading").html(""+Reading+""); } else { $("#tblSensor tbody") .append(""+ ""+ //status ""+data[i].Name+""+ //sensor name - ""+ data[i].LowerNonRec +""+ - ""+ data[i].LowerCritical +""+ - ""+ data[i].LowerNonCrit +""+ + ""+ data[i].LowerNR +""+ + ""+ data[i].LowerC +""+ + ""+ data[i].LowerNC +""+ ""+ "" + Reading + ""+ //sensor reading ""+data[i].Units+""+ //sensor units - ""+ data[i].UpperNonCrit +""+ - ""+ data[i].UpperCritical +""+ - ""+ data[i].UpperNonRec +""+ + ""+ data[i].UpperNC +""+ + ""+ data[i].UpperC +""+ + ""+ data[i].UpperNR +""+ ""); } } @@ -194,4 +198,4 @@ function slideRow(td) { .children() .slideUp(function() { td.remove(); }); $("#tblEvents").trigger("update") -}; +}; \ No newline at end of file