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/config.html

93 lines
3.6 KiB

{% extends "base.html" %}
{% block content %}
5 years ago
<script src="/inc/jquery-linenumbers.js"></script>
<center>
<h3>Choose server</h3>
<p>
5 years ago
<form action="{{ action }}" method="post">
<a class="ui-button ui-widget ui-corner-all" title="Return back" id="back" onclick="history.go(-2)">Back</a>
<input type="hidden" id="service" value="{{service}}" />
<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>
{% if service != 'keepalived' %}
<a class="ui-button ui-widget ui-corner-all" title="Show running config" onclick="showConfig()">Open</a>
<a class="ui-button ui-widget ui-corner-all" title="View stat" onclick="openStats()">Stat</a>
{% endif %}
{% if service != 'keepalived' and service != 'nginx'%}
6 years ago
<a class="ui-button ui-widget ui-corner-all" title="Show map" onclick="showMap()">Map</a>
{% endif %}
{% if service != 'keepalived' %}
<a class="ui-button ui-widget ui-corner-all" title="Compare configs" onclick="showCompareConfigs()">Compare</a>
{% if role <= 2 %}
<a class="ui-button ui-widget ui-corner-all" title="Show versions" onclick="openVersions()">Versions</a>
{% endif %}
{% else %}
{% if role <= 2 %}
<button type="submit" value="open" name="open" class="btn btn-default" title="Edit running config">Edit</button>
<a class="ui-button ui-widget ui-corner-all" title="Show versions" onclick="openVersions()">Versions</a>
{% endif %}
{% endif %}
</form>
</p>
{% if not aftersave %}
{% if stderr or error %}
{% include 'include/errors.html' %}
{% endif %}
{% endif %}
{% if config %}
{% if role <= 2 %}
<div id="config">
<h4>Config from {{ serv }}</h4>
5 years ago
<form action="{{ action }}" name="saveconfig" method="post">
<input type="hidden" value="{{ serv }}" name="serv">
<input type="hidden" value="{{ cfg }}.old" name="oldconfig">
<textarea name="config" class="config" rows="35" cols="100">{{ config }}</textarea>
<p>
{% if service == 'haproxy' %}
<button type="submit" value="test" name="save" class="btn btn-default">Just test</button>
{% endif %}
<button type="submit" value="save" name="save" class="btn btn-default">Just save</button>
<button type="submit" value="" name="" class="btn btn-default">Save and restart</button>
{% if service != 'keepalived' %}
<button type="submit" value="reload" name="save" class="btn btn-default">Save and reload</button>
{% endif %}
</p>
</form>
{% if note %}
<div class="alert alert-info"><b>Note:</b> If you reconfigure Master server, Slave will reconfigured automatically</div>
{% endif %}
</div>
{% endif %}
{% endif %}
{% if aftersave %}
<div class="alert alert-info">New config was saved as: {{ cfg }} </div>
{% if stderr or error %}
{% include 'include/errors.html' %}
{% else %}
<div class="alert alert-success">Config is ok</div>
<a href="viewsttats.py?serv={{ serv }}" target="_blank" title="View stats">Go to view stats</a>
{% endif %}
{% endif %}
</center>
<script>
if (cur_url[1].split('&')[1] == 'showMap') {
showMap();
}
if (cur_url[1].split('&')[1] == 'showCompare' || cur_url[1].split('&')[2] == 'showCompare') {
showCompareConfigs();
}
if (cur_url[1].split('&')[2] == 'showConfig') {
showConfig();
}
5 years ago
$('textarea').linenumbers({col_width: '25px'});
</script>
5 years ago
{% endblock %}