[ZBXNEXT-2185] jqueryui autocomplete dropdowns instead of ordinary selects Created: 2014 Mar 05 Updated: 2021 May 26 Resolved: 2021 May 26 |
|
Status: | Closed |
Project: | ZABBIX FEATURE REQUESTS |
Component/s: | Frontend (F) |
Affects Version/s: | None |
Fix Version/s: | 5.0.11 |
Type: | New Feature Request | Priority: | Major |
Reporter: | Jan Keirse | Assignee: | Unassigned |
Resolution: | Fixed | Votes: | 9 |
Labels: | dropdown, jquery, patch, usability | ||
Remaining Estimate: | Not Specified | ||
Time Spent: | Not Specified | ||
Original Estimate: | Not Specified |
Attachments: |
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
Description |
Hello, we have a large number of screens and a large number of graphs per host (hundreds). Finding the appropriate screen or graph using the existing select widgets can be a pain. Thanks for taking this into consideration, Jan |
Comments |
Comment by Jan Keirse [ 2014 Apr 23 ] |
A patch using select2 to implement this feature. I made tiny modifications to the select2 css file so that dropdown's are about the same height as they are without this patch. The patch is against 2.2.3 but a version that is also patched with zbx extras and the snmp builder, however only 3 zabbix files contain 1 or 2 extra lines, so it shouldn't really matter to apply it. You also have to put these files in styles/ : select2.png They can be found in this archive: |
Comment by Jan Keirse [ 2014 Apr 23 ] |
Screenshot of the result. ps.: The Attach Screenshot button redirects me to an oracle page hence the use of Attach Files. |
Comment by Jan Keirse [ 2014 Apr 23 ] |
It looks a little better if you add this to the bottom of select2.css: .select2-container { border: none; } .header_r .select2-container { margin-top: -3px; } .item-list-row .select2-container { margin-top: 6px; } .select2-result-label { line-height: 1.1em; } (2014-04-25 these fixes have been included in the patch currently attached to the issue) |
Comment by Tatapoum [ 2014 Apr 24 ] |
+1 |
Comment by Jan Keirse [ 2014 Apr 24 ] |
Thanks, but I think it's best to use the vote system on the right side of the issue in the people section, so that it turns up in queries for popular issues. Given the huge impact on usability on bigger installations (we have by now over 1000 graphs on some hosts) and the availability of a patch with almost no code changes to the actual zabbix code it looks to me like a nice candidate for addition to standard zabbix. |
Comment by Jan Keirse [ 2014 Apr 25 ] |
There's still a little issue, select2 also kicks in when selecting applications for a new item but that doesn't work particularly well. I'll see if how I can fix that. |
Comment by Jan Keirse [ 2014 Apr 25 ] |
Fix for this issue, but disabled for multiselect boxes as it didn't work for those and was not very usefull anyway. |
Comment by Jan Keirse [ 2014 Jun 30 ] |
Patch against vanilla 2.2.4. |
Comment by Jan Keirse [ 2014 Jun 30 ] |
The version I have just added is a patch against 2.2.4 as part of the RPM. It shows how little has to change in the actual zabbix code. |
Comment by Marc [ 2014 Jul 02 ] |
Interesting idea! Two things that possibly could be improved:
|
Comment by Jan Keirse [ 2014 Jul 03 ] |
Fixed style.css so that selected value in drop down is visible for popups. |
Comment by Jan Keirse [ 2014 Jul 03 ] |
Marc, what exactly do you mean with 'Combo-box entries may wrap'? |
Comment by Jan Keirse [ 2014 Jul 03 ] |
image that shows combo box moves to second line both with and without select2 |
Comment by Jan Keirse [ 2014 Jul 03 ] |
patch including all modified code |
Comment by Jan Keirse [ 2014 Jul 03 ] |
Files to be stored in styles/ folder. |
Comment by Volker Fröhlich [ 2014 Jul 03 ] |
Works fine as far as I can tell, but it is also present in some places where I would rather not have it. It doesn't really make sense on dropdowns with fixed content, e. g. severity on Monitoring/Maps. For whatever reason it appears to be missing for "Host" on the following Configuration/Hosts entities: Graphs, Web, Triggers, Applications. I applied the patch on a 2.2.0 though, so that may cause it. |
Comment by Jan Keirse [ 2014 Jul 04 ] |
Updated version of select2 to 3.5.0 and extracted custom css (specific for zabbix) from the original select2.css file into an additional one (select2-zabbix.css) to make it possible to upgrade without having to rebase the original select2 css file everytime. |
Comment by Jan Keirse [ 2014 Jul 04 ] |
Volker, disabling it for fixed content dropdowns could be done, I have updated the CComboBox class constructor with an option $autocomplete that defaults to true, but could be set false for small dropdowns (and must be set to false for the current multiselect comboboxes.) However I am undecided if should be disabled for small comboboxes, while the feature is not required there I think the interface looks cleaner if all comboboxes have the same styling. |
Comment by Jan Keirse [ 2014 Jul 04 ] |
v3 version of the patch fixes the problem where the multiselect didn't work if there are multiple html elements with the same id (hostid) on the page. |
Comment by Marc [ 2014 Jul 29 ] |
Just played around with select2 again. |
Comment by Jan Keirse [ 2014 Jul 29 ] |
I don't know, I prefer to have the same look for all combo-boxes. While the search isn't required for small comboboxes it doesn't hurt either and it looks a little sloppy if not all combo-boxes have the same look. |
Comment by Marc [ 2014 Jul 29 ] |
That's the point. |
Comment by Jan Keirse [ 2014 Jul 29 ] |
Aah, I agree. I thought you were suggesting to add an option to zabbix that would disable calling select2 for small combo-boxes. I see now that select2 has an option to just remove the search box which does make sense. |
Comment by Marc [ 2014 Jul 29 ] |
Btw, adding Some combo-boxes get display:inline set what leads to combo-boxes with maximum width. E.g. on item edit. Another thing I chaged was the border-radius. Setting this to 0px looks a bit more similar to the origin combo-boxes. Yet another thing I changed was left text aligning for current selection/chosen text. The patch in connection with iexplore 9 makes no fun when having ~1.5k elements. It's very laggy - not that I care though... |
Comment by Branislav Brna [ 2015 Apr 30 ] |
Hi, Thanks in advance |
Comment by Jan Keirse [ 2015 May 04 ] |
Yes it will work, but it will need some changes. I have it running on a modified version of zabbix 2.4.3 (various patches applied.) I'll try to make an updated patch for the latest stable release within 2 weeks, if I can find the time. |
Comment by Branislav Brna [ 2015 May 04 ] |
Thank you for reply. That sound awesome. This sort of functionality is must for us since we frequently search graphs by name. I am looking forward for updated patch. Thanks again |
Comment by Branislav Brna [ 2015 May 25 ] |
Hi. |
Comment by Jan Keirse [ 2015 May 26 ] |
Sorry, I haven't found the time due to other projects I'm working on. I will eventually make a new patch (if nobody else does it) but it will take at least a few more weeks. |
Comment by Branislav Brna [ 2015 Aug 19 ] |
Hi, |
Comment by Jan Keirse [ 2015 Aug 19 ] |
This should work, although I haven't tested it yet. Installation procedure pretty much goes like this: And then: In case something goes wrong you should be able to recover with |
Comment by Branislav Brna [ 2015 Aug 25 ] |
Hi, |
Comment by Jan Keirse [ 2015 Aug 31 ] |
No, could you try to see what the javascript console in your browser says? |
Comment by Branislav Brna [ 2015 Aug 31 ] |
I get no errors. Only these two warnings: Any idea where is the problem? |
Comment by Jan Keirse [ 2015 Sep 08 ] |
There's no telify.js in my installation, I have no idea where you got it, but I don't think it came from zabbix or my patch. |
Comment by Branislav Brna [ 2015 Sep 08 ] |
And is this patch working for you fine? |
Comment by Jan Keirse [ 2015 Sep 08 ] |
Yes. Have you looked in your server log files? |
Comment by Branislav Brna [ 2015 Sep 08 ] |
Ok so after setting up new test machine I can see it is working. I guess in my production machine/real test machine it is not working because I installed Zabbix-Extras which are somewhat broken in their own regards. |
Comment by Ronny Pettersen [ 2017 Sep 20 ] |
This would be a very nice additions to installations with larger number of hosts/groups. And also make selecting much easier. Select2 is now in version 4.0.3, so I would say it is very mature and should be safe to include as it supports most browsers. |
Comment by Jan Keirse [ 2017 Oct 06 ] |
I just attached a patch that can be applied to 3.0.4, if ever you were to consider this. |
Comment by Jan Keirse [ 2019 Aug 14 ] |
For those interested: Because this does not get merged in the product and I no longer wanted to patch each release I have solved this problem in the browser instead: https://github.com/jankeirse/zabbix-select2-dropdowns Tested with zabbix 4.0.5. Advantage: far easier to deploy than patching the server. Should be largely version independent. Disadvantage: every zabbix user that wants it has to install it in the browser of their choice.
|
Comment by Alexei Vladishev [ 2021 May 26 ] |
I believe it is pretty much resolved in the latest 5.x. We introduced autocomplete controls (instead of long drop-downs) across all UI. |