app.html
exported SGML document, ASCII text
1{% extends "default.html" %} 2{% block title %}{{ app.name }} | Echo Tracker{% endblock %} 3{% block content %} 4<main> 5<h1>{{ app.name }}</h1> 6{% if session.get("username") == app.owner_name %} 7<a class="button" style="width:100%; margin: 1em 0;" tabindex="0" href="/app/{{ app.id }}/edit"> 8<iconify-icon icon="mdi:pencil"></iconify-icon> 9Manage endpoints 10</a> 11{% endif %} 12<form style="margin-bottom: 1em;" class="horizontal-form"> 13<label class="extend"> 14Interval duration (minutes) 15<input type="number" name="bar_duration" step="1" value="{{ bar_duration }}"> 16</label> 17<label class="extend"> 18Time period (minutes) 19<input type="number" name="time_period" step="1" value="{{ time_period }}"> 20</label> 21<button type="submit">Change</button> 22</form> 23<div id="endpoint-list"> 24{% for endpoint in app.endpoints %} 25<div class="endpoint-card"> 26<h2>{{ endpoint.name }}</h2> 27<p>{{ endpoint.comment }}</p> 28<div class="app-uptime"> 29<!-- {% set slice_size = bar_duration * 60 %}--> 30<!-- {% set shown_seconds = 3600 %}--> 31<!-- {% set num_slices = int(shown_seconds // slice_size) %}--> 32<!-- {% for i in range(num_slices) %}--> 33<!-- {% set slice_statuses = endpoint.statuses.filter(Status.time.between(fromtimestamp(now - i*slice_size), fromtimestamp(now - i*slice_size + slice_size))) %}--> 34<!-- {% if not slice_statuses.count() %}--> 35<!-- <div class="uptime-bar"></div>--> 36<!-- {% elif is_ok(slice_statuses) %}--> 37<!-- <div class="uptime-bar uptime-bar-ok"></div>--> 38<!-- {% else %}--> 39<!-- <div class="uptime-bar uptime-bar-down"></div>--> 40<!-- {% endif %}--> 41<!-- {{ slice_statuses.all() }}<br>--> 42<!-- {% endfor %}--> 43{% for slice in slices %} 44{% if not slice %} 45<div class="uptime-bar"></div> 46{% elif is_ok(slice) %} 47<div class="uptime-bar uptime-bar-ok"></div> 48{% else %} 49<div class="uptime-bar uptime-bar-down"></div> 50{% endif %} 51{% endfor %} 52</div> 53</div> 54{% endfor %} 55</div> 56</main> 57{% endblock %}