opserver / Opserver

Stack Exchange's Monitoring System
https://opserver.github.io/Opserver/
MIT License
4.51k stars 827 forks source link

Prefer exact match when retrieving dashboard nodes #260

Closed hughesjon closed 7 years ago

hughesjon commented 7 years ago

In our environment we have a server whose name is a substring of several other servers (we have several different projects with dedicated servers, e.g. projA-web-1, projB-web-1, projC-web-1, and then a shared server for lots of other small/tiny projects which is just called web-1). Because that name is a substring of other servers' names, if you click on the link on the dashboard, it finds the wrong node.

I changed it to prefer an exact match, but it will still fall back to the previous behaviour if there is no exact match (I guess this is useful if you're typing in the search box?)

NickCraver commented 7 years ago

I really should remove that really inefficient compare as well - will do after merging. Thanks for the improvement!