diff --git a/html/includes/graphs/fanspeed.inc.php b/html/includes/graphs/fanspeed.inc.php new file mode 100644 index 0000000000..8f6b03cd81 --- /dev/null +++ b/html/includes/graphs/fanspeed.inc.php @@ -0,0 +1,27 @@ + diff --git a/html/includes/graphs/voltage.inc.php b/html/includes/graphs/voltage.inc.php new file mode 100644 index 0000000000..84eb3193fd --- /dev/null +++ b/html/includes/graphs/voltage.inc.php @@ -0,0 +1,27 @@ + diff --git a/html/includes/print-menubar.php b/html/includes/print-menubar.php index e5a14f7d11..2a528580fa 100644 --- a/html/includes/print-menubar.php +++ b/html/includes/print-menubar.php @@ -158,7 +158,7 @@ echo('
  • diff --git a/html/pages/sensors.php b/html/pages/sensors.php index 2c7bcd780b..aebd2ed949 100644 --- a/html/pages/sensors.php +++ b/html/pages/sensors.php @@ -24,7 +24,7 @@ switch ($_GET['opta']) { case 'temperatures': case 'voltages': - case 'fans': + case 'fanspeeds': include('pages/sensors/'.$_GET['opta'].'.php'); break; default: diff --git a/html/pages/sensors/fanspeeds.php b/html/pages/sensors/fanspeeds.php new file mode 100644 index 0000000000..5126d0b855 --- /dev/null +++ b/html/pages/sensors/fanspeeds.php @@ -0,0 +1,62 @@ += '5') { + $sql = "SELECT * FROM `fanspeed` AS F, `devices` AS D WHERE F.fan_host = D.device_id ORDER BY D.hostname, F.fan_descr"; +} else { + $sql = "SELECT * FROM `fanspeed` AS F, `devices` AS D, devices_perms as P WHERE F.fan_host = D.device_id AND D.device_id = P.device_id AND P.user_id = '" . $_SESSION['user_id'] . "' ORDER BY D.hostname, F.fan_descr"; +} + +$query = mysql_query($sql); + +echo(''); + +echo(' + + + + + + + + '); + +$row = 1; + +while($fan = mysql_fetch_array($query)) +{ + if(is_integer($row/2)) { $row_colour = $list_colour_a; } else { $row_colour = $list_colour_b; } + + $weekly_fan = "graph.php?id=" . $fan['fan_id'] . "&type=fanspeed&from=$week&to=$now&width=500&height=150"; + $fan_popup = "', LEFT);\" onmouseout=\"return nd();\"> + " . $fan['fan_descr'] . ""; + + if($fan['fan_current'] <= $fan['fan_limit']) { $alert = 'alert'; } else { $alert = ""; } + + $fan_day = "graph.php?id=" . $fan['fan_id'] . "&type=fanspeed&from=$day&to=$now&width=300&height=100"; + $fan_week = "graph.php?id=" . $fan['fan_id'] . "&type=fanspeed&from=$week&to=$now&width=300&height=100"; + $fan_month = "graph.php?id=" . $fan['fan_id'] . "&type=fanspeed&from=$month&to=$now&width=300&height=100"; + $fan_year = "graph.php?id=" . $fan['fan_id'] . "&type=fanspeed&from=$year&to=$now&width=300&height=100"; + + $fan_minigraph = "".$fan['hostname']." - ".$fan['fan_descr']; + $fan_minigraph .= "
    ', RIGHT".$config['overlib_defaults'].");\" onmouseout=\"return nd();\" >"; + + echo(" + + + + + + + + \n"); + + $row++; + +} + +echo("
    DeviceFanCurrentAlertNotes
    " . generatedevicelink($fan) . "$fan_popup$fan_minigraph$alert" . $fan['fan_current'] . " rpm" . $fan['fan_limit'] . " rpm" . (isset($fan['fan_notes']) ? $fan['fan_notes'] : '') . "
    "); + + +?> + diff --git a/html/pages/sensors/voltages.php b/html/pages/sensors/voltages.php new file mode 100644 index 0000000000..b9e41858bc --- /dev/null +++ b/html/pages/sensors/voltages.php @@ -0,0 +1,62 @@ += '5') { + $sql = "SELECT * FROM `voltage` AS V, `devices` AS D WHERE V.volt_host = D.device_id ORDER BY D.hostname, V.volt_descr"; +} else { + $sql = "SELECT * FROM `voltage` AS V, `devices` AS D, devices_perms as P WHERE V.volt_host = D.device_id AND D.device_id = P.device_id AND P.user_id = '" . $_SESSION['user_id'] . "' ORDER BY D.hostname, V.volt_descr"; +} + +$query = mysql_query($sql); + +echo(''); + +echo(' + + + + + + + + '); + +$row = 1; + +while($volt = mysql_fetch_array($query)) +{ + if(is_integer($row/2)) { $row_colour = $list_colour_a; } else { $row_colour = $list_colour_b; } + + $weekly_volt = "graph.php?id=" . $volt['volt_id'] . "&type=voltage&from=$week&to=$now&width=500&height=150"; + $volt_popup = "', LEFT);\" onmouseout=\"return nd();\"> + " . $volt['volt_descr'] . ""; + + if($volt['volt_current'] >= $volt['volt_limit']) { $alert = 'alert'; } else { $alert = ""; } + + $volt_day = "graph.php?id=" . $volt['volt_id'] . "&type=voltage&from=$day&to=$now&width=300&height=100"; + $volt_week = "graph.php?id=" . $volt['volt_id'] . "&type=voltage&from=$week&to=$now&width=300&height=100"; + $volt_month = "graph.php?id=" . $volt['volt_id'] . "&type=voltage&from=$month&to=$now&width=300&height=100"; + $volt_year = "graph.php?id=" . $volt['volt_id'] . "&type=voltage&from=$year&to=$now&width=300&height=100"; + + $volt_minigraph = "".$volt['hostname']." - ".$volt['volt_descr']; + $volt_minigraph .= "
    ', RIGHT".$config['overlib_defaults'].");\" onmouseout=\"return nd();\" >"; + + echo(" + + + + + + + + \n"); + + $row++; + +} + +echo("
    DeviceSensorCurrentRange limitNotes
    " . generatedevicelink($volt) . "$volt_popup$volt_minigraph$alert" . $volt['volt_current'] . "V" . $volt['volt_limit_low'] . "V - " . $volt['volt_limit'] . "V" . (isset($volt['volt_notes']) ? $volt['volt_notes'] : '') . "
    "); + + +?> +