show.html 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. {% extends "base.html" %}
  2. {% block header_title %}Firewall Dashboard{% endblock %}
  3. {% block section_title %}Firewall Dashboard{% endblock %}
  4. {% block debug %}
  5. {{ firewall_all }}
  6. {{ firewall_name }}
  7. {% endblock %}
  8. {% block content %}
  9. {% if firewall %}
  10. <table border="1" width="100%">
  11. <tr><th>name</th><th>description</th><th>action</th></tr>
  12. {% for key, value in firewall.items %}
  13. <tr>
  14. {% for ifkey, ifvalue in value.items %}
  15. <td><a href="{% url 'firewall:show' ifkey %}">{{ ifkey }}</a></td>
  16. <td>{{ ifvalue.description }}</td>
  17. <td>delete</td>
  18. {% endfor %}
  19. </tr>
  20. {% endfor %}
  21. </table>
  22. {% else %}
  23. <p>No firewalls.</p>
  24. {% endif %}
  25. <h2>Create new rule</h2>
  26. <form action="{% url 'firewall:addrule' firewall_name %}" method="post">
  27. {% csrf_token %}
  28. <p>
  29. <label for="alias">rule number</label><br>
  30. <input type="text" name="rulenumber" id="rulenumber" value="{{ rulenumber }}" size="5">
  31. </p>
  32. <p>
  33. <label for="hostname">action</label><br>
  34. <input type="checkbox" name="action" id="action" value="accept"> accept
  35. <input type="checkbox" name="action" id="action" value="drop"> drop
  36. </p>
  37. <p>
  38. <label for="hostname">protocol</label><br>
  39. <input type="checkbox" name="protocol" id="protocol" value="tcp"> tcp
  40. <input type="checkbox" name="protocol" id="protocol" value="udp"> udp
  41. </p>
  42. <p>
  43. <label for="alias">destination port</label><br>
  44. <input type="text" name="destinationport" id="destinationport" value="{{ destinationport }}" size="5">
  45. </p>
  46. <p>
  47. <label for="alias">source port</label><br>
  48. <input type="text" name="sourceport" id="sourceport" value="{{ sourceport }}" size="5">
  49. </p>
  50. <input type="submit" value="Add Rule">
  51. </form>
  52. {% endblock %}