fixes: #5264
The issue was all the string concatenation...
But I decided to try loading the select via ajax. Seems ok. We could just use something like select2. Opinions? Use this approach or load at page load.
I was able to reduce the loading of the 4000 select items from 1.6s to 0.6s on my laptop by optimizing the sql.
I added 4000 devices to my database to check this :)