<%= javascript_include_tag "ping" %>
<%= javascript_tag do %>
  $("#ping").click(function() {
    $("#ping_result_lag_ms").val("");
    $("#ping_result_ping_progress").html("");
    Pinger.measure("<%= path_to_javascript "ping" %>",
      function(lag){$("#ping_result_ping_progress").append(" " + lag);},
      function(lag){$("#ping_result_lag_ms").val(lag);}
    )});
<% end %>
<%
  other_hosts = apps_hosts
  if other_hosts.empty?
    other_hosts_p = ""
  else
    other_hosts_p = "<p>Please also visit #{other_hosts.map{|host|
      link_to(host, request.protocol + host)
    }.join(", ")}.</p>"
  end
%>

<h1>Ping Cloud!</h1>

<%= react_component('MeasurementBox') %>

<footer>
<%=other_hosts_p.html_safe %>
<p>
A ping measures a round trip time of packets for a HEAD request to this server.
Your IP address and user agent are recorded and maybe used statistically.
Your phyical location is guessed thruogh a geocoding service.
</p>
<p><a href="https://github.com/zunda/ping">Fork me on GitHub</a></p>
</footer>

<%= javascript_include_tag "ping" %>
<%= javascript_tag do %>
  $("#ping").click(function() {
    $("#ping_result_lag_ms").val("");
    $("#ping_result_ping_progress").html("");
    Pinger.measure("<%= path_to_javascript "ping" %>",
      function(lag){$("#ping_result_ping_progress").append(" " + lag);},
      function(lag){$("#ping_result_lag_ms").val(lag);}
    )});
<% end %>
<%
  other_hosts = apps_hosts
  if other_hosts.empty?
    other_hosts_p = ""
  else
    other_hosts_p = "<p>Please also visit - #{other_hosts.map{|host|
      link_to(host, request.protocol + host)
    }.join(" ")}.</p>"
  end
%>

<h1>Ping Cloud!</h1>

<%= react_component('MeasurementBox') %>

<footer>
<%=other_hosts_p.html_safe %>
<p>
A ping measures a round trip time of packets for a HEAD request to this server.
Your IP address and user agent are recorded and maybe used statistically.
Your phyical location is guessed thruogh a geocoding service.
</p>
<p><a href="https://github.com/zunda/ping">Fork me on GitHub</a></p>
</footer>

Improve list of this app in other regions
Improve list of this app in other regions
