Imported Upstream version 2.7.1

This commit is contained in:
Laurent Bigonville 2013-11-24 16:00:12 +01:00
parent a1fa151fc7
commit 0121794af9
451 changed files with 41339 additions and 10887 deletions

View file

@ -1,7 +1,7 @@
# FIXME: do we really have to distribute these many Kb too?
# RCS should be enough, and website generation should use
# source from subversion tags!
EXTRA_DIST = news.txt projects.txt website.txt \
EXTRA_DIST = news.txt old-news.txt projects.txt website.txt \
ups-protocols.txt $(LAYOUT).conf $(SCRIPT_FILES) $(LAYOUT_FILES) \
$(FAVICON_FILES)
@ -30,8 +30,8 @@ SCRIPT_FILES = scripts/filter_png.js \
WEBSITE_FILES = index.html projects.html stable-hcl.html \
documentation.html acknowledgements.html features.html \
ups-protocols.html \
cables.html nut-qa.html download.html support.html
ups-protocols.html cables.html nut-qa.html download.html \
support.html old-news.html
WEBSITE_DEPS = ../user-manual.chunked ../packager-guide.chunked \
../FAQ.html ../developer-guide.chunked \
@ -123,7 +123,7 @@ support.html: ../support.txt
nut-qa.html: ../nut-qa.txt
$(ASCIIDOC) $(ASCIIDOC_PARAMS) -o $@ $<
stable-hcl.html: ../stable-hcl.txt
stable-hcl.html: ../stable-hcl.txt ../ups-html.txt
$(ASCIIDOC) $(ASCIIDOC_PARAMS) -o $@ -a hcl $<
.txt.html:

View file

