about summary refs log tree commit diff
path: root/templates/botSingle.html
blob: dcb874f34527e2f86261b7297f5ac726115239c6 (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
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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
{{ define "botSingle" }}

{{ template "head" . }}
<body>
  {{ template "nav" . }}

  <span id="bot"></span>
  <h1><a href="#bot">{{ .bot.Name }}</a></h1>

  <form method="POST" action="/bot/{{ .bot.ID }}">
    <table>
      {{ if .editable }}
      <tr>
        <td><label for="name">Name:</label></td>
        <td><input class="border" type="text" id="name" name="name" value="{{ .bot.Name }}"></td>
      </tr>
      {{ else }}
      {{ end }}

      <tr>
        <td>Archs</td>
        <td>
          {{ range $idx, $arch := .archs }}{{if $idx}},{{end}}
            <input
              type="checkbox"
              class="check-with-label"
              name="arch-{{$arch.ID}}"
              id="arch-{{$arch.ID}}"
              {{if $arch.Enabled}}checked{{end}}
              {{if $.editable}}{{else}}disabled="disabled"{{end}}/>
            <label class="label-for-check" for="arch-{{$arch.ID}}">{{$arch.Name}}</label>
          {{- end }}
        </td>
      </td>

      <tr>
        <td>Bits</td>
        <td>{{ range $idx, $bit := .bits }}{{if $idx}},{{end}}
          <input
            type="checkbox"
            class="check-with-label"
            id="bit-{{$bit.ID}}"
            name="bit-{{$bit.ID}}"
            {{if $bit.Enabled}}checked{{end}}
            {{if $.editable}}{{else}}disabled="disabled"{{end}}/>
          <label class="label-for-check" for="bit-{{$bit.ID}}">{{$bit.Name}}</label>
          {{- end }}
        </td>
      </td>

      <tr>
        <td><label for="source">Source:</label></td>
        <td><textarea
          id="source"
          name="source"
          cols="80"
          rows="15"
          {{ if .editable }}{{ else }}readonly{{ end }}
        >{{ .bot.Source }}</textarea></td>
      <tr>

      {{ if .editable }}
      <tr>
        <td></td>
        <td><input class="border" type="submit" value="Save"></td>
      </tr>
      {{ else }}
      {{ end }}

      <tr>
        <td></td>
        <td>{{ .res }}</td>
      </tr>

      <tr><td><hr></td><td><hr></td></tr>

      <tr>
        <td>CMD</td>
        <td>{{ .bytecode_r2cmd }}</td>
      </tr>
      <tr>
        <td>Bytecode</td>
        <td>{{ .bytecode }}</td>
      </tr>

      <tr><td><hr></td><td><hr></td></tr>

      <tr>
        <td>CMD</td>
        <td>{{ .disasm_r2cmd }}</td>
      </tr>
      <tr>
        <td>Disasm</td>
        <td><pre>{{ .disasm }}</pre></td>
      </tr>

    <table>
  </form>

</body>
{{ template "footer" . }}
{{ end }}