Restored mcord topology
diff --git a/views/ngXosViews/mcordTopology/src/css/main.css b/views/ngXosViews/mcordTopology/src/css/main.css
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/views/ngXosViews/mcordTopology/src/css/main.css
diff --git a/views/ngXosViews/mcordTopology/src/index.html b/views/ngXosViews/mcordTopology/src/index.html
index 691a869..d8985de 100644
--- a/views/ngXosViews/mcordTopology/src/index.html
+++ b/views/ngXosViews/mcordTopology/src/index.html
@@ -4,10 +4,11 @@
<!-- endbower --><!-- endcss -->
<!-- inject:css -->
<link rel="stylesheet" href="/css/dev.css">
+<link rel="stylesheet" href="/css/main.css">
<link rel="stylesheet" href="/css/mcord.css">
<!-- endinject -->
-<div ng-app="xos.mcordTopology" id="xosMcordTopology">
+<div ng-app="xos.mcordTopology" id="xosMcordTopology" class="container-fluid">
<div ui-view></div>
</div>
@@ -19,17 +20,11 @@
<script src="vendor/angular-ui-router/release/angular-ui-router.js"></script>
<script src="vendor/angular-cookies/angular-cookies.js"></script>
<script src="vendor/angular-resource/angular-resource.js"></script>
-<script src="vendor/ng-lodash/build/ng-lodash.js"></script>
+<script src="vendor/lodash/lodash.js"></script>
<script src="vendor/bootstrap-css/js/bootstrap.js"></script>
<!-- endbower --><!-- endjs -->
<!-- inject:js -->
-<script src="/xosHelpers/src/xosHelpers.module.js"></script>
-<script src="/xosHelpers/src/services/noHyperlinks.interceptor.js"></script>
-<script src="/xosHelpers/src/services/csrfToken.interceptor.js"></script>
-<script src="/xosHelpers/src/services/api.services.js"></script>
-<script src="/api/ng-xoslib.js"></script>
-<script src="/api/ng-xos.js"></script>
-<script src="/api/ng-hpcapi.js"></script>
+<script src="/../../../xos/core/xoslib/static/js/vendor/ngXosHelpers.js"></script>
<script src="/.tmp/main.js"></script>
<script src="/.tmp/static.data.js"></script>
<script src="/.tmp/node_drawer.js"></script>
diff --git a/views/ngXosViews/mcordTopology/src/js/main.js b/views/ngXosViews/mcordTopology/src/js/main.js
index a479717..f926df9 100644
--- a/views/ngXosViews/mcordTopology/src/js/main.js
+++ b/views/ngXosViews/mcordTopology/src/js/main.js
@@ -3,7 +3,6 @@
angular.module('xos.mcordTopology', [
'ngResource',
'ngCookies',
- 'ngLodash',
'ui.router',
'xos.helpers'
])
@@ -17,12 +16,17 @@
.config(function($httpProvider){
$httpProvider.interceptors.push('NoHyperlinks');
})
+.factory('_', $window => $window._)
.service('Traffic', function($http, $q){
this.get = () => {
var deferred = $q.defer();
$http.get('videoLocal.txt')
.then(res => {
deferred.resolve(res.data);
+ })
+ .catch(e => {
+ console.log(e);
+ deferred.resolve(Math.random() * 10)
});
return deferred.promise;
}
@@ -34,7 +38,7 @@
bindToController: true,
controllerAs: 'vm',
template: '',
- controller: function($element, $interval, $rootScope, XosApi, lodash, TopologyElements, NodeDrawer, Traffic){
+ controller: function($element, $interval, $rootScope, _, $http, TopologyElements, NodeDrawer, Traffic){
const el = $element[0];
@@ -45,7 +49,7 @@
let trafficCorrection = 5;
const filterBBU = (instances) => {
- return lodash.filter(instances, i => i.name.indexOf('BBU') >= 0);
+ return _.filter(instances, i => i.name.indexOf('BBU') >= 0);
};
const filterOthers = (instances) => {
@@ -91,11 +95,13 @@
traffic = newTraffic;
- return XosApi.Instance_List_GET()
+ return $http.get('/api/core/xos/instances');
+ // return XosApi.Instance_List_GET()
})
.then((instances) => {
- addBbuNodes(filterBBU(instances));
- addOtherNodes(filterOthers(instances));
+
+ addBbuNodes(filterBBU(instances.data));
+ addOtherNodes(filterOthers(instances.data));
draw(svg, nodes, links);
})
@@ -127,9 +133,9 @@
const buildLinks = (links, nodes) => {
return links.map((l) => {
-
- let source = lodash.findIndex(nodes, {id: l.source});
- let target = lodash.findIndex(nodes, {id: l.target});
+ console.log(_.find);
+ let source = _.findIndex(nodes, {id: l.source});
+ let target = _.findIndex(nodes, {id: l.target});
// console.log(`link-${source}-${target}`, source, target);
return {
source: source,
@@ -144,7 +150,7 @@
// find fabric nodes and center horizontally
const positionFabricNodes = (nodes) => {
- return lodash.map(nodes, n => {
+ return _.map(nodes, n => {
if(n.type !== 'fabric'){
return n;
}
diff --git a/views/ngXosViews/mcordTopology/src/sass/main.scss b/views/ngXosViews/mcordTopology/src/sass/main.scss
new file mode 100644
index 0000000..78cf25b
--- /dev/null
+++ b/views/ngXosViews/mcordTopology/src/sass/main.scss
@@ -0,0 +1,5 @@
+@import '../../../../style/sass/lib/_variables.scss';
+
+#xosMcordTopology {
+
+}
\ No newline at end of file
diff --git a/views/ngXosViews/mcordTopology/src/templates/users-list.tpl.html b/views/ngXosViews/mcordTopology/src/templates/users-list.tpl.html
new file mode 100644
index 0000000..fd8d208
--- /dev/null
+++ b/views/ngXosViews/mcordTopology/src/templates/users-list.tpl.html
@@ -0,0 +1,16 @@
+<div class="row">
+ <div class="col-xs-12">
+ <h1>Users List</h1>
+ <p>This is only an example view.</p>
+ </div>
+</div>
+<div class="row">
+ <div class="col-xs-4">Email</div>
+ <div class="col-xs-4">First Name</div>
+ <div class="col-xs-4">Last Name</div>
+</div>
+<div class="row" ng-repeat="user in vm.users">
+ <div class="col-xs-4">{{user.email}}</div>
+ <div class="col-xs-4">{{user.firstname}}</div>
+ <div class="col-xs-4">{{user.lastname}}</div>
+</div>
\ No newline at end of file