2021-10-01 21:14:10 +00:00
|
|
|
<!DOCTYPE html>
|
2023-07-23 00:28:21 +00:00
|
|
|
<html class="theme_{{theme}}">
|
2021-10-01 21:14:10 +00:00
|
|
|
<head>
|
|
|
|
{% import "header.html" as header %}
|
|
|
|
<title>Admin control</title>
|
|
|
|
<meta charset="UTF-8">
|
|
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
|
2022-05-28 23:21:23 +00:00
|
|
|
<link rel="icon" href="/favicon.png" type="image/png"/>
|
2021-10-01 21:14:10 +00:00
|
|
|
<link rel="stylesheet" href="/static/css/common.css">
|
|
|
|
<link rel="stylesheet" href="/static/css/etiquette.css">
|
|
|
|
<script src="/static/js/common.js"></script>
|
|
|
|
<script src="/static/js/api.js"></script>
|
2022-09-30 00:34:35 +00:00
|
|
|
<script src="/static/js/http.js"></script>
|
2021-10-01 21:14:10 +00:00
|
|
|
|
|
|
|
<style>
|
2022-11-13 02:40:09 +00:00
|
|
|
table, th, td
|
|
|
|
{
|
|
|
|
border: 1px solid var(--color_text_placeholder);
|
|
|
|
border-collapse: collapse
|
|
|
|
}
|
|
|
|
th, td
|
|
|
|
{
|
|
|
|
padding: 4px;
|
|
|
|
}
|
2021-10-01 21:14:10 +00:00
|
|
|
</style>
|
|
|
|
</head>
|
|
|
|
|
|
|
|
|
|
|
|
<body>
|
2023-02-02 06:04:44 +00:00
|
|
|
{{header.make_header(session=request.session)}}
|
2021-10-01 21:14:10 +00:00
|
|
|
<div id="content_body">
|
|
|
|
<div class="panel">
|
2022-07-16 06:35:35 +00:00
|
|
|
<h1>Admin tools</h1>
|
|
|
|
<p><button id="reload_config_button" class="green_button" onclick="return reload_config_form();">Reload config file</button></p>
|
2022-07-23 02:23:36 +00:00
|
|
|
<p><button id="uncache_button" class="green_button" onclick="return uncache_form();">Uncache objects</button></p>
|
2022-11-08 01:51:02 +00:00
|
|
|
<p><button id="clear_sessions_button" class="green_button" onclick="return clear_sessions_form();">Clear login sessions</button></p>
|
2022-07-16 06:35:35 +00:00
|
|
|
<p><a href="/admin/dbdownload">Download database file</a></p>
|
2021-10-01 21:14:10 +00:00
|
|
|
</div>
|
2022-11-12 03:26:36 +00:00
|
|
|
<div class="panel">
|
|
|
|
<h2>Statistics</h2>
|
2022-11-13 02:40:09 +00:00
|
|
|
<table>
|
|
|
|
<tr><th></th><th>Stored</th><th>Cached</th></tr>
|
|
|
|
<tr><td>Albums</td><td>{{counts.albums}}</td><td>{{cached.albums}}</td></tr>
|
|
|
|
<tr><td>Bookmarks</td><td>{{counts.bookmarks}}</td><td>{{cached.bookmarks}}</td></tr>
|
|
|
|
<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>
|
2022-11-12 03:26:36 +00:00
|
|
|
</div>
|
2021-10-01 21:14:10 +00:00
|
|
|
</div>
|
|
|
|
</body>
|
|
|
|
|
|
|
|
|
|
|
|
<script type="text/javascript">
|
2022-11-08 01:51:02 +00:00
|
|
|
function clear_sessions_form()
|
|
|
|
{
|
|
|
|
const reload_config_button = document.getElementById("clear_sessions_button");
|
|
|
|
clear_sessions_button.disabled = true;
|
|
|
|
function callback(response)
|
|
|
|
{
|
|
|
|
clear_sessions_button.disabled = false;
|
|
|
|
if (response.meta.status !== 200)
|
|
|
|
{
|
|
|
|
alert(JSON.stringify(response));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return api.admin.clear_sessions(callback);
|
|
|
|
}
|
|
|
|
|
2021-10-01 21:14:10 +00:00
|
|
|
function reload_config_form()
|
|
|
|
{
|
|
|
|
const reload_config_button = document.getElementById("reload_config_button");
|
|
|
|
reload_config_button.disabled = true;
|
|
|
|
function callback(response)
|
|
|
|
{
|
|
|
|
reload_config_button.disabled = false;
|
|
|
|
if (response.meta.status !== 200)
|
|
|
|
{
|
|
|
|
alert(JSON.stringify(response));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return api.admin.reload_config(callback);
|
|
|
|
}
|
2022-07-23 02:23:36 +00:00
|
|
|
|
|
|
|
function uncache_form()
|
|
|
|
{
|
|
|
|
const uncache_button = document.getElementById("uncache_button");
|
|
|
|
uncache_button.disabled = true;
|
|
|
|
function callback(response)
|
|
|
|
{
|
|
|
|
uncache_button.disabled = false;
|
|
|
|
if (response.meta.status !== 200)
|
|
|
|
{
|
|
|
|
alert(JSON.stringify(response));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return api.admin.uncache(callback);
|
|
|
|
}
|
2021-10-01 21:14:10 +00:00
|
|
|
</script>
|
|
|
|
</html>
|