Create Catalogue page
[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 = "59,222,156,317";
14             $scope.functest = "203,163,334,365";
15             $scope.yardstick = "398,161,513,384";
16             $scope.vsperf = "567,163,673,350";
17             $scope.stor = "686,165,789,341";
18             $scope.qtip = "802,164,905,341";
19             $scope.bootleneck = "917,161,1022,338";
20             $scope.noPopArea1 = "30,11,1243,146";
21             $scope.noPopArea2 = "1041,157,1250,561";
22             $scope.noPopArea3 = "15,392,1027,561";
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                 var url = PROJECT_URL + '/projects/' + name + '/cases';
45
46                 var config = {
47                     headers: {
48                         'Content-Type': 'application/x-www-form-urlencoded;charset=utf-8;'
49                     }
50                 }
51                 $http.get(url, config).then(function(response) {
52                     if (response.status == 200) {
53                         $scope.tableData = response.data;
54                         $loading.finish('Key');
55
56
57                     }
58                 })
59             }
60
61             function getDetail(casename) {
62                 TableFactory.getProjectTestCaseDetail().get({
63                     'project': $scope.modalName,
64                     'testcase': casename
65                 }).$promise.then(function(response) {
66                     if (response != null) {
67                         $scope.project_name_modal = response.project_name;
68                         $scope.description_modal = response.description;
69                         openTestDetail();
70                     }
71                 })
72
73             }
74
75
76             function openTestDetail() {
77                 ngDialog.open({
78                     template: 'views/modal/testcasedetail.html',
79                     className: 'ngdialog-theme-default',
80                     scope: $scope,
81                     showClose: false
82                 })
83             }
84
85             function getUrl() {
86                 TableFactory.getProjectUrl().get({
87
88                 }).$promise.then(function(response) {
89                     if (response != null) {
90                         $scope.functesturl = response.functest;
91                         $scope.yardstickurl = response.yardstick;
92                         $scope.vsperfurl = response.vsperf;
93                         $scope.storperfurl = response.storperf;
94                         $scope.qtipurl = response.qtip;
95                         $scope.bottlenecksurl = response.bottlenecks;
96                         $scope.doveturl = null;
97                     }
98                 })
99             }
100
101
102
103
104
105
106
107
108
109
110         }
111     ]);