Allow returning up to 500 search results and error on empty search
* Added the ability for errors to be passed along when rendering result
sets, to display an error or warning message while still allowing
a result set to be rendered.
* Results are only rendered once all the requests have succeeded (or
failed), not every time there is a response. This greatly improves
the performance and now up to 500 results can be rendered reasonably.
* Limits the result set to a maximum of 500 results, introducing a new
error message when this number is exceeded. (Fixes: #15395)
* Introduces a new error message when an empty string is passed and
fixed the rendering of that error message by displaying it. (Fixes:
#19372)
* Thanks to karsten and hellais for their help on this patch. (:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
@@ -1,18 +1,18 @@
<divclass="results_box">
<% if(!relays) {%>
<% if(error == 0) {%>
<% if(!relays) {%>
<% if(error == 0) {%>
<divclass="alert">
<strong>No Results found!</strong><p>
No Tor relays matched your query :(</p>
</div>
<% } else if (error == 1) {%>
<% } else if (error == 1) {%>
<divclass="alert alert-error">
<strong>Too many matches!</strong><p>The current version of Atlas does
not support a result set greater than 40. This is due to some performance
issues in doing multiple parallel connections in javascript. Future versions
will hopefully manage to overcome this issue.</p>
</div>
<% } else if (error == 2) {%>
<% } else if (error == 2) {%>
<divclass="alert alert-error">
<strong>Backend error!</strong>
<p>Atlas is unable to get a response from its backend server. This
@@ -22,12 +22,34 @@
page</a> that explains what type of search queries are supported by
Atlas.</p>
</div>
<% } else if (error == 3) {%>
<% } else if (error == 3) {%>
<divclass="alert alert-error">
<strong>JavaScript Error!</strong><p>There is a problem with your javascript environment, you may have noscript enabled on the remote onionoo backend. Try temporarily allowing noscript to connect to the backend IP address. If the problem persits consult <ahref="https://trac.torproject.org/">the bugtracker.</a></p>
<strong>JavaScript Error!</strong><p>There is a problem with your
javascript environment, you may have noscript enabled on the remote
onionoo backend. Try temporarily allowing noscript to connect to the
backend IP address. If the problem persits consult <a