Skip to content

Commit

Permalink
Special allowance on devicesRead for the Server section close buttons.
Browse files Browse the repository at this point in the history
  • Loading branch information
mark-unwin committed May 15, 2024
1 parent f86caa3 commit 7be0091
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion app/Views/shared/read_functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,11 @@ function device_panel(string $name = '', string $toolbar = '', int $device_id =
}
$temp = explode(' ', $name);
$export_name = strtolower($temp[0]);
$server = false;
if (stripos($name, 'Server') !== false) {
$server = $name;
$name = 'server';
}
if ($toolbar === 'icontext') {
$panel_close_button = "<a role=\"button\" class=\"btn btn-light mb-2 section_toggle\" tabindex=0 data-section=\"" . $name . "_section\" title=\"" . __("Close") . "\" href=\"#\"><span style=\"margin-right:6px;\" class=\"fa-regular fa-circle-xmark\"></span>" . __("Close") . "</a>";
$export_button = "<a role=\"button\" class=\"btn btn-light mb-2\" title=\"" . __("Export CSV") . "\" href=\"" . url_to('componentsCollection') . "?components.type=" . $export_name . "&components.device_id=" . $device_id . "&format=csv\"><span style=\"margin-right:6px;\" class=\"fa-solid fa-angles-down text-primary\"></span>" . __("Export CSV") . "</a>
Expand Down Expand Up @@ -321,7 +326,9 @@ function device_panel(string $name = '', string $toolbar = '', int $device_id =
if (!in_array(strtolower($export_name), ['audit_log', 'bios', 'certificate', 'change_log', 'discovery_log', 'disk', 'dns', 'edit_log', 'file', 'ip', 'log', 'memory', 'module', 'monitor', 'motherboard', 'netstat', 'network', 'nmap', 'optical', 'pagefile', 'partition', 'policy', 'print_queue', 'processor', 'radio', 'route', 'san', 'scsi', 'server', 'server_item', 'service', 'share', 'software', 'software_key', 'sound', 'task', 'usb', 'user', 'user_group', 'variable', 'video', 'vm', 'windows']) or empty($device_id) or $count === 0) {
$export_button = '';
}

if ($server) {
$name = $server;
}
$human_name = read_column_name($name);
$header = '<div class="card-header">
<div class="row">
Expand Down

0 comments on commit 7be0091

Please sign in to comment.