From dffa1b7de17a7cc921db1b6e3e6bec7640bface9 Mon Sep 17 00:00:00 2001 From: ljm42 Date: Thu, 9 Nov 2017 18:14:52 -0800 Subject: [PATCH] Suppress output when no SMART devices available (#365) * Suppress output when no SMART devices available Small fix. Prevents empty form dropdowns when no SMART devices are available (i.e. running in a VM with a vdisk) * use gettext for text * better conditional check --- sysutils/smart/src/www/diag_smart.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sysutils/smart/src/www/diag_smart.php b/sysutils/smart/src/www/diag_smart.php index b43cd2bc6..a4fb4c405 100644 --- a/sysutils/smart/src/www/diag_smart.php +++ b/sysutils/smart/src/www/diag_smart.php @@ -137,6 +137,8 @@ switch($action) { // Get all AD* and DA* (IDE and SCSI) devices currently installed and stores them in the $devs array exec("ls /dev | grep '^\(ad\|da\|ada\)[0-9]\{1,2\}$'", $devs); + + if (count($devs) > 0) { ?>
@@ -302,6 +304,9 @@ switch($action) {