diff --git a/html/pages/device-groups.inc.php b/html/pages/device-groups.inc.php index 891b42c20..e5e6c9918 100644 --- a/html/pages/device-groups.inc.php +++ b/html/pages/device-groups.inc.php @@ -3,23 +3,31 @@ require_once 'includes/modal/new_device_group.inc.php'; require_once 'includes/modal/delete_device_group.inc.php'; $no_refresh = true; - +$group_count_check = array_filter(GetDeviceGroups()); +if(!empty($group_count_check)) { echo '
'; echo '
'; echo ''; echo ''; echo ''; -foreach (GetDeviceGroups() as $group) { - echo ''; - echo ''; - echo ''; - echo ''; - echo ''; - echo ''; -} - + foreach (GetDeviceGroups() as $group) { + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + } +} else { //if $group_count_check is empty, aka no group found, then display a message to the user. + echo "
Looks like no groups have been created, let's create one now. Click on Create New Group to create one.

"; + echo "
"; +} echo '
NameDescriptionPatternActions
'.$group['name'].''.$group['desc'].''.$group['pattern'].''; - echo " "; - echo ""; - echo '
'.$group['name'].''.$group['desc'].''.$group['pattern'].''; + echo " "; + echo ""; + echo '
'; -echo " "; + +if(!empty($group_count_check)) { //display create new node group when $group_count_check has a value so that the user can define more groups in the future. +echo "
"; +echo "
"; +}