Don't verify Danube and verify Euphrates
[releng.git] / utils / test / reporting / pages / app / scripts / controllers / testvisual.controller.js
1 'use strict';
2
3 /**
4  * @ngdoc function
5  * @name opnfvdashBoardAngularApp.controller:testVisualController
6  * @description
7  * # TableController
8  * Controller of the opnfvdashBoardAngularApp
9  */
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";
23
24             init();
25             $scope.showSelectValue = 0;
26             $scope.scenarioList = ["os_nosdn_kvm_noha", "os_nosdn_kvm_no", "os_nosdn_kvm_"];
27
28             function init() {
29                 $scope.myTrigger = myTrigger;
30                 $scope.openTestDetail = openTestDetail;
31                 $scope.pop = pop;
32                 $scope.getDetail = getDetail;
33                 getUrl();
34
35
36
37             }
38
39             function myTrigger(name) {
40                 $loading.start('Key');
41                 $scope.tableData = null;
42                 $scope.modalName = name;
43
44                 TableFactory.getProjectTestCases(name).then(function(response) {
45                     if (response.status == 200) {
46                         $scope.tableData = response.data;
47
48                         $scope.tableData = constructObjectArray($scope.tableData);
49                         console.log($scope.tableData);
50                         $loading.finish('Key');
51                     }
52                 }, function(error) {
53
54                 })
55
56             }
57
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];
64                     var temp = {
65                         'key': key,
66                         'value': value
67                     };
68                     templateArray.push(temp);
69
70                 }
71
72                 return templateArray;
73             }
74
75             function getDetail(casename) {
76                 TableFactory.getProjectTestCaseDetail().get({
77                     'project': $scope.modalName,
78                     'testcase': casename
79                 }).$promise.then(function(response) {
80                     if (response != null) {
81                         $scope.name_modal = response.name;
82                         $scope.description_modal = response.description;
83                         openTestDetail();
84                     }
85                 })
86
87             }
88
89
90             function openTestDetail() {
91                 ngDialog.open({
92                     template: 'views/modal/testcasedetail.html',
93                     className: 'ngdialog-theme-default',
94                     scope: $scope,
95                     showClose: false
96                 })
97             }
98
99             function getUrl() {
100                 TableFactory.getProjectUrl().get({
101
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;
111                     }
112                 })
113             }
114
115
116
117
118
119
120
121
122
123
124         }
125     ]);