From a4c7bd90e9efd3acea6a3cb773138a50fcac62f7 Mon Sep 17 00:00:00 2001 From: Treer Date: Sat, 13 Aug 2016 23:31:25 +1000 Subject: [PATCH 1/6] switching to Bootstrap/php UI --- sysutils/pfSense-pkg-LCDproc/Makefile | 11 +- .../files/etc/inc/priv/lcdproc.priv.inc | 7 +- .../files/usr/local/pkg/lcdproc.xml | 653 +----------------- .../usr/local/www/packages/lcdproc/index.php | 6 + .../local/www/packages/lcdproc/lcdproc.php | 106 +++ .../www/packages/lcdproc/lcdproc_screens.php | 187 +++++ sysutils/pfSense-pkg-LCDproc/pkg-plist | 4 +- 7 files changed, 315 insertions(+), 659 deletions(-) create mode 100644 sysutils/pfSense-pkg-LCDproc/files/usr/local/www/packages/lcdproc/index.php create mode 100644 sysutils/pfSense-pkg-LCDproc/files/usr/local/www/packages/lcdproc/lcdproc.php create mode 100644 sysutils/pfSense-pkg-LCDproc/files/usr/local/www/packages/lcdproc/lcdproc_screens.php diff --git a/sysutils/pfSense-pkg-LCDproc/Makefile b/sysutils/pfSense-pkg-LCDproc/Makefile index e4925739e44d..7ba30c133c19 100644 --- a/sysutils/pfSense-pkg-LCDproc/Makefile +++ b/sysutils/pfSense-pkg-LCDproc/Makefile @@ -1,7 +1,7 @@ # $FreeBSD$ PORTNAME= pfSense-pkg-LCDproc -PORTVERSION= 0.9.15 +PORTVERSION= 0.10.0 CATEGORIES= sysutils MASTER_SITES= # empty DISTFILES= # empty @@ -44,15 +44,20 @@ do-extract: do-install: ${MKDIR} ${STAGEDIR}${PREFIX}/pkg ${MKDIR} ${STAGEDIR}/etc/inc/priv + ${MKDIR} ${STAGEDIR}${PREFIX}/www/packages/lcdproc ${MKDIR} ${STAGEDIR}${DATADIR} ${INSTALL_DATA} -m 0644 ${FILESDIR}${PREFIX}/pkg/lcdproc.xml \ ${STAGEDIR}${PREFIX}/pkg - ${INSTALL_DATA} -m 0644 ${FILESDIR}${PREFIX}/pkg/lcdproc_screens.xml \ - ${STAGEDIR}${PREFIX}/pkg ${INSTALL_DATA} -m 0644 ${FILESDIR}${PREFIX}/pkg/lcdproc_client.php \ ${STAGEDIR}${PREFIX}/pkg ${INSTALL_DATA} ${FILESDIR}${PREFIX}/pkg/lcdproc.inc \ ${STAGEDIR}${PREFIX}/pkg + ${INSTALL_DATA} ${FILESDIR}${PREFIX}/www/packages/lcdproc/lcdproc.php \ + ${STAGEDIR}${PREFIX}/www/packages/lcdproc + ${INSTALL_DATA} ${FILESDIR}${PREFIX}/www/packages/lcdproc/lcdproc_screens.php \ + ${STAGEDIR}${PREFIX}/www/packages/lcdproc + ${INSTALL_DATA} ${FILESDIR}${PREFIX}/www/packages/lcdproc/index.php \ + ${STAGEDIR}${PREFIX}/www/packages/lcdproc ${INSTALL_DATA} ${FILESDIR}/etc/inc/priv/lcdproc.priv.inc \ ${STAGEDIR}/etc/inc/priv ${INSTALL_DATA} ${FILESDIR}${DATADIR}/info.xml \ diff --git a/sysutils/pfSense-pkg-LCDproc/files/etc/inc/priv/lcdproc.priv.inc b/sysutils/pfSense-pkg-LCDproc/files/etc/inc/priv/lcdproc.priv.inc index 6b2c061fe85b..3f58088ffa73 100644 --- a/sysutils/pfSense-pkg-LCDproc/files/etc/inc/priv/lcdproc.priv.inc +++ b/sysutils/pfSense-pkg-LCDproc/files/etc/inc/priv/lcdproc.priv.inc @@ -32,9 +32,8 @@ $priv_list['page-services-lcdproc'] = array(); $priv_list['page-services-lcdproc']['name'] = "WebCfg - Services: LCDproc package"; $priv_list['page-services-lcdproc']['descr'] = "Allow access to LCDproc package GUI"; $priv_list['page-services-lcdproc']['match'] = array(); -$priv_list['page-services-lcdproc']['match'][] = "pkg.php?xml=lcdproc.xml*"; -$priv_list['page-services-lcdproc']['match'][] = "pkg.php?xml=lcdproc_screens.xml*"; -$priv_list['page-services-lcdproc']['match'][] = "pkg_edit.php?xml=lcdproc.xml*"; -$priv_list['page-services-lcdproc']['match'][] = "pkg_edit.php?xml=lcdproc_screens.xml*"; +$priv_list['page-services-lcdproc']['match'][] = "packages/lcdproc/lcdproc.php*"; +$priv_list['page-services-lcdproc']['match'][] = "packages/lcdproc/lcdproc_screens.php*"; +$priv_list['page-services-lcdproc']['match'][] = "packages/lcdproc/index.php*"; ?> diff --git a/sysutils/pfSense-pkg-LCDproc/files/usr/local/pkg/lcdproc.xml b/sysutils/pfSense-pkg-LCDproc/files/usr/local/pkg/lcdproc.xml index cab0ae8cbc33..42e4227aa824 100644 --- a/sysutils/pfSense-pkg-LCDproc/files/usr/local/pkg/lcdproc.xml +++ b/sysutils/pfSense-pkg-LCDproc/files/usr/local/pkg/lcdproc.xml @@ -45,24 +45,13 @@ Services: LCDproc lcdproc - 0.9.15 + 0.10.0 /usr/local/pkg/lcdproc.inc - - - Server - /pkg_edit.php?xml=lcdproc.xml - - - - Screens - /pkg_edit.php?xml=lcdproc_screens.xml - - LCDproc Set LCDproc settings such as display driver and COM port.
Services
- /pkg_edit.php?xml=lcdproc.xml + /packages/lcdproc/lcdproc.php
lcdproc @@ -70,644 +59,6 @@ LCDd LCD Driver - - - Enable LCDproc - enable - checkbox - - - comport - COM Port - Set the COM port LCDproc should use. - select - - - - - - - - - - - - - - - ucom1 - - - size - Display Size - Set the display size lcdproc should use. - select - - - - - - - - - - - - 16x2 - - - driver - Driver - Set the LCD driver LCDproc should use. - select - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - pyramid - - - connection_type - Connection Type - Set connection type for the HD44780 driver - select - - - - - - - - - - - - - - - - - - - - - lcd2usb - - - refresh_frequency - Refresh frequency - Set the refresh frequency of the information on the LCD Panel - select - - - - - - - - 5 - - - port_speed - Port speed - - - Caution: not all the driver or panels support all the speeds, leave "default" if unsure. - ]]> - - select - - - - - - - - - - 0 - - - brightness - Brightness - - - This option is not supported by all the LCD panels, leave "default" if unsure. - ]]> - - select - - - - - - - - - - - - - - - -1 - - - offbrightness - Off brightness - - - This option is not supported by all the LCD panels, leave "default" if unsure. - ]]> - - select - - - - - - - - - - - - - - - -1 - - - contrast - Contrast - - - This option is not supported by all the LCD panels, leave "default" if unsure. - ]]> - - select - - - - - - - - - - - - - - - -1 - - - backlight - Backlight - - - This option is not supported by all the LCD panels, leave "default" if unsure. - ]]> - - select - - - - - - default - - - outputleds - Enable Output LEDs - - - Each LED can be off or show two colors: RED (alarm) or GREEN (everything ok) and shows:
- LED1: NICs status (green: ok, red: at least one nic down)
- LED2: CARP status (green: master, red: backup, off: CARP not implemented)
- LED3: CPU status (green < 50%, red > 50%)
- LED4: Gateway status (green: ok, red: at least one gateway not responding, off: no gateway configured). - ]]> -
- checkbox - default -
-
validate_form_lcdproc($_POST, $input_errors); diff --git a/sysutils/pfSense-pkg-LCDproc/files/usr/local/www/packages/lcdproc/index.php b/sysutils/pfSense-pkg-LCDproc/files/usr/local/www/packages/lcdproc/index.php new file mode 100644 index 000000000000..24237ecc446d --- /dev/null +++ b/sysutils/pfSense-pkg-LCDproc/files/usr/local/www/packages/lcdproc/index.php @@ -0,0 +1,6 @@ + diff --git a/sysutils/pfSense-pkg-LCDproc/files/usr/local/www/packages/lcdproc/lcdproc.php b/sysutils/pfSense-pkg-LCDproc/files/usr/local/www/packages/lcdproc/lcdproc.php new file mode 100644 index 000000000000..75372ff0d536 --- /dev/null +++ b/sysutils/pfSense-pkg-LCDproc/files/usr/local/www/packages/lcdproc/lcdproc.php @@ -0,0 +1,106 @@ + + Copyright (C) 2009 Scott Ullrich + Copyright (C) 2011 Michele Di Maria + Copyright (C) 2016 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. + + 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. +*/ +require_once("guiconfig.inc"); +require_once("/usr/local/pkg/lcdproc.inc"); + +$a_lcdproc = &$config['lcdproc']['item']; + +/* +if ($_GET['act'] == "del") { + if ($_GET['type'] == 'php') { + if ($a_lcdproc[$_GET['id']]) { + unset($a_lcdproc[$_GET['id']]); + write_config(); + header("Location: lcdproc.php"); + exit; + } + } +}*/ + +$pgtitle = array(gettext("Services"), gettext("LCDproc"), gettext("Server")); +include("head.inc"); + +$tab_array = array(); +$tab_array[] = array(gettext("Server"), true, "/packages/lcdproc/lcdproc.php"); +$tab_array[] = array(gettext("Screens"), false, "/packages/lcdproc/lcdproc_screens.php"); +display_top_tabs($tab_array); + +// The constructor for Form automatically creates a submit button. If you want to suppress that +// use Form(false), of specify a different button using Form($mybutton) +$form = new Form(); + +// Create a new form section and give it a title +$section = new Form_Section('General Options'); + +// Add a checkbox to our new form section +$section->addInput( + new Form_Checkbox( + 'enable', // checkbox name (id) + 'Enable', // checkbox label + 'Enable LCDproc at startup', // checkbox text + $pconfig['enable'] // checkbox initial value + ) +); + +// ucom1 +// Add a selector (option) box passing the selector values in an associative array +$section->addInput( + new Form_Select( + 'comport', + 'Com port', + $pconfig['comport'], // Initial value. + [ + 'none' => 'none', + 'com1' => 'Serial COM port 1 (/dev/cua0)', + 'com2' => 'Serial COM port 2 (/dev/cua1)', + 'com1a' => 'Serial COM port 1 alternate (/dev/cuau0)', + 'com2a' => 'Serial COM port 2 alternate (/dev/cuau1)', + 'ucom1' => 'USB COM port 1 (/dev/cuaU0)', + 'ucom2' => 'USB COM port 2 (/dev/cuaU1)', + 'lpt1' => 'Parallel port 1 (/dev/lpt0)', + 'ugen0.2' => 'USB COM port 1 alternate (/dev/ugen0.2)', + 'ugen1.2' => 'USB COM port 2 alternate (/dev/ugen1.2)', + 'ugen1.3' => 'USB COM port 3 alternate (/dev/ugen1.3)', + 'ugen2.2' => 'USB COM port 4 alternate (/dev/ugen2.2)' + ] + ) +)->setHelp('Set the com port LCDproc should use.'); + + +$form->add($section); // Add the section to our form +?> +
+ LCDproc documentation.', info)?> +
+ + diff --git a/sysutils/pfSense-pkg-LCDproc/files/usr/local/www/packages/lcdproc/lcdproc_screens.php b/sysutils/pfSense-pkg-LCDproc/files/usr/local/www/packages/lcdproc/lcdproc_screens.php new file mode 100644 index 000000000000..0d9cdd32c95f --- /dev/null +++ b/sysutils/pfSense-pkg-LCDproc/files/usr/local/www/packages/lcdproc/lcdproc_screens.php @@ -0,0 +1,187 @@ +addInput(new Form_Input( + 'minute', + 'Minute', + 'text', + $pconfig['minute'] +))->setHelp("The minute(s) at which the command will be executed. (0-59, ranges, or divided, *=all)"); + +$section->addInput(new Form_Input( + 'hour', + 'Hour', + 'text', + $pconfig['hour'] +))->setHelp("The hour(s) at which the command will be executed. (0-23, ranges, or divided, *=all)"); + +$section->addInput(new Form_Input( + 'mday', + 'Day of the Month', + 'text', + $pconfig['mday'] +))->setHelp("The day(s) of the month on which the command will be executed. (1-31, ranges, or divided, *=all)"); + +$section->addInput(new Form_Input( + 'month', + 'Month of the Year', + 'text', + $pconfig['month'] +))->setHelp("The month(s) of the year during which the command will be executed. (1-12, ranges, or divided, *=all)"); + +$section->addInput(new Form_Input( + 'wday', + 'Day of the Week', + 'text', + $pconfig['wday'] +))->setHelp("The day(s) of the week on which the command will be executed. (0-7, 7=Sun or use names, ranges, or divided, *=all)"); + +$section->addInput(new Form_Input( + 'who', + 'User', + 'text', + $pconfig['who'] +))->setHelp("The user executing the command (typically \"root\")"); + +$section->addInput(new Form_Textarea( + 'command', + 'Command', + $pconfig['command'] +))->setHelp("The full path to the command, plus parameters."); + +$form->add($section); + +$btncncl = new Form_Button( + 'cancel', + 'Cancel' +); + +$btncncl->removeClass('btn-primary')->addClass('btn-danger'); + +$form->addGlobal($btncncl); + +print $form; + +?> +
+ Ranges may also be used, for example "1-5" in the "Day of Week" field means Monday through Friday' . + '
Time entries may be divided and will be executed when they divide evenly, for example "*/15" in the Minute field means "Every 15 minutes".' . + '

