You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
haproxy-wi/app/templates/configver.html

79 lines
2.3 KiB

{% extends "base.html" %}
{% block content %}
<center>
<h3>Choose server</h3>
<p>
<form action="{{ action }}" method="get">
<a class="ui-button ui-widget ui-corner-all" title="Return back" onclick="history.back()">Back</a>
<select autofocus required name="serv" id="{{ select_id }}">
<option disabled>Choose server</option>
{% for select in selects %}
{% if select.2 == serv %}
<option value="{{ select.2 }}" selected>{{ select.1 }}</option>
{% else %}
<option value="{{ select.2 }}">{{ select.1 }}</option>
{% endif %}
{% endfor %}
</select>
<button type="submit" value="open" name="open" class="btn btn-default">Open</button>
</form>
</p>
{% if not aftersave %}
{% if stderr or error %}
<div class="alert alert-danger" style="margin-bottom: 10px;">
Some errors:
<br>
<br>
{{stderr}}
{{error}}
</div>
{% endif %}
{% endif %}
{% if open %}
<center>
<h4>Choose old version</h4>
<form action="configver.py#conf" method="get">
<p>
<select autofocus required name="configver" id="configver">
<option disabled selected>Choose version</option>
{% for file in return_files %}
{% if file == configver %}
<option value="{{file}}" selected>{{file.split('-', maxsplit=1)[1]}}</option>
{% else %}
<option value="{{file}}">{{file.split('-', maxsplit=1)[1]}}</option>
{% endif %}
{% endfor %}
</select>
<input type="hidden" value="{{serv}}" name="serv">
<input type="hidden" value="open" name="open">
<a class="ui-button ui-widget ui-corner-all" id="show" title="Enter" onclick="showUploadConfig()">Select</a>
</p>
</form>
</center>
{% endif %}
{% if aftersave %}
<div class="alert alert-info">Uploaded old config ver: {{ configver }} </div>
{% if stderr or error %}
<div class="alert alert-danger">
Some errors:
<br>
<br>
{{stderr}}
{{error}}
</div>
{% else %}
<div class="alert alert-success">Config ok</div>
<a href="viewsttats.py?serv={{ serv }}" target="_blank" title="View stats">Go to view stats</a>
<script>window.history.pushState("Map", "Map", cur_url[0])</script>
{% endif %}
{% endif %}
</center>
{% if aftersave != 1 %}
<script>
showUploadConfig()
</script>
{% endif %}
{% endblock %}