Changeset - b02e16dc7708
[Not reviewed]
default
0 2 0
Branko Majic (branko) - 10 years ago 2013-11-09 14:02:29
branko@majic.rs
CONNT-17: Added tabelarised representation of communications to the project details page with colour-coding.
2 files changed with 27 insertions and 0 deletions:
0 comments (0 inline, 0 general)
conntrackt/templates/conntrackt/project_detail.html
Show inline comments
 
@@ -35,12 +35,36 @@
 
  {% for location, entities in location_entities %}
 
  <div class="span4">
 
    <div class="well">{% include "conntrackt/location_widget.html" with location=location entities=entities %}</div>
 
  </div>
 
  {% endfor %}
 
</div>
 

	
 
{% if communications %}
 
<div class="row">
 
  <div class="span12">
 
    <h2>Communications</h2>
 
    <table class="table table-hover table-condensed table-striped">
 
      <thead>
 
        <tr><th>From</th><th>To</th><th>Protocol</th><th>Port</th></tr>
 
      </thead>
 
      <tbody>
 
      {% for communication in communications %}
 
        <tr>
 
          <td><span class="badge" style="background-color: {{ communication.source_color }};">O</span> {{ communication.source }}</td>
 
          <td><span class="badge" style="background-color: {{ communication.destination_color }};">O</span> {{ communication.destination }}</td>
 
          <td>{{ communication.protocol }}</td>
 
          <td>{{ communication.port }}</td>
 
        </tr>
 
      {% endfor %}
 
      </tbody>
 
    </table>
 
  </div>
 
</div>
 
{% endif %}
 

	
 
<div class="row">
 
  <div class="span12">
 
    <h2>Communications diagram</h2>
 
    <img src="{% url "project_diagram" project.id %}" width="100%">
 
  </div>
 
</div>
conntrackt/views.py
Show inline comments
 
@@ -174,12 +174,15 @@ class ProjectView(MultiplePermissionsReq
 
            entities = Entity.objects.filter(project=self.object, location=location)
 
            location_entities.append((location, entities))
 

	
 
        # Add the (location, entities) tuples to context.
 
        context['location_entities'] = location_entities
 

	
 
        # Add all project communications to context.
 
        context['communications'] = self.object.get_project_communications_summary()
 

	
 
        # Finally return the context.
 
        return context
 

	
 

	
 
class EntityView(MultiplePermissionsRequiredMixin, DetailView):
 
    """
0 comments (0 inline, 0 general)