Merge pull request #113 from Symbianx/master

Was added "Just save" button
pull/145/head
Pavel Loginov 2019-05-06 17:00:05 +03:00 committed by GitHub
commit 47120eba06
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 1 deletions

View File

@ -343,7 +343,9 @@ def upload_and_restart(serv, cfg, **kwargs):
else:
commands = [ "sudo mv -f " + tmp_file + " /etc/keepalived/keepalived.conf && sudo systemctl restart keepalived" ]
else:
if kwargs.get("just_save") == "save":
if kwargs.get("just_save") == "test":
commands = [ "sudo haproxy -q -c -f " + tmp_file + "&& sudo rm -f " + tmp_file ]
elif kwargs.get("just_save") == "save":
commands = [ "sudo haproxy -q -c -f " + tmp_file + "&& sudo mv -f " + tmp_file + " " + sql.get_setting('haproxy_config_path') ]
else:
commands = [ "sudo haproxy -q -c -f " + tmp_file + "&& sudo mv -f " + tmp_file + " " + sql.get_setting('haproxy_config_path') + " && sudo " + sql.get_setting('restart_command') ]

View File

@ -60,6 +60,7 @@
<input type="hidden" value="{{ cfg }}.old" name="oldconfig">
<textarea name="config" class="config" rows="35" cols="100">{{ 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>
</p>