/
lookup.html.go
87 lines (81 loc) · 2.93 KB
/
lookup.html.go
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
package templates
func init() {
registerTemplate("lookup.html", `
{{template "header.html" .}}
<div class="row-fluid">
<div class="span12">
<h2>Lookup</h2>
</div>
</div>
{{if not .Lookupd}}
<div class="alert">
<h4>Notice</h4> nsqadmin is not configured with nsqlookupd hosts
</div>
{{else}}
<div class="row-fluid">
<div class="span4">
<table class="table table-bordered table-condensed">
<tr>
<th>nsqlookupd Host</th>
</tr>
{{range .Lookupd}}
<tr>
<td>{{.}}</td>
</tr>
{{end}}
</table>
</div>
</div>
<div class="row-fluid">
<div class="span4">
{{if .TopicMap}}
<div class="alert alert-info">
Below is a tree of Topics/Channels that are currently inactive (i.e. not produced on any nsqd in the cluster but are present in the lookup data)
</div>
<ul>
{{range $t, $channels := .TopicMap}}
<li><form class="form-inline" style="margin:0" action="/delete_topic" method="POST">
<input type="hidden" name="rd" value="/lookup">
<input type="hidden" name="topic" value="{{$t}}">
<button class="btn btn-mini btn-link red" type="submit">✘</button><a href="/topic/{{$t}}">{{$t}}</a>
</form>
<ul>
{{range $channels}}
<li><form class="form-inline" style="margin:0" action="/delete_channel" method="POST">
<input type="hidden" name="rd" value="/lookup">
<input type="hidden" name="topic" value="{{$t}}">
<input type="hidden" name="channel" value="{{.}}">
<button class="btn btn-mini btn-link red" type="submit">✘</button><a href="/topic/{{$t}}/{{.}}">{{.}}</a>
</form></li>
{{end}}
</ul>
</li>
{{end}}
</ul>
{{else}}
<div class="alert"><h4>Notice</h4>No inactive Topics</div>
{{end}}
</div>
</div>
<div class="row-fluid">
<div class="span4">
<form class="form" action="/create_topic_channel" method="POST">
<fieldset>
<legend>Create Topic/Channel</legend>
<div class="alert alert-info">
<p>This provides a way to setup a stream hierarchy
before services are deployed to production.
<p>If <em>Channel Name</em> is empty, just the topic is created.
</div>
<input type="text" name="topic" placeholder="Topic Name">
<input type="text" name="channel" placeholder="Channel Name"><br/>
<button class="btn btn-info" type="submit">Create</button>
</fieldset>
</form>
</div>
</div>
{{end}}
{{template "js.html" .}}
{{template "footer.html" .}}
`)
}