summaryrefslogtreecommitdiff
path: root/views/admin.html
blob: ebec09ceb0cacd52b217df6ef53e432716ca9b37 (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
{{template "header.html"}}
{{template "navbar.html"}}

{{if .Error}}
<div class="container">
	<div class="row">
{{range .Error}}
<p class="col-md-4 col-md-offset-4 alert alert-danger alert-dismissible shadow-z-2" role="alert">
	<button type="button" class="close" data-dismiss="alert" aria-label="close"><span aria-hidden="true">&times;</span></button>
	{{.}}
</p>
{{end}}
	</div>
</div>
{{end}}
{{if .Success}}
<div class="container">
	<div class="row">
{{range .Success}}
<p class="col-md-4 col-md-offset-4 alert alert-success alert-dismissible shadow-z-2" role="alert">
	<button type="button" class="close" data-dismiss="alert" aria-label="close"><span aria-hidden="true">&times;</span></button>
	{{.}}
</p>
{{end}}
	</div>
</div>
{{end}}
<div class="container">
	<div class="row">
		<div class="pull-left">
		<button id="btn-reload" class="btn btn-primary btn-raised"><span class="glyphicon glyphicon-refresh"></span> Reload</button>
		<button class="btn btn-primary btn-raised" data-toggle="modal" data-target="#jobs-modal"><span class="glyphicon glyphicon-plus-sign"></span> Add new host</button>
		</div>
		<div class="pull-right">
			<form action="/logout">
			<button class="btn btn-danger btn-raised" href="/logout"><span class="glyphicon glyphicon-minus-sign"></span> Logout</button>
			</form>
		</div>
		<table class="table table-striped table-hover ">
			<thead>
				<th>#</th>
				<th>Host</th>
				<th>Url</th>
				<th>Status</th>
				<!--th>Status Code</th-->
				<th class="hide">Failure Reason</th>
				<th>Delete</th>
			</thead>
			<tbody>
{{range $index, $results := .Hosts}}
		<tr class="{{.Class}}">
				<td>{{add $index 1}}</td>
				<td>{{.Host}}</td>
				<td>{{.Url}}</td>
				<td>{{.Status}}</td>
				<!--td>{{.StatusCode}}</td-->
				<td class="hide">{{.Reason}}</td>
				<!--td><span class="glyphicon glyphicon-pencil"></span></td-->
				<td><a href="#" data-toggle="modal" data-target="delete-modal">&times;</a></td>
			</tr>
{{end}}
			</tbody>
		</table>
		<div class="pull-left">
			<form action="/refresh" method="POST">
			<button class="btn btn-primary btn-raised"><span class="glyphicon glyphicon-refresh"></span> Update all</button>
			</form>
		</div>
	</div>
</div>
{{template "jobs_modal.html"}}
{{template "footer.html"}}