diff options
Diffstat (limited to 'config/nut')
-rw-r--r-- | config/nut/nut.xml | 14 | ||||
-rw-r--r-- | config/nut/ups_status.inc | 10 | ||||
-rw-r--r-- | config/nut/ups_status.js | 14 | ||||
-rw-r--r-- | config/nut/ups_status.widget.php | 31 |
4 files changed, 33 insertions, 36 deletions
diff --git a/config/nut/nut.xml b/config/nut/nut.xml index ca7ca956..e066bc83 100644 --- a/config/nut/nut.xml +++ b/config/nut/nut.xml @@ -41,7 +41,7 @@ ]]> </copyright> <name>nut</name> - <version>2.0.5</version> + <version>2.1.1</version> <title>Services: NUT</title> <savetext>Change</savetext> <aftersaveredirect>/status_nut.php</aftersaveredirect> @@ -77,6 +77,18 @@ <prefix>/usr/local/www/</prefix> <item>https://packages.pfsense.org/packages/config/nut/status_nut.php</item> </additional_files_needed> + <additional_files_needed> + <prefix>/usr/local/www/widgets/widgets/</prefix> + <item>https://packages.pfsense.org/packages/config/nut/ups_status.widget.php</item> + </additional_files_needed> + <additional_files_needed> + <prefix>/usr/local/www/widgets/javascript/</prefix> + <item>https://packages.pfsense.org/packages/config/nut/ups_status.js</item> + </additional_files_needed> + <additional_files_needed> + <prefix>/usr/local/www/widgets/include/</prefix> + <item>https://packages.pfsense.org/packages/config/nut/ups_status.inc</item> + </additional_files_needed> <advanced_options>enabled</advanced_options> <fields> <field> diff --git a/config/nut/ups_status.inc b/config/nut/ups_status.inc index ee6280f9..8953ff94 100644 --- a/config/nut/ups_status.inc +++ b/config/nut/ups_status.inc @@ -1,14 +1,6 @@ <?php -/* - $Id: ups_status.inc - File location: - \usr\local\www\widgets\include\ - Used by: - \usr\local\www\widgets\widgets\ups_status.widget.php -*/ - -//set variable for custom title +// set variable for custom title $ups_status_title = "UPS Status"; $ups_status_title_link = "status_nut.php"; diff --git a/config/nut/ups_status.js b/config/nut/ups_status.js index 98a27a9e..4c64498f 100644 --- a/config/nut/ups_status.js +++ b/config/nut/ups_status.js @@ -1,10 +1,9 @@ /* - $Id: ups_status.js - - File location: - \usr\local\www\widgets\javascript\ - Used by: - \usr\local\www\widgets\widgets\ups_status.widget.php + ups_status.js + part of pfSense (https://www.pfSense.org/) + Copyright (C) 2015 SunStroke <andrey.b.nikitin@gmail.com> + Copyright (C) 2015 ESF, 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: @@ -27,7 +26,6 @@ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - //should be called from "ups_status.widget.php" function showUPSData() { @@ -46,7 +44,7 @@ function showUPSData() { updateUPSWidgetContent("Error getting data from [ups_status.widget.php]"); } }); - + //call itself in 11 seconds window.setTimeout(showUPSData, 11000); } diff --git a/config/nut/ups_status.widget.php b/config/nut/ups_status.widget.php index dade23d6..f2a766e1 100644 --- a/config/nut/ups_status.widget.php +++ b/config/nut/ups_status.widget.php @@ -1,24 +1,20 @@ <?php /* - $Id: ups_status.widget.php - + ups_status.widget.php + part of pfSense (https://www.pfsense.org/) Copyright (C) 2015 SunStroke <andrey.b.nikitin@gmail.com> - - File location: - \usr\local\www\widgets\widgets\ - Depends on: - \usr\local\www\widgets\javascript\ups_status.js - \usr\local\www\widgets\include\ups_status.inc + Copyright (C) 2015 ESF, 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. + 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. + 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 @@ -30,16 +26,15 @@ 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"); // NOTE: maybe not needed (no GUI settings)? Remove if so. require_once("/usr/local/www/widgets/include/ups_status.inc"); //called by showUPSData() (jQuery Ajax call) in ups_status.js if (isset($_GET["getUPSData"])) { - //get UPS data and return it in ajax response - echo getUPSData(); - return; + //get UPS data and return it in ajax response + echo getUPSData(); + return; } function getUPSData() { @@ -142,8 +137,8 @@ function getUPSData() { if ($secs < 0 || $secs == "") { $data .= ":" . gettext("n/a"); } else { - $m = (int)($secs / 60); - $h = (int)($m / 60) % 24; + $m = (int)($secs / 60); + $h = (int)($m / 60) % 24; $m = $m % 60; $s = $secs % 60; $data .= ":" . $h."h " . $m."m " . $s."s"; |