Code

graphs: Determine GroupBy attributes automatically and use check boxes.
[sysdb/webui.git] / templates / graphs.tmpl
1 <section>
2         <h1>Graphs</h1>
3         <form action="/graphs" method="POST">
4                 <p><input type="text" name="metrics-query" value="{{.Query}}"
5                        class="query" placeholder="Search metrics" required />
6                 <button type="submit">GO</button></p>
7 {{if .Attributes}}
8         <p><b>Group by:</b>
9         {{range $a, $v := .Attributes}}
10                 <input type="checkbox" name="group-by" value="{{$a}}" {{if $v}}checked{{end}} />{{$a}}
11         {{end}}
12         </p>
13 {{end}}
14         </form><br />
15 {{if .Metrics}}
16         <img src="/graph/q{{urlquery .QueryOptions}}/{{urlquery .Metrics}}" border="0" />
17 {{end}}
18         <p>&nbsp;</p>
19 </section>