summaryrefslogtreecommitdiff
path: root/www/index.htm
blob: 447c6dd1c7ad27c0d6d9171921aff251cc793c8a (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
<!doctype html>
<html>
  <head>
    <meta charset="utf-8">
    <link rel="stylesheet" href="css/normalize.css">
    <link rel="stylesheet" href="css/skeleton.css">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css" integrity="sha256-eZrrJcwDc/3uDhsdt61sL2oOBY362qM3lon1gyExkL0=" crossorigin="anonymous" />
    <link rel="stylesheet" href="imok.css">
    <script src="https://cdn.jsdelivr.net/npm/vue"></script>
  </head>
  <body>
    <div id="container">
      <div class="row">
        <div class="two-thirds column">
          <h1>Buttons</h1>
        </div>
        <div class="one-third column">
          <button id="create" class="button-primary" v-on:click="create">create</button>
        </div>
      </div>

      <table class="u-full-width">
        <thead>
          <tr>
            <th>id</th>
            <th>status</th>
            <th>last pressed</th>
          </tr>
        </thead>
        <tbody>
          <tr v-if="!ready">
            <td colspan="3"><i class="fa fa-spinner fa-spin"></i>
          </tr>

          <tr v-for="(button, index) in buttons" v-show="ready">
            <td>{{ button.id }} <button v-on:click="remove(index)">delete</button></td>
            <td>
              <select v-model="button.status" v-on:change="update(index)">
                <option value="0">Inventory</option>
                <option value="1">Active</option>
                <option>2</option>
                <option>3</option>
                <option>4</option>
              </select>
            </td>
            <td>{{ button.last_pressed }}</td>
          </tr>
        </tbody>
      </table>
    </div>
    <script src="imok.js"></script>
  </body>
</html>