diff options
Diffstat (limited to 'src/usr/local/www/widgets/widgets/thermal_sensors.widget.php')
-rw-r--r-- | src/usr/local/www/widgets/widgets/thermal_sensors.widget.php | 150 |
1 files changed, 80 insertions, 70 deletions
diff --git a/src/usr/local/www/widgets/widgets/thermal_sensors.widget.php b/src/usr/local/www/widgets/widgets/thermal_sensors.widget.php index 875ccb2..78d0983 100644 --- a/src/usr/local/www/widgets/widgets/thermal_sensors.widget.php +++ b/src/usr/local/www/widgets/widgets/thermal_sensors.widget.php @@ -1,37 +1,56 @@ <?php /* $Id: thermal_sensors.widget.php - Copyright (C) 2013-2015 Electric Sheep Fencing, LP - - Description: Thermal Sensors Widget. - NOTE: depends on proper config in System >> Advanced >> Miscellaneous tab >> Thermal Sensors section. - - File location: - \usr\local\www\widgets\widgets\ - Depends on: - \usr\local\www\widgets\javascript\thermal_sensors.js - \usr\local\www\widgets\include\thermal_sensors.inc - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, - INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY - AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, - OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. +*/ +/* ==================================================================== + * Copyright (c) 2004-2015 Electric Sheep Fencing, LLC. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgment: + * "This product includes software developed by the pfSense Project + * for use in the pfSense software distribution. (http://www.pfsense.org/). + * + * 4. The names "pfSense" and "pfSense Project" must not be used to + * endorse or promote products derived from this software without + * prior written permission. For written permission, please contact + * coreteam@pfsense.org. + * + * 5. Products derived from this software may not be called "pfSense" + * nor may "pfSense" appear in their names without prior written + * permission of the Electric Sheep Fencing, LLC. + * + * 6. Redistributions of any form whatsoever must retain the following + * acknowledgment: + * + * "This product includes software developed by the pfSense Project + * for use in the pfSense software distribution (http://www.pfsense.org/). + * + * THIS SOFTWARE IS PROVIDED BY THE pfSense PROJECT ``AS IS'' AND ANY + * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE pfSense PROJECT OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + * + * ==================================================================== + * */ require_once("guiconfig.inc"); @@ -87,8 +106,8 @@ function saveThresholdSettings(&$configArray, &$postArray, $warningValueKey, $cr } if (($warningValue >= MIN_THRESHOLD_VALUE && $warningValue <= MAX_THRESHOLD_VALUE) && - ($criticalValue >= MIN_THRESHOLD_VALUE && $criticalValue <= MAX_THRESHOLD_VALUE) && - ($warningValue < $criticalValue)) { + ($criticalValue >= MIN_THRESHOLD_VALUE && $criticalValue <= MAX_THRESHOLD_VALUE) && + ($warningValue < $criticalValue)) { //all validated ok, save to config array $configArray[WIDGETS_CONFIG_SECTION_KEY][THERMAL_SENSORS_WIDGET_SUBSECTION_KEY][$warningValueKey] = $warningValue; $configArray[WIDGETS_CONFIG_SECTION_KEY][THERMAL_SENSORS_WIDGET_SUBSECTION_KEY][$criticalValueKey] = $criticalValue; @@ -159,14 +178,19 @@ function getBoolValueFromConfig(&$configArray, $valueKey, $defaultValue) { //start showing temp data //NOTE: the refresh interval will be reset to a proper value in showThermalSensorsData() (thermal_sensors.js). - jQuery(document).ready(function() { + events.push(function(){ showThermalSensorsData(); }); //]]> </script> - +<div style="padding: 5px"> + <div id="thermalSensorsContainer" class="listr"> + (Updating...)<br /><br /> + </div> +</div> <input type="hidden" id="thermal_sensors-config" name="thermal_sensors-config" value="" /> -<div id="thermal_sensors-settings" class="widgetconfigdiv" style="display:none;"> +</div> +<div id="thermal_sensors-settings" class="widgetconfigdiv panel-footer collapse" > <form action="/widgets/widgets/thermal_sensors.widget.php" method="post" id="iform_thermal_sensors_settings" name="iform_thermal_sensors_settings"> <table> <tr> @@ -183,16 +207,16 @@ function getBoolValueFromConfig(&$configArray, $valueKey, $defaultValue) { </td> <td> <input type="text" maxlength="3" size="3" class="formfld unknown" - name="thermal_sensors_widget_zone_warning_threshold" - id="thermal_sensors_widget_zone_warning_threshold" - value="<?= $thermal_sensors_widget_zoneWarningTempThreshold; ?>" /> + name="thermal_sensors_widget_zone_warning_threshold" + id="thermal_sensors_widget_zone_warning_threshold" + value="<?= $thermal_sensors_widget_zoneWarningTempThreshold; ?>" /> </td> <td align="right"> <label for="thermal_sensors_widget_show_raw_output">Show raw output (no graph): </label> <input type="checkbox" - id="thermal_sensors_widget_show_raw_output" - name="thermal_sensors_widget_show_raw_output" - value="<?= $thermal_sensors_widget_showRawOutput; ?>" <?= ($thermal_sensors_widget_showRawOutput) ? " checked='checked'" : ""; ?> /> + id="thermal_sensors_widget_show_raw_output" + name="thermal_sensors_widget_show_raw_output" + value="<?= $thermal_sensors_widget_showRawOutput; ?>" <?= ($thermal_sensors_widget_showRawOutput) ? " checked='checked'" : ""; ?> /> </td> </tr> <tr> @@ -201,16 +225,16 @@ function getBoolValueFromConfig(&$configArray, $valueKey, $defaultValue) { </td> <td> <input type="text" maxlength="3" size="3" class="formfld unknown" - name="thermal_sensors_widget_zone_critical_threshold" - id="thermal_sensors_widget_zone_critical_threshold" - value="<?= $thermal_sensors_widget_zoneCriticalTempThreshold; ?>" /> + name="thermal_sensors_widget_zone_critical_threshold" + id="thermal_sensors_widget_zone_critical_threshold" + value="<?= $thermal_sensors_widget_zoneCriticalTempThreshold; ?>" /> </td> <td align="right"> <label for="thermal_sensors_widget_show_full_sensor_name">Show full sensor name: </label> <input type="checkbox" - id="thermal_sensors_widget_show_full_sensor_name" - name="thermal_sensors_widget_show_full_sensor_name" - value="<?= $thermal_sensors_widget_showFullSensorName; ?>" <?= ($thermal_sensors_widget_showFullSensorName) ? " checked='checked'" : ""; ?> /> + id="thermal_sensors_widget_show_full_sensor_name" + name="thermal_sensors_widget_show_full_sensor_name" + value="<?= $thermal_sensors_widget_showFullSensorName; ?>" <?= ($thermal_sensors_widget_showFullSensorName) ? " checked='checked'" : ""; ?> /> </td> </tr> <tr> @@ -219,16 +243,12 @@ function getBoolValueFromConfig(&$configArray, $valueKey, $defaultValue) { </td> <td> <input type="text" maxlength="3" size="3" class="formfld unknown" - name="thermal_sensors_widget_core_warning_threshold" - id="thermal_sensors_widget_core_warning_threshold" - value="<?= $thermal_sensors_widget_coreWarningTempThreshold ?>" /> + name="thermal_sensors_widget_core_warning_threshold" + id="thermal_sensors_widget_core_warning_threshold" + value="<?= $thermal_sensors_widget_coreWarningTempThreshold ?>" /> </td> <td align="right"> - <label for="thermal_sensors_widget_pulsate_warning">Pulsate Warning: </label> - <input type="checkbox" - id="thermal_sensors_widget_pulsate_warning" - name="thermal_sensors_widget_pulsate_warning" - value="<?= $thermal_sensors_widget_pulsateWarning; ?>" <?= ($thermal_sensors_widget_pulsateWarning) ? " checked='checked'" : ""; ?> /> + </td> </tr> <tr> @@ -237,16 +257,12 @@ function getBoolValueFromConfig(&$configArray, $valueKey, $defaultValue) { </td> <td> <input type="text" maxlength="3" size="3" class="formfld unknown" - name="thermal_sensors_widget_core_critical_threshold" - id="thermal_sensors_widget_core_critical_threshold" - value="<?= $thermal_sensors_widget_coreCriticalTempThreshold ?>" /> + name="thermal_sensors_widget_core_critical_threshold" + id="thermal_sensors_widget_core_critical_threshold" + value="<?= $thermal_sensors_widget_coreCriticalTempThreshold ?>" /> </td> <td align="right"> - <label for="thermal_sensors_widget_pulsate_critical">Pulsate Critical: </label> - <input type="checkbox" - id="thermal_sensors_widget_pulsate_critical" - name="thermal_sensors_widget_pulsate_critical" - value="<?= $thermal_sensors_widget_pulsateCritical; ?>" <?= ($thermal_sensors_widget_pulsateCritical) ? " checked='checked'" : ""; ?> /> + </td> </tr> <tr> @@ -264,12 +280,6 @@ function getBoolValueFromConfig(&$configArray, $valueKey, $defaultValue) { </form> </div> -<div style="padding: 5px"> - <div id="thermalSensorsContainer" class="listr"> - (Updating...)<br /><br /> - </div> -</div> - <!-- needed to display the widget settings menu --> <script type="text/javascript"> //<![CDATA[ |