Set up first page of VPN Dashboard attempt 1
diff --git a/views/ngXosViews/vpnDashboard/src/css/dev.css b/views/ngXosViews/vpnDashboard/src/css/dev.css
index 228639b..92e77cc 100644
--- a/views/ngXosViews/vpnDashboard/src/css/dev.css
+++ b/views/ngXosViews/vpnDashboard/src/css/dev.css
@@ -2,4 +2,15 @@
position: absolute;
top: 100px;
left: 200px;
-}
\ No newline at end of file
+}
+.body {
+ width: 70%;
+ margin: auto;
+}
+.row {
+ display: table-row;
+}
+.cell {
+ display: table-cell;
+ padding: 5px;
+}
diff --git a/views/ngXosViews/vpnDashboard/src/js/main.js b/views/ngXosViews/vpnDashboard/src/js/main.js
index 6a2d672..4923b1c 100644
--- a/views/ngXosViews/vpnDashboard/src/js/main.js
+++ b/views/ngXosViews/vpnDashboard/src/js/main.js
@@ -9,9 +9,9 @@
])
.config(($stateProvider) => {
$stateProvider
- .state('user-list', {
+ .state('vpn-list', {
url: '/',
- template: '<users-list></users-list>'
+ template: '<vpn-list></vpn-list>'
});
})
.service('Vpn', function($http, $q){
@@ -33,18 +33,18 @@
.config(function($httpProvider){
$httpProvider.interceptors.push('NoHyperlinks');
})
-.directive('usersList', function(){
+.directive('vpnList', function(){
return {
restrict: 'E',
scope: {},
bindToController: true,
controllerAs: 'vm',
- templateUrl: 'templates/users-list.tpl.html',
+ templateUrl: 'templates/vpn-list.tpl.html',
controller: function(Vpn){
// retrieving user list
Vpn.getVpnTenants()
- .then((users) => {
- this.users = users;
+ .then((vpns) => {
+ this.vpns = vpns;
})
.catch((e) => {
throw new Error(e);
diff --git a/views/ngXosViews/vpnDashboard/src/templates/users-list.tpl.html b/views/ngXosViews/vpnDashboard/src/templates/users-list.tpl.html
deleted file mode 100644
index 2983ad0..0000000
--- a/views/ngXosViews/vpnDashboard/src/templates/users-list.tpl.html
+++ /dev/null
@@ -1,14 +0,0 @@
-<div class="row">
- <h1>Users List</h1>
- <p>This is only an example view.</p>
-</div>
-<div class="row">
- <div class="span4">Email</div>
- <div class="span4">First Name</div>
- <div class="span4">Last Name</div>
-</div>
-<div class="row" ng-repeat="user in vm.users">
- <div class="span4">{{user.email}}</div>
- <div class="span4">{{user.firstname}}</div>
- <div class="span4">{{user.lastname}}</div>
-</div>
\ No newline at end of file
diff --git a/xos/core/xoslib/methods/vpnview.py b/xos/core/xoslib/methods/vpnview.py
index 1942609..fe2f323 100644
--- a/xos/core/xoslib/methods/vpnview.py
+++ b/xos/core/xoslib/methods/vpnview.py
@@ -1,9 +1,10 @@
from rest_framework.response import Response
from rest_framework.views import APIView
+from services.vpn.models import VPNTenant
class VpnTenantsList(APIView):
method_kind = "list"
method_name = "vpntenants"
def get(self, request, format=None):
- return Response(list())
+ return Response(VPNTenant.get_tenant_objects())