For more information see: FreeBSD Handbook - Configuring cron(8) ' . + 'and crontab(5) man page.', info)?> +
+ + diff --git a/sysutils/pfSense-pkg-LCDproc/pkg-plist b/sysutils/pfSense-pkg-LCDproc/pkg-plist index 4ea59d2f89fa..2a47972c2d83 100644 --- a/sysutils/pfSense-pkg-LCDproc/pkg-plist +++ b/sysutils/pfSense-pkg-LCDproc/pkg-plist @@ -1,7 +1,9 @@ pkg/lcdproc.xml -pkg/lcdproc_screens.xml pkg/lcdproc.inc pkg/lcdproc_client.php +www/packages/lcdproc/lcdproc.php +www/packages/lcdproc/lcdproc_screens.php +www/packages/lcdproc/index.php /etc/inc/priv/lcdproc.priv.inc %%DATADIR%%/info.xml @dir /etc/inc/priv From bea50446a119b238c34f405dfdec1bb6b098cb27 Mon Sep 17 00:00:00 2001 From: Treer Date: Sun, 14 Aug 2016 03:33:23 +1000 Subject: [PATCH 2/6] Converted first page to Bootstrap --- .../local/www/packages/lcdproc/lcdproc.php | 294 ++++++++++++++++-- sysutils/pfSense-pkg-LCDproc/pkg-plist | 2 +- 2 files changed, 277 insertions(+), 19 deletions(-) diff --git a/sysutils/pfSense-pkg-LCDproc/files/usr/local/www/packages/lcdproc/lcdproc.php b/sysutils/pfSense-pkg-LCDproc/files/usr/local/www/packages/lcdproc/lcdproc.php index 75372ff0d536..369824a81f6e 100644 --- a/sysutils/pfSense-pkg-LCDproc/files/usr/local/www/packages/lcdproc/lcdproc.php +++ b/sysutils/pfSense-pkg-LCDproc/files/usr/local/www/packages/lcdproc/lcdproc.php @@ -33,36 +33,63 @@ require_once("guiconfig.inc"); require_once("/usr/local/pkg/lcdproc.inc"); -$a_lcdproc = &$config['lcdproc']['item']; +$lcdproc_config = &$config['installedpackages']['lcdproc']['config'][0]; +$lcdproc_screens_config = &$config['installedpackages']['lcdprocscreens']['config'][0]; -/* -if ($_GET['act'] == "del") { - if ($_GET['type'] == 'php') { - if ($a_lcdproc[$_GET['id']]) { - unset($a_lcdproc[$_GET['id']]); - write_config(); - header("Location: lcdproc.php"); - exit; - } +// Set default values for anything not in the $config +$pconfig = $lcdproc_config; +if (!isset($pconfig['enabled'])) $pconfig['enabled'] = 'no'; +if (!isset($pconfig['comport'])) $pconfig['enabled'] = 'ucom1'; +if (!isset($pconfig['size'])) $pconfig['size'] = '16x2'; +if (!isset($pconfig['driver'])) $pconfig['driver'] = 'pyramid'; +if (!isset($pconfig['connection_type'])) $pconfig['connection_type'] = 'lcd2usb'; +if (!isset($pconfig['refresh_frequency'])) $pconfig['refresh_frequency'] = '5'; +if (!isset($pconfig['port_speed'])) $pconfig['port_speed'] = '0'; +if (!isset($pconfig['brightness'])) $pconfig['brightness'] = '-1'; +if (!isset($pconfig['offbrightness'])) $pconfig['offbrightness'] = '-1'; +if (!isset($pconfig['contrast'])) $pconfig['contrast'] = '-1'; +if (!isset($pconfig['backlight'])) $pconfig['backlight'] = 'default'; +if (!isset($pconfig['outputleds'])) $pconfig['outputleds'] = 'no'; + + +if ($_POST) { + unset($input_errors); + $pconfig = $_POST; + + if (!$input_errors) { + $lcdproc_config['enabled'] = $pconfig['enabled']; + $lcdproc_config['enabled'] = $pconfig['enabled']; + $lcdproc_config['size'] = $pconfig['size']; + $lcdproc_config['driver'] = $pconfig['driver']; + $lcdproc_config['connection_type'] = $pconfig['connection_type']; + $lcdproc_config['refresh_frequency'] = $pconfig['refresh_frequency']; + $lcdproc_config['port_speed'] = $pconfig['port_speed']; + $lcdproc_config['brightness'] = $pconfig['brightness']; + $lcdproc_config['offbrightness'] = $pconfig['offbrightness']; + $lcdproc_config['contrast'] = $pconfig['contrast']; + $lcdproc_config['backlight'] = $pconfig['backlight']; + $lcdproc_config['outputleds'] = $pconfig['outputleds']; + + write_config(); + sync_package_lcdproc(); } -}*/ +} + $pgtitle = array(gettext("Services"), gettext("LCDproc"), gettext("Server")); include("head.inc"); $tab_array = array(); -$tab_array[] = array(gettext("Server"), true, "/packages/lcdproc/lcdproc.php"); +$tab_array[] = array(gettext("Server"), true, "/packages/lcdproc/lcdproc.php"); $tab_array[] = array(gettext("Screens"), false, "/packages/lcdproc/lcdproc_screens.php"); display_top_tabs($tab_array); // The constructor for Form automatically creates a submit button. If you want to suppress that // use Form(false), of specify a different button using Form($mybutton) $form = new Form(); +$section = new Form_Section('LCD Options'); -// Create a new form section and give it a title -$section = new Form_Section('General Options'); - -// Add a checkbox to our new form section +// Add the Enable checkbox $section->addInput( new Form_Checkbox( 'enable', // checkbox name (id) @@ -72,8 +99,7 @@ ) ); -// ucom1 -// Add a selector (option) box passing the selector values in an associative array +// Add the com port selector $section->addInput( new Form_Select( 'comport', @@ -96,9 +122,241 @@ ) )->setHelp('Set the com port LCDproc should use.'); +$section->addInput( + new Form_Select( + 'size', + 'Display Size', + $pconfig['size'], // Initial value. + [ + '12x1' => '1 rows 12 colums', + '12x2' => '2 rows 12 colums', + '12x4' => '4 rows 12 colums', + '16x1' => '1 row 16 colums', + '16x2' => '2 rows 16 colums', + '16x4' => '4 rows 16 colums', + '20x1' => '1 row 20 colums', + '20x2' => '2 rows 20 colums', + '20x4' => '4 rows 20 colums' + ] + ) +)->setHelp('Set the display size lcdproc should use.'); + +$section->addInput( + new Form_Select( + 'driver', + 'Driver', + $pconfig['driver'], // Initial value. + [ + 'bayrad' => 'bayrad', + 'CFontz' => 'CrystalFontz', + 'CFontz633' => 'CrystalFontz 633', + 'CFontzPacket' => 'CrystalFontz Packet', + 'curses' => 'curses', + 'CwLnx' => 'CwLnx', + 'ea65' => 'ea65', + 'EyeboxOne' => 'EyeboxOne', + 'glk' => 'glk', + 'hd44780' => 'hd44780', + 'icp_a106' => 'icp_a106', + 'IOWarrior' => 'IOWarrior', + 'lb216' => 'lb216', + 'lcdm001' => 'lcdm001', + 'lcterm' => 'lcterm', + 'MD8800' => 'MD8800', + 'ms6931' => 'ms6931', + 'mtc_s16209x' => 'mtc_s16209x', + 'MtxOrb' => 'MtxOrb', + 'nexcom' => 'nexcom (x86 only)', + 'NoritakeVFD' => 'NoritakeVFD', + 'picolcd' => 'picolcd', + 'pyramid' => 'pyramid', + 'sdeclcd' => 'Watchguard Firebox with SDEC', + 'sed1330' => 'sed1330', + 'sed1520' => 'sed1520', + 'serialPOS' => 'serialPOS', + 'serialVFD' => 'serialVFD', + 'shuttleVFD' => 'shuttleVFD', + 'sli' => 'sli', + 'stv5730' => 'stv5730', + 'SureElec' => 'Sure Electronics', + 't6963' => 't6963', + 'text' => 'text', + 'tyan' => 'tyan' + ] + ) +)->setHelp('Set the LCD driver LCDproc should use.'); + +$section->addInput( + new Form_Select( + 'connection_type', + 'Connection Type', + $pconfig['connection_type'], // Initial value. + [ + '4bit' => '4bit wiring to parallel port', + '8bit' => '8bit wiring to parallel port (lcdtime)', + 'winamp' => '8bit wiring winamp style to parallel port', + 'serialLpt' => 'Serial LPT wiring', + 'picanlcd' => 'PIC-an-LCD serial device', + 'lcdserializer' => 'LCD serializer', + 'los-panel' => 'LCD on serial panel device', + 'vdr-lcd' => 'VDR LCD serial device', + 'vdr-wakeup' => 'VDR-Wakeup module', + 'pertelian' => 'Pertelian X2040 LCD', + 'bwctusb' => 'BWCT USB device', + 'lcd2usb' => 'Till Harbaum\'s LCD2USB', + 'usbtiny' => 'Dick Streefland\'s USBtiny', + 'lis2' => 'LIS2 from VLSystem', + 'mplay' => 'MPlay Blast from VLSystem', + 'ftdi' => 'LCD connected to FTDI 2232D USB chip', + 'usblcd' => 'USBLCD adapter from Adams IT Services', + 'i2c' => 'LCD driven by PCF8574/PCA9554 connected via i2c' + ] + ) +)->setHelp('Set connection type for the HD44780 driver'); + +$section->addInput( + new Form_Select( + 'refresh_frequency', + 'Refresh frequency', + $pconfig['refresh_frequency'], // Initial value. + [ + '1' => '1 second', + '2' => '2 seconds', + '3' => '3 seconds', + '5' => '5 seconds', + '10' => '10 seconds', + '15' => '15 seconds' + ] + ) +)->setHelp('Set the refresh frequency of the information on the LCD Panel'); + +$section->addInput( + new Form_Select( + 'port_speed', + 'Port speed', + $pconfig['port_speed'], // Initial value. + [ + '0' => 'Default', + '1200' => '1200 bps', + '2400' => '2400 bps', + '9600' => '9600 bps', + '19200' => '19200 bps', + '57600' => '57600 bps', + '115200' => '115200 bps' + ] + ) +)->setHelp('Set the port speed.
Caution: not all the driver or panels support all the speeds, leave "default" if unsure.'); + +$section->addInput( + new Form_Select( + 'brightness', + 'Brightness', + $pconfig['brightness'], // Initial value. + [ + '-1' => 'Default', + '0' => '0%', + '10' => '10%', + '20' => '20%', + '30' => '30%', + '40' => '40%', + '50' => '50%', + '60' => '60%', + '70' => '70%', + '80' => '80%', + '90' => '90%', + '100' => '100%' + ] + ) +)->setHelp('Set the brightness of the LCD panel.
This option is not supported by all the LCD panels, leave "default" if unsure.'); + +$section->addInput( + new Form_Select( + 'offbrightness', + 'Off brightness', + $pconfig['offbrightness'], // Initial value. + [ + '-1' => 'Default', + '0' => '0%', + '10' => '10%', + '20' => '20%', + '30' => '30%', + '40' => '40%', + '50' => '50%', + '60' => '60%', + '70' => '70%', + '80' => '80%', + '90' => '90%', + '100' => '100%' + ] + ) +)->setHelp( + 'Set the off-brightness of the LCD panel. This value is used when the display is normally switched off in case LCDd is inactive.
' . + 'This option is not supported by all the LCD panels, leave "default" if unsure.' +); + +$section->addInput( + new Form_Select( + 'contrast', + 'Contrast', + $pconfig['contrast'], // Initial value. + [ + '-1' => 'Default', + '0' => '0%', + '10' => '10%', + '20' => '20%', + '30' => '30%', + '40' => '40%', + '50' => '50%', + '60' => '60%', + '70' => '70%', + '80' => '80%', + '90' => '90%', + '100' => '100%' + ] + ) +)->setHelp( + 'Set the contrast of the LCD panel.
' . + 'This option is not supported by all the LCD panels, leave "default" if unsure.' +); + +$section->addInput( + new Form_Select( + 'backlight', + 'Backlight', + $pconfig['backlight'], // Initial value. + [ + 'default' => 'Default', + 'on' => 'On', + 'off' => 'Off' + ] + ) +)->setHelp( + 'Set the backlight setting. If set to the default value, then the backlight setting of the display can be influenced by the clients.
' . + 'This option is not supported by all the LCD panels, leave "default" if unsure.' +); + +$section->addInput( + new Form_Checkbox( + 'outputleds', // checkbox name (id) + 'Enable Output LEDs', // checkbox label + 'Enable the Output LEDs present on some LCD panels.', // checkbox text + $pconfig['outputleds'] // checkbox initial value + ) +)->setHelp( + 'This feature is currently supported by the CFontz633 driver only.
' . + 'Each LED can be off or show two colors: RED (alarm) or GREEN (everything ok) and shows:
' . + 'LED1: NICs status (green: ok, red: at least one nic down)
' . + 'LED2: CARP status (green: master, red: backup, off: CARP not implemented)
' . + 'LED3: CPU status (green < 50%, red > 50%)
' . + 'LED4: Gateway status (green: ok, red: at least one gateway not responding, off: no gateway configured).' +); + $form->add($section); // Add the section to our form +print($form); // Finally . . We can display our new form + ?> +
LCDproc documentation.', info)?>
diff --git a/sysutils/pfSense-pkg-LCDproc/pkg-plist b/sysutils/pfSense-pkg-LCDproc/pkg-plist index 2a47972c2d83..7edb31a3a6e1 100644 --- a/sysutils/pfSense-pkg-LCDproc/pkg-plist +++ b/sysutils/pfSense-pkg-LCDproc/pkg-plist @@ -1,9 +1,9 @@ pkg/lcdproc.xml pkg/lcdproc.inc pkg/lcdproc_client.php +/etc/inc/priv/lcdproc.priv.inc www/packages/lcdproc/lcdproc.php www/packages/lcdproc/lcdproc_screens.php www/packages/lcdproc/index.php -/etc/inc/priv/lcdproc.priv.inc %%DATADIR%%/info.xml @dir /etc/inc/priv From cb483c33f7cd197980b6fc28f4e1f9b35279efba Mon Sep 17 00:00:00 2001 From: Treer Date: Sun, 14 Aug 2016 05:46:43 +1000 Subject: [PATCH 3/6] Converted most of the second screen --- .../files/usr/local/pkg/lcdproc_client.php | 4 +- .../local/www/packages/lcdproc/lcdproc.php | 10 +- .../www/packages/lcdproc/lcdproc_screens.php | 318 +++++++++++------- 3 files changed, 198 insertions(+), 134 deletions(-) diff --git a/sysutils/pfSense-pkg-LCDproc/files/usr/local/pkg/lcdproc_client.php b/sysutils/pfSense-pkg-LCDproc/files/usr/local/pkg/lcdproc_client.php index 6635bf7f365a..346227688abb 100644 --- a/sysutils/pfSense-pkg-LCDproc/files/usr/local/pkg/lcdproc_client.php +++ b/sysutils/pfSense-pkg-LCDproc/files/usr/local/pkg/lcdproc_client.php @@ -595,7 +595,7 @@ function build_interface($lcd) { /* process screens to display */ if (is_array($lcdproc_screens_config)) { foreach ($lcdproc_screens_config as $name => $screen) { - if ($screen == "on") { + if ($screen == "on" || $screen == "yes" ) { switch($name) { case "scr_version": $lcd_cmds[] = "screen_add $name"; @@ -817,7 +817,7 @@ function loop_status($lcd) { /* process screens to display */ foreach ((array) $lcdproc_screens_config as $name => $screen) { - if ($screen != "on") { + if ($screen != "on" && $screen != "yes") { continue; } switch($name) { diff --git a/sysutils/pfSense-pkg-LCDproc/files/usr/local/www/packages/lcdproc/lcdproc.php b/sysutils/pfSense-pkg-LCDproc/files/usr/local/www/packages/lcdproc/lcdproc.php index 369824a81f6e..82572391f706 100644 --- a/sysutils/pfSense-pkg-LCDproc/files/usr/local/www/packages/lcdproc/lcdproc.php +++ b/sysutils/pfSense-pkg-LCDproc/files/usr/local/www/packages/lcdproc/lcdproc.php @@ -38,7 +38,7 @@ // Set default values for anything not in the $config $pconfig = $lcdproc_config; -if (!isset($pconfig['enabled'])) $pconfig['enabled'] = 'no'; +if (!isset($pconfig['enable'])) $pconfig['enable'] = ''; if (!isset($pconfig['comport'])) $pconfig['enabled'] = 'ucom1'; if (!isset($pconfig['size'])) $pconfig['size'] = '16x2'; if (!isset($pconfig['driver'])) $pconfig['driver'] = 'pyramid'; @@ -57,8 +57,8 @@ $pconfig = $_POST; if (!$input_errors) { - $lcdproc_config['enabled'] = $pconfig['enabled']; - $lcdproc_config['enabled'] = $pconfig['enabled']; + $lcdproc_config['enable'] = $pconfig['enable']; + $lcdproc_config['comport'] = $pconfig['comport']; $lcdproc_config['size'] = $pconfig['size']; $lcdproc_config['driver'] = $pconfig['driver']; $lcdproc_config['connection_type'] = $pconfig['connection_type']; @@ -79,6 +79,10 @@ $pgtitle = array(gettext("Services"), gettext("LCDproc"), gettext("Server")); include("head.inc"); +if ($input_errors) { + print_input_errors($input_errors); +} + $tab_array = array(); $tab_array[] = array(gettext("Server"), true, "/packages/lcdproc/lcdproc.php"); $tab_array[] = array(gettext("Screens"), false, "/packages/lcdproc/lcdproc_screens.php"); diff --git a/sysutils/pfSense-pkg-LCDproc/files/usr/local/www/packages/lcdproc/lcdproc_screens.php b/sysutils/pfSense-pkg-LCDproc/files/usr/local/www/packages/lcdproc/lcdproc_screens.php index 0d9cdd32c95f..f91e404e03b6 100644 --- a/sysutils/pfSense-pkg-LCDproc/files/usr/local/www/packages/lcdproc/lcdproc_screens.php +++ b/sysutils/pfSense-pkg-LCDproc/files/usr/local/www/packages/lcdproc/lcdproc_screens.php @@ -28,74 +28,59 @@ POSSIBILITY OF SUCH DAMAGE. */ require_once("guiconfig.inc"); -require_once("/usr/local/pkg/cron.inc"); - -$a_cron = &$config['cron']['item']; - -$id = $_GET['id']; -if (isset($_POST['id'])) { - $id = $_POST['id']; -} - -if ($_GET['act'] == "del") { - if ($_GET['type'] == 'php') { - if ($a_cron[$_GET['id']]) { - unset($a_cron[$_GET['id']]); - write_config(); - cron_sync_package(); - header("Location: cron.php"); - exit; - } - } -} - -if (isset($id) && $a_cron[$id]) { - $pconfig['minute'] = $a_cron[$id]['minute']; - $pconfig['hour'] = $a_cron[$id]['hour']; - $pconfig['mday'] = $a_cron[$id]['mday']; - $pconfig['month'] = $a_cron[$id]['month']; - $pconfig['wday'] = $a_cron[$id]['wday']; - $pconfig['who'] = $a_cron[$id]['who']; - $pconfig['command'] = $a_cron[$id]['command']; -} +require_once("/usr/local/pkg/lcdproc.inc"); + +$lcdproc_config = &$config['installedpackages']['lcdproc']['config'][0]; +$lcdproc_screens_config = &$config['installedpackages']['lcdprocscreens']['config'][0]; + +// Set default values for anything not in the $config +$pconfig = $lcdproc_screens_config; +if (!isset($pconfig['scr_version'])) $pconfig['scr_version'] = false; +if (!isset($pconfig['scr_time'])) $pconfig['scr_time'] = false; +if (!isset($pconfig['scr_uptime'])) $pconfig['scr_uptime'] = false; +if (!isset($pconfig['scr_hostname'])) $pconfig['scr_hostname'] = false; +if (!isset($pconfig['scr_system'])) $pconfig['scr_system'] = false; +if (!isset($pconfig['scr_disk'])) $pconfig['scr_disk'] = false; +if (!isset($pconfig['scr_load'])) $pconfig['scr_load'] = false; +if (!isset($pconfig['scr_states'])) $pconfig['scr_states'] = false; +if (!isset($pconfig['scr_carp'])) $pconfig['scr_carp'] = false; +if (!isset($pconfig['scr_ipsec'])) $pconfig['scr_ipsec'] = false; +if (!isset($pconfig['scr_slbd'])) $pconfig['scr_slbd'] = false; +if (!isset($pconfig['scr_interfaces'])) $pconfig['scr_interfaces'] = false; +if (!isset($pconfig['scr_mbuf'])) $pconfig['scr_mbuf'] = false; +if (!isset($pconfig['scr_cpufrequency'])) $pconfig['scr_cpufrequency'] = false; +if (!isset($pconfig['scr_traffic'])) $pconfig['scr_traffic'] = false; +if (!isset($pconfig['scr_traffic_interface'])) $pconfig['scr_traffic_interface'] = ''; if ($_POST) { unset($input_errors); $pconfig = $_POST; if (!$input_errors) { - - $ent = array(); - $ent['minute'] = $_POST['minute']; - $ent['hour'] = $_POST['hour']; - $ent['mday'] = $_POST['mday']; - $ent['month'] = $_POST['month']; - $ent['wday'] = $_POST['wday']; - $ent['who'] = $_POST['who']; - $ent['command'] = $_POST['command']; - - if (isset($id) && $a_cron[$id]) { - // update - $a_cron[$id] = $ent; - } else { - // add - $a_cron[] = $ent; - } - + $lcdproc_screens_config['scr_version'] = $pconfig['scr_version']; + $lcdproc_screens_config['scr_time'] = $pconfig['scr_time']; + $lcdproc_screens_config['scr_uptime'] = $pconfig['scr_uptime']; + $lcdproc_screens_config['scr_hostname'] = $pconfig['scr_hostname']; + $lcdproc_screens_config['scr_system'] = $pconfig['scr_system']; + $lcdproc_screens_config['scr_disk'] = $pconfig['scr_disk']; + $lcdproc_screens_config['scr_load'] = $pconfig['scr_load']; + $lcdproc_screens_config['scr_states'] = $pconfig['scr_states']; + $lcdproc_screens_config['scr_carp'] = $pconfig['scr_carp']; + $lcdproc_screens_config['scr_ipsec'] = $pconfig['scr_ipsec']; + $lcdproc_screens_config['scr_slbd'] = $pconfig['scr_slbd']; + $lcdproc_screens_config['scr_interfaces'] = $pconfig['scr_interfaces']; + $lcdproc_screens_config['scr_mbuf'] = $pconfig['scr_mbuf']; + $lcdproc_screens_config['scr_cpufrequency'] = $pconfig['scr_cpufrequency']; + $lcdproc_screens_config['scr_traffic'] = $pconfig['scr_traffic']; + $lcdproc_screens_config['scr_traffic_interface'] = $pconfig['scr_traffic_interface']; + write_config(); - cron_sync_package(); - - header("Location: cron.php"); - exit; + sync_package_lcdproc(); } } -if (empty($id)) { - $pgtitle = array(gettext("Services"), gettext("Cron"), gettext("Add")); -} else { - $pgtitle = array(gettext("Services"), gettext("Cron"), gettext("Edit")); -} +$pgtitle = array(gettext("Services"), gettext("LCDproc"), gettext("Screens")); include("head.inc"); if ($input_errors) { @@ -103,85 +88,160 @@ } $tab_array = array(); -$tab_array[] = array(gettext("Settings"), false, "/packages/cron/cron.php"); -if (empty($id)) { - $tab_array[] = array(gettext("Add"), true, "/packages/cron/cron_edit.php"); -} else { - $tab_array[] = array(gettext("Edit"), true, "/packages/cron/cron_edit.php"); -} +$tab_array[] = array(gettext("Server"), false, "/packages/lcdproc/lcdproc.php"); +$tab_array[] = array(gettext("Screens"), true, "/packages/lcdproc/lcdproc_screens.php"); display_top_tabs($tab_array); -$form = new Form; -$section = new Form_Section('Add A Cron Schedule'); - -$section->addInput(new Form_Input( - 'minute', - 'Minute', - 'text', - $pconfig['minute'] -))->setHelp("The minute(s) at which the command will be executed. (0-59, ranges, or divided, *=all)"); - -$section->addInput(new Form_Input( - 'hour', - 'Hour', - 'text', - $pconfig['hour'] -))->setHelp("The hour(s) at which the command will be executed. (0-23, ranges, or divided, *=all)"); - -$section->addInput(new Form_Input( - 'mday', - 'Day of the Month', - 'text', - $pconfig['mday'] -))->setHelp("The day(s) of the month on which the command will be executed. (1-31, ranges, or divided, *=all)"); - -$section->addInput(new Form_Input( - 'month', - 'Month of the Year', - 'text', - $pconfig['month'] -))->setHelp("The month(s) of the year during which the command will be executed. (1-12, ranges, or divided, *=all)"); - -$section->addInput(new Form_Input( - 'wday', - 'Day of the Week', - 'text', - $pconfig['wday'] -))->setHelp("The day(s) of the week on which the command will be executed. (0-7, 7=Sun or use names, ranges, or divided, *=all)"); - -$section->addInput(new Form_Input( - 'who', - 'User', - 'text', - $pconfig['who'] -))->setHelp("The user executing the command (typically \"root\")"); - -$section->addInput(new Form_Textarea( - 'command', - 'Command', - $pconfig['command'] -))->setHelp("The full path to the command, plus parameters."); - -$form->add($section); - -$btncncl = new Form_Button( - 'cancel', - 'Cancel' +// The constructor for Form automatically creates a submit button. If you want to suppress that +// use Form(false), of specify a different button using Form($mybutton) +$form = new Form(); +$section = new Form_Section('LCD info screens'); + +// Add the Version checkbox +$section->addInput( + new Form_Checkbox( + 'scr_version', // checkbox name (id) + 'Version', // checkbox label + 'Display the version', // checkbox text + $pconfig['scr_version'] // checkbox initial value + ) +); +$section->addInput( + new Form_Checkbox( + 'scr_time', // checkbox name (id) + 'Time', // checkbox label + 'Display the time', // checkbox text + $pconfig['scr_time'] // checkbox initial value + ) +); +$section->addInput( + new Form_Checkbox( + 'scr_uptime', // checkbox name (id) + 'Up-time', // checkbox label + 'Display the up-time', // checkbox text + $pconfig['scr_uptime'] // checkbox initial value + ) +); +$section->addInput( + new Form_Checkbox( + 'scr_hostname', // checkbox name (id) + 'Hostname', // checkbox label + 'Display the Hostname', // checkbox text + $pconfig['scr_hostname'] // checkbox initial value + ) +); +$section->addInput( + new Form_Checkbox( + 'scr_system', // checkbox name (id) + 'System', // checkbox label + 'Display system info', // checkbox text + $pconfig['scr_system'] // checkbox initial value + ) +); +$section->addInput( + new Form_Checkbox( + 'scr_disk', // checkbox name (id) + 'Disk', // checkbox label + 'Display disk info', // checkbox text + $pconfig['scr_disk'] // checkbox initial value + ) +); +$section->addInput( + new Form_Checkbox( + 'scr_load', // checkbox name (id) + 'Load', // checkbox label + 'Display the load', // checkbox text + $pconfig['scr_load'] // checkbox initial value + ) +); +$section->addInput( + new Form_Checkbox( + 'scr_states', // checkbox name (id) + 'States', // checkbox label + 'Display the states', // checkbox text + $pconfig['scr_states'] // checkbox initial value + ) +); +$section->addInput( + new Form_Checkbox( + 'scr_carp', // checkbox name (id) + 'Carp', // checkbox label + 'Show CARP state', // checkbox text + $pconfig['scr_carp'] // checkbox initial value + ) +); +$section->addInput( + new Form_Checkbox( + 'scr_ipsec', // checkbox name (id) + 'IPsec', // checkbox label + 'Show IPsec Tunnels state', // checkbox text + $pconfig['scr_ipsec'] // checkbox initial value + ) +); +$section->addInput( + new Form_Checkbox( + 'scr_slbd', // checkbox name (id) + 'Load Balancer', // checkbox label + '', // checkbox text + $pconfig['scr_slbd'] // checkbox initial value + ) +); +$section->addInput( + new Form_Checkbox( + 'scr_interfaces', // checkbox name (id) + 'Interfaces', // checkbox label + 'Show whether interfaces are up', // checkbox text + $pconfig['scr_interfaces'] // checkbox initial value + ) +); +$section->addInput( + new Form_Checkbox( + 'scr_mbuf', // checkbox name (id) + 'Mbuf', // checkbox label + '', // checkbox text + $pconfig['scr_mbuf'] // checkbox initial value + ) +); +$section->addInput( + new Form_Checkbox( + 'scr_cpufrequency', // checkbox name (id) + 'CPU Frequency', // checkbox label + 'Display how much the CPU has clocked down to reduce power consumption', // checkbox text + $pconfig['scr_cpufrequency'] // checkbox initial value + ) +); +$section->addInput( + new Form_Checkbox( + 'scr_traffic', // checkbox name (id) + 'Interface Traffic', // checkbox label + 'Display the traffic of an interface', // checkbox text + $pconfig['scr_traffic'] // checkbox initial value + ) ); - -$btncncl->removeClass('btn-primary')->addClass('btn-danger'); - -$form->addGlobal($btncncl); -print $form; + +/* +$interfaceList = array(); +foreach($config['interfaces'] as $interface) { + $interfaceList[$interface['if']] = '*' . $interface['descr']; +}*/ +$section->addInput( + new Form_Select( + 'scr_traffic_interface', + ' > interface selected', + $pconfig['scr_traffic_interface'], // Initial value. + [ 'wan' => 'WAN', 'lan' => 'LAN' ] + ) +)->setHelp('If Interface Traffic is enabled, here you specify which interface to monitor'); + + +$form->add($section); // Add the section to our form +print($form); // Finally . . We can display our new form ?> +
- Ranges may also be used, for example "1-5" in the "Day of Week" field means Monday through Friday' . - '
Time entries may be divided and will be executed when they divide evenly, for example "*/15" in the Minute field means "Every 15 minutes".' . - '

For more information see: FreeBSD Handbook - Configuring cron(8) ' . - 'and crontab(5) man page.', info)?> + LCDproc documentation.', info)?>
From a96033655de5acdac790a7f65860d82201699523 Mon Sep 17 00:00:00 2001 From: Treer Date: Sun, 14 Aug 2016 15:26:06 +1000 Subject: [PATCH 4/6] Finished conversion of settings to php pages --- .../files/usr/local/pkg/lcdproc_screens.xml | 154 ----------------- .../local/www/packages/lcdproc/lcdproc.php | 156 +++++++++++------- .../www/packages/lcdproc/lcdproc_screens.php | 36 ++-- 3 files changed, 115 insertions(+), 231 deletions(-) delete mode 100644 sysutils/pfSense-pkg-LCDproc/files/usr/local/pkg/lcdproc_screens.xml diff --git a/sysutils/pfSense-pkg-LCDproc/files/usr/local/pkg/lcdproc_screens.xml b/sysutils/pfSense-pkg-LCDproc/files/usr/local/pkg/lcdproc_screens.xml deleted file mode 100644 index ca2b0f872b9c..000000000000 --- a/sysutils/pfSense-pkg-LCDproc/files/usr/local/pkg/lcdproc_screens.xml +++ /dev/null @@ -1,154 +0,0 @@ - - - - - - - Copyright (C) 2009 Scott Ullrich - Copyright (C) 2011 Michele Di Maria - 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. - - 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. -*/ -/* ====================================================================================== */ - ]]> - - Services: LCDproc: Screens - lcdprocscreens - 0.9.15 - Save - /usr/local/pkg/lcdproc.inc - - - Server - /pkg_edit.php?xml=lcdproc.xml - - - Screens - /pkg_edit.php?xml=lcdproc_screens.xml - - - - - LCDproc - Set LCDproc settings such as display driver and COM port. -
Services
- /pkg_edit.php?xml=lcdproc.xml -
- - - Enable Version - scr_version - checkbox - - - Enable Time - scr_time - checkbox - - - Enable Uptime - scr_uptime - checkbox - - - Enable Hostname - scr_hostname - checkbox - - - Enable System - scr_system - checkbox - - - Enable Disk - scr_disk - checkbox - - - Enable Load - scr_load - checkbox - - - Enable States - scr_states - checkbox - - - Enable Carp - scr_carp - checkbox - - - Enable IPsec - scr_ipsec - checkbox - - - Enable Load Balancer - scr_slbd - checkbox - - - Enable Interfaces - scr_interfaces - checkbox - - - Enable Mbuf - scr_mbuf - checkbox - - - Enable CPU Frequency - scr_cpufrequency - checkbox - - - Enable Interface Traffic - scr_traffic - checkbox - - - > interface selected - scr_traffic_interface - interfaces_selection - If Interface Traffic is enabled, here you specify which interface to monitor - - - - sync_package_lcdproc_screens(); - -
diff --git a/sysutils/pfSense-pkg-LCDproc/files/usr/local/www/packages/lcdproc/lcdproc.php b/sysutils/pfSense-pkg-LCDproc/files/usr/local/www/packages/lcdproc/lcdproc.php index 82572391f706..1d30c363b1c7 100644 --- a/sysutils/pfSense-pkg-LCDproc/files/usr/local/www/packages/lcdproc/lcdproc.php +++ b/sysutils/pfSense-pkg-LCDproc/files/usr/local/www/packages/lcdproc/lcdproc.php @@ -91,7 +91,7 @@ // The constructor for Form automatically creates a submit button. If you want to suppress that // use Form(false), of specify a different button using Form($mybutton) $form = new Form(); -$section = new Form_Section('LCD Options'); +$section = new Form_Section('LCD connection and hardware'); // Add the Enable checkbox $section->addInput( @@ -129,7 +129,7 @@ $section->addInput( new Form_Select( 'size', - 'Display Size', + 'Display size', $pconfig['size'], // Initial value. [ '12x1' => '1 rows 12 colums', @@ -145,7 +145,8 @@ ) )->setHelp('Set the display size lcdproc should use.'); -$section->addInput( +$driverGroup = new Form_Group('Interface Traffic'); +$driverGroup->add( new Form_Select( 'driver', 'Driver', @@ -160,7 +161,7 @@ 'ea65' => 'ea65', 'EyeboxOne' => 'EyeboxOne', 'glk' => 'glk', - 'hd44780' => 'hd44780', + 'hd44780' => 'HD44780 and compatible', 'icp_a106' => 'icp_a106', 'IOWarrior' => 'IOWarrior', 'lb216' => 'lb216', @@ -188,12 +189,14 @@ 'tyan' => 'tyan' ] ) -)->setHelp('Set the LCD driver LCDproc should use.'); +); -$section->addInput( +// The connection type is HD44780-specific, so is hidden by javascript (below) +// if the HD44780 driver is not being used. +$driverGroup->add( new Form_Select( 'connection_type', - 'Connection Type', + 'Connection type', $pconfig['connection_type'], // Initial value. [ '4bit' => '4bit wiring to parallel port', @@ -216,23 +219,37 @@ 'i2c' => 'LCD driven by PCF8574/PCA9554 connected via i2c' ] ) -)->setHelp('Set connection type for the HD44780 driver'); +); +$driverGroup->setHelp('Set the LCD driver LCDproc should use.
If using a HD44780 driver, set the connection type using the second selection box, which will appear.'); +$section->add($driverGroup); +?> -$section->addInput( - new Form_Select( - 'refresh_frequency', - 'Refresh frequency', - $pconfig['refresh_frequency'], // Initial value. - [ - '1' => '1 second', - '2' => '2 seconds', - '3' => '3 seconds', - '5' => '5 seconds', - '10' => '10 seconds', - '15' => '15 seconds' - ] - ) -)->setHelp('Set the refresh frequency of the information on the LCD Panel'); + + +addInput( new Form_Select( @@ -251,33 +268,51 @@ ) )->setHelp('Set the port speed.
Caution: not all the driver or panels support all the speeds, leave "default" if unsure.'); +/********* New section *********/ +$form->add($section); +$section = new Form_Section('Display preferences'); +/********* New section *********/ + $section->addInput( new Form_Select( - 'brightness', - 'Brightness', - $pconfig['brightness'], // Initial value. + 'refresh_frequency', + 'Refresh frequency', + $pconfig['refresh_frequency'], // Initial value. [ - '-1' => 'Default', - '0' => '0%', - '10' => '10%', - '20' => '20%', - '30' => '30%', - '40' => '40%', - '50' => '50%', - '60' => '60%', - '70' => '70%', - '80' => '80%', - '90' => '90%', - '100' => '100%' + '1' => '1 second', + '2' => '2 seconds', + '3' => '3 seconds', + '5' => '5 seconds', + '10' => '10 seconds', + '15' => '15 seconds' ] ) -)->setHelp('Set the brightness of the LCD panel.
This option is not supported by all the LCD panels, leave "default" if unsure.'); +)->setHelp('Set the duration for which each info screen will be displayed.'); + +// The connection type is CFontz633/CFontzPacket-specific, so is hidden by javascript (above) +// if a CFontz633/CFontzPacket driver is not being used. +$section->addInput( + new Form_Checkbox( + 'outputleds', // checkbox name (id) + 'Enable output LEDs', // checkbox label + 'Enable the output LEDs present on some LCD panels.', // checkbox text + $pconfig['outputleds'] // checkbox initial value + ) +)->setHelp( + 'This feature is currently supported by the CFontz633 driver only.
' . + 'Each LED can be off or show two colors: RED (alarm) or GREEN (everything ok) and shows:
' . + 'LED1: NICs status (green: ok, red: at least one nic down)
' . + 'LED2: CARP status (green: master, red: backup, off: CARP not implemented)
' . + 'LED3: CPU status (green < 50%, red > 50%)
' . + 'LED4: Gateway status (green: ok, red: at least one gateway not responding, off: no gateway configured).' +); + $section->addInput( new Form_Select( - 'offbrightness', - 'Off brightness', - $pconfig['offbrightness'], // Initial value. + 'brightness', + 'Brightness', + $pconfig['brightness'], // Initial value. [ '-1' => 'Default', '0' => '0%', @@ -293,10 +328,7 @@ '100' => '100%' ] ) -)->setHelp( - 'Set the off-brightness of the LCD panel. This value is used when the display is normally switched off in case LCDd is inactive.
' . - 'This option is not supported by all the LCD panels, leave "default" if unsure.' -); +)->setHelp('Set the brightness of the LCD panel.
This option is not supported by all the LCD panels, leave "default" if unsure.'); $section->addInput( new Form_Select( @@ -340,22 +372,30 @@ ); $section->addInput( - new Form_Checkbox( - 'outputleds', // checkbox name (id) - 'Enable Output LEDs', // checkbox label - 'Enable the Output LEDs present on some LCD panels.', // checkbox text - $pconfig['outputleds'] // checkbox initial value + new Form_Select( + 'offbrightness', + 'Off brightness', + $pconfig['offbrightness'], // Initial value. + [ + '-1' => 'Default', + '0' => '0%', + '10' => '10%', + '20' => '20%', + '30' => '30%', + '40' => '40%', + '50' => '50%', + '60' => '60%', + '70' => '70%', + '80' => '80%', + '90' => '90%', + '100' => '100%' + ] ) )->setHelp( - 'This feature is currently supported by the CFontz633 driver only.
' . - 'Each LED can be off or show two colors: RED (alarm) or GREEN (everything ok) and shows:
' . - 'LED1: NICs status (green: ok, red: at least one nic down)
' . - 'LED2: CARP status (green: master, red: backup, off: CARP not implemented)
' . - 'LED3: CPU status (green < 50%, red > 50%)
' . - 'LED4: Gateway status (green: ok, red: at least one gateway not responding, off: no gateway configured).' + 'Set the off-brightness of the LCD panel. This value is used when the display is normally switched off in case LCDd is inactive.
' . + 'This option is not supported by all the LCD panels, leave "default" if unsure.' ); - $form->add($section); // Add the section to our form print($form); // Finally . . We can display our new form diff --git a/sysutils/pfSense-pkg-LCDproc/files/usr/local/www/packages/lcdproc/lcdproc_screens.php b/sysutils/pfSense-pkg-LCDproc/files/usr/local/www/packages/lcdproc/lcdproc_screens.php index f91e404e03b6..c6278eb99596 100644 --- a/sysutils/pfSense-pkg-LCDproc/files/usr/local/www/packages/lcdproc/lcdproc_screens.php +++ b/sysutils/pfSense-pkg-LCDproc/files/usr/local/www/packages/lcdproc/lcdproc_screens.php @@ -142,7 +142,7 @@ new Form_Checkbox( 'scr_disk', // checkbox name (id) 'Disk', // checkbox label - 'Display disk info', // checkbox text + 'Display the percentage of disk-space used', // checkbox text $pconfig['scr_disk'] // checkbox initial value ) ); @@ -150,7 +150,7 @@ new Form_Checkbox( 'scr_load', // checkbox name (id) 'Load', // checkbox label - 'Display the load', // checkbox text + 'Display the load averages', // checkbox text $pconfig['scr_load'] // checkbox initial value ) ); @@ -174,7 +174,7 @@ new Form_Checkbox( 'scr_ipsec', // checkbox name (id) 'IPsec', // checkbox label - 'Show IPsec Tunnels state', // checkbox text + 'Show IPsec tunnels', // checkbox text $pconfig['scr_ipsec'] // checkbox initial value ) ); @@ -182,7 +182,7 @@ new Form_Checkbox( 'scr_slbd', // checkbox name (id) 'Load Balancer', // checkbox label - '', // checkbox text + 'Show the load balance state', // checkbox text $pconfig['scr_slbd'] // checkbox initial value ) ); @@ -198,7 +198,7 @@ new Form_Checkbox( 'scr_mbuf', // checkbox name (id) 'Mbuf', // checkbox label - '', // checkbox text + 'Show the MBuf usage', // checkbox text $pconfig['scr_mbuf'] // checkbox initial value ) ); @@ -210,29 +210,27 @@ $pconfig['scr_cpufrequency'] // checkbox initial value ) ); -$section->addInput( + + +$trafficGroup = new Form_Group('Traffic'); +$trafficGroup->add( new Form_Checkbox( 'scr_traffic', // checkbox name (id) - 'Interface Traffic', // checkbox label - 'Display the traffic of an interface', // checkbox text + '', // checkbox label + 'Display interface traffic for:', // checkbox text $pconfig['scr_traffic'] // checkbox initial value ) ); - - -/* -$interfaceList = array(); -foreach($config['interfaces'] as $interface) { - $interfaceList[$interface['if']] = '*' . $interface['descr']; -}*/ -$section->addInput( +$trafficGroup->add( new Form_Select( 'scr_traffic_interface', - ' > interface selected', + '', $pconfig['scr_traffic_interface'], // Initial value. - [ 'wan' => 'WAN', 'lan' => 'LAN' ] + get_configured_interface_with_descr() ) -)->setHelp('If Interface Traffic is enabled, here you specify which interface to monitor'); +); +//$trafficGroup->setHelp('Show the current in and out speed of the interface'); +$section->add($trafficGroup); $form->add($section); // Add the section to our form From 9acaf19b525807c01470016338c23f91ada99899 Mon Sep 17 00:00:00 2001 From: Treer Date: Sun, 14 Aug 2016 15:36:49 +1000 Subject: [PATCH 5/6] bump version --- sysutils/pfSense-pkg-LCDproc/Makefile | 4 ++-- sysutils/pfSense-pkg-LCDproc/files/usr/local/pkg/lcdproc.xml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/sysutils/pfSense-pkg-LCDproc/Makefile b/sysutils/pfSense-pkg-LCDproc/Makefile index 7ba30c133c19..51adbd8551cf 100644 --- a/sysutils/pfSense-pkg-LCDproc/Makefile +++ b/sysutils/pfSense-pkg-LCDproc/Makefile @@ -1,7 +1,7 @@ # $FreeBSD$ PORTNAME= pfSense-pkg-LCDproc -PORTVERSION= 0.10.0 +PORTVERSION= 0.10.1 CATEGORIES= sysutils MASTER_SITES= # empty DISTFILES= # empty @@ -44,7 +44,7 @@ do-extract: do-install: ${MKDIR} ${STAGEDIR}${PREFIX}/pkg ${MKDIR} ${STAGEDIR}/etc/inc/priv - ${MKDIR} ${STAGEDIR}${PREFIX}/www/packages/lcdproc + ${MKDIR} ${STAGEDIR}${PREFIX}/www/packages/lcdproc ${MKDIR} ${STAGEDIR}${DATADIR} ${INSTALL_DATA} -m 0644 ${FILESDIR}${PREFIX}/pkg/lcdproc.xml \ ${STAGEDIR}${PREFIX}/pkg diff --git a/sysutils/pfSense-pkg-LCDproc/files/usr/local/pkg/lcdproc.xml b/sysutils/pfSense-pkg-LCDproc/files/usr/local/pkg/lcdproc.xml index 42e4227aa824..fe15315934b1 100644 --- a/sysutils/pfSense-pkg-LCDproc/files/usr/local/pkg/lcdproc.xml +++ b/sysutils/pfSense-pkg-LCDproc/files/usr/local/pkg/lcdproc.xml @@ -45,7 +45,7 @@ Services: LCDproc lcdproc - 0.10.0 + 0.10.1 /usr/local/pkg/lcdproc.inc LCDproc From 14c24f23b64513836ab9dec19ab06057ddbf2409 Mon Sep 17 00:00:00 2001 From: Treer Date: Sun, 14 Aug 2016 15:47:10 +1000 Subject: [PATCH 6/6] Unrolling version bump - 10.0 was completed, will wait for next completed version before bumping --- sysutils/pfSense-pkg-LCDproc/Makefile | 2 +- sysutils/pfSense-pkg-LCDproc/files/usr/local/pkg/lcdproc.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sysutils/pfSense-pkg-LCDproc/Makefile b/sysutils/pfSense-pkg-LCDproc/Makefile index 51adbd8551cf..e0bbbca0565f 100644 --- a/sysutils/pfSense-pkg-LCDproc/Makefile +++ b/sysutils/pfSense-pkg-LCDproc/Makefile @@ -1,7 +1,7 @@ # $FreeBSD$ PORTNAME= pfSense-pkg-LCDproc -PORTVERSION= 0.10.1 +PORTVERSION= 0.10.0 CATEGORIES= sysutils MASTER_SITES= # empty DISTFILES= # empty diff --git a/sysutils/pfSense-pkg-LCDproc/files/usr/local/pkg/lcdproc.xml b/sysutils/pfSense-pkg-LCDproc/files/usr/local/pkg/lcdproc.xml index fe15315934b1..42e4227aa824 100644 --- a/sysutils/pfSense-pkg-LCDproc/files/usr/local/pkg/lcdproc.xml +++ b/sysutils/pfSense-pkg-LCDproc/files/usr/local/pkg/lcdproc.xml @@ -45,7 +45,7 @@ Services: LCDproc lcdproc - 0.10.1 + 0.10.0 /usr/local/pkg/lcdproc.inc LCDproc