diff --git a/html/includes/graphs/current.inc.php b/html/includes/graphs/current.inc.php new file mode 100644 index 0000000000..6a6396a761 --- /dev/null +++ b/html/includes/graphs/current.inc.php @@ -0,0 +1,23 @@ + diff --git a/html/includes/graphs/device_current.inc.php b/html/includes/graphs/device_current.inc.php new file mode 100644 index 0000000000..2761256986 --- /dev/null +++ b/html/includes/graphs/device_current.inc.php @@ -0,0 +1,56 @@ + diff --git a/html/pages/device.php b/html/pages/device.php index 3dc67316f3..e5551400da 100644 --- a/html/pages/device.php +++ b/html/pages/device.php @@ -44,6 +44,8 @@ $health = mysql_result(mysql_query("select count(*) from storage WHERE device_i mysql_result(mysql_query("select count(*) from cempMemPool WHERE device_id = '" . $device['device_id'] . "'"), 0) + mysql_result(mysql_query("select count(*) from cpmCPU WHERE device_id = '" . $device['device_id'] . "'"), 0) + mysql_result(mysql_query("select count(*) from processors WHERE device_id = '" . $device['device_id'] . "'"), 0) + + mysql_result(mysql_query("select count(current_id) from current WHERE device_id = '" . $device['device_id'] . "'"), 0) + + mysql_result(mysql_query("select count(freq_id) from frequencies WHERE device_id = '" . $device['device_id'] . "'"), 0) + mysql_result(mysql_query("select count(volt_id) from voltage WHERE device_id = '" . $device['device_id'] . "'"), 0) + mysql_result(mysql_query("select count(fan_id) from fanspeed WHERE device_id = '" . $device['device_id'] . "'"), 0); diff --git a/html/pages/device/health.inc.php b/html/pages/device/health.inc.php index f525312515..c22e503882 100644 --- a/html/pages/device/health.inc.php +++ b/html/pages/device/health.inc.php @@ -7,6 +7,7 @@ $processor = mysql_result(mysql_query("select count(*) from processors WHERE de $fans = mysql_result(mysql_query("select count(*) from fanspeed WHERE device_id = '" . $device['device_id'] . "'"), 0); $volts = mysql_result(mysql_query("select count(*) from voltage WHERE device_id = '" . $device['device_id'] . "'"), 0); $freqs = mysql_result(mysql_query("select count(*) from frequency WHERE device_id = '" . $device['device_id'] . "'"), 0); +$current = mysql_result(mysql_query("select count(*) from current WHERE device_id = '" . $device['device_id'] . "'"), 0); if ($processor) { $datas[] = 'processors'; } if ($memory) { $datas[] = 'memory'; } @@ -15,6 +16,7 @@ if ($temperatures) { $datas[] = 'temperatures'; } if ($fans) { $datas[] = 'fanspeeds'; } if ($volts) { $datas[] = 'voltages'; } if ($freqs) { $datas[] = 'frequencies'; } +if ($current) { $datas[] = 'current'; } $type_text['temperatures'] = "Temperatures"; $type_text['memory'] = "Memory Pools"; @@ -23,6 +25,7 @@ $type_text['processors'] = "Processor Usage"; $type_text['voltages'] = "Voltages"; $type_text['fanspeeds'] = "Fan Speeds"; $type_text['frequencies'] = "Frequencies"; +$type_text['current'] = "Current"; print_optionbar_start(); diff --git a/html/pages/device/overview.inc.php b/html/pages/device/overview.inc.php index 10b4775214..79af61c16d 100644 --- a/html/pages/device/overview.inc.php +++ b/html/pages/device/overview.inc.php @@ -81,6 +81,7 @@ include("overview/temperatures.inc.php"); include("overview/fanspeeds.inc.php"); include("overview/voltages.inc.php"); include("overview/frequencies.inc.php"); +include("overview/current.inc.php"); echo("
"); echo("

Recent Events

"); diff --git a/html/pages/device/overview/current.inc.php b/html/pages/device/overview/current.inc.php new file mode 100644 index 0000000000..9bcbd5fad9 --- /dev/null +++ b/html/pages/device/overview/current.inc.php @@ -0,0 +1,45 @@ +"); + echo("

Current

"); + $i = '1'; + $currents = mysql_query("SELECT * FROM current WHERE device_id = '" . $device['device_id'] . "'"); + echo(""); + echo(""); + echo("
"); + echo(""); + while($current = mysql_fetch_array($currents)) { + if(is_integer($i/2)) { $row_colour = $list_colour_a; } else { $row_colour = $list_colour_b; } + + $graph_colour = str_replace("#", "", $row_colour); + + $current_day = "graph.php?id=" . $current['current_id'] . "&type=current&from=$day&to=$now&width=300&height=100"; + $current_week = "graph.php?id=" . $current['current_id'] . "&type=current&from=$week&to=$now&width=300&height=100"; + $current_month = "graph.php?id=" . $current['current_id'] . "&type=current&from=$month&to=$now&width=300&height=100"; + $current_year = "graph.php?id=" . $current['current_id'] . "&type=current&from=$year&to=$now&width=300&height=100"; + $current_minigraph = ""; + + $current_link = ""; + + $current_link_c = $current_link . " $current['current_limit'] ? "style='color: red'" : '') . '>' . $current['current_current'] . "A"; + $current_link_b = $current_link . $current_minigraph . ""; + $current_link_a = $current_link . $current['current_descr'] . ""; + + $current['current_descr'] = truncate($current['current_descr'], 25, ''); + echo(""); + if($i == $rows) { echo("
$current_link_a$current_link_b$current_link_c
"); } + $i++; + } + echo("
"); + echo("
"); + echo("
"); +} + + +?>