aboutsummaryrefslogtreecommitdiff
path: root/src/zenserver/frontend/html/index.html
blob: 96b69a6432603f5221e23ad5b74729c500f8d7b8 (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
<!DOCTYPE html>
<html>
<head>
	<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" integrity="sha384-F3w7mX95PdgyTmZZMECAngseQB83DfGTowi0iMjiWaeVhAn4FJkqJByhZMI3AhiU" crossorigin="anonymous">
	<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.min.js" integrity="sha384-skAcpIdS7UcVUC05LJ9Dxay8AXcDYfBJqt1CJ85S/CFujBsIzCIv+l9liuYLaMQ/" crossorigin="anonymous"></script>
	<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/font/bootstrap-icons.css">
	<style type="text/css">
		body {
			background-color: #fafafa;
		}
	</style>
	<script type="text/javascript">
		const getCacheStats = () => {
			const opts = { headers: { "Accept": "application/json" } };
			const queryString = window.location.search;
			fetch("/stats/z$" + queryString, opts)
				.then(response => {
					if (!response.ok) {
						throw Error(response.statusText);
					}
					return response.json();
				})
				.then(json => {
					document.getElementById("status").innerHTML = "connected"
					document.getElementById("stats").innerHTML = JSON.stringify(json, null, 4);
				})
				.catch(error => {
					document.getElementById("status").innerHTML = "disconnected"
					document.getElementById("stats").innerHTML = ""
					console.log(error);
				})
				.finally(() => {
					window.setTimeout(getCacheStats, 1000);
				});
		};
		getCacheStats();
	</script>
</head>
<body>
	<div class="container">
		<div class="row">
			<div class="text-center mt-5">
				<pre>
__________                  _________  __                           
\____    /  ____    ____   /   _____/_/  |_   ____  _______   ____  
  /     / _/ __ \  /    \  \_____  \ \   __\ /  _ \ \_  __ \_/ __ \ 
 /     /_ \  ___/ |   |  \ /        \ |  |  (  <_> ) |  | \/\  ___/ 
/_______ \ \___  >|___|  //_______  / |__|   \____/  |__|    \___  >
        \/     \/      \/         \/                             \/ 
				</pre>
				<pre id="status"/>
			</div>
		</div>
		<div class="row">
			<pre class="mb-0">Z$:</pre>
			<pre id="stats"></pre>
		</div>
	</div>
</body>
</html>