{{ template "base" . }}
{{ define "title" }}Trace{{ end }}
{{ define "head" }}{{end}}
{{ define "body" }}
<div class="jumbotron">
  <h2>Welcome to Trace!</h2>
  <p>
    Trace is a tool for analyzing the connections between systems. We
    log <em>all</em> requests and responses very precisely - including
    even calls that you might think of as "internal" like SQL queries
    - and aggregate the results for analysis here.
  </p>
</div>
<hr>
<div class="row">
  <div class="col-md-12">
    <h2>Tracked Service Index</h2>
    <p>
      Each of the services listed below is trace-enabled. Click on
      to view a report on the service's response time to requests.
    </p>
    <p class="alert alert-warning">
      <strong>Currently, reports are grouped to describe response
        time to un-Traced clients</strong>. In effect, that means that
      services which end users can access (like web/web, or tmi)
      have <em>vastly</em> more data. This is not a fundamental
      limitation of Trace; we plan to add better reporting for
      internal services soon!</p>
  </div>
</div>
<div class="row">
  <div class="col-md-12">
    <dl class="binary-list">
      {{ range $_, $org := $.Orgs }}
      <dt>{{ $org.Name }}</dt>
      <dd>
        <dl class="binary-list">
          {{ range $_, $proj := $org.Projects }}
          <dt>
            {{ if $proj.IsACommand }}
            <a href="{{ URLForService $org.Name $proj.Name "" }}">
              {{ $proj.Name }}
            </a>
            {{ else }}
            {{ $proj.Name }}
            {{ end }}
          </dt>
            {{ range $cmd := $proj.Commands }}
            <dd>
              <ul class="list-unstyled">
                <li>
                  <a href="{{ URLForService $org.Name $proj.Name $cmd }}">{{ $cmd }}</a>
                </li>
              </ul>
            </dd>
            {{ end }}
          {{ end }}
        </dl>
      </dd>
      {{ end }}
    </dl>
  </div>
</div>
{{ end }}
