100 lines
		
	
	
	
		
			3.1 KiB
		
	
	
	
		
			HTML
		
	
	
	
	
	
			
		
		
	
	
			100 lines
		
	
	
	
		
			3.1 KiB
		
	
	
	
		
			HTML
		
	
	
	
	
	
| <!DOCTYPE html>
 | |
| <html class="theme_{{theme}}">
 | |
| <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"/>
 | |
|     <link rel="icon" href="/favicon.png" type="image/png"/>
 | |
|     <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>
 | |
|     <script src="/static/js/http.js"></script>
 | |
| 
 | |
| <style>
 | |
| table, th, td
 | |
| {
 | |
|     border: 1px solid var(--color_text_placeholder);
 | |
|     border-collapse: collapse
 | |
| }
 | |
| th, td
 | |
| {
 | |
|     padding: 4px;
 | |
| }
 | |
| </style>
 | |
| </head>
 | |
| 
 | |
| 
 | |
| <body>
 | |
| {{header.make_header(session=request.session)}}
 | |
| <div id="content_body">
 | |
|     <div class="panel">
 | |
|         <h1>Admin tools</h1>
 | |
|         <p><button id="reload_config_button" class="green_button" onclick="return reload_config_form();">Reload config file</button></p>
 | |
|         <p><button id="uncache_button" class="green_button" onclick="return uncache_form();">Uncache objects</button></p>
 | |
|         <p><button id="clear_sessions_button" class="green_button" onclick="return clear_sessions_form();">Clear login sessions</button></p>
 | |
|         <p><a href="/admin/dbdownload">Download database file</a></p>
 | |
|     </div>
 | |
|     <div class="panel">
 | |
|         <h2>Statistics</h2>
 | |
|         <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>
 | |
|     </div>
 | |
| </div>
 | |
| </body>
 | |
| 
 | |
| 
 | |
| <script type="text/javascript">
 | |
| 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);
 | |
| }
 | |
| 
 | |
| 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);
 | |
| }
 | |
| 
 | |
| 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);
 | |
| }
 | |
| </script>
 | |
| </html>
 |