How would i be able to make it so that the search bar is always expanded, which would then not require me to click on the magnifying glass icon every time?
Web UI - Search Bar Always Expanded
Web UI - Search Bar Always Expanded
You do not have the required permissions to view the files attached to this post.
-
benjaminsmith
- Posts: 5324
- Joined: Wed Aug 22, 2018 4:39 pm
- Location: saint paul
Re: Web UI - Search Bar Always Expanded
Hello @treesquid,
A couple of options for making this happen. You can either use the Custome Includes component to modifying the UI by adding your own CSS and Javascript or you could directly modify the PHP file and remove the hide class. However, this would be overwritten when you upgrade Nagios XI.
1. To learn more about the Customs Includes component, please see the following documentation:
Nagios XI - Using The Custom Includes Component
2. To modify the top-bar, you would edit the /usr/local/nagiosxi/html/includes/header.inc.php file, and go to line 139:
Here you can remove the hide class from search-field and the <i> tag if desired.
A couple of options for making this happen. You can either use the Custome Includes component to modifying the UI by adding your own CSS and Javascript or you could directly modify the PHP file and remove the hide class. However, this would be overwritten when you upgrade Nagios XI.
1. To learn more about the Customs Includes component, please see the following documentation:
Nagios XI - Using The Custom Includes Component
2. To modify the top-bar, you would edit the /usr/local/nagiosxi/html/includes/header.inc.php file, and go to line 139:
Code: Select all
<div class="header-right search">
<div class="search-field hide">
<form method="post" target="maincontentframe" action="<?php echo get_base_url(); ?>includes/components/xicore/status.php?show=services">
<input type="hidden" name="navbarsearch" value="1"/>
<input type="text" class="search-query form-control" name="search" id="navbarSearchBox" value="" placeholder="<?php echo _('Search...'); ?>"/>
</form>
</div>
<a href="#" id="open-search" title="<?php echo _('Search'); ?>"><i class="fa fa-search"></i></a>
</div>
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Be sure to check out our Knowledgebase for helpful articles and solutions!
Re: Web UI - Search Bar Always Expanded
Thanks for the info Benjamin, i appreciate the info on how to do it either temporary or permanent (won't change with version update) so that i can make the temp fix now, and when i have time later i can implement the permanent solution.
Would it be possible to modify the hierarchy of the search drop-down results so that if there are results for services, host, hostgroups, etc found it will always display the hostgroup results at the top of the list? I notice there that hostgroup will always show at the bottom currently.
Would it be possible to modify the hierarchy of the search drop-down results so that if there are results for services, host, hostgroups, etc found it will always display the hostgroup results at the top of the list? I notice there that hostgroup will always show at the bottom currently.
You do not have the required permissions to view the files attached to this post.
Re: Web UI - Search Bar Always Expanded
This can be done by editing /usr/local/nagiosxi/html/suggest.php. Starting around line is the suggest_multi() function which has a section to display services, hosts, servicegroups, and hostsgroup. These can be arranged in the order you'd like to see. To move Hostgroups to the top I moved this code:
Above the "// Services line".
Code: Select all
// Hostgroups
$args = array(
"hostgroup_name" => "lk:" . $query . ";alias=lk:" . $query,
"brevity" => 1,
"is_active" => 1,
'orderby' => 'hostgroup_name:a',
'records' => 10,
);
$res1 = get_hostgroup_objects_xml_output($args);
$xres1 = simplexml_load_string($res1);
if ($xres1) {
foreach ($xres1->hostgroup as $obj) {
$names[] = (object) array('url' => get_base_url().'/includes/components/xicore/status.php?show=hostgroups&hostgroup='.urlencode(strval($obj->hostgroup_name)),
'value' => strval($obj->hostgroup_name),
'category' => _('Hostgroup'),
'label' => (stripos(strval($obj->hostgroup_name),$query) !== false) ? strval($obj->hostgroup_name) : _('[A] '). strval($obj->alias));
}
}Above the "// Services line".
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.