Skip to content

Commit

Permalink
Update main.py, ui/index.html, ui/ui.js
Browse files Browse the repository at this point in the history
  Initial UI VRF support
Update ui/index.html
  Add Internet2 logo
  • Loading branch information
knewell committed Mar 16, 2019
1 parent a28a5cb commit e5ca08b
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 5 deletions.
4 changes: 2 additions & 2 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ def getActiveFlowRoutes(self):

if hex_dig not in self.flow_active:

self.flow_active[hex_dig] = {'router': name, 'term': flow.term, 'destination': destination,
self.flow_active[hex_dig] = {'router': name, 'vrf': flowtable, 'term': flow.term, 'destination': destination,
'commAction': commAction, 'krtAction': krt_actions,
'age': str(_age['current']),
'hash': hex_dig, 'status': 'new'}
Expand Down Expand Up @@ -273,7 +273,7 @@ def getActiveFlowRouteFilter(self):
_item = item.split('=')
data[didx] = _item[1] if len(_item) > 1 else _item[0]

self.filter_active[name].append({'data': data, 'packet_count': filter.packet_count,
self.filter_active[name].append({'vrf': table, 'data': data, 'packet_count': filter.packet_count,
'byte_count': filter.byte_count})

return True, self.filter_active
Expand Down
6 changes: 4 additions & 2 deletions ui/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ <h2 style="text-align:right;float:right;" class="mainheader">Monitoring BGP Flow
<div class="tab-pane active" id="overview">
<br/>
<div class="panel panel-default">
<img src="jnpr.png" class="img-rounded img-responsive" alt="Juniper Networks">
<img src="internet2.png" class="img-rounded img-responsive" alt="Juniper Networks">
</div>
</div>
<div class="tab-pane" id="flowConfiguration">
Expand Down Expand Up @@ -102,6 +102,7 @@ <h2 style="text-align:right;float:right;" class="mainheader">Monitoring BGP Flow
<thead>
<tr>
<th>Router</th>
<th>VRF</th>
<th>Name</th>
<th>Destination Prefix</th>
<th>Source Prefix</th>
Expand Down Expand Up @@ -129,6 +130,7 @@ <h2 style="text-align:right;float:right;" class="mainheader">Monitoring BGP Flow
<thead>
<tr>
<th>Name</th>
<th>VRF</th>
<th>Destination Prefix</th>
<th>Source Prefix</th>
<th>Protocol</th>
Expand Down Expand Up @@ -342,4 +344,4 @@ <h4 class="modal-title">Modify Flow Route</h4>
<script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap3-dialog/1.34.7/js/bootstrap-dialog.min.js"></script>
<script type="text/javascript" charset="utf8" src="ui.js"></script>
</body>
</html>
</html>
Binary file added ui/internet2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 11 additions & 1 deletion ui/ui.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ $(document).ready(function () {

return_data.push({
'router': flow.router,
'vrf': flow.vrf,
'term': flow.term,
'dstPrefix': flow.destination[0],
'dstPort': flow.destination[3],
Expand Down Expand Up @@ -147,6 +148,10 @@ $(document).ready(function () {
"data": "router",
"defaultContent": ""
},
{
"data": "vrf",
"defaultContent": ""
},
{
"data": "term",
"defaultContent": ""
Expand Down Expand Up @@ -202,6 +207,7 @@ $(document).ready(function () {

return_data.push({
'name': rname,
'vrf': filter.vrf,
'dstPrefix': filter.data[0],
'dstPort': filter.data[3],
'srcPrefix': filter.data[1],
Expand All @@ -223,6 +229,10 @@ $(document).ready(function () {
"data": "name",
"defaultContent": ""
},
{
"data": "vrf",
"defaultContent": ""
},
{
"data": "dstPrefix",
"defaultContent": ""
Expand Down Expand Up @@ -610,4 +620,4 @@ function saveSettings(settings){
$("#errormsg").html(errorText).show();
}
});
}
}

0 comments on commit e5ca08b

Please sign in to comment.