app-editor.html
ASCII text
1{% extends "default.html" %} 2{% block title %}{{ app.name }} | Echo Tracker{% endblock %} 3{% block content %} 4<main> 5<h1>Editing {{ app.name }}</h1> 6<h2>General</h2> 7<form class="stacked-form" method="post" action="/app/{{ app.id }}/edit/"> 8<input type="text" name="name" placeholder="Name" value="{{ app.name }}"> 9<label> 10Stability threshold (minutes) 11<input type="number" name="threshold" value="{{ app.stability_threshold }}" step="1" min="1" max="300"> 12</label> 13<button type="submit">Apply changes</button> 14</form> 15<h2>Endpoints</h2> 16<div id="endpoint-editor"> 17{% for endpoint in app.endpoints %} 18<form class="stacked-form" method="post" action="/app/{{ app.id }}/edit/{{ endpoint.id }}"> 19<input type="text" name="name" placeholder="Name" value="{{ endpoint.name }}"> 20<input type="url" name="url" placeholder="Ping address" value="{{ endpoint.address }}"> 21<div class="side-by-side"> 22<input class="extend" type="number" name="ping_interval" placeholder="Interval (seconds)" value="{{ endpoint.ping_interval }}" step="1" min="15"> 23seconds 24</div> 25<textarea name="comment" placeholder="Comment" rows="4">{{ endpoint.comment }}</textarea> 26<div class="side-by-side"> 27<button type="submit" class="extend">Apply changes</button> 28<button type="submit" name="delete" value="delete" class="danger-button"> 29<iconify-icon icon="mdi:trash-can">Delete</iconify-icon> 30</button> 31</div> 32</form> 33{% endfor %} 34</div> 35<h2>Add an endpoint</h2> 36<form class="stacked-form" method="post" action="/app/{{ app.id }}/add-endpoint"> 37<input type="text" name="name" placeholder="Name"> 38<input type="url" name="url" placeholder="Ping address"> 39<div class="side-by-side"> 40<input class="extend" type="number" name="ping_interval" placeholder="Interval (seconds)" value="300" step="1" min="15"> 41seconds 42</div> 43<textarea name="comment" placeholder="Comment" rows="4"></textarea> 44<button type="submit">Add</button> 45</form> 46</main> 47{% endblock %}