Drawing slices, expanding and collapsing slices
Drawing forms
Added keybindings
Change-Id: Ic1f06eef20a6e1e7c0f1fea51752fe738f86d600
diff --git a/views/ngXosViews/mcord-slicing/src/js/main.js b/views/ngXosViews/mcord-slicing/src/js/main.js
new file mode 100644
index 0000000..fbd9039
--- /dev/null
+++ b/views/ngXosViews/mcord-slicing/src/js/main.js
@@ -0,0 +1,93 @@
+'use strict';
+
+angular.module('xos.mcord-slicing', [
+ 'ngResource',
+ 'ngCookies',
+ 'ui.router',
+ 'xos.helpers'
+])
+.config(($stateProvider) => {
+ $stateProvider
+ .state('slicing-topo', {
+ url: '/',
+ template: '<slicing-topo></slicing-topo>'
+ })
+ .state('node-links', {
+ url: '/data',
+ template: '<node-links></node-links>'
+ });
+})
+.config(function($httpProvider){
+ $httpProvider.interceptors.push('NoHyperlinks');
+})
+.service('McordSlicingTopo', function($http, $q){
+ this.query = () => {
+ const d = $q.defer();
+
+ $http.get('api/service/mcord_slicing_ui/topology/')
+ .then((res) => {
+ let data;
+ if (res.data.hasOwnProperty('nodes')){
+ data = res.data;
+ }
+ else {
+ // INVESTIGATE why proxy change resposne
+ data = {
+ nodes: res.data[0],
+ links: res.data[1]
+ };
+ }
+ d.resolve(data);
+ })
+ .catch((e) => {
+ d.reject(e);
+ });
+
+ return {$promise: d.promise};
+ };
+})
+.directive('nodeLinks', function(){
+ return {
+ restrict: 'E',
+ scope: {},
+ bindToController: true,
+ controllerAs: 'vm',
+ templateUrl: 'templates/node-links.tpl.html',
+ controller: function(McordSlicingTopo){
+
+ this.tableConfig = {
+ columns: [
+ {
+ label: 'Id',
+ prop: 'id'
+ },
+ {
+ label: 'Name',
+ prop: 'name'
+ },
+ {
+ label: 'Type',
+ prop: 'type'
+ },
+ {
+ label: 'Plane',
+ prop: 'plane'
+ },
+ {
+ label: 'Model Id',
+ prop: 'model_id'
+ }
+ ]
+ };
+
+ // retrieving user list
+ McordSlicingTopo.query().$promise
+ .then((users) => {
+ this.users = users.nodes;
+ })
+ .catch((e) => {
+ throw new Error(e);
+ });
+ }
+ };
+});
\ No newline at end of file