From f5c1c9086ec0d6f1e7d302c0f24637ec6e7c1f78 Mon Sep 17 00:00:00 2001 From: doktornotor Date: Sat, 24 Oct 2015 20:00:23 +0200 Subject: Remove useless stuff from file --- config/nut/ups_status.inc | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) (limited to 'config/nut') 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 @@ Date: Sat, 24 Oct 2015 20:03:02 +0200 Subject: Fix file header and whitespace --- config/nut/ups_status.widget.php | 31 +++++++++++++------------------ 1 file changed, 13 insertions(+), 18 deletions(-) (limited to 'config/nut') 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 @@ - - 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"; -- cgit v1.2.3 From 4466e845cc1d875732df4074b002c2400c8f17e4 Mon Sep 17 00:00:00 2001 From: doktornotor Date: Sat, 24 Oct 2015 20:05:52 +0200 Subject: Fix file header and whitespace --- config/nut/ups_status.js | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'config/nut') 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 + 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); } -- cgit v1.2.3 From 84b618f07e6b7be3aa6b3865026bc36e427dc822 Mon Sep 17 00:00:00 2001 From: doktornotor Date: Sat, 24 Oct 2015 20:07:41 +0200 Subject: Add NUT widget files --- config/nut/nut.xml | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'config/nut') 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 @@ ]]> nut - 2.0.5 + 2.1.1 Services: NUT Change /status_nut.php @@ -77,6 +77,18 @@ /usr/local/www/ https://packages.pfsense.org/packages/config/nut/status_nut.php + + /usr/local/www/widgets/widgets/ + https://packages.pfsense.org/packages/config/nut/ups_status.widget.php + + + /usr/local/www/widgets/javascript/ + https://packages.pfsense.org/packages/config/nut/ups_status.js + + + /usr/local/www/widgets/include/ + https://packages.pfsense.org/packages/config/nut/ups_status.inc + enabled -- cgit v1.2.3