| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990 |
- {% extends "base.html" %}
- {% block header_title %}Firewall Dashboard{% endblock %}
- {% block section_title %}Firewall Dashboard{% endblock %}
- {% block debug %}
- {{ firewall }}
- {{ firewall_name }}
- {{ firewall_rulenumber }}
- {{ firewall_rule }}
- {% endblock %}
- {% block content %}
- {% if firewall %}
- <table border="1" width="100%">
- <tr><th>rule #</th><th>description</th><th>protocol</th><th>destination port</th><th>source port</th><th>action</th></tr>
- {% for key, value in firewall.items %}
-
- {% for ifkey, ifvalue in value.items %}
- <tr>
- <td><a href="{% url 'firewall:editrule' firewall_name ifkey %}">{{ ifkey }}</a></td>
- <td>{{ ifvalue.description }}</td>
- <td>{{ ifvalue.protocol }}</td>
- <td>{{ ifvalue.destination.port }}</td>
- <td>{{ ifvalue.source.port }}</td>
- <td>{{ ifvalue.action }}</td>
- </tr>
- {% endfor %}
-
- {% endfor %}
- </table>
- {% else %}
- <p>No firewalls.</p>
- {% endif %}
- <h2>Edit rule</h2>
- <form action="{% url 'firewall:editrule' firewall_name firewall_rulenumber %}" method="post">
- {% csrf_token %}
-
- <p>
- <label for="alias">rule number</label><br>
- <input type="text" name="rulenumber" id="rulenumber" value="{{ firewall_rulenumber }}" size="5" disabled>
- </p>
-
- <p>
- <label for="hostname">action</label><br>
- <input type="radio" name="action" id="action" value="accept" {% if firewall_rule.action == "accept" %}checked="checked"{% endif %}> accept
- <input type="radio" name="action" id="action" value="drop" {% if firewall_rule.action == "drop" %}checked="checked"{% endif %}> drop
- <input type="radio" name="action" id="action" value="reject" {% if firewall_rule.action == "reject" %}checked="checked"{% endif %}> reject
- </p>
- <p>
- <label for="hostname">protocol</label><br>
- <input type="radio" name="protocol" id="protocol" value="tcp" {% if firewall_rule.protocol == "tcp" %}checked="checked"{% endif %}> tcp
- <input type="radio" name="protocol" id="protocol" value="udp" {% if firewall_rule.protocol == "udp" %}checked="checked"{% endif %}> udp
- </p>
-
- <p>
- <label for="alias">destination port</label><br>
- <input type="text" name="destinationport" id="destinationport" value="{{ firewall_rule.destination.port }}" size="5">
- </p>
-
- <p>
- <label for="alias">source port</label><br>
- <input type="text" name="sourceport" id="sourceport" value="{{ firewall_rule.source.port }}" size="5">
- </p>
-
-
- <input type="submit" value="Edit Rule">
- </form>
-
- {% endblock %}
|