rework templating using mako templates
This commit is contained in:
parent
2ff0ca382f
commit
676d7cabbc
4 changed files with 68 additions and 88 deletions
|
@ -2,21 +2,42 @@
|
|||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Status Page</title>
|
||||
<title>${title}</title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<link rel="stylesheet" href="bootstrap.min.css">
|
||||
<link rel="icon" href="data:image/svg+xml,<svg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 100 100%22><text y=%22.9em%22 font-size=%2290%22>{mood}</text></svg>">
|
||||
<link rel="icon" href="data:image/svg+xml,<svg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 100 100%22><text y=%22.9em%22 font-size=%2290%22>${mood}</text></svg>">
|
||||
</head>
|
||||
<body>
|
||||
<div class="container">
|
||||
<div class="page-header my-5" id="banner">
|
||||
<div class="row">
|
||||
<div class="col-lg-8">
|
||||
<h1>Status: {mood}</h1>
|
||||
<h1>Status: ${mood}</h1>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{services}
|
||||
% for prettyname, details in sorted(hosts.items()):
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<div class="card text-white border-primary mb-3">
|
||||
<div id="${details['hostname']}" class="card-header d-flex justify-content-between align-items-center">
|
||||
<h4><a href="#${details['hostname']}">${prettyname}</a></h4>
|
||||
<span class="badge badge-${details['host_badge']}">${details['host_state']}</span>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<ul class="list-group">
|
||||
% for service_name, service_details in sorted(details['services'].items()):
|
||||
<li class="list-group-item d-flex justify-content-between align-items-center">
|
||||
${service_name}
|
||||
<span class="badge badge-${service_details['badge']}">${service_details['state']}</span>
|
||||
</li>
|
||||
% endfor
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
% endfor
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue