Exemple #1
0
 def add(self, req, resp):
     html_form = form(luxon_user)
     role_form = form(luxon_user_role)
     return render_template('photonic/users/add.html',
                            view='Add User',
                            form=html_form,
                            role_form=role_form)
Exemple #2
0
 def view(self, req, resp, id):
     endpoint = g.client.execute('GET', '/v1/endpoint/%s' % id)
     html_form = form(luxon_endpoint, endpoint.json, readonly=True)
     return render_template('photonic/endpoints/view.html',
                            view='View Endpoint',
                            form=html_form,
                            id=id)
Exemple #3
0
 def edit(self, req, resp, id):
     role = g.client.execute('GET', '/v1/role/%s' % id)
     html_form = form(luxon_role, role.json)
     return render_template('photonic/roles/edit.html',
                            view='Edit Role',
                            form=html_form,
                            id=id)
Exemple #4
0
 def view(self, req, resp, id):
     tenant = req.context.api.execute('GET', '/v1/tenant/%s' % id)
     html_form = form(luxon_tenant, tenant.json, readonly=True)
     return render_template('photonic/tenants/view.html',
                            view='View Tenant',
                            form=html_form,
                            id=id)
Exemple #5
0
 def view(self, req, resp, id):
     role = g.client.execute('GET', '/v1/role/%s' % id)
     html_form = form(luxon_role, role.json, readonly=True)
     return render_template('photonic/roles/view.html',
                            view='View Role',
                            form=html_form,
                            id=id)
Exemple #6
0
 def view(self, req, resp, id):
     domain = req.context.api.execute('GET', '/v1/domain/%s' % id)
     html_form = form(luxon_domain, domain.json, readonly=True)
     return render_template('photonic/domains/view.html',
                            view='View Domain',
                            form=html_form,
                            id=id)
Exemple #7
0
 def edit(self, req, resp, id):
     endpoint = g.client.execute('GET', '/v1/endpoint/%s' % id)
     html_form = form(luxon_endpoint, endpoint.json)
     return render_template('photonic/endpoints/edit.html',
                            view='Edit Endpoint',
                            form=html_form,
                            id=id)
Exemple #8
0
 def view(self, req, resp, id):
     vr = req.context.api.execute('GET', '/v1/group/%s' % id,
                                  endpoint='radius')
     html_form = form(tradius_group, vr.json, readonly=True)
     return render_template('tradius.ui/groups/view.html',
                            view='View Subscriber Group',
                            form=html_form,
                            id=id)
Exemple #9
0
 def view(self, req, resp, id):
     cdr = req.context.api.execute('GET',
                                   '/v1/accounting/%s' % id,
                                   endpoint='radius')
     html_form = form(tradius_accounting, cdr.json, readonly=True)
     return render_template('tradius.ui/accounting/view.html',
                            form=html_form,
                            view="Radius Accounting entry")
Exemple #10
0
 def view(self, req, resp, id):
     vr = req.context.api.execute('GET', '/v1/pool/%s' % id,
                                  endpoint='subscriber')
     html_form = form(pool, vr.json, readonly=True)
     return render_template('calabiyau.ui/pool/view.html',
                            view='Subscriber IP Pool',
                            form=html_form,
                            id=id)
Exemple #11
0
 def view(self, req, resp, id):
     cdr = req.context.api.execute('GET',
                                   '/v1/accounting/%s' % id,
                                   endpoint='calabiyau')
     html_form = form(accounting, cdr.json, readonly=True)
     return render_template('calabiyau.ui/accounting/view.html',
                            form=html_form,
                            view="Subscriber Accounting entry")
 def view(self, req, resp, id):
     user = req.context.api.execute('GET', '/v1/subscriber/%s' % id,
                                    endpoint='subscriber')
     html_form = form(subscriber, user.json, readonly=True)
     return render_template('calabiyau.ui/subscribers/view.html',
                            form=html_form,
                            id=id,
                            view="View Subscriber")
Exemple #13
0
 def view(self, req, resp, id):
     vr = req.context.api.execute('GET', '/v1/pool/%s' % id,
                                  endpoint='radius')
     html_form = form(tradius_pool, vr.json, readonly=True)
     return render_template('tradius.ui/pool/view.html',
                            view='View Pool Authentication Service',
                            form=html_form,
                            id=id)
Exemple #14
0
 def view(self, req, resp, id):
     vr = req.context.api.execute('GET', '/v1/virtual/%s' % id,
                                  endpoint='subscriber')
     html_form = form(virtual, vr.json, readonly=True)
     return render_template('calabiyau.ui/virtual/view.html',
                            view='View Virtual Authentication Service',
                            form=html_form,
                            id=id)
Exemple #15
0
 def view(self, req, resp, id):
     user = req.context.api.execute('GET',
                                    '/v1/user/%s' % id,
                                    endpoint='radius')
     html_form = form(tradius_subscriber, user.json, readonly=True)
     return render_template('tradius.ui/radius/view.html',
                            form=html_form,
                            id=id,
                            view="View Subscriber")
Exemple #16
0
 def add(self, req, resp):
     if req.method == 'POST':
         response = req.context.api.execute('POST', '/v1/group',
                                            data=req.form_dict,
                                            endpoint='radius')
         return self.view(req, resp, response.json['id'])
     else:
         html_form = form(tradius_group)
         return render_template('tradius.ui/groups/add.html',
                                view='Add Subscriber Group',
                                form=html_form)
Exemple #17
0
 def add(self, req, resp):
     if req.method == 'POST':
         response = req.context.api.execute('POST', '/v1/virtual',
                                            data=req.form_dict,
                                            endpoint='subscriber')
         return self.view(req, resp, response.json['id'])
     else:
         html_form = form(virtual)
         return render_template('calabiyau.ui/virtual/add.html',
                                view='Add Virtual Authentication Service',
                                form=html_form)
Exemple #18
0
 def add(self, req, resp):
     if req.method == 'POST':
         data = req.form_dict
         data['tag'] = "tachyonic"
         response = req.context.api.execute('POST', '/v1/user', data=data)
         return self.view(req, resp, response.json['id'])
     else:
         html_form = form(luxon_user)
         return render_template('photonic/users/add.html',
                                view='Add User',
                                form=html_form)
Exemple #19
0
 def add(self, req, resp):
     if req.method == 'POST':
         response = req.context.api.execute('POST',
                                            '/v1/tenant',
                                            data=req.form_dict)
         return self.view(req, resp, response.json['id'])
     else:
         html_form = form(luxon_tenant)
         return render_template('photonic/tenants/add.html',
                                view='Add Tenant',
                                form=html_form)
Exemple #20
0
 def view(self, req, resp, id):
     user = req.context.api.execute('GET', '/v1/user/%s' % id)
     html_form = form(luxon_user, user.json, readonly=True)
     assignments = req.context.api.execute('GET',
                                           '/v1/rbac/user/%s' % id).json
     assignments = none_to_blank(assignments)
     return render_template('photonic/users/view.html',
                            form=html_form,
                            id=id,
                            view="View User",
                            assignments=assignments)
Exemple #21
0
 def add(self, req, resp):
     if req.method == 'POST':
         response = req.context.api.execute('POST', '/v1/pool',
                                            data=req.form_dict,
                                            endpoint='radius')
         return self.view(req, resp, response.json['id'])
     else:
         html_form = form(tradius_pool)
         return render_template('tradius.ui/pool/add.html',
                                view='Add Pool Authentication Service',
                                form=html_form)
Exemple #22
0
 def add(self, req, resp):
     if req.method == 'POST':
         response = req.context.api.execute('POST', '/v1/pool',
                                            data=req.form_dict,
                                            endpoint='subscriber')
         return self.view(req, resp, response.json['id'])
     else:
         html_form = form(pool)
         return render_template('calabiyau.ui/pool/add.html',
                                view='Add Subscriber IP Pool',
                                form=html_form)
Exemple #23
0
 def edit(self, req, resp, id):
     if req.method == 'POST':
         req.context.api.execute('PUT',
                                 '/v1/domain/%s' % id,
                                 data=req.form_dict)
         return self.view(req, resp, id)
     else:
         domain = req.context.api.execute('GET', '/v1/domain/%s' % id)
         html_form = form(luxon_domain, domain.json)
         return render_template('photonic/domains/edit.html',
                                view='Edit Domain',
                                form=html_form,
                                id=id)
Exemple #24
0
 def edit(self, req, resp, id):
     if req.method == 'POST':
         req.context.api.execute('PUT',
                                 '/v1/tenant/%s' % id,
                                 data=req.form_dict)
         return self.view(req, resp, id)
     else:
         tenant = req.context.api.execute('GET', '/v1/tenant/%s' % id)
         html_form = form(luxon_tenant, tenant.json)
         return render_template('photonic/tenants/edit.html',
                                view='Edit Tenant',
                                form=html_form,
                                id=id)
Exemple #25
0
 def edit(self, req, resp, id):
     user = req.context.api.execute('GET', '/v1/user/%s' % id)
     html_form = form(luxon_user, user.json)
     assignments = req.context.api.execute('GET',
                                           '/v1/rbac/user/%s' % id).json
     assignments = none_to_blank(assignments)
     num_roles = len(assignments)
     return render_template('photonic/users/edit.html',
                            form=html_form,
                            id=id,
                            view="Edit User",
                            num_roles=num_roles,
                            assignments=assignments)
Exemple #26
0
 def edit(self, req, resp, id):
     if req.method == 'POST':
         req.context.api.execute('PUT', '/v1/pool/%s' % id,
                                 data=req.form_dict,
                                 endpoint='radius')
         return self.view(req, resp, id)
     else:
         domain = req.context.api.execute('GET', '/v1/pool/%s' % id,
                                          endpoint='radius')
         html_form = form(tradius_pool, domain.json)
         return render_template('tradius.ui/pool/edit.html',
                                view='Edit Pool Authentication Service',
                                form=html_form,
                                id=id)
Exemple #27
0
 def edit(self, req, resp, id):
     if req.method == 'POST':
         req.context.api.execute('PUT', '/v1/group/%s' % id,
                                 data=req.form_dict,
                                 endpoint='radius')
         return self.view(req, resp, id)
     else:
         domain = req.context.api.execute('GET', '/v1/group/%s' % id,
                                          endpoint='radius')
         html_form = form(tradius_group, domain.json)
         return render_template('tradius.ui/groups/edit.html',
                                view='Edit Subscriber Group',
                                form=html_form,
                                id=id,
                                ops=ops)
Exemple #28
0
 def edit(self, req, resp, id):
     if req.method == 'POST':
         req.context.api.execute('PUT', '/v1/pool/%s' % id,
                                 data=req.form_dict,
                                 endpoint='subscriber')
         return self.view(req, resp, id)
     else:
         response = req.context.api.execute('GET',
                                            '/v1/pool/%s' % id,
                                            endpoint='subscriber')
         html_form = form(pool, response.json)
         return render_template('calabiyau.ui/pool/edit.html',
                                name=response.json['pool_name'],
                                view='Edit Subscriber IP Pool',
                                form=html_form,
                                id=id)
Exemple #29
0
 def edit(self, req, resp, id):
     if req.method == 'POST':
         req.context.api.execute('PUT', '/v1/virtual/%s' % id,
                                 data=req.form_dict,
                                 endpoint='subscriber')
         return self.view(req, resp, id)
     else:
         response = req.context.api.execute('GET', '/v1/virtual/%s'
                                            % id,
                                            endpoint='subscriber')
         html_form = form(virtual, response.json)
         return render_template('calabiyau.ui/virtual/edit.html',
                                name=response.json['name'],
                                view='Edit Virtual Authentication Service',
                                form=html_form,
                                vendors=vendors,
                                id=id)
Exemple #30
0
 def edit(self, req, resp, id):
     if req.method == 'POST':
         req.context.api.execute('PUT', '/v1/package/%s' % id,
                                 data=req.form_dict,
                                 endpoint='subscriber')
         return self.view(req, resp, id)
     else:
         response = req.context.api.execute('GET', '/v1/package/%s'
                                            % id,
                                            endpoint='subscriber')
         html_form = form(package, response.json)
         return render_template('calabiyau.ui/packages/edit.html',
                                view='Edit Subscriber Package',
                                name=response.json['name'],
                                form=html_form,
                                id=id,
                                ctx=ctx,
                                vendors=vendors)