Improved Add pages
pull/19/head
Aidaho12 2018-05-12 22:41:07 +06:00
parent 3c76043935
commit d0671d8a40
4 changed files with 52 additions and 10 deletions

View File

@ -111,9 +111,27 @@ if form.getvalue('mode') is not None:
cookie = " cookie "+form.getvalue('cookie_name') cookie = " cookie "+form.getvalue('cookie_name')
if form.getvalue('cookie_domain'): if form.getvalue('cookie_domain'):
cookie += " domain "+form.getvalue('cookie_domain') cookie += " domain "+form.getvalue('cookie_domain')
cookie += " "+form.getvalue('rewrite')+" "+form.getvalue('nocache')+" "+form.getvalue('postonly')+"\n" if form.getvalue('rewrite'):
rewrite = form.getvalue('rewrite')
else:
rewrite = ""
if form.getvalue('nocache'):
nocache = form.getvalue('nocache')
else:
nocache = ""
if form.getvalue('postonly'):
postonly = form.getvalue('postonly')
else:
postonly = ""
if form.getvalue('dynamic'):
dynamic = form.getvalue('dynamic')
else:
dynamic = ""
cookie += " "+rewrite+" "+nocache+" "+postonly+" "+dynamic+"\n"
options_split += cookie options_split += cookie
if form.getvalue('dynamic'):
options_split += " dynamic-cookie-key " + form.getvalue('dynamic-cookie-key')+"\n"
if form.getvalue('servers') is not None: if form.getvalue('servers') is not None:
servers = form.getvalue('servers') servers = form.getvalue('servers')
i = servers.split("\n") i = servers.split("\n")

View File

@ -96,8 +96,13 @@
</select> </select>
<label for="nocache" style="margin-top: 5px;" title="This option is recommended in conjunction with the insert mode when there is a cache between the client and HAProxy.">nocache</label> <label for="nocache" style="margin-top: 5px;" title="This option is recommended in conjunction with the insert mode when there is a cache between the client and HAProxy.">nocache</label>
<input type="checkbox" name="nocache" value="nocache" id="nocache"> <input type="checkbox" name="nocache" value="nocache" id="nocache">
<label for="postonly" style="margin-top: 5px;" title="This option ensures that cookie insertion will only be performed on responses to POST requests..">postonly</label> <label for="postonly" style="margin-top: 5px;" title="This option ensures that cookie insertion will only be performed on responses to POST requests.">postonly</label>
<input type="checkbox" name="postonly" value="postonly" id="postonly"> <input type="checkbox" name="postonly" value="postonly" id="postonly">
<label for="dynamic" style="margin-top: 5px;" title="Activate dynamic cookies. When used, a session cookie is dynamically created for each server.">dynamic</label>
<input type="checkbox" name="dynamic" value="dynamic" id="dynamic">
<span id="dynamic_div" style="display: none;">
dynamic-cookie-key: <input type="text" placeholder="your-custom-key" name="dynamic-cookie-key" id="dynamic-cookie-key" class="form-control">
</span>
</span> </span>
<div id="options-listen-show-div" style="display: none;"> <div id="options-listen-show-div" style="display: none;">
<div class="tooltip"> <div class="tooltip">
@ -329,6 +334,11 @@
<input type="checkbox" name="nocache" value="nocache" id="nocache2"> <input type="checkbox" name="nocache" value="nocache" id="nocache2">
<label for="postonly2" style="margin-top: 5px;" title="This option ensures that cookie insertion will only be performed on responses to POST requests..">postonly</label> <label for="postonly2" style="margin-top: 5px;" title="This option ensures that cookie insertion will only be performed on responses to POST requests..">postonly</label>
<input type="checkbox" name="postonly" value="postonly" id="postonly2"> <input type="checkbox" name="postonly" value="postonly" id="postonly2">
<label for="dynamic2" style="margin-top: 5px;" title="Activate dynamic cookies. When used, a session cookie is dynamically created for each server.">dynamic</label>
<input type="checkbox" name="dynamic" value="dynamic" id="dynamic2">
<span id="dynamic_div2" style="display: none;">
dynamic-cookie-key: <input type="text" placeholder="your-custom-key" name="dynamic-cookie-key" id="dynamic-cookie-key2" class="form-control">
</span>
</span> </span>
<div id="options-backend-show-div" style="display: none;"> <div id="options-backend-show-div" style="display: none;">
<div style="font-size: 12px; padding-bottom: 10px;"> <div style="font-size: 12px; padding-bottom: 10px;">

Binary file not shown.

Before

Width:  |  Height:  |  Size: 309 KiB

After

Width:  |  Height:  |  Size: 341 KiB

View File

@ -303,13 +303,7 @@ $( function() {
} ); } );
$( "select" ).selectmenu(); $( "select" ).selectmenu();
var tooltips = $( "[title]" ).tooltip({ var tooltips = $( "[title]" ).tooltip();
position: {
my: "left top",
at: "right+5 top-25",
collision: "none"
}
});
$( "input[type=submit], button" ).button(); $( "input[type=submit], button" ).button();
$( "input[type=checkbox]" ).checkboxradio(); $( "input[type=checkbox]" ).checkboxradio();
$( ".controlgroup" ).controlgroup(); $( ".controlgroup" ).controlgroup();
@ -473,6 +467,7 @@ $( function() {
} else { } else {
$("#cookie_name" ).attr('required',false); $("#cookie_name" ).attr('required',false);
$("#cookie_div").hide( "fast" ); $("#cookie_div").hide( "fast" );
$("#dynamic-cookie-key" ).attr('required',false);
} }
}); });
$( "#cookie2" ).click( function(){ $( "#cookie2" ).click( function(){
@ -482,6 +477,25 @@ $( function() {
} else { } else {
$("#cookie_name2" ).attr('required',false); $("#cookie_name2" ).attr('required',false);
$("#cookie_div2").hide( "fast" ); $("#cookie_div2").hide( "fast" );
$("#dynamic-cookie-key2" ).attr('required',false);
}
});
$( "#dynamic" ).click( function(){
if ($('#dynamic').is(':checked')) {
$("#dynamic-cookie-key" ).attr('required',true);
$("#dynamic_div").show("slide", "fast" );
} else {
$("#dynamic-cookie-key" ).attr('required',false);
$("#dynamic_div").hide("slide", "fast" );
}
});
$( "#dynamic2" ).click( function(){
if ($('#dynamic2').is(':checked')) {
$("#dynamic-cookie-key2" ).attr('required',true);
$("#dynamic_div2").show("slide", "fast" );
} else {
$("#dynamic-cookie-key2" ).attr('required',false);
$("#dynamic_div2").hide("slide", "fast" );
} }
}); });
$( "#check-servers-backend" ).click( function(){ $( "#check-servers-backend" ).click( function(){