Skip to content

Commit

Permalink
Revert "first stab at using some templating for UI"
Browse files Browse the repository at this point in the history
This reverts commit 7272960.
  • Loading branch information
knewell committed May 22, 2019
1 parent ffb82d9 commit 027f5d6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 11 deletions.
9 changes: 3 additions & 6 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
from jnpr.junos.exception import ConfigLoadError, CommitError
from data.fr import FlowRoutesTable, FlowFilterTable

env = Environment(loader=FileSystemLoader('ui'))

class MyDev(object):

Expand Down Expand Up @@ -520,15 +519,13 @@ def load_settings(self):
self.routers = config['routers']
self.vrfs = config['vrfs']


class BGPFlow(object):

@cherrypy.expose
def index(self):
with open('ui/config.yml', 'r') as fp:
configvrf = yaml.load(fp)
vrflist = configvrf['vrfs']
tmpl = env.get_template('index.html')
return tmpl.render(first_option=vrflist[0], second_option=vrflist[1])
return open('ui/index.html', 'r')


@cherrypy.expose
class BGPFlowWS(object):
Expand Down
10 changes: 5 additions & 5 deletions ui/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Internet2 BGP Portal</title>
<title>BGP Flow Spec Demo</title>

<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/1.10.19/css/jquery.dataTables.css">
Expand All @@ -33,8 +33,8 @@
</head>
<body>

<div class="container col-sm-9 col-md-8 col-lg-12"><h2 style="text-align:left;float:left;">Internet2</h2>
<h2 style="text-align:right;float:right;" class="mainheader">BGP FlowSpec Portal</h2></div>
<div class="container col-sm-9 col-md-8 col-lg-12"><h2 style="text-align:left;float:left;">DevOps against DDoS</h2>
<h2 style="text-align:right;float:right;" class="mainheader">Monitoring BGP FlowSpec with Junos PyEZ</h2></div>
<div id="exTab1" class="container col-sm-9 col-md-8 col-lg-12">
<ul class="nav nav-pills mynav">
<li class="active">
Expand Down Expand Up @@ -213,8 +213,8 @@ <h4 class="modal-title">Add new flow route</h4>
<label for="selectVrf" class="col-sm-2 col-form-label">VRF</label>
<div class="col-sm-3">
<select class="form-control" id="selectVrf">
<option selected="selected">{{first_option}}</option>
<option>{{second_option}}</option>
<option selected="selected">default</option>
<option>trcps</option>
</select>
</div>
</div>
Expand Down

0 comments on commit 027f5d6

Please sign in to comment.