Pavel Loginov 2020-11-06 10:39:44 +06:00
parent 92103b2e37
commit 5d591fdf7f
3 changed files with 33 additions and 32 deletions

View File

@ -22,7 +22,7 @@ end_line = ""
try:
user, user_id, role, token, servers = funct.get_users_params()
except:
except Exception:
pass
hap_configs_dir = funct.get_config_var('configs', 'haproxy_save_configs_dir')
@ -36,7 +36,7 @@ if serv is not None and section is not None :
try:
funct.logging(serv, "sections.py open config")
except:
except Exception:
pass
start_line, end_line, config_read = funct.get_section_from_config(cfg, section)
@ -46,7 +46,7 @@ if serv is not None and section is not None :
if serv is not None and form.getvalue('config') is not None:
try:
funct.logging(serv, "config.py edited config")
except:
except Exception:
pass
config = form.getvalue('config')
@ -87,7 +87,6 @@ template = template.render(h2 = 1, title = "Working with HAProxy configs",
end_line=end_line,
section=section,
sections=sections,
note = 1,
versions=funct.versions(),
token=token)
print(template)

View File

@ -70,7 +70,7 @@
</p>
</form>
{% if note %}
<div class="alert alert-info"><b>Note:</b> If you reconfigure Master server, Slave will reconfigured automatically</div>
<div class="alert alert-info"><b>Note:</b> When reconfiguring the master server, the slave will be reconfigured automatically</div>
{% endif %}
{% endif %}
{% endif %}
@ -80,7 +80,7 @@
{% 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>
<a href="viewsttats.py?serv={{ serv }}" target="_blank" title="View stats">Go to stats</a>
{% endif %}
{% endif %}
</center>

View File

@ -26,7 +26,7 @@
{% if config %}
{% if role <= 3 %}
<div id="config">
<h4>You are editting "{{section}}" from server {{ serv }}</h4>
<h4>You are editing "{{section}}" section from server {{ serv }}</h4>
</center>
<form action="{{ action }}" name="saveconfig" method="post">
<input type="hidden" value="{{ serv }}" name="serv">
@ -44,9 +44,11 @@
<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 class="alert alert-info">
<p><b>Note:</b></p>
<p>When reconfiguring the master server, the slave will be reconfigured automatically</p>
<p>Unable to delete entire section</p>
</div>
<script>
var myCodeMirror = CodeMirror.fromTextArea(document.getElementById("config_text_area"), {mode: "haproxy", lineNumbers: true});
</script>
@ -68,8 +70,8 @@
{% 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>
<a href="config.py?serv={{ serv }}" title="Working with HAProxy config">Config</a> |
<a href="viewsttats.py?serv={{ serv }}" target="_blank" title="View stats">Go to stats</a>
{% endif %}
<script>window.history.pushState("Config", "Config", cur_url[0])</script>
{% endif %}