summaryrefslogtreecommitdiff
path: root/deps/rabbitmq_tracing/priv/www/js/tmpl/traces.ejs
blob: 4c1244c6ddd5d5b174cac0b0eaa83fadb8ed9476 (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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
<h1>Traces: <b><%= node.name %></b></h1>
<p>
  Node:
  <select id="traces-node">
  <% for (var i = 0; i < nodes.length; i++) { %>
     <option name="#/traces/<%= fmt_string(nodes[i].name) %>"<% if (nodes[i].name == node.name) { %>selected="selected"<% } %>><%= nodes[i].name %></option>
  <% } %>
  </select>
</p>

<div class="section">
  <h2>All traces</h2>
  <div class="hider updatable">
    <table class="two-col-layout">
      <tr>
        <td>
          <h3>Currently running traces</h3>
          <% if (traces.length > 0) { %>
          <table class="list">
            <thead>
              <tr>
                <% if (vhosts_interesting) { %>
                  <th>Virtual host</th>
                <% } %>
                <th>Name</th>
                <th>Pattern</th>
                <th>Format</th>
                <th>Payload limit</th>
                <th>Rate</th>
                <th>Queued</th>
                <th>Tracer connection username</th>
                <th></th>
              </tr>
            </thead>
            <tbody>
              <%
                 for (var i = 0; i < traces.length; i++) {
                     var trace = traces[i];
              %>
              <tr<%= alt_rows(i)%>>
                <% if (vhosts_interesting) { %>
                  <td><%= fmt_string(trace.vhost) %></td>
                <% } %>
                <td><%= fmt_string(trace.name) %></td>
                <td><%= fmt_string(trace.pattern) %></td>
                <td><%= fmt_string(trace.format) %></td>
                <td class="c"><%= fmt_string(trace.max_payload_bytes, 'Unlimited') %></td>
                <% if (trace.queue) { %>
                <td class="r">
                  <%= fmt_detail_rate(trace.queue.message_stats, 'deliver_no_ack') %>
                </td>
                <td class="r">
                  <%= trace.queue.messages %>
                  <sub><%= link_trace_queue(trace) %></sub>
                </td>
                <% } else { %>
                <td colspan="2">
                  <div class="status-red"><acronym title="The trace failed to start - check the server logs for details.">FAILED</acronym></div>
                </td>
                <% } %>
                <td><%= fmt_string(trace.tracer_connection_username) %></td>
                <td>
                  <form action="#/traces/node/<%= node.name %>" method="delete">
                    <input type="hidden" name="vhost" value="<%= fmt_string(trace.vhost) %>"/>
                    <input type="hidden" name="name" value="<%= fmt_string(trace.name) %>"/>
                    <input type="submit" value="Stop"/>
                  </form>
                </td>
              </tr>
              <% } %>
            </tbody>
          </table>
          <% } else { %>
          <p>... no traces running ...</p>
          <% } %>
        </td>
        <td>
          <h3>Trace log files</h3>
          <% if (files.length > 0) { %>
            <table class="list">
              <thead>
                <tr>
                  <th>Name</th>
                  <th>Size</th>
                  <th></th>
                </tr>
              </thead>
              <tbody>
              <%
                for (var i = 0; i < files.length; i++) {
                  var file = files[i];
              %>
                <tr<%= alt_rows(i)%>>
                  <td><%= link_trace(node.name, file.name) %></td>
                  <td class="r"><%= fmt_bytes(file.size) %></td>
                  <td>
                    <form action="#/trace-files/node/<%= node.name %>" method="delete" class="inline-form">
                      <input type="hidden" name="name" value="<%= fmt_string(file.name) %>"/>
                      <input type="submit" value="Delete" />
                    </form>
                  </td>
                </tr>
              <% } %>
              </tbody>
            </table>
          <% } else { %>
            <p>... no files ...</p>
          <% } %>
        </td>
      </tr>
    </table>
  </div>
</div>

<div class="section">
  <h2>Add a new trace</h2>
  <div class="hider">
    <form action="#/traces/node/<%= node.name %>" method="put">
      <table class="form">
<% if (vhosts_interesting) { %>
        <tr>
          <th><label>Virtual host:</label></th>
          <td>
            <select name="vhost">
              <% for (var i = 0; i < vhosts.length; i++) { %>
              <option value="<%= fmt_string(vhosts[i].name) %>"><%= fmt_string(vhosts[i].name) %></option>
              <% } %>
            </select>
          </td>
        </tr>
<% } else { %>
        <tr><td><input type="hidden" name="vhost" value="<%= fmt_string(vhosts[0].name) %>"/></td></tr>
<% } %>
        <tr>
          <th><label>Name:</label></th>
          <td><input type="text" name="name"/><span class="mand">*</span></td>
        </tr>
        <tr>
          <th><label>Format:</label></th>
          <td>
            <select name="format">
              <option value="text">Text</option>
              <option value="json">JSON</option>
            </select>
          </td>
        </tr>
        <tr>
          <th><label>Tracer connection username:</label></th>
          <td><input type="text" name="tracer_connection_username"/></td>
          <td><label>Tracer connection password:</label></td>
          <td>
            <div id="password-div">
              <input type="password" name="tracer_connection_password"/>
            </div>
          </td>
        </tr>
        <tr>
          <th><label>Max payload bytes: <span class="help" id="tracing-max-payload"></span></label></th>
          <td>
            <input type="text" name="max_payload_bytes" value=""/>
          </td>
        </tr>
        <tr>
          <th><label>Pattern:</label></th>
          <td>
            <input type="text" name="pattern" value="#"/>
            <sub>Examples: #, publish.#, deliver.# #.amq.direct, #.myqueue</sub>
          </td>
        </tr>
      </table>
      <input type="submit" value="Add trace"/>
    </form>
  </div>
</div>