From 72b4c4598f60a9c594f15de9d6387a2c841e1cfb Mon Sep 17 00:00:00 2001 From: Henry Camacho Date: Wed, 15 Mar 2017 19:32:05 -0500 Subject: [PATCH] =?UTF-8?q?Admin=20is=20functioning=20=E2=80=94=20Displays?= =?UTF-8?q?=20Servers=20that=20are=20connected=20with=20in/out=20bytes.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- html/admin/index.html | 14 ++------ html/admin/js/app.js | 35 +++++++++++++++--- html/admin/partials/servers.html | 62 +++++++++++++++++++------------- 3 files changed, 70 insertions(+), 41 deletions(-) diff --git a/html/admin/index.html b/html/admin/index.html index df94d1b..1af2fc6 100644 --- a/html/admin/index.html +++ b/html/admin/index.html @@ -24,7 +24,7 @@ - -
-
-
-
- -
+
- -
-
-
diff --git a/html/admin/js/app.js b/html/admin/js/app.js index dfbcf1b..58eeb3a 100644 --- a/html/admin/js/app.js +++ b/html/admin/js/app.js @@ -1,17 +1,44 @@ console.log("app.sh startup") - var app = angular.module("rvpnApp", ["ngRoute"]); app.config(function($routeProvider, $locationProvider) { $routeProvider - .when("/admin/servers", { + .when("/admin/index.html", { templateUrl : "admin/partials/servers.html" }) - .when("/admin/domains", { + .when("/admin/servers/", { + templateUrl : "admin/partials/servers.html" + }) + .when("/admin/#domains", { templateUrl : "green.htm" }) .when("/blue", { templateUrl : "blue.htm" }); $locationProvider.html5Mode(true); -}); \ No newline at end of file +}); + +app.controller('serverController', function ($scope, $http) { + $scope.servers = []; + var api = '/api/com.daplie.rvpn/servers' + + $http.get(api).then(function(response) { + updateView(response.data); + }); + + updateView = function(data) { + console.log(data); + if (data.error == 'ok' ){ + console.log("ok") + $scope.servers = data.result.servers; + console.log(data.result) + + } + }; + + + + + +}); + \ No newline at end of file diff --git a/html/admin/partials/servers.html b/html/admin/partials/servers.html index 5461862..3c323d0 100644 --- a/html/admin/partials/servers.html +++ b/html/admin/partials/servers.html @@ -1,29 +1,41 @@ -
Control Plane
-
- -
-
-
- - - - +
+
+
+
+
+ Servers
-
-
- -
- -
-
-
- - - - +
+
+
+ + +
+
-
+
+
+
+ + + + + + + + + + + + + + + +
IDNameAddressXfer (in/out)Time
{{ s.server_id }}{{ s.server_name }}{{ s.source_address }}{{ s.bytes_in }}/{{ s.bytes_out}}{{ s.duration }}
+ + + + +
\ No newline at end of file