Browse Source

firewall rules are listed

Roberto Berto 5 years ago
parent
commit
2ecfe8be9b

+ 10 - 5
vycenter/firewall/templates/firewall/show.html

@@ -4,7 +4,7 @@
 {% block section_title %}Firewall Dashboard{% endblock %}
 
 {% block debug %}
-{{ firewall_all }}
+{{ firewall }}
 {{ firewall_name }}
 {% endblock %}
 
@@ -14,16 +14,21 @@
 
 {% if firewall %}
     <table border="1" width="100%">
-    <tr><th>name</th><th>description</th><th>action</th></tr>
+    <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 %}
-        <tr>
+        
         {% for ifkey, ifvalue in value.items %}
+            <tr>
             <td><a href="{% url 'firewall:show' ifkey %}">{{ ifkey }}</a></td>
             <td>{{ ifvalue.description }}</td>
-            <td>delete</td>
+            <td>{{ ifvalue.protocol }}</td>
+            <td>{{ ifvalue.destination.port }}</td>
+            <td>{{ ifvalue.source.port }}</td>
+            <td>{{ ifvalue.action }}</td>                        
+            </tr>
         {% endfor %}
-        </tr>
+        
     {% endfor %}
 
     </table>

+ 6 - 0
vycenter/interface/templates/interface/index.html

@@ -3,6 +3,12 @@
 {% block header_title %}interfaces List{% endblock %}
 {% block section_title %}Interfaces List{% endblock %}
 
+{% block debug %}
+    {{ interfaces }}
+{% endblock %}
+
+
+
 {% block content %}
 
 {% if interfaces %}

+ 1 - 1
vycenter/vyos.py

@@ -222,7 +222,7 @@ def get_firewall_all(hostname):
 
 
 def get_firewall(hostname, name):
-    cmd = {"op": "showConfig", "path": ["firewall", name]}
+    cmd = {"op": "showConfig", "path": ["firewall", "name", name]}
 
     print(json.dumps(cmd))
     post = {'key': get_key(hostname), 'data': json.dumps(cmd)}