aboutsummaryrefslogtreecommitdiff
path: root/cmd/monfront/templates/create_index.html
blob: 1e4a67e38b42b5a07e52e82c1d1e534d697c3149 (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
77
78
79
80
81
82
83
84
{{ template "header" . }}
<section id="content">
  <h1>create entries</h1>
  <details>
    <summary>checks</summary>
      <form action="/create" method="POST">
      <p><label>name</label><input name="name" /></p>
      <p><label>node</label>
        <select name="node_id">
          {{ range $node := .Content.nodes.Rows }}
            <option value="{{ (index . 0).String }}">{{ (index . 1).String }}</option>
          {{ end }}
        </select>
      </p>
      <p><label>command</label><select name="command_id">
          {{ range $node := .Content.commands.Rows }}
            <option value="{{ (index . 0).String }}">{{ (index . 1).String }}</option>
          {{ end }}
      </select></p>
      <p><label>checker</label><select name="checker_id">
          {{ range $node := .Content.checkers.Rows }}
            <option value="{{ (index . 0).String }}">{{ (index . 1).String }}</option>
          {{ end }}
      </select></p>
      <p><label>interval</label><input type="integer" name="interval" value="300" /></p>
      <fieldset>
        <legend>options</legend>
        <!-- TODO implement setting options -->
      </fieldset>
      <p><label>message</label><textarea name="message"></textarea></p>
      <p><button type="submit" name="type" value="check">create</button></p>
    </form>
  </details>
  <details>
    <summary>nodes</summary>
    <details>
      <summary>create new node</summary>
      <form action="/create" method="POST">
        <p><label>name</label><input name="name" /></p>
        <p><label>message</label><textarea name="message"></textarea></p>
        <p><button type="submit" name="type" value="node">create</button></p>
      </form>
    </details>
    {{ template "rows_to_table" .Content.nodes }}
  </details>
  <details>
    <summary>commands</summary>
    <details>
      <summary>create new command</summary>
      <form action="/create" method="POST">
        <p><label>name</label><input name="name" /></p>
        <p><label>command</label><textarea name="command"></textarea></p>
        <p><label>message</label><textarea name="message"></textarea></p>
        <p><button type="submit" name="type" value="command">create</button></p>
      </form>
    </details>
    {{ template "rows_to_table" .Content.commands }}
  </details>
  <details>
    <summary>checkers</summary>
    <details>
      <summary>create new checker instance</summary>
      <form action="/create" method="POST">
        <p><label>name</label><input name="name" /></p>
        <p><label>description</label><textarea name="description"></textarea></p>
        <p><button type="submit" name="type" value="checker">create</button></p>
      </form>
    </details>
    {{ template "rows_to_table" .Content.checkers }}
  </details>
  <details>
    <summary>notifier</summary>
    <details>
      <summary>create new notifier</summary>
      <form action="/create" method="POST">
        <p><label>name</label><input name="name" /></p>
        <p><label>settings</label><textarea name="settings">{}</textarea></p>
        <p><button type="submit" name="type" value="notifier">create</button></p>
      </form>
    </details>
    {{ template "rows_to_table" .Content.notifier }}
  </details>
</section>
{{ template "footer" . }}