1 angular.module('dlux.node', [])
3 .controller('nodeCtrl', function($scope, SwitchSvc) {
6 // Fetch the node then fetch more info about each node
7 SwitchSvc.nodeUrl().getList().then(function(npData) {
8 $scope.npData = npData.nodeProperties;
12 .config(function ($stateProvider) {
13 $stateProvider.state('node', {
16 templateUrl: 'node/root.tpl.html'
19 $stateProvider.state('node.index', {
23 templateUrl: 'node/index.tpl.html',
24 controller: function ($scope, SwitchSvc) {
25 $scope.svc = SwitchSvc;
27 $scope.gridOptions = {
28 data: 'data["nodeProperties"]',
30 enableRowSelection: true,
31 showSelectionCheckbox: true,
32 selectWithCheckboxOnly: true,
35 field: 'properties.description.value', displayName: 'Node Name'
38 field: 'node.id', displayName: 'Node ID'
41 field: 'properties.macAddress.value', displayName: 'MAC Address'
48 return SwitchSvc.data;
59 $stateProvider.state('node.detail', {
60 url: '/{nodeType}/{nodeId}/detail',
63 templateUrl: 'node/detail.tpl.html',
64 controller: function ($scope, $stateParams, SwitchSvc) {
65 SwitchSvc.nodeUrl(null, $stateParams.nodeType, $stateParams.nodeId).get().then(
70 // Filter function to remove ports with id 0
71 $scope.portNotNull = function (property) {
72 return property.nodeconnector.id !== "0";