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

65 lines
2.8 KiB

{% extends "base.html" %}
{% block content %}
<center>
<h3>Choose a section</h3>
<p>
5 years ago
<form action="{{ action }}" method="post">
{% if aftersave %}
<a class="ui-button ui-widget ui-corner-all" title="Return back" onclick="history.go(-3)">Back</a>
{% else %}
<a class="ui-button ui-widget ui-corner-all" title="Return back" onclick="history.back()">Back</a>
{% endif %}
<select autofocus required name="section" id="{{ select_id }}">
<option disabled>Choose a section</option>
{% for s in sections %}
{% if s == section %}
<option value="{{ s }}" selected>{{ s }}</option>
{% else %}
<option value="{{ s }}">{{ s }}</option>
{% endif %}
{% endfor %}
</select>
<input type="hidden" value="{{ serv }}" name="serv">
{% if role <= 2 %}
<button type="submit" value="open" name="open" class="btn btn-default" title="Edit running config">Edit</button>
{% endif %}
</form>
</p>
{% if config %}
{% if role <= 2 %}
<div id="config">
<h4>You are editting "{{section}}" from server {{ serv }}</h4>
5 years ago
<form action="{{ action }}" name="saveconfig" method="post">
<input type="hidden" value="{{ serv }}" name="serv">
<input type="hidden" value="{{ start_line }}" name="start_line">
<input type="hidden" value="{{ end_line }}" name="end_line">
<input type="hidden" value="{{ cfg }}.old" name="oldconfig">
<textarea name="config" class="config" rows="35" cols="80" style="height: 40%">{{ config }}</textarea>
<p>
<button type="submit" value="test" name="save" class="btn btn-default">Just test</button>
<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>
<button type="submit" value="reload" name="save" class="btn btn-default">Save and reload</button>
</p>
</form>
{% if note %}
<div class="alert alert-info"><b>Note:</b> If you reconfigure Master server, Slave will reconfigured automatically</div>
{% endif %}
</div>
<script src="/inc/jquery-linenumbers.js"></script>
<script>$('textarea').linenumbers({col_width: '25px'});</script>
{% 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="config.py?serv={{ serv }}" title="Working with HAProxy configs">Configs</a> |
<a href="viewsttats.py?serv={{ serv }}" target="_blank" title="View stats">Go to view stats</a>
{% endif %}
<script>window.history.pushState("Config", "Config", cur_url[0])</script>
{% endif %}
</center>
{% endblock %}