5 * @name opnfvdashBoardAngularApp.controller:testVisualController
8 * Controller of the opnfvdashBoardAngularApp
10 angular.module('opnfvApp')
11 .controller('testVisualController', ['$scope', '$state', '$stateParams', 'TableFactory', 'ngDialog', '$http', '$loading',
12 function($scope, $state, $stateParams, TableFactory, ngDialog, $http, $loading) {
13 $scope.dovet = "50,168,177,443";
14 $scope.functest = "194,173,356,442";
15 $scope.yardstick = "377,183,521,412";
16 $scope.vsperf = "542,185,640,414";
17 $scope.stor = "658,187,750,410";
18 $scope.qtip = "769,190,852,416";
19 $scope.bottlenecks = "870,192,983,419";
20 $scope.noPopArea1 = "26,8,1190,180";
21 $scope.noPopArea2 = "1018,193,1190,590";
22 $scope.noPopArea3 = "37,455,1003,584";
25 $scope.showSelectValue = 0;
26 $scope.scenarioList = ["os_nosdn_kvm_noha", "os_nosdn_kvm_no", "os_nosdn_kvm_"];
29 $scope.myTrigger = myTrigger;
30 $scope.openTestDetail = openTestDetail;
32 $scope.getDetail = getDetail;
39 function myTrigger(name) {
40 $loading.start('Key');
41 $scope.tableData = null;
42 $scope.modalName = name;
44 TableFactory.getProjectTestCases(name).then(function(response) {
45 if (response.status == 200) {
46 $scope.tableData = response.data;
48 $scope.tableData = constructObjectArray($scope.tableData);
49 console.log($scope.tableData);
50 $loading.finish('Key');
58 //construct key value for tableData
59 function constructObjectArray(array) {
60 var templateArray = [];
61 for (var i = 0; i < array.length; i++) {
62 var key = Object.keys(array[i])[0];
63 var value = array[i][key];
68 templateArray.push(temp);
75 function getDetail(casename) {
76 TableFactory.getProjectTestCaseDetail().get({
77 'project': $scope.modalName,
79 }).$promise.then(function(response) {
80 if (response != null) {
81 $scope.name_modal = response.name;
82 $scope.description_modal = response.description;
90 function openTestDetail() {
92 template: 'views/modal/testcasedetail.html',
93 className: 'ngdialog-theme-default',
100 TableFactory.getProjectUrl().get({
102 }).$promise.then(function(response) {
103 if (response != null) {
104 $scope.functesturl = response.functest;
105 $scope.yardstickurl = response.yardstick;
106 $scope.vsperfurl = response.vsperf;
107 $scope.storperfurl = response.storperf;
108 $scope.qtipurl = response.qtip;
109 $scope.bottlenecksurl = response.bottlenecks;
110 $scope.doveturl = null;