|
1 {% extends "base.html" %} |
|
2 |
|
3 {% block title %}{{ application_name }} Development Console - Memcache Viewer{% endblock %} |
|
4 |
|
5 {% block head %} |
|
6 <style type="text/css">{% include "css/memcache.css" %}</style> |
|
7 {% endblock %} |
|
8 |
|
9 {% block breadcrumbs %} |
|
10 <span class="item"><a href="">Memcache Viewer</a></span> |
|
11 {% endblock %} |
|
12 |
|
13 {% block body %} |
|
14 <h3>Memcache Viewer</h3> |
|
15 |
|
16 {% if message %} |
|
17 <div class="message"> |
|
18 {{ message|escape }} |
|
19 </div> |
|
20 {% endif %} |
|
21 |
|
22 {% if show_stats %} |
|
23 <div id="stats"> |
|
24 <ul> |
|
25 <li>Hit ratio: {{ hitratio }}% ({{ stats.hits }} hit{{ stats.hits|pluralize }} and {{ stats.misses }} miss{{ stats.misses|pluralize:"es" }})</li> |
|
26 <li>Size of cache: {{ stats.items }} item{{ stats.items|pluralize }}, {{ stats.bytes|filesizeformat }} |
|
27 <form id="flush_form" action="{{ request.path }}" method="post"> |
|
28 <input type="submit" name="action:flush" value="Flush Cache" onclick="return confirm('Are you sure you want to flush all keys from the cache?');"/> |
|
29 </form> |
|
30 </li> |
|
31 <li>Cache contains items up to {{ oldest_item_age|timesince }} old.</li> |
|
32 </ul> |
|
33 </div> |
|
34 |
|
35 <div id="memcache_search"> |
|
36 <form action="{{ request.path }}" method="post"> |
|
37 <span class="field"> |
|
38 <span class="name">Key:</span> |
|
39 <span class="value"><input id="key_input" name="key" type="text" size="40" value="{{ key|escape }}"/></span> |
|
40 </span> |
|
41 <span class="buttons"> |
|
42 <input type="submit" name="action:display" value="Display"/> |
|
43 <input type="submit" name="action:edit" value="Edit/Create"/> |
|
44 <input type="submit" name="action:delete" value="Delete" onclick="return confirm('Are you sure you want to permanently delete this key?');"/> |
|
45 </span> |
|
46 </form> |
|
47 </div> |
|
48 {% endif %} |
|
49 |
|
50 {% if show_value %} |
|
51 {% if key_exists %} |
|
52 {% ifequal type "error" %} |
|
53 <div class="message">Error fetching {{ key|escape }}: {{ value|escape }}</div> |
|
54 {% else %} |
|
55 <div id="value_display"> |
|
56 <div id="value_display_key">"<b>{{ key|escape }}</b>" is a <b>{{ type|escape }}</b>:</div> |
|
57 <pre id="value_display_value">{{ value|escape }}</pre> |
|
58 </div> |
|
59 {% endifequal %} |
|
60 {% else %} |
|
61 <div class="message">No such key: {{ key|escape }}</div> |
|
62 {% endif %} |
|
63 {% endif %} |
|
64 |
|
65 {% if show_valueform %} |
|
66 <div id="memcache_edit"> |
|
67 <form action="{{ request.path }}" method="post"> |
|
68 <table> |
|
69 <tr> |
|
70 <th>Key</th> |
|
71 <td> |
|
72 <input name="key" type="hidden" value="{{ key|escape }}"/> |
|
73 {{ key|escape }} |
|
74 </td> |
|
75 </tr> |
|
76 <tr> |
|
77 <th>Type</th> |
|
78 <td> |
|
79 {% if key_exists %} |
|
80 <input name="type" type="hidden" value="{{ type|escape }}"/> |
|
81 {{ type|escape }} |
|
82 {% else %} |
|
83 <select name="type" size="1"> |
|
84 {% for typeopt in types %} |
|
85 <option>{{ typeopt }}</option> |
|
86 {% endfor %} |
|
87 </select> |
|
88 {% endif %} |
|
89 </td> |
|
90 </tr> |
|
91 <tr> |
|
92 <th id="value_key"><div id="value_key_text">Value</div></th> |
|
93 <td> |
|
94 <textarea id="value_input" name="value" cols="80" rows="20"{% if not writable %} readonly{% endif %}>{{ value|default_if_none:""|escape }}</textarea> |
|
95 </td> |
|
96 </tr> |
|
97 <tr> |
|
98 <th> </th> |
|
99 <td> |
|
100 {% if writable %} |
|
101 <input type="submit" name="action:save" value="Save"/> |
|
102 {% endif %} |
|
103 <input type="submit" name="action:cancel" value="Cancel"/> |
|
104 </td> |
|
105 </tr> |
|
106 </table> |
|
107 </form> |
|
108 </div> |
|
109 {% endif %} |
|
110 |
|
111 {% endblock %} |
|
112 |
|
113 {% block final %} |
|
114 <script type="text/javascript"> |
|
115 //<![CDATA[ |
|
116 document.getElementById('key_input').focus(); |
|
117 //]]> |
|
118 </script> |
|
119 {% endblock %} |