Assign image keyname and pubkey at vnf level
[ccsdk/apps.git] / sdnr / wireless-transport / code-Carbon-SR1 / ux / onapAai / onapAai-module / src / main / resources / onapAai / onapAai.controller.js
1 /*
2  * Copyright (c) 2017 highstreet technologies GmbH and others.  All rights reserved.
3  *
4  * This program and the accompanying materials are made available under the
5  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6  * and is available at http://www.eclipse.org/legal/epl-v10.html
7  */
8
9 define(['app/onapAai/onapAai.module',
10   'app/onapAai/onapAai.services'],
11   function (onapAaiApp) {
12
13     onapAaiApp.register.controller('onapAaiCtrl', ['uiGridConstants', '$uibModal', '$scope', '$rootScope', '$window', '$timeout', '$onapAai', '$mwtnLog',
14       function (uiGridConstants, $uibModal, $scope, $rootScope, $window, $timeout, $onapAai, $mwtnLog) {
15
16         var COMPONENT = 'onapAaiCtrl';
17         $mwtnLog.info({ component: COMPONENT, message: 'onapAaiCtrl started!' });
18
19         $rootScope.section_logo = 'src/app/onapAai/images/onapAai.png'; // Add your topbar logo location here such as 'assets/images/logo_topology.gif'
20
21         $scope.highlightFilteredHeader = $onapAai.highlightFilteredHeader;
22
23         // Grid
24         $scope.gridOptions = JSON.parse(JSON.stringify($onapAai.gridOptions));
25         $scope.gridOptions.columnDefs = [
26           { field: 'pnf-id', type: 'string', displayName: 'ID', headerCellClass: $scope.highlightFilteredHeader, width: 170 },
27           { field: 'pnf-name', type: 'string', displayName: 'Name', headerCellClass: $scope.highlightFilteredHeader, width: 200 },
28           { field: 'equip-type', type: 'string', displayName: 'Type', headerCellClass: $scope.highlightFilteredHeader, width: 160 },
29           { field: 'equip-vendor', type: 'string', displayName: 'Vendor', headerCellClass: $scope.highlightFilteredHeader, width: 100 },
30           { field: 'equip-model', type: 'string', displayName: 'Model', headerCellClass: $scope.highlightFilteredHeader, width: 160 },
31           { field: 'ipaddress-v4-oam', type: 'string', displayName: 'If OAM', headerCellClass: $scope.highlightFilteredHeader, width: 140 },
32           { field: 'in-maint', type: 'string', displayName: 'Maintenance', headerCellClass: $scope.highlightFilteredHeader, width: 100 },
33           { field: 'interfaces', type: 'string', displayName: '#p-interfaces', headerCellClass: $scope.highlightFilteredHeader, width: 100, visible: false },
34           { field: 'resourceVersion', type: 'string', displayName: 'Resource version', headerCellClass: $scope.highlightFilteredHeader, width: 100, visible: false }
35         ];
36
37         $onapAai.getAaiPnfs().then(function(success){
38           $scope.gridOptions.data = success.data.pnf;
39           $scope.gridOptions.data.map(function(item){
40             item.interfaces = 1;
41           });
42         }, function(error) {
43           console.log('error');
44           $scope.error = error;
45         });
46
47       }]);
48
49   });