Show cached counts in admin statistics.
This commit is contained in:
parent
e3a0b3898f
commit
cc3cf58f46
2 changed files with 25 additions and 6 deletions
|
@ -25,7 +25,14 @@ def get_admin():
|
||||||
'tags': common.P.get_tag_count(),
|
'tags': common.P.get_tag_count(),
|
||||||
'users': common.P.get_user_count(),
|
'users': common.P.get_user_count(),
|
||||||
})
|
})
|
||||||
return common.render_template(request, 'admin.html', counts=counts)
|
cached = dotdict.DotDict({
|
||||||
|
'albums': len(common.P.caches[etiquette.objects.Album]),
|
||||||
|
'bookmarks': len(common.P.caches[etiquette.objects.Bookmark]),
|
||||||
|
'photos': len(common.P.caches[etiquette.objects.Photo]),
|
||||||
|
'tags': len(common.P.caches[etiquette.objects.Tag]),
|
||||||
|
'users': len(common.P.caches[etiquette.objects.User]),
|
||||||
|
})
|
||||||
|
return common.render_template(request, 'admin.html', cached=cached, counts=counts)
|
||||||
|
|
||||||
@site.route('/admin/dbdownload')
|
@site.route('/admin/dbdownload')
|
||||||
def get_dbdump():
|
def get_dbdump():
|
||||||
|
|
|
@ -14,6 +14,15 @@
|
||||||
<script src="/static/js/http.js"></script>
|
<script src="/static/js/http.js"></script>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
|
table, th, td
|
||||||
|
{
|
||||||
|
border: 1px solid var(--color_text_placeholder);
|
||||||
|
border-collapse: collapse
|
||||||
|
}
|
||||||
|
th, td
|
||||||
|
{
|
||||||
|
padding: 4px;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
|
@ -30,11 +39,14 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="panel">
|
<div class="panel">
|
||||||
<h2>Statistics</h2>
|
<h2>Statistics</h2>
|
||||||
<p>{{counts.albums}} albums</p>
|
<table>
|
||||||
<p>{{counts.bookmarks}} bookmarks</p>
|
<tr><th></th><th>Stored</th><th>Cached</th></tr>
|
||||||
<p>{{counts.photos}} photos</p>
|
<tr><td>Albums</td><td>{{counts.albums}}</td><td>{{cached.albums}}</td></tr>
|
||||||
<p>{{counts.tags}} tags</p>
|
<tr><td>Bookmarks</td><td>{{counts.bookmarks}}</td><td>{{cached.bookmarks}}</td></tr>
|
||||||
<p>{{counts.users}} users</p>
|
<tr><td>Photos</td><td>{{counts.photos}}</td><td>{{cached.photos}}</td></tr>
|
||||||
|
<tr><td>Tags</td><td>{{counts.tags}}</td><td>{{cached.tags}}</td></tr>
|
||||||
|
<tr><td>Users</td><td>{{counts.users}}</td><td>{{cached.users}}</td></tr>
|
||||||
|
</table>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</body>
|
</body>
|
||||||
|
|
Loading…
Reference in a new issue