add result count and logic for no results

This commit is contained in:
2025-11-11 17:45:34 -08:00
parent dac5ef2983
commit 93d6100293
2 changed files with 31 additions and 24 deletions
+7
View File
@@ -45,6 +45,7 @@ if (isset($_GET['group'])) {
} }
curl_close($ch); curl_close($ch);
$data = json_decode($response, true); $data = json_decode($response, true);
$numResults = count($data);
// build the group array // build the group array
$gpoMap = []; // will look like: [ 'GPOName' => ['Administrator' => [...], 'vnc_admin' => [...]] ] $gpoMap = []; // will look like: [ 'GPOName' => ['Administrator' => [...], 'vnc_admin' => [...]] ]
@@ -74,6 +75,8 @@ if (isset($_GET['group'])) {
} }
} }
ksort($gpoMap, SORT_STRING | SORT_FLAG_CASE); ksort($gpoMap, SORT_STRING | SORT_FLAG_CASE);
if($numResults > 0){
echo 'Total results: '.$numResults.'<br>';
echo '<table border="1" cellpadding="4" cellspacing="0">'; echo '<table border="1" cellpadding="4" cellspacing="0">';
echo '<tr><th>GPO</th><th>Administrators</th><th>vnc_admin</th></tr>'; echo '<tr><th>GPO</th><th>Administrators</th><th>vnc_admin</th></tr>';
@@ -90,6 +93,10 @@ if (isset($_GET['group'])) {
} }
echo '</table>'; echo '</table>';
} }
else{
echo 'No results found for query.<p>';
}
}
} else { } else {
echo "<p>No group specified.</p>"; echo "<p>No group specified.</p>";
+12 -12
View File
@@ -1,18 +1,18 @@
--- ---
# Mount GPO Share path # Mount GPO Share path
- name: Mount GPO Share path #- name: Mount GPO Share path
include_role: # include_role:
name: "cifs_mount" # name: "cifs_mount"
vars: # vars:
smb_username: "{{ ITMFG_USERNAME }}" # smb_username: "{{ ITMFG_USERNAME }}"
smb_password: "{{ ITMFG_PASSWORD }}" # smb_password: "{{ ITMFG_PASSWORD }}"
server_path: "//172.23.1.23/gpo" # server_path: "//172.23.1.23/gpo"
target_path: "{{ gpo_yaml_share }}" # target_path: "{{ gpo_yaml_share }}"
#
# create python gpo service ## create python gpo service
- name: GPO Site - python api service #- name: GPO Site - python api service
include_tasks: api.yaml # include_tasks: api.yaml
# create python gpo service # create python gpo service
- name: GPO Site - dashboard container - name: GPO Site - dashboard container