Timotej Lazar
25ee4e8a44
Address rules by name instead of index. Still problematic if the rules are changed while someone is managing them, but with names it’s more likely to just not work instead of enabling or disabling the wrong rule. Also prevent bringing down the whole network with a single click.
34 lines
640 B
HTML
34 lines
640 B
HTML
{% extends 'base.html' %}
|
|
|
|
{% block header %}
|
|
<style>
|
|
pre {
|
|
margin: 0.5em 2em;
|
|
}
|
|
summary {
|
|
list-style: none;
|
|
}
|
|
</style>
|
|
{% endblock %}
|
|
|
|
{% block content %}
|
|
<p>
|
|
Tu lahko vklopite in izklopite posamezna pravila za požarni zid.
|
|
|
|
<form id="request" method="POST">
|
|
{% for rule in rules %}
|
|
<details>
|
|
<summary>
|
|
<input name="rule" type="hidden" value="{{ rule.name }}" />
|
|
<input name="enabled" type="checkbox" value="{{ rule.name }}" autocomplete="off"{% if rule.enabled %} checked{% endif %} />
|
|
{{ rule.name }}
|
|
</summary>
|
|
<pre><code>{{ rule.text }}</code></pre>
|
|
</details>
|
|
{% endfor %}
|
|
<p>
|
|
<button>Potrdi</button>
|
|
</form>
|
|
|
|
{% endblock %}
|