aboutsummaryrefslogtreecommitdiff
path: root/bh20simplewebuploader/templates/demo.html
blob: 2e290c6f6d65255662570dcdfb0264dba153b8f8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
<!DOCTYPE html>
<html>
  {% include 'header.html' %}
  <body>
    {% include 'banner.html' %}
    {% include 'menu.html' %}
    {% include 'search.html' %}
    <p>The Virtuoso database contains <span id="CounterDB"></span> public sequences!</p>

    <section class="search-section">
      <div class="filter-options" action="#">
        <p>[Demo] Display content sequences by: </p>
        <div>
          <button class="button" onclick="fetchSEQCountBySpecimen()">Count by Specimen source</button>
          <button class="button" onclick="fetchSEQCountByLocation()">Count by Location</button>
          <button class="button" onclick="fetchSEQCountByTech()">Count by Sequencer</button>
          <!-- <button class="button" onclick="fetchAllaccessions()">Show All accessions</button> -->
          <button class="button" onclick="fetchSEQCountbyContinent()">Count by Continent</button>
          <button class="button" onclick="fetchMap()">Map</button>
        </div>

      </div>

    </section>
    <div id="loader" class="loader invisible">
    </div>

    <section id="map_view" class="invisible">
      <div id="map"></div>
    </section>

    <section>
      <div id="table"></div>
    </section>

    {% include 'footer.html' %}

    <script type="text/javascript">
      let scriptRoot = {{ request.script_root|tojson|safe }}; // examples

      document.addEventListener("DOMContentLoaded", function(){
          var count = fetch("/api/getCountDB")
              .then((resp) => resp.json())
              .then(function (data) {
                  count = data["sequences"];
                  console.log(count);
                  span = document.getElementById("CounterDB");
                  txt = document.createTextNode(count);
                  span.appendChild(txt);
              });
      });

    </script>
  </body>

</html>