mirror of https://github.com/Aidaho12/haproxy-wi
parent
bd78cc7bd6
commit
8dc6dda1b1
|
@ -14,6 +14,7 @@ funct.page_for_admin(level = 2)
|
||||||
|
|
||||||
form = cgi.FieldStorage()
|
form = cgi.FieldStorage()
|
||||||
serv = form.getvalue('serv')
|
serv = form.getvalue('serv')
|
||||||
|
view = form.getvalue('view')
|
||||||
configver = form.getvalue('configver')
|
configver = form.getvalue('configver')
|
||||||
hap_configs_dir = funct.get_config_var('configs', 'haproxy_save_configs_dir')
|
hap_configs_dir = funct.get_config_var('configs', 'haproxy_save_configs_dir')
|
||||||
config_read = ""
|
config_read = ""
|
||||||
|
@ -77,5 +78,6 @@ output_from_parsed_template = template.render(h2 = 1, title = "Old Versions HAPr
|
||||||
onclick = "showUploadConfig()",
|
onclick = "showUploadConfig()",
|
||||||
error = error,
|
error = error,
|
||||||
note = 1,
|
note = 1,
|
||||||
token = token)
|
token = token,
|
||||||
|
view = view)
|
||||||
print(output_from_parsed_template)
|
print(output_from_parsed_template)
|
||||||
|
|
|
@ -279,8 +279,9 @@ if serv is not None and act == "configShow":
|
||||||
print('<input type="hidden" value="%s" name="serv">' % serv)
|
print('<input type="hidden" value="%s" name="serv">' % serv)
|
||||||
print('<input type="hidden" value="%s" name="configver">' % form.getvalue('configver'))
|
print('<input type="hidden" value="%s" name="configver">' % form.getvalue('configver'))
|
||||||
print('<input type="hidden" value="1" name="config">')
|
print('<input type="hidden" value="1" name="config">')
|
||||||
funct.get_button("Just save", value="save")
|
if form.getvalue('view') is None:
|
||||||
funct.get_button("Upload and restart")
|
funct.get_button("Just save", value="save")
|
||||||
|
funct.get_button("Upload and restart")
|
||||||
print('</form></center>')
|
print('</form></center>')
|
||||||
|
|
||||||
if form.getvalue('master'):
|
if form.getvalue('master'):
|
||||||
|
|
|
@ -100,7 +100,7 @@
|
||||||
</ul>
|
</ul>
|
||||||
</nav>
|
</nav>
|
||||||
<div class="copyright-menu">
|
<div class="copyright-menu">
|
||||||
HAproxy-WI v2.5.6.1
|
HAproxy-WI v2.5.6.2
|
||||||
<br>
|
<br>
|
||||||
<a href="https://www.patreon.com/haproxy_wi" title="Donate" target="_blank" style="color: #fff; margin-left: 40px;">Patreon</a>
|
<a href="https://www.patreon.com/haproxy_wi" title="Donate" target="_blank" style="color: #fff; margin-left: 40px;">Patreon</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -39,11 +39,16 @@
|
||||||
<select autofocus required name="configver" id="configver">
|
<select autofocus required name="configver" id="configver">
|
||||||
<option disabled selected>Choose version</option>
|
<option disabled selected>Choose version</option>
|
||||||
{% for file in return_files %}
|
{% for file in return_files %}
|
||||||
<option {{file}}>{{file}}</option>
|
{% if file == configver %}
|
||||||
|
<option {{file}} selected>{{file}}</option>
|
||||||
|
{% else %}
|
||||||
|
<option {{file}}>{{file}}</option>
|
||||||
|
{% endif %}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</select>
|
</select>
|
||||||
<input type="hidden" value="{{serv}}" name="serv">
|
<input type="hidden" value="{{serv}}" name="serv">
|
||||||
<input type="hidden" value="open" name="open">
|
<input type="hidden" value="open" name="open">
|
||||||
|
<input type="hidden" value="{{ view }}" id="view">
|
||||||
<a class="ui-button ui-widget ui-corner-all" id="show" title="Enter" onclick="{{ onclick }}">Select</a>
|
<a class="ui-button ui-widget ui-corner-all" id="show" title="Enter" onclick="{{ onclick }}">Select</a>
|
||||||
</p>
|
</p>
|
||||||
</form>
|
</form>
|
||||||
|
@ -66,5 +71,10 @@
|
||||||
<script>window.history.pushState("Map", "Map", cur_url[0])</script>
|
<script>window.history.pushState("Map", "Map", cur_url[0])</script>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</center>
|
</center>
|
||||||
|
{% if view %}
|
||||||
|
<script>
|
||||||
|
showUploadConfig()
|
||||||
|
</script>
|
||||||
|
{% endif %}
|
||||||
{% endblock %}
|
{% endblock %}
|
|
@ -27,7 +27,8 @@
|
||||||
<label for="select_all" id="label_select_all"><b>Select all</b></label>
|
<label for="select_all" id="label_select_all"><b>Select all</b></label>
|
||||||
<input type="checkbox" id="select_all"><br />
|
<input type="checkbox" id="select_all"><br />
|
||||||
{% for file in return_files %}
|
{% for file in return_files %}
|
||||||
<label for="{{file}}"> {{file}} </label><input type="checkbox" value="{{file}}" name="{{file}}" id="{{file}}"><br />
|
<label for="{{file}}"> {{file}} </label><input type="checkbox" value="{{file}}" name="{{file}}" id="{{file}}">
|
||||||
|
<a href="/app/configver.py?serv={{serv}}&open=open&configver={{file}}&view=1" class="ui-button ui-widget ui-corner-all" target="_blanck" title="View config" style="margin-top: -6px;">View</a><br />
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
<input type="hidden" value="{{serv}}" name="serv">
|
<input type="hidden" value="{{serv}}" name="serv">
|
||||||
<input type="hidden" value="open" name="open">
|
<input type="hidden" value="open" name="open">
|
||||||
|
|
|
@ -251,18 +251,27 @@ function showConfig() {
|
||||||
} );
|
} );
|
||||||
}
|
}
|
||||||
function showUploadConfig() {
|
function showUploadConfig() {
|
||||||
|
var view = $('#view').val();
|
||||||
|
if(view != "1") {
|
||||||
|
view = ""
|
||||||
|
}
|
||||||
$.ajax( {
|
$.ajax( {
|
||||||
url: "options.py",
|
url: "options.py",
|
||||||
data: {
|
data: {
|
||||||
serv: $("#serv").val(),
|
serv: $("#serv").val(),
|
||||||
act: "configShow",
|
act: "configShow",
|
||||||
configver: $('#configver').val(),
|
configver: $('#configver').val(),
|
||||||
token: $('#token').val()
|
token: $('#token').val(),
|
||||||
|
view: view
|
||||||
},
|
},
|
||||||
type: "GET",
|
type: "GET",
|
||||||
success: function( data ) {
|
success: function( data ) {
|
||||||
$("#ajax").html(data);
|
$("#ajax").html(data);
|
||||||
window.history.pushState("Show config", "Show config", cur_url[0]+"?serv="+$("#serv").val()+"&open=open&configver="+$('#configver').val());
|
if(view == "1") {
|
||||||
|
window.history.pushState("Show config", "Show config", cur_url[0]+"?serv="+$("#serv").val()+"&open=open&configver="+$('#configver').val()+"&view="+$('#view').val());
|
||||||
|
} else {
|
||||||
|
window.history.pushState("Show config", "Show config", cur_url[0]+"?serv="+$("#serv").val()+"&open=open&configver="+$('#configver').val());
|
||||||
|
}
|
||||||
var urlConfigShowJs = '/inc/configshow.js';
|
var urlConfigShowJs = '/inc/configshow.js';
|
||||||
$.getScript(urlConfigShowJs);
|
$.getScript(urlConfigShowJs);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue