This file is indexed.

/usr/share/flower/templates/worker.html is in python-flower 0.8.3+dfsg-3.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  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
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
{% extends "base.html" %}

{% block navbar %}
  {% module Template("navbar.html", active_tab="workers") %}
{% end %}

{% block container %}
  <div class="container-fluid">
    <div class="row-fluid">
      <div class="span12">
        <div class="page-header">
                <small>Worker: </small><h1 id="workername">{{ worker['name'] }}</h1>
        </div>

        <button class="btn pull-right" type="button" onclick="flower.on_worker_refresh(event)">Refresh</button>
        <div class="tabbable">
          <ul class="nav nav-tabs">
            <li class="active"><a href="#tab-pool" data-toggle="tab">Pool</a></li>
            <li><a href="#tab-broker" data-toggle="tab">Broker</a></li>
            <li><a href="#tab-queues" data-toggle="tab">Queues</a></li>
            <li><a href="#tab-tasks" data-toggle="tab">Tasks</a></li>
            <li><a href="#tab-limits" data-toggle="tab">Limits</a></li>
            <li><a href="#tab-config" data-toggle="tab">Config</a></li>
            <li><a href="#tab-system" data-toggle="tab">System</a></li>
          </ul>

          <div class="tab-content">
            <div class="tab-pane active" id="tab-pool">

              <div class="row-fluid">
                <div class="span6">
                  <table class="table table-bordered table-striped">
                    <caption>Worker pool options</caption>
                    <tbody>
                      {% for name,value in worker['stats']['pool'].items() %}
                        <tr>
                          <td>{{ humanize(name) }}</td>
                          <td>{{ humanize(value) }}</td>
                        </tr>
                      {% end %}
                        <tr>
                            <td>Worker PID</td>
                            <td>{{ worker['stats'].get('pid', 'N/A')}}</td>
                        </tr>
                        <tr>
                            <td>Prefetch Count</td>
                            <td>{{ worker['stats'].get('prefetch_count', 'N/A')}}</td>
                        </tr>
                    </tbody>
                  </table>
                </div>

                <div class="span6">
                  <div class="form-horizontal">
                    <fieldset>
                      <legend>Pool size control</legend>
                      <div class="control-group">
                        <label class="control-label" for="pool-size">Pool size</label>
                        <div class="controls">
                          <div class="input-append">
                            <select class="input-mini" id="pool-size">
                              <option>1</option>
                              <option>2</option>
                              <option>3</option>
                              <option>4</option>
                              <option>5</option>
                            </select>
                            <button class="btn" type="button" onclick="flower.on_pool_grow(event)">Grow</button>
                            <button class="btn" type="button" onclick="flower.on_pool_shrink(event)">Shrink</button>
                          </div>
                        </div>
                      </div>

                      <div class="control-group">
                        <label class="control-label" for="min-autoscale">Min/Max autoscale</label>
                        <div class="controls">
                          <div class="input-append">
                            <input class="input-mini" id="min-autoscale" size="6" type="text">
                            <input class="input-mini" id="max-autoscale" size="6" type="text">
                            <button class="btn" type="button" onclick="flower.on_pool_autoscale(event)">Apply</button>
                          </div>
                        </div>
                      </div>
                    </fieldset>
                  </div>
                </div>
              </div>

              {% if worker['stats'].get('autoscaler', None) %}
                <div class="row-fluid">
                    <div class="span6">
                        <table class="table table-bordered table-striped">
                            <caption>Autoscaler options</caption>
                            <tbody>
                            {% for name,value in worker['stats']['autoscaler'].items() %}
                                <tr>
                                <td>{{ humanize(name) }}</td>
                                <td>{{ humanize(value) }}</td>
                                </tr>
                            {% end %}
                            </tbody>
                        </table>
                    </div>
                </div>
              {% end %}

            </div> <!-- end pool tab -->

            <div class="tab-pane" id="tab-broker">
              <div class="span6">
                <table class="table table-bordered table-striped">
                  <caption>Broker options</caption>
                  <tbody>
                    {% for name,value in (worker['stats'].get('consumer', None) or worker['stats'])['broker'].items() %}
                      <tr>
                        <td>{{ humanize(name) }}</td>
                        <td>{{ value }}</td>
                      </tr>
                    {% end %}
                  </tbody>
                </table>
              </div>
            </div> <!-- end broker tab -->

            <div class="tab-pane" id="tab-queues">
              <h3>Active  <small>queues being consumed from</small></h3>

              <div class="control-group">
                <div class="controls">
                  <div class="input-append">
                    <input class="span2" id="add-consumer-name" size="16" type="text">
                    <button class="btn" type="button" onclick="flower.on_add_consumer(event)">Add Consumer</button>
                 </div>
                </div>
              </div>

              <table class="table table-bordered table-striped">
                <thead>
                  <tr>
                    <th>Name</th>
                    <th>Exclusive</th>
                    <!-- <th>Exchange</th> -->
                    <th>Durable</th>
                    <th>Routing key</th>
                    <th>No ACK</th>
                    <th>Alias</th>
                    <th>Queue arguments</th>
                    <th>Binding arguments</th>
                    <th>Auto delete</th>
                    <th style="width: 125px;"></th>
                  </tr>
                </thead>
                <tbody>
                  {% for queue in worker.get('active_queues', []) %}
                    <tr>
                      <td>{{ queue['name'] }}</td>
                      <td>{{ queue['exclusive'] }}</td>
                      <!-- <td>{{ queue['exchange'] }}</td> -->
                      <td>{{ queue['durable'] }}</td>
                      <td>{{ queue['routing_key'] }}</td>
                      <td>{{ queue['no_ack'] }}</td>
                      <td>{{ queue['alias'] }}</td>
                      <td>{{ queue['queue_arguments'] }}</td>
                      <td>{{ queue['binding_arguments'] }}</td>
                      <td>{{ queue['auto_delete'] }}</td>
                      <td><button class="btn btn-danger" onclick="flower.on_cancel_consumer(event)">Cancel Consumer</button></td>
                  </tr>
                {% end %}
              </tbody>
              </table>
            </div> <!-- end queues tab -->

            <div class="tab-pane" id="tab-tasks">
              <h2>Processed <small>number of completed tasks</small></h2>
              <table class="table table-bordered table-striped">
                <tbody>
                  {% for name,value in worker['stats']['total'].items() %}
                    <tr>
                      <td>{{ name }}</td>
                      <td>{{ value }}</td>
                    </tr>
                  {% end %}
                  </tbody>
              </table>

              <h2>Active  <small>currently executing tasks</small></h2>
              <table class="table table-bordered table-striped">
                <thead>
                  <tr>
                    <th>Name</th>
                    <th>UUID</th>
                    <th>Start time</th>
                    <th>Ack</th>
                    <th>PID</th>
                    <th>args</th>
                    <th>kwargs</th>
                  </tr>
                </thead>
                <tbody>
                {% for task in worker.get('active', {}) %}
                    <tr>
                      <td>{{ task['name'] }}</td>
                      <td><a href="{{ '/task/' + task['id'] }}">{{ task['id'] }}</a></td>
                      <td>{{ humanize(task['time_start'], type='time') }}</td>
                      <td>{{ task['acknowledged'] }}</td>
                      <td>{{ task['worker_pid'] }}</td>
                      <td>{{ task.get('args', 'N/A') }}</td>
                      <td>{{ task.get('kwargs', 'N/A') }}</td>
                    </tr>
                  {% end %}
                </tbody>
              </table>

              <h2>Scheduled <small>scheduled (eta/countdown/retry) tasks</small></h2>
              <table class="table table-bordered table-striped">
                <thead>
                  <tr>
                    <th>Name</th>
                    <th>UUID</th>
                    <th>args</th>
                    <th>kwargs</th>
                  </tr>
                </thead>
                <tbody>
                {% for task in worker.get('scheduled', {}) %}
                    <tr>
                      <td>{{ task['request']['name'] }}</td>
                      <td><a href="{{ '/task/' + task['request']['id'] }}">{{ task['request']['id'] }}</a></td>
                      <td>{{ task['request']['args'] }}</td>
                      <td>{{ task['request']['kwargs'] }}</td>
                    </tr>
                  {% end %}
                  </tbody>
              </table>

              <h2>Reserved  <small>tasks that have been received, but are still waiting to be executed</small></h2>
              <table class="table table-bordered table-striped">
                <thead>
                  <tr>
                    <th>Name</th>
                    <th>UUID</th>
                    <th>args</th>
                    <th>kwargs</th>
                  </tr>
                </thead>
                <tbody>
                {% for task in worker.get('reserved', {}) %}
                    <tr>
                      <td>{{ task['name'] }}</td>
                      <td><a href="{{ '/task/' + task['id'] }}">{{ task['id'] }}</a></td>
                      <td>{{ task['args'] }}</td>
                      <td>{{ task['kwargs'] }}</td>
                    </tr>
                  {% end %}
                  </tbody>
              </table>

              <h2>Revoked  <small>cancelled tasks</small></h2>
              <table class="table table-bordered table-striped">
                <thead>
                  <tr>
                    <th>UUID</th>
                  </tr>
                </thead>
                <tbody>
                  {% for task in worker.get('revoked', []) %}
                    <tr>
                      <td><a href="{{ '/task/' + task }}">{{ task }}</a></td>
                    </tr>
                  {% end %}
                </tbody>
              </table>
            </div> <!-- end tasks tab -->

            <div class="tab-pane" id="tab-limits">
              <h3>Task limits</h3>
              <table class="table table-bordered table-striped">
                <thead>
                  <tr>
                    <th>Task name</th>
                    <th>Rate limit</th>
                    <th>Timeouts</th>
                  </tr>
                </thead>
                {% for taskname in worker.get('registered', []) %}
                  <tr>
                    <td>{{ taskname }}</td>
                    <td>
                      <div class="control-group">
                        <div class="controls">
                          <div class="input-append">
                            <input class="input-small" type="text">
                            <button class="btn" type="button" onclick="flower.on_task_rate_limit(event)">Apply</button>
                            </div>
                        </div>
                      </div>
                    </td>
                    <td>
                      <div class="control-group">
                        <div class="controls">
                          <div class="input-append">
                            <input class="input-small" type="text">
                            <button class="btn" type="button" onclick="flower.on_task_timeout(event)">Soft</button>
                            <button class="btn" type="button" onclick="flower.on_task_timeout(event)">Hard</button>
                          </div>
                        </div>
                      </div>
                    </td>
                  </tr>
                {% end %}
              </table>
          </div> <!-- end limits tab -->

          <div class="tab-pane" id="tab-config">
            <div class="span8">
              <table class="table table-bordered table-striped">
                <caption>Configuration options</caption>
                <tbody>
                {% for name,value in sorted(worker.get('conf', {}).items()) %}
                    {% if value is not None %}
                      <tr>
                        <td><a href="http://docs.celeryproject.org/en/latest/configuration.html#{{ name.lower().replace('_', '-') }}" target="_blank">{{ name }}</a></td>
                        <td>{{ value }}</td>
                      </tr>
                    {% end %}
                  {% end %}
                </tbody>
              </table>
            </div>
          </div> <!-- end config tab -->

          <div class="tab-pane" id="tab-system">
            <div class="span8">
              <table class="table table-bordered table-striped">
                <caption>System usage statistics</caption>
                <tbody>
                {% if isinstance(worker['stats'].get('rusage', None), dict) %}
                    {% for name, value in worker['stats']['rusage'].items() %}
                        <tr>
                            <td>{{ name }}</td>
                            <td>{{ value }}</td>
                        </tr>
                    {% end %}
                {% end %}
                </tbody>
              </table>
            </div>
          </div> <!-- end system tab -->

         </div>
        </div>
      </div>
  </div>
  </div>
{% end %}