@ -1,9 +1,9 @@
# Makefile.in generated by automake 1.11.1 from Makefile.am.
# Makefile.in generated by automake 1.11.6 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation,
# Inc.
# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software
# Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
@ -15,6 +15,23 @@
@SET_MAKE@
VPATH = @srcdir@
am__make_dryrun = \
{ \
am__dry=no; \
case $$MAKEFLAGS in \
*\\[\ \ ]*) \
echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \
| grep '^AM OK$$' >/dev/null || am__dry=yes;; \
*) \
for am__flg in $$MAKEFLAGS; do \
case $$am__flg in \
*=*|--*) ;; \
*n*) am__dry=yes; break;; \
esac; \
done;; \
esac; \
test $$am__dry = yes; \
}
pkgdatadir = $(datadir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
@ -50,8 +67,9 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/ax_compare_version.m4 \
$(top_srcdir)/m4/nut_check_libltdl.m4 \
$(top_srcdir)/m4/nut_check_libneon.m4 \
$(top_srcdir)/m4/nut_check_libnetsnmp.m4 \
$(top_srcdir)/m4/nut_check_libnss.m4 \
$(top_srcdir)/m4/nut_check_libopenssl.m4 \
$(top_srcdir)/m4/nut_check_libpowerman.m4 \
$(top_srcdir)/m4/nut_check_libssl.m4 \
$(top_srcdir)/m4/nut_check_libusb.m4 \
$(top_srcdir)/m4/nut_check_libwrap.m4 \
$(top_srcdir)/m4/nut_check_os.m4 \
@ -67,12 +85,18 @@ CONFIG_CLEAN_FILES =
CONFIG_CLEAN_VPATH_FILES =
SOURCES =
DIST_SOURCES =
am__can_run_installinfo = \
case $$AM_UPDATE_INFO_DIR in \
n|no|NO) false;; \
*) (install-info --version) >/dev/null 2>&1;; \
esac
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
A2X = @A2X@
ACLOCAL = @ACLOCAL@
AMTAR = @AMTAR@
AR = @AR@
ASCIIDOC = @ASCIIDOC@
ASPELL = @ASPELL@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
@ -99,6 +123,7 @@ DOC_BUILD_LIST = @DOC_BUILD_LIST@
DRIVER_BUILD_LIST = @DRIVER_BUILD_LIST@
DRIVER_INSTALL_TARGET = @DRIVER_INSTALL_TARGET@
DRIVER_MAN_LIST = @DRIVER_MAN_LIST@
DRVPATH = @DRVPATH@
DSYMUTIL = @DSYMUTIL@
DUMPBIN = @DUMPBIN@
ECHO_C = @ECHO_C@
@ -255,7 +280,7 @@ udevdir = @udevdir@
# FIXME: do we really have to distribute these many Kb too?
# RCS should be enough, and website generation should use
# source from subversion tags!
EXTRA_DIST = news.txt projects.txt website.txt \
EXTRA_DIST = news.txt old-news.txt projects.txt website.txt \
ups-protocols.txt $(LAYOUT).conf $(SCRIPT_FILES) $(LAYOUT_FILES) \
$(FAVICON_FILES)
@ -283,8 +308,8 @@ SCRIPT_FILES = scripts/filter_png.js \
WEBSITE_FILES = index.html projects.html stable-hcl.html \
documentation.html acknowledgements.html features.html \
ups-protocols.html \
cables.html nut-qa.html download.html support.html
ups-protocols.html cables.html nut-qa.html download.html \
support.html old-news.html
WEBSITE_DEPS = ../user-manual.chunked ../packager-guide.chunked \
../FAQ.html ../developer-guide.chunked \
@ -405,10 +430,15 @@ install-am: all-am
installcheck: installcheck-am
install-strip:
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
`test -z '$(STRIP)' || \
echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
if test -z '$(STRIP)'; then \
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
install; \
else \
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
"INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
fi
mostlyclean-generic:
clean-generic:
@ -559,7 +589,7 @@ support.html: ../support.txt
nut-qa.html: ../nut-qa.txt
$(ASCIIDOC) $(ASCIIDOC_PARAMS) -o $@ $<
stable-hcl.html: ../stable-hcl.txt
stable-hcl.html: ../stable-hcl.txt ../ups-html.txt
$(ASCIIDOC) $(ASCIIDOC_PARAMS) -o $@ -a hcl $<
.txt.html:

View file

@ -128,15 +128,91 @@ td#driver-col { width: 30%; }
.hidden { display: none; }
#filters-set, #filters-set fieldset { display: none; border: 1px solid silver; padding: 10px; }
#filters-set legend { font-weight: bold; }
#filters-set td { border: 0; }
#filters-set fieldset { display: block; }
#filters-set select { max-width: 200px }
/* HCL Chooser/Legend */
#filters-set {
display: none;
border: 1px solid silver;
padding: 10px;
}
#support-level-legend { width: 31.25em; float: right; margin-right: 10px; padding: 10px; }
#support-level-legend dt { margin: 0; padding: 0; width: 15%; float: left; }
#support-level-legend dd { margin: 0; padding: 0; width: 85%; float: left; }
#filters-set legend, #support-level-legend legend {
font-weight: bold;
}
#filters-set td {
border: 0;
}
#filters-set select {
max-width: 200px;
}
/* Clear HCL Legend */
#filters-set + * {
clear: both;
}
#support-level-legend {
width: 31.25em;
float: right;
margin: 0 0 1em 1em;
padding: 10px;
border: 1px solid silver;
}
#support-level-legend dt {
margin: 0;
padding: 0;
width: 15%;
float: left;
}
.hcl-legend-level {
visibility: hidden;
position: relative;
}
.red.hcl-legend-level:after {
content: '*';
position: absolute;
visibility: visible;
background-color: #ffa4a4;
}
.orange.hcl-legend-level:after {
content: '**';
position: absolute;
visibility: visible;
background-color: #fccb81;
}
.yellow.hcl-legend-level:after {
content: '***';
position: absolute;
visibility: visible;
background-color: #fdf88e;
}
.blue.hcl-legend-level:after {
content: '****';
position: absolute;
visibility: visible;
background-color: #cfd9fe;
}
.green.hcl-legend-level:after {
content: '*****';
position: absolute;
visibility: visible;
background-color: #b1fea7;
}
#support-level-legend dd {
margin: 0;
padding: 0;
width: 85%;
float: left;
}
/*.support-level-descr { margin-left: 20px; float: right; }*/

View file

@ -1,3 +1,9 @@
- November 20, 2013: 2.7.1 released
- June 21, 2013: new client link:https://github.com/zykh/walNUT[walNUT] released
- February 10, 2013: NUT source repository is converted to link:https://github.com/networkupstools/nut[Git] using link:http://www.catb.org/~esr/reposurgeon/[reposurgeon]
- September 19, 2012: link:download.html#_binary_packages[Beta NUT 2.6.5-3 package for Windows released]
- September 17, 2012: link:download.html#_binary_packages[Beta NUT 2.6.5-2 package for Windows released]
- August 9, 2012: link:download.html#_binary_packages[Beta NUT 2.6.5-1 package for Windows released]
- August 8, 2012: 2.6.5 released
- June 27, 2012: link:download.html#_virtualization_packages[VMware NUT client for ESXI 5.0]
- June 5, 2012: link:http://wmnut.networkupstools.org[WMNut] 0.64 released, and move hosting
@ -8,19 +14,5 @@
- May 2, 2012: link:download.html#_binary_packages[Beta NUT 2.6.3-3 package for Windows released]
- April 26, 2012: link:download.html#_binary_packages[Beta NUT 2.6.3-1 package for Windows released]
- January 4, 2012: 2.6.3 released
- October 31, 2011: link:download.html#_java_packages[jNUT and jNutWebAPI 0.2-SNAPSHOT released]
- September 15, 2011: 2.6.2 released
- September 2, 2011: link:download.html#_java_packages[jNUT (NUT Java support) 0.1-SNAPSHOT released]
- July 4, 2011: link:download.html#_binary_packages[Beta NUT 2.6.1-1 package for Windows released]
- June 8, 2011: link:http://www.dell.com/us/business/p/powervault-nx3500/pd[Dell PowerVault NX3500] use NUT for power protection
- June 1, 2011: 2.6.1 released
- May 19, 2011: link:download.html#_binary_packages[Beta NUT 2.6.0-1 package for Windows released]
- January 14, 2011: 2.6.0 released
- December 24, 2010: 2.6.0-pre1 released
- December 16, 2010: link:http://www.lestat.st/en/informatique/projets/nut-monitor[NUT-Monitor] 1.3 released
- July 22, 2010: new client link:http://www.revpol.com/xymon_nut_scripts[Hobbit (Xymon) monitor plugin]
- July 2, 2010: link:http://knut.prynych.cz[KNutClient] 1.0.3 and link update
- May 12, 2010: link:http://www.lestat.st/informatique/projets/nut-monitor-en[NUT-Monitor] 1.2 released
- March 22, 2010: link:http://knut.prynych.cz[KNutClient] 1.0
- February 23, 2010: 2.4.3 released
- February 19, 2010: 2.4.2 released
link:old-news.html[Older news]

63
docs/website/old-news.txt Normal file
View file

@ -0,0 +1,63 @@
Archived news
-------------
- October 31, 2011: link:download.html#_java_packages[jNUT and jNutWebAPI 0.2-SNAPSHOT released]
- September 15, 2011: 2.6.2 released
- September 2, 2011: link:download.html#_java_packages[jNUT (NUT Java support) 0.1-SNAPSHOT released]
- July 4, 2011: link:download.html#_binary_packages[Beta NUT 2.6.1-1 package for Windows released]
- June 8, 2011: link:http://www.dell.com/us/business/p/powervault-nx3500/pd[Dell PowerVault NX3500] use NUT for power protection
- June 1, 2011: 2.6.1 released
- May 19, 2011: link:download.html#_binary_packages[Beta NUT 2.6.0-1 package for Windows released]
- January 14, 2011: 2.6.0 released
- December 24, 2010: 2.6.0-pre1 released
- December 16, 2010: link:http://www.lestat.st/en/informatique/projets/nut-monitor[NUT-Monitor] 1.3 released
- July 22, 2010: new client link:http://www.revpol.com/xymon_nut_scripts[Hobbit (Xymon) monitor plugin]
- July 2, 2010: link:http://knut.prynych.cz[KNutClient] 1.0.3 and link update
- May 12, 2010: link:http://www.lestat.st/en/informatique/projets/nut-monitor[NUT-Monitor] 1.2 released
- March 22, 2010: link:http://knut.prynych.cz[KNutClient] 1.0
- February 23, 2010: 2.4.3 released
- February 19, 2010: 2.4.2 released
- February 17, 2009: 2.4.1 released
- January 28, 2009: 2.4.0 released
- January 21, 2009: 2.4.0-pre2 released
- December 24, 2008: 2.4.0-pre1 released
- July 7, 2008: Client activity: new client link:http://www.lestat.st/en/informatique/projets/nut-monitor[NUT-Monitor]
- June 27, 2008: Client activity: new Python class link:http://www.lestat.st/en/informatique/projets/pynut[PyNUT]
- June 19, 2008: Client activity: KNutClient 0.9.4
- May 7, 2008: 2.2.2 released
- April 25, 2008: 2.2.2-pre3 released
- April 15, 2008: 2.2.2-pre2 released
- April 2, 2008: 2.2.2-pre1 released
- December 21, 2007: 2.2.1 released
- December 17, 2007: 2.2.1-pre2 released
- October 4, 2007: 2.2.1-pre1 released
- August 31, 2007: Client activity: UPS Monitor link update
- August 31, 2007: Client activity: link:http://sourceforge.net/projects/winnutclient/[Windows NUT client 1.5.0]
- July 5, 2007: 2.2.0 released
- June 26, 2007: 2.2.0-pre2 released
- June 5, 2007: Client activity: link:http://collectd.org/[collectd NUT plugin]
- June 4, 2007: 2.2.0-pre1 released
- April 10, 2007: Client activity: KNutClient 0.9.3
- January 15, 2007: 2.0.5 released
- January 8, 2007: Client activity: link:http://sourceforge.net/projects/winnutclient/[Windows NUT client]
- January 4, 2007: 2.0.5-pre2 released
- December 20, 2006: 2.0.5-pre1 released
- July 27, 2006: 2.0.4 released
- July 18, 2006: 2.0.4-pre2 released
- July 7, 2006: 2.0.4-pre1 released
- February 7, 2006: 2.0.3 released
- December 22, 2005: 2.0.3-pre2 released
- August 16, 2005: 2.0.3-pre1 released
- June 27, 2005: 2.0.2 released
- June 22, 2005: 2.0.2-pre2 released
- June 15, 2005: new mailing lists ready on link:http://alioth.debian.org/mail/?group_id=30602[Alioth]
- May 4, 2005: 2.0.2-pre1 released
- April 15, 2005: new development infrastructure ready on link:http://alioth.debian.org/projects/nut/[Alioth]
- March 15, 2005: Client activity: first beta of MGE Personal Solution Pac
- March 11, 2005: Client activity: UPS Monitor 0.8 released
- February 24, 2005: 2.0.1 released
- February 2, 2005: Belated announcement: WMNut 0.61 released
- October 20, 2004: Client activity: KNutClient 0.8.5 released
- September 22, 2004: New driver project: BCMXCP
- September 3, 2004: New EU mirror (thanks to Gilles, from Signetic)
- August 10, 2004: Client activity: ups_control 1.7 released

View file

@ -8,12 +8,6 @@ This page tries to track them.
Graphical desktop clients
-------------------------
link:http://sourceforge.net/projects/gknut/[GKrellM NUT]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Simple UPS monitoring plugin for GKrellM. Uses NUT (Network UPS Tools) for UPS
connection.
link:http://knut.prynych.cz[KNutClient]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@ -29,16 +23,10 @@ a NUT server. This application is written in Python and PyGTK, and uses the
NOTE: NUT-Monitor is part of NUT since version NUT 2.4.1.
It will further evolve toward the NUT Control Center.
link:http://download.mgeops.com/explore/eng/ptp/ptp_sol.htm?sol=PSP[Eaton - Personal Solution Pac]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
link:https://github.com/zykh/walNUT[walNUT]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
NUT configuration and monitoring software for Eaton (previously MGE Office
Protection Systems) units.
link:http://www.amautacorp.com/staff/Rudd-O/ups-monitor/[UPS Monitor]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Multi-threaded python/GTK2 graphical monitoring application.
A Gnome Shell extension that uses upsc/upscmd to monitor devices and invoke instant commands.
link:http://sourceforge.net/projects/winnutclient[Windows NUT client]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@ -81,6 +69,7 @@ There are three different scripts that add NUT support to Cacti:
- link:http://forums.cacti.net/about14475.html[Ruby script]
- link:http://forums.cacti.net/about9729.html[shell script]
[[collectd]]
link:http://collectd.org[collectd]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@ -120,13 +109,8 @@ KNutSetting is a visual KDE tool for configuring NUT - Network UPS Tools.
Other software projects
-----------------------
link:http://www.the-mcdonalds.org/Nut-Graph/[Nut-Graph]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
PHP4 / GD / MySQL / jpgraph package to visualize logged UPS status data.
[[PyNUT]]
link:http://www.lestat.st/informatique/projets/pynut-en[PyNUT]
link:http://www.lestat.st/en/informatique/projets/pynut[PyNUT]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
PyNUT is an abstraction class written in Python to access NUT (Network UPS
@ -139,10 +123,10 @@ link:http://bugs.debian.org/343530[RRDtool logging support]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This patch adds link:http://oss.oetiker.ch/rrdtool[RRDtool] logging support to
NUT.
NUT. (See also <<collectd>>.)
link:http://home.tele2.fr/elrik/[ups_control]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
link:http://elrik75.free.fr/ups_control/[ups_control]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
A developing Python wrapper to upsc which can generate mails and shutdown the
machine.
@ -179,7 +163,7 @@ Synology
~~~~~~~~
link:http://www.synology.com[Synology] has worked closely with Arnaud to integrate
link:http://www.synology.com/enu/products/features/power.php[UPS support] on all
link:http://www.synology.com/support/faq_show.php?lang=enu&q_id=300[UPS support] on all
its devices.
Alcatel Lucent IPBX
@ -212,6 +196,33 @@ link:http://www.webbastards.com/projects/[lcd-nut]
A Project to display the status of a UPS on computer through one of the many
cheap LCD matrix displays available on the market.
Legacy and discontinued projects
--------------------------------
link:http://sourceforge.net/projects/gknut/[GKrellM NUT]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Simple UPS monitoring plugin for GKrellM. Uses NUT (Network UPS Tools) for UPS
connection.
Nut-Graph
~~~~~~~~~
PHP4 / GD / MySQL / jpgraph package to visualize logged UPS status data.
Eaton - Personal Solution Pac
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
NUT configuration and monitoring software for Eaton (previously MGE Office
Protection Systems) units.
UPS Monitor
~~~~~~~~~~~
Multi-threaded python/GTK2 graphical monitoring application.
Notes
-------

View file

@ -1,422 +1,577 @@
var NUT =
{
// UPS table DOM ids
listID: "#ups_list",
listBodyID: "#ups_list_body",
// Field names
fields:
[
"manufacturer",
"device-type",
"support-level",
"model",
"comment",
"driver"
],
// Actual HTML table columns
columns:
[
["manufacturer"],
["model","comment"],
["driver"],
["support-level"],
],
// driver => connection type mappings
driverMap: function(driver)
{
if(driver.match(/bcmxcp_usb|blazer_usb|richcomm_usb|tripplite_usb|usbhid-ups/))
return "USB";
if(driver.match(/snmp-ups|netxml-ups/))
return "Network";
return "Serial";
},
// Support level => CSS class mappings
supportLevelClasses:
{
0: "",
1: "red",
2: "orange",
3: "yellow",
4: "blue",
5: "green"
},
tableCache: false,
var NUT = {
// UPS table DOM ids
listID: "#ups_list",
listBodyID: "#ups_list_body",
// Field names
fields: [
"manufacturer",
"device-type",
"support-level",
"model",
"comment",
"driver"
],
// Actual HTML table columns
columns: [
[ "manufacturer" ],
[ "model", "comment" ],
[ "driver" ],
[ "support-level" ],
],
// driver => connection type mappings
driverMap: function(driver) {
// Try not to catch "usb" across a word boundary:
if (driver.match(/_usb|usbserial|usbhid-ups/))
return "USB";
// TODO: what about IPMI/powerman-pdu?
if (driver.match(/snmp-ups|netxml-ups/))
return "Network";
return "Serial";
},
// Support level => CSS class mappings
supportLevelClasses: {
0: "",
1: "red",
2: "orange",
3: "yellow",
4: "blue",
5: "green"
},
tableCache: false,
// Parse GET parameters from window url and return them as a hash
// The call format is:
// stable-hcl.html?<filter name>=<filter value>
// Refer to docs/stable-hcl.txt for examples
parseGetParameters: function() {
var url = window.location.href;
url = url.replace(/#$/, "");
var fieldPos = url.indexOf("?");
var get = {};
if (fieldPos > -1) {
var fileName = url.substring(0, fieldPos);
var getList = url.substring(fieldPos + 1).split("&");
for (var i = 0; i < getList.length; i++) {
var getField = getList[i].split("=");
key = unescape(getField[0]).toLowerCase();
value = unescape(getField[1]);
// just in case there are any old links out there.
if (key === "manufacturer" && value === "Tripp-Lite") {
value = "Tripp Lite";
}
get[key] = value;
}
}
return get;
},
// UPS filter renderers by data column index
filterRenderers: {
"support-level": function(value) {
var result = [];
for (var i = 0; i < value; i++)
result.push("*");
return result.join("");
},
"driver": function(value) {
return this.driverMap(value);
},
"device-type": function(value) {
var map = {
"pdu": "Power Distribution Unit",
"ups": "Uninterruptible Power Supply",
"scd": "Solar Controller Device"
}
return map[value];
}
},
// Specific filter handlers
filterHandlers: {
// Filter functions:
// @param {string} value value to filter
// @param {array} row raw data fields
// @return {boolean} true if value passes the filter, false otherwise
"driver": function(value, row) {
var driver = row[this.fields.indexOf("driver")];
if (this.driverMap(driver) == value)
return true;
return false;
},
"support-level": function(value, row) {
var level = row[this.fields.indexOf("support-level")];
if (level >= value)
return true;
return false;
}
},
// Returns rendered UPS data according to column index
// @param {integer} index
// @param {string} value
renderFilter: function(index, value) {
var renderer = this.filterRenderers[this.fields[index]];
if (typeof renderer == "function")
return renderer.call(this, value);
return value;
},
// Initialization method
init: function() {
this.initFilters();
this.sortUPSData(UPSData);
this.buildUPSList(UPSData);
this.buildFilters(UPSData);
var get = this.parseGetParameters();
for (var param in get) {
var filter = $("#"+param);
if (filter) {
filter.val(get[param]);
this.doFilter();
}
}
},
// Initialize filter filters references
initFilters: function() {
// Display filters fieldset hidden by default for user-agents not using javascript
$("#filters-set").show();
this.filters = {
"support-level": {
index: this.fields.indexOf("support-level"),
field: $("#support-level")
},
"device-type": {
index: this.fields.indexOf("device-type"),
field: $("#device-type")
},
"manufacturer": {
index: this.fields.indexOf("manufacturer"),
field: $("#manufacturer")
},
"model": {
index: this.fields.indexOf("model"),
field: $("#model")
},
"driver": {
index: this.fields.indexOf("driver"),
field: $("#connection")
}
}
},
// Sorts table data by manufacturer and driver
// @param {Object} data
sortUPSData: function(data) {
var mI = this.fields.indexOf("manufacturer"),
dI = this.fields.indexOf("driver");
data.sort(function(a, b) {
var toLower = function(ar) {
var res = ar.slice();
res.forEach(function(i, index) {
if (typeof i == "string")
res[index] = i.toLowerCase()
});
return res;
}
var c = toLower(a),
d = toLower(b);
return c[mI] == d[mI] ? c[dI] > d[dI] : c[mI] > d[mI];
});
},
// Builds UPS list from provided data
// @param {array} data
buildUPSList: function(data) {
var list = $(this.listBodyID);
// Initialize table cache
if (!this.tableCache)
this.tableCache = list.html();
// If we're rebuilding the original table, just use the one in cache
if (data == UPSData && this.tableCache) {
list.html(this.tableCache);
return;
}
list.empty();
// Bailout if no data
if (!data || data.length == 0)
return;
// Build rows
var cellHistory = [], rows = [];
var rowHistory = data[0][0];
var classes = [ "even", "odd" ],
manufIndex = this.fields.indexOf("manufacturer"),
currentClass = 0;
data.forEach(function(upsRow, rowIndex) {
if (upsRow[manufIndex] != rowHistory) {
currentClass = Number(!currentClass);
rowHistory = upsRow[manufIndex];
}
var cells = [];
// Build cells
this.columns.forEach(function(column, colIndex) {
var cellContent = [];
column.forEach(function(field) {
cellContent.push(upsRow[this.fields.indexOf(field)])
}, this);
cellContent = cellContent.join("<br />");
// Inspect the last cell on this column and increase row span if the current cell has the same content
var cH = cellHistory[colIndex];
if (column.indexOf("driver") == -1 && cH && cH.html == cellContent)
cH.rowSpan += 1;
else {
var cell = "";
if (column.indexOf("driver") != -1) {
cell = {
html: cellContent,
rowSpan: 1,
cls: this.supportLevelClasses[upsRow[this.fields.indexOf("support-level") || ""]]
};
} else {
cell = {
html: cellContent,
rowSpan: 1,
cls: classes[currentClass]
}
}
if (column.indexOf("support-level") != -1)
cell.cls += " hidden";
cells.push(cell);
cellHistory[colIndex] = cell;
}
}, this);
rows.push(cells);
}, this);
// Generate actual rows/cells tags
rows.forEach(function(r, index) {
r.forEach(function(c, index) {
r[index] = [ "<td class='", c.cls, "' rowspan='", c.rowSpan, "'>", c.html, "</td>" ].join("");
});
rows[index] = [ "<tr>", r.join(""), "</tr>" ].join("");
});
list.html(rows.join(""));
},
// Initialize filters event listeners
// @param {Object} data
buildFilters: function(data) {
for (var f in this.filters) {
var filter = this.filters[f];
this.populateCombo(data, filter);
filter.field.change(this.doFilter);
var op = $("#op-" + (filter.index));
if (op)
op.change(this.doFilter);
}
},
// Load data in filter combos
// @param {array} data
// @param {object} combo
// @param {integer} index
populateCombo: function(data, filter) {
var values = [];
var valueDict = {};
var combo = filter.field;
var oldValue = combo.val();
combo.html("<option value='-1'>---</option>");
// Special case for connection type
if (filter.field.attr("id") == "connection") {
[ "Serial", "USB", "Network" ].forEach(function(type) {
values.push([ type, type ]);
}, this);
} else {
data.forEach(function(row) {
var value = row[filter.index];
if (value != "" && !valueDict[value]) {
values.push([ value, this.renderFilter(filter.index, value) ]);
valueDict[value] = true;
}
}, this);
values = values.sort();
}
values.forEach(function(value) {
var option = $(document.createElement("option"));
option.val(value[0]);
option.text(value[1]);
combo.append(option);
}, this);
combo.val(oldValue);
},
// Apply selected filters on UPS list
doFilter: function() {
var initialRows = UPSData.slice();
var filteredRows = UPSData.slice();
// Applies a single filter on provided UPS data set
// @param {string} value
// @param {integer} index
// @param {array} data
// @returns {array} filtered data set
var applyFilter = function(value, index, data) {
var tmpData = [];
tmpData = data.slice();
tmpData.forEach(function(row, rowIndex) {
var field = row[index];
var handler = this.filterHandlers[this.fields[index]];
if (handler) {
if (!handler.apply(this, [ value, row ]))
data.splice(data.indexOf(row), 1);
} else if (row[index] != value)
data.splice(data.indexOf(row), 1);
}, this);
return data;
}
// Sequentially apply filters
for (var f in NUT.filters) {
var filter = NUT.filters[f];
var value = filter.field.val();
// Is filter active, i.e have the user picked a value in the filter combo
if (value != "-1") {
var opField = $("#op-" + filter.index);
filteredRows = applyFilter.apply(NUT, [ value, filter.index, filteredRows ]);
}
}
// Rebuild UPS list and combos according to filtered data
NUT.buildUPSList(filteredRows);
[ "manufacturer", "model", "driver" ].forEach(function(id) {
if (this.id != id)
this.populateCombo(filteredRows, this.filters[id]);
}, NUT);
},
resetCombos: function() {
for (var f in this.filters) {
var field = this.filters[f].field;
this.populateCombo(UPSData, this.filters[f]);
field.val("-1");
}
this.buildUPSList(UPSData);
}
// Parse GET parameters from window url and return them as a hash
// The call format is:
// stable-hcl.html?<filter name>=<filter value>
// Refer to docs/website/stable-hcl.txt for examples
parseGetParameters: function()
{
var url = window.location.href;
url = url.replace(/#$/, "");
var fieldPos = url.indexOf("?");
var get = {};
if(fieldPos > -1)
{
var fileName = url.substring(0, fieldPos);
var getList = url.substring(fieldPos + 1).split("&");
for(var i = 0; i<getList.length; i++)
{
var getField = getList[i].split("=");
get[unescape(getField[0])] = unescape(getField[1]);
}
}
return get;
},
// UPS filter renderers by data column index
filterRenderers:
{
"support-level": function(value)
{
var result = [];
for(var i = 0; i < value; i++) result.push("*");
return result.join("");
},
"driver": function(value)
{
return this.driverMap(value);
},
"device-type": function(value)
{
var map =
{
"pdu": "Power Distribution Unit",
"ups": "Uninterruptible Power Supply",
"scd": "Solar Controller Device"
}
return map[value];
}
},
// Specific filter handlers
filterHandlers:
{
/**
* @param {string} value value to filter
* @param {array} row raw data fields
* @return {boolean} true if value passes the filter, false otherwise
*/
"driver": function(value, row)
{
var driver = row[this.fields.indexOf("driver")];
if(this.driverMap(driver) == value) return true;
return false;
}
},
/**
* Returns rendered UPS data according to column index
* @param {integer} index
* @param {string} value
*/
renderFilter: function(index, value)
{
var renderer = this.filterRenderers[this.fields[index]];
if(typeof renderer == "function")
return renderer.call(this, value);
return value;
},
/**
* Initialization method
*/
init: function()
{
this.initFilters();
this.sortUPSData(UPSData);
this.buildUPSList(UPSData);
this.buildFilters(UPSData);
var get = this.parseGetParameters();
for(var param in get)
{
var filter = $("#"+param);
if(filter)
{
filter.val(get[param]);
this.doFilter();
}
}
},
/**
* Initialize filter filters references
*/
initFilters: function()
{
// Display filters fieldset hidden by default for user-agents not using javascript
$("#filters-set").show();
this.filters =
{
"support-level": { index: this.fields.indexOf("support-level"), field: $("#support-level") },
"device-type": { index: this.fields.indexOf("device-type"), field: $("#device-type") },
"manufacturer": { index: this.fields.indexOf("manufacturer"), field: $("#manufacturer") },
"model": { index: this.fields.indexOf("model"), field: $("#model") },
"driver": { index: this.fields.indexOf("driver"), field: $("#connection") }
}
},
/**
* Sorts table data by manufacturer and driver
* @param {Object} data
*/
sortUPSData: function(data)
{
var mI = this.fields.indexOf("manufacturer"), dI = this.fields.indexOf("driver");
data.sort(function(a,b)
{
var toLower = function(ar)
{
var res = ar.slice();
res.forEach(function(i, index) { if(typeof i == "string") res[index] = i.toLowerCase() });
return res;
}
var c = toLower(a), d = toLower(b);
return c[mI] == d[mI] ? c[dI] > d[dI] : c[mI] > d[mI];
});
},
/**
* Builds UPS list from provided data
* @param {array} data
*/
buildUPSList: function(data)
{
var list = $(this.listBodyID);
// Initialize table cache
if(!this.tableCache) this.tableCache = list.html();
// If we're rebuilding the original table, just use the one in cache
if(data == UPSData && this.tableCache)
{
list.html(this.tableCache);
return;
}
list.empty();
// Bailout if no data
if(!data || data.length == 0) return;
// Build rows
var cellHistory = [], rows = [];
var rowHistory = data[0][0];
var classes = ["even", "odd"], manufIndex = this.fields.indexOf("manufacturer"), currentClass = 0;
data.forEach(function(upsRow, rowIndex)
{
if(upsRow[manufIndex] != rowHistory)
{
currentClass = Number(!currentClass);
rowHistory = upsRow[manufIndex];
}
var cells = [];
// Build cells
this.columns.forEach(function(column, colIndex)
{
var cellContent = [];
column.forEach(function(field) {cellContent.push(upsRow[this.fields.indexOf(field)])}, this);
cellContent = cellContent.join("<br />");
// Inspect the last cell on this column and increase row span if the current cell has the same content
var cH = cellHistory[colIndex];
if(cH && cH.html == cellContent)
cH.rowSpan += 1;
else
{
var cell = "";
if(column.indexOf("driver") != -1)
{
cell = {html: cellContent, rowSpan: 1, cls: this.supportLevelClasses[upsRow[this.fields.indexOf("support-level") || ""]]};
}
else cell = {html: cellContent, rowSpan: 1, cls: classes[currentClass] }
if(column.indexOf("support-level") != -1) cell.cls += " hidden";
cells.push(cell);
cellHistory[colIndex] = cell;
}
}, this);
rows.push(cells);
}, this);
// Generate actual rows/cells tags
rows.forEach(function(r, index)
{
r.forEach(function(c, index)
{
r[index] = ["<td class='", c.cls, "' rowspan='", c.rowSpan, "'>", c.html, "</td>"].join("");
});
rows[index] = ["<tr>", r.join(""), "</tr>"].join("");
});
list.html(rows.join(""));
},
/**
* Initialize filters event listeners
* @param {Object} data
*/
buildFilters: function(data)
{
for(var f in this.filters)
{
var filter = this.filters[f];
this.populateCombo(data, filter);
filter.field.change(this.doFilter);
var op = $("#op-" + (filter.index));
if(op) op.change(this.doFilter);
}
},
/**
* Load data in filter combos
* @param {array} data
* @param {object} combo
* @param {integer} index
*/
populateCombo: function(data, filter)
{
var values = [];
var valueDict = {};
var combo = filter.field;
var oldValue = combo.val();
combo.html("<option value='-1'>---</option>");
// Special case for connection type
if(filter.field.attr("id") == "connection")
{
["Serial", "USB", "Network"].forEach(function(type)
{
values.push([type, type]);
}, this);
}
else
{
data.forEach(function(row)
{
var value = row[filter.index];
if(value != "" && !valueDict[value])
{
values.push([value, this.renderFilter(filter.index, value)]);
valueDict[value] = true;
}
}, this);
values = values.sort();
}
values.forEach(function(value)
{
var option = $(document.createElement("option"));
option.val(value[0]);
option.text(value[1]);
combo.append(option);
}, this);
combo.val(oldValue);
},
/**
* Apply selected filters on UPS list
*/
doFilter: function()
{
var initialRows = UPSData.slice();
var filteredRows = UPSData.slice();
/**
* Applies a single filter on provided UPS data set
* @param {string} value
* @param {integer} index
* @param {array} data
* @returns {array} filtered data set
*/
var applyFilter = function(value, index, data)
{
var tmpData = [];
tmpData = data.slice();
tmpData.forEach(function(row, rowIndex)
{
var field = row[index];
var handler = this.filterHandlers[this.fields[index]];
if(handler)
{
if(!handler.apply(this, [value, row]))
{
data.splice(data.indexOf(row), 1);
}
}
else if(row[index] != value) data.splice(data.indexOf(row), 1);
}, this);
return data;
}
// Sequentially apply filters
for(var f in NUT.filters)
{
var filter = NUT.filters[f];
var value = filter.field.val();
if(value != "-1") // Is filter active, i.e have the user picked a value in the filter combo
{
var opField = $("#op-" + filter.index);
filteredRows = applyFilter.apply(NUT, [value, filter.index, filteredRows]);
}
}
// Rebuild UPS list and combos according to filtered data
NUT.buildUPSList(filteredRows);
["manufacturer", "model", "driver"].forEach(function(id)
{
if(this.id != id) this.populateCombo(filteredRows, this.filters[id]);
}, NUT);
},
resetCombos: function()
{
for(var f in this.filters)
{
var field = this.filters[f].field;
this.populateCombo(UPSData, this.filters[f]);
field.val("-1");
}
this.buildUPSList(UPSData);
}
}
if(typeof Array.prototype.indexOf != "function")
{
Array.prototype.indexOf = function(elt)
{
var i = 0;
while(i < this.length)
{
if(this[i] == elt) return i;
i++;
}
return -1;
}
if (typeof Array.prototype.indexOf != "function") {
Array.prototype.indexOf = function(elt) {
var i = 0;
while (i < this.length) {
if (this[i] == elt)
return i;
i++;
}
return -1;
}
}
if(typeof Array.prototype.forEach != "function")
{
Array.prototype.forEach = function(cb, scope)
{
for (var i = 0, n = this.length; i<n; i++)
if (i in this)
cb.call(scope, this[i], i, this);
}
if (typeof Array.prototype.forEach != "function") {
Array.prototype.forEach = function(cb, scope) {
for (var i = 0, n = this.length; i < n; i++) {
if (i in this)
cb.call(scope, this[i], i, this);
}
}
}
// Global initialization
$(function()
{
NUT.init.call(NUT);
$(function() {
NUT.init.call(NUT);
});

View file

@ -81,7 +81,8 @@ endif::hcl[]
<li><a href="stable-hcl.html">Compatibility</a></li>
<li><a href="documentation.html">Documentation</a></li>
<li><a href="support.html">Support</a></li>
<li><a href="https://alioth.debian.org/projects/nut/">Alioth Forge</a></li>
<li><a href="https://github.com/networkupstools/nut/">GitHub</a></li>
<li><a href="https://alioth.debian.org/projects/nut/">Alioth (old)</a></li>
</ul>
<!-- div id="sponsor"><span>Hosted by<br/></span>
<a href="http://sponsor.com"><img src="images/sponsor-logo.png" alt="Sponsor" /></a>