blob: 55f869a63f293792444281c8e5bc57b8be8894a1 (
plain) (
blame)
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
|
{% extends "base.html" %}
{% block title %}{{ application_name }} Development Console - Memcache Viewer{% endblock %}
{% block head %}
<style type="text/css">{% include "css/memcache.css" %}</style>
{% endblock %}
{% block breadcrumbs %}
<span class="item"><a href="">Memcache Viewer</a></span>
{% endblock %}
{% block body %}
<h3>Memcache Viewer</h3>
{% if message %}
<div class="message">
{{ message|escape }}
</div>
{% endif %}
{% if show_stats %}
<div id="stats">
<ul>
<li>Hit ratio: {{ hitratio }}% ({{ stats.hits }} hit{{ stats.hits|pluralize }} and {{ stats.misses }} miss{{ stats.misses|pluralize:"es" }})</li>
<li>Size of cache: {{ stats.items }} item{{ stats.items|pluralize }}, {{ stats.bytes|filesizeformat }}
<form id="flush_form" action="{{ request.path }}" method="post">
<input type="submit" name="action:flush" value="Flush Cache" onclick="return confirm('Are you sure you want to flush all keys from the cache?');"/>
</form>
</li>
<li>Cache contains items up to {{ oldest_item_age|timesince }} old.</li>
</ul>
</div>
<div id="memcache_search">
<form action="{{ request.path }}" method="post">
<span class="field">
<span class="name">Key:</span>
<span class="value"><input id="key_input" name="key" type="text" size="40" value="{{ key|escape }}"/></span>
</span>
<span class="buttons">
<input type="submit" name="action:display" value="Display"/>
<input type="submit" name="action:edit" value="Edit/Create"/>
<input type="submit" name="action:delete" value="Delete" onclick="return confirm('Are you sure you want to permanently delete this key?');"/>
</span>
</form>
</div>
{% endif %}
{% if show_value %}
{% if key_exists %}
{% ifequal type "error" %}
<div class="message">Error fetching {{ key|escape }}: {{ value|escape }}</div>
{% else %}
<div id="value_display">
<div id="value_display_key">"<b>{{ key|escape }}</b>" is a <b>{{ type|escape }}</b>:</div>
<pre id="value_display_value">{{ value|escape }}</pre>
</div>
{% endifequal %}
{% else %}
<div class="message">No such key: {{ key|escape }}</div>
{% endif %}
{% endif %}
{% if show_valueform %}
<div id="memcache_edit">
<form action="{{ request.path }}" method="post">
<table>
<tr>
<th>Key</th>
<td>
<input name="key" type="hidden" value="{{ key|escape }}"/>
{{ key|escape }}
</td>
</tr>
<tr>
<th>Type</th>
<td>
{% if key_exists %}
<input name="type" type="hidden" value="{{ type|escape }}"/>
{{ type|escape }}
{% else %}
<select name="type" size="1">
{% for typeopt in types %}
<option>{{ typeopt }}</option>
{% endfor %}
</select>
{% endif %}
</td>
</tr>
<tr>
<th id="value_key"><div id="value_key_text">Value</div></th>
<td>
<textarea id="value_input" name="value" cols="80" rows="20"{% if not writable %} readonly{% endif %}>{{ value|default_if_none:""|escape }}</textarea>
</td>
</tr>
<tr>
<th> </th>
<td>
{% if writable %}
<input type="submit" name="action:save" value="Save"/>
{% endif %}
<input type="submit" name="action:cancel" value="Cancel"/>
</td>
</tr>
</table>
</form>
</div>
{% endif %}
{% endblock %}
{% block final %}
<script type="text/javascript">
//<![CDATA[
document.getElementById('key_input').focus();
//]]>
</script>
{% endblock %}
|