diff --git a/main.py b/main.py index 65cf4c5..83c4c89 100644 --- a/main.py +++ b/main.py @@ -31,6 +31,7 @@ from jnpr.junos.exception import ConfigLoadError, CommitError from data.fr import FlowRoutesTable, FlowFilterTable +env = Environment(loader=FileSystemLoader('ui')) class MyDev(object): @@ -519,13 +520,15 @@ def load_settings(self): self.routers = config['routers'] self.vrfs = config['vrfs'] - class BGPFlow(object): @cherrypy.expose def index(self): - return open('ui/index.html', 'r') - + 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]) @cherrypy.expose class BGPFlowWS(object): diff --git a/ui/index.html b/ui/index.html index be8311c..4d4c7c0 100644 --- a/ui/index.html +++ b/ui/index.html @@ -23,7 +23,7 @@ - BGP Flow Spec Demo + Internet2 BGP Portal @@ -33,8 +33,8 @@ -

DevOps against DDoS

-

Monitoring BGP FlowSpec with Junos PyEZ

+

Internet2

+

BGP FlowSpec Portal