Kiln » Kiln Storage Service Read More
Clone URL:  
queuestats.html
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
{% extends "base.html" %} {% block title %}Kiln Queue Stats{% endblock title %} {% block extra_head %} <link rel="stylesheet" href="{{ url_for('static', filename='jquery.terminal.css') }}" /> <script type="text/javascript" src="{{ url_for('static', filename='jquery.mousewheel.min.js') }}"></script> <script type="text/javascript" src="{{ url_for('static', filename='jquery.color.js') }}"></script> <script type="text/javascript" src="{{ url_for('static', filename='jquery.terminal-0.3.3.min.js') }}"></script> <script type="text/javascript"> function updateStats() { $.get('{{ url_for("queuestats") }}', function (data, status, xhr) { $('#table_stats tbody tr').each(function(i, e) { tds = $(e).find('td'); key = tds.eq(0).text().trim(); value = data[key]; if (value !== undefined) { val_cell = tds.eq(1).find('span'); if (val_cell.text().trim() != value) { val_cell.text(value) .clearQueue() .css({backgroundColor: '#9ff'}) .animate({backgroundColor: '#fff'}, 2000); } } }); }, 'json'); } $(function() { var terminal = $('#redis_term').terminal(function(cmd, term) { if (cmd) { term.pause(); $.post("{{ url_for('cli') }}", {cmd: cmd}, function(data, status, xhr) { term.resume(); if (data.type === 'error') { term.error(data.response); } else { term.echo(data.response); } updateStats(); }, 'json'); } }, { greetings: '[[;#0f0;]Welcome to the Redis Interactive Shell\nType `help` for a list of commands.]', name: 'redis_cli', height: 600, width: 800, prompt: '[[;#0ff;](Redis)]', enabled: false }); $(window).click(function() { terminal.disable(); return false; }); $('#start_term').click(function() { if (confirm('WARNING: Only use the Redis terminal if you really know what you are doing.\n\nAre you sure you want to continue?')) { $(this).attr({disabled: 'disabled'}); $('#redis_term').slideDown('normal', function() { terminal.enable(); $(this).focus(); }); } }).attr({disabled: false}); setInterval(updateStats, 2000); }); </script> {% endblock extra_head %} {% block content %} <h1>Kiln Queue Stats</h1> <table id="table_stats"> <thead> <tr> <th align="left">Key</th> <th align="right">Count</th> </tr> </thead> <tbody> {% for row in data|dictsort %} <tr> <td>{{ row[0] }}</td> <td align="right"><span>{{ row[1] }}</span></td> </tr> {% endfor %} </tbody> </table> <button id="start_term">Start Redis Shell</button> <div id="redis_term" style="display: none; overflow-y: scroll; overflow-x: auto;"></div> {% endblock content %}