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