Limit host_id and template_id select box width in graph_view

Anything that you think should be in Cacti.

Moderators: Moderators, Developers

Post Reply
Posts: 11
Joined: Sun Jul 23, 2006 6:48 am

Limit host_id and template_id select box width in graph_view

#1 Post by thermoman » Mon Aug 06, 2012 6:12 am


i'm using cacti in firefox with the browser window not being maximized but approx. 1100px in width.

Problem: long hostnames and long graph template names makes the header table grow so big that
i have to use the horizontal scroll bar to see everything.

Please see attached screenshots and patch file.


Code: Select all

% grep -Ei '<select.*(host_id|graph_template_id)' /usr/share/cacti/site/graph_view.php
<select name="host_id" onChange="applyGraphPreviewFilterChange(document.form_graph_view)">
<select name="graph_template_id" onChange="applyGraphPreviewFilterChange(document.form_graph_view)">
<select name="host_id" onChange="applyGraphListFilterChange(document.form_graph_list)">
<select name="graph_template_id" onChange="applyGraphListFilterChange(document.form_graph_list)">
After patching:

Code: Select all

% grep -Ei '<select.*(host_id|graph_template_id)' /usr/share/cacti/site/graph_view.php
<select name="host_id" onChange="applyGraphPreviewFilterChange(document.form_graph_view)" style="width: 100px">
<select name="graph_template_id" onChange="applyGraphPreviewFilterChange(document.form_graph_view)" style="width: 100px">
<select name="host_id" onChange="applyGraphListFilterChange(document.form_graph_list)" style="width: 100px">
<select name="graph_template_id" onChange="applyGraphListFilterChange(document.form_graph_list)" style="width: 100px">
This is just a workaround for myself. An even better version would be to make
the width of the SELECT boxes an user option so everyone can tweak this for himself easily.

Screenshot of Cacti in Firefox with stock Cacti Version
graph_view_original.png (123.47 KiB) Viewed 1138 times
Screenshot of Cacti in Firefox with modified graph_view.php file to reduce width of header table
graph_view_after_patch.png (116.43 KiB) Viewed 1138 times
Patch file to modify graph_view.php
(2.05 KiB) Downloaded 134 times

Post Reply