aboutsummaryrefslogtreecommitdiffstats
path: root/src/views/pages/index.ejs
blob: 6087732f227db6d625231c24cb81fa045deee4ae (plain) (blame)
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
<!DOCTYPE html>
<html lang="en">

<head>
  <!-- HTML headers information -->
  <%- include('../partials/head.ejs') %>
  <script type="text/javascript" src="/static/js/app.js"></script>
</head>

<body>
  <%- include('../partials/nav.ejs') %>
  <div class="header">
    <!-- Get the navbar -->

    <div class="row">
      <div class="col">

        <h1 id="title2">Homepage</h1>
        <hr>


        <h3 id="subtitle1">Please upload a Python file (.py file extension) onto the Inverted Pendulum</h3>
        <!--**************************Send form data to web server**************************-->
        <form method="POST" action="/index" enctype="multipart/form-data">
          <p><input type="file" name="file" accept=".py" /></p>
          <p><input type="submit" value="Upload File" onclick="update()"></p>
        </form>

        For file upload progress bar
        <div id="myProgress">
          <div id="myBar"></div>
        </div>

        <!--The following lines are for the warning flash() messages-->
        <% if (errors) { %>
        <% for (const message in errors) { %>
        <div class="alert alert-warning alert-dismissible fade show" role="alert">
          <span>
            <% message %>
          </span>
          <button type="button" class="close" data-dismiss="alert" aria-label="Close">
            <span aria-hidden="true">&times;</span>
          </button>
        </div>
        <% } %>
        <% } %>

        <!--The following lines are for the danger flash() messages-->
        <% if (errors) { %>
        <% for (const message in errors) { %>
        <div class="alert alert-danger alert-dismissible fade show" role="alert">
          <span>
            <% message %>
          </span>
          <button type="button" class="close" data-dismiss="alert" aria-label="Close">
            <span aria-hidden="true">&times;</span>
          </button>
        </div>
        <% } %>
        <% } %>


        <div class="mb-3">
          <div class="form-group">
            <label id="Start">Start pendulum: </label>
            <!-- <button class="btn btn-primary" id="onbutton">Actuate!</button> -->
            <button type="button" id=button1 onclick="window.location.href='{{ url_for( 'run_test_file') }}';">Actuate!</button>
          </div>
        </div>
        <hr>
      </div>
    </div>
  </div>
</body>

</html>