diff --git a/app.js b/app.js index 83612e6..4731241 100644 --- a/app.js +++ b/app.js @@ -13,7 +13,8 @@ angular.module('adminApp', [ 'app.login', 'app.main', 'app.user', - 'app.travel' + 'app.travel', + 'app.network' ]). config(['$locationProvider', '$routeProvider', function($locationProvider, $routeProvider) { $locationProvider.hashPrefix('!'); diff --git a/img/asking.png b/img/asking.png new file mode 100644 index 0000000..39c4842 Binary files /dev/null and b/img/asking.png differ diff --git a/img/offering.png b/img/offering.png new file mode 100644 index 0000000..8a60d08 Binary files /dev/null and b/img/offering.png differ diff --git a/img/package.png b/img/package.png new file mode 100644 index 0000000..2bb078a Binary files /dev/null and b/img/package.png differ diff --git a/index.html b/index.html index b5a9bb8..fbbfb92 100644 --- a/index.html +++ b/index.html @@ -55,18 +55,20 @@ + - + + diff --git a/views/main/main.html b/views/main/main.html index 763aafd..8ff289a 100644 --- a/views/main/main.html +++ b/views/main/main.html @@ -5,7 +5,7 @@

All users

-
+
-
+

All travels

-
+
@@ -65,13 +63,15 @@ -
+

Actions

- Panel content +
Create user
+
Create travel
+ View network
diff --git a/views/network/network.html b/views/network/network.html new file mode 100644 index 0000000..83afe6c --- /dev/null +++ b/views/network/network.html @@ -0,0 +1,12 @@ +
+
+
+
+

Network

+
+
+
+
+
+
+
diff --git a/views/network/network.js b/views/network/network.js new file mode 100644 index 0000000..00a1756 --- /dev/null +++ b/views/network/network.js @@ -0,0 +1,53 @@ +'use strict'; + +angular.module('app.network', ['ngRoute']) + + .config(['$routeProvider', function($routeProvider) { + $routeProvider.when('/network', { + templateUrl: 'views/network/network.html', + controller: 'NetworkCtrl' + }); + }]) + + .controller('NetworkCtrl', function($scope, $http, $routeParams) { + $scope.data = []; + $scope.nodes = []; + $scope.edges = []; + var nodes, edges, container; + var options = { + layout: { + improvedLayout: false + } + /*, + physics:{ + //stabilization: false, + // enabled: false + }*/ + }; + + + $scope.showMap = function() { + var nodes = $scope.nodes; + var edges = $scope.edges; + + var container = document.getElementById('mynetwork'); + var data = { + nodes: nodes, + edges: edges + }; + var network = new vis.Network(container, data, options); + }; + + $http.get(urlapi + 'admin/network') + .then(function(data, status, headers, config) { + console.log('data success'); + console.log(data); + + $scope.nodes = data.data.nodes; + $scope.edges = data.data.edges; + $scope.showMap(); + }, function(data, status, headers, config) { + console.log('data error'); + }); + + });