summaryrefslogtreecommitdiffstats
path: root/utils/test/reporting/pages/app/scripts/controllers
diff options
context:
space:
mode:
Diffstat (limited to 'utils/test/reporting/pages/app/scripts/controllers')
-rw-r--r--utils/test/reporting/pages/app/scripts/controllers/admin.controller.js26
-rw-r--r--utils/test/reporting/pages/app/scripts/controllers/case.controller.js70
-rw-r--r--utils/test/reporting/pages/app/scripts/controllers/main.controller.js32
-rw-r--r--utils/test/reporting/pages/app/scripts/controllers/table.controller.js278
-rw-r--r--utils/test/reporting/pages/app/scripts/controllers/testvisual.controller.js125
5 files changed, 0 insertions, 531 deletions
diff --git a/utils/test/reporting/pages/app/scripts/controllers/admin.controller.js b/utils/test/reporting/pages/app/scripts/controllers/admin.controller.js
deleted file mode 100644
index e6ecad006..000000000
--- a/utils/test/reporting/pages/app/scripts/controllers/admin.controller.js
+++ /dev/null
@@ -1,26 +0,0 @@
-'use strict';
-
-/**
- * @ngdoc function
- * @name opnfvdashBoardAngularApp.controller:AdminController
- * @description
- * # TableController
- * Controller of the opnfvdashBoardAngularApp
- */
-angular.module('opnfvApp')
- .controller('AdminController', ['$scope', '$state', '$stateParams', 'TableFactory', function($scope, $state, $stateParams, TableFactory) {
-
- init();
- $scope.showSelectValue = 0;
- $scope.scenarioList = ["os_nosdn_kvm_noha", "os_nosdn_kvm_no", "os_nosdn_kvm_"];
-
- function init() {}
-
-
-
-
-
-
-
-
- }]); \ No newline at end of file
diff --git a/utils/test/reporting/pages/app/scripts/controllers/case.controller.js b/utils/test/reporting/pages/app/scripts/controllers/case.controller.js
deleted file mode 100644
index a4f165119..000000000
--- a/utils/test/reporting/pages/app/scripts/controllers/case.controller.js
+++ /dev/null
@@ -1,70 +0,0 @@
-'use strict';
-
-/**
- * @ngdoc function
- * @name opnfvdashBoardAngularApp.controller:CaseController
- * @description
- * # TableController
- * Controller of the opnfvdashBoardAngularApp
- */
-angular.module('opnfvApp')
- .controller('CaseController', ['$scope', '$state', '$stateParams', 'TableFactory', function($scope, $state, $stateParams, TableFactory) {
-
- init();
- $scope.projectSelect = "";
- $scope.funcTestCase = ['test1func', 'test2func', 'test3func', 'test4func'];
- $scope.yardStickCase = ['test1yard', 'test2yard', 'test3yard', 'test4yard'];
- $scope.bottleNeckCase = ['test1bottle', 'test2bottle', 'test3bottle', 'test4bottle',
- 'test5bottle', 'test6bottle', 'test7bottle', 'test8bottle',
- 'test9bottle', 'test10bottle', 'test11bottle', 'test12bottle',
- 'test13bottle', 'test14bottle', 'test15bottle', 'test16bottle',
- 'test17bottle', 'test18bottle', 'test19bottle', 'test20bottle'
- ];
- $scope.selectedFunc = ["test1func"];
- $scope.selectBottle = ["test8bottle"];
- $scope.versionlist = ["Colorado", "Master"];
- $scope.VersionOption = [
- { title: 'Colorado' },
- { title: 'Master' }
- ];
- $scope.VersionConfig = {
- create: true,
- valueField: 'title',
- labelField: 'title',
- delimiter: '|',
- maxItems: 1,
- placeholder: 'Version',
- onChange: function(value) {
- checkElementArrayValue($scope.selection, $scope.VersionOption);
- $scope.selection.push(value);
- // console.log($scope.selection);
-
- }
- };
-
-
- function init() {
- $scope.toggleSelection = toggleSelection;
- $scope.toggleSelectionMulti = toggleSelectionMulti;
-
- }
-
- function toggleSelection(status) {
- // var idx = $scope.weekselection.indexOf(status);
- $scope.projectSelect = status;
-
- }
-
- function toggleSelectionMulti(status) {
- var idx = $scope.selection.indexOf(status);
-
- if (idx > -1) {
- $scope.selection.splice(idx, 1);
- } else {
- $scope.selection.push(status);
- }
- console.log($scope.selection);
- }
-
-
- }]); \ No newline at end of file
diff --git a/utils/test/reporting/pages/app/scripts/controllers/main.controller.js b/utils/test/reporting/pages/app/scripts/controllers/main.controller.js
deleted file mode 100644
index 2054dc2dd..000000000
--- a/utils/test/reporting/pages/app/scripts/controllers/main.controller.js
+++ /dev/null
@@ -1,32 +0,0 @@
-'use strict';
-
-/**
- * @ngdoc function
- * @name opnfvdashBoardAngularApp.controller:MainPageController
- * @description
- * # TableController
- * Controller of the opnfvdashBoardAngularApp
- */
-angular.module('opnfvApp')
- .controller('MainController', ['$scope', '$state', '$stateParams', function($scope, $state, $stateParams) {
-
- init();
-
- function init() {
- $scope.goTest = goTest;
- $scope.goLogin = goLogin;
-
- }
-
- function goTest() {
- $state.go("select.selectTestCase");
- }
-
- function goLogin() {
- $state.go("login");
- }
-
-
-
-
- }]); \ No newline at end of file
diff --git a/utils/test/reporting/pages/app/scripts/controllers/table.controller.js b/utils/test/reporting/pages/app/scripts/controllers/table.controller.js
deleted file mode 100644
index 8d494c3ae..000000000
--- a/utils/test/reporting/pages/app/scripts/controllers/table.controller.js
+++ /dev/null
@@ -1,278 +0,0 @@
-'use strict';
-
-/**
- * @ngdoc function
- * @name opnfvdashBoardAngularApp.controller:TableController
- * @description
- * # TableController
- * Controller of the opnfvdashBoardAngularApp
- */
-angular.module('opnfvApp')
- .controller('TableController', ['$scope', '$state', '$stateParams', '$http', 'TableFactory', '$timeout',
- function($scope, $state, $stateParams, $http, TableFactory, $timeout) {
-
- init();
-
- function init() {
- $scope.filterlist = [];
- $scope.selection = [];
-
- $scope.statusList = [];
- $scope.projectList = [];
- $scope.installerList = [];
- $scope.versionlist = [];
- $scope.loopList = [];
- $scope.timeList = [];
-
- $scope.selectStatus = [];
- $scope.selectProjects = [];
- $scope.selectInstallers = [];
- $scope.selectVersion = null;
- $scope.selectLoop = null;
- $scope.selectTime = null;
-
- $scope.statusClicked = false;
- $scope.installerClicked = false;
- $scope.projectClicked = false;
-
- $scope.scenarios = {};
-
- $scope.VersionConfig = {
- create: true,
- valueField: 'title',
- labelField: 'title',
- delimiter: '|',
- maxItems: 1,
- placeholder: 'Version',
- onChange: function(value) {
- $scope.selectVersion = value;
-
- getScenarioData();
-
- }
- }
-
- $scope.LoopConfig = {
- create: true,
- valueField: 'title',
- labelField: 'title',
- delimiter: '|',
- maxItems: 1,
- placeholder: 'Loop',
- onChange: function(value) {
- $scope.selectLoop = value;
-
- getScenarioData();
-
- }
- }
-
- $scope.TimeConfig = {
- create: true,
- valueField: 'title',
- labelField: 'title',
- delimiter: '|',
- maxItems: 1,
- placeholder: 'Time',
- onChange: function(value) {
- $scope.selectTime = value;
-
- getScenarioData();
- }
- }
-
- getFilters();
- }
-
- function getFilters() {
- TableFactory.getFilter().get({
- }).$promise.then(function(response) {
- if (response != null) {
- $scope.statusList = response.filters.status;
- $scope.projectList = response.filters.projects;
- $scope.installerList = response.filters.installers;
- $scope.versionList = toSelectList(response.filters.version);
- $scope.loopList = toSelectList(response.filters.loops);
- $scope.timeList = toSelectList(response.filters.time);
-
- $scope.selectStatus = copy($scope.statusList);
- $scope.selectInstallers = copy($scope.installerList);
- $scope.selectProjects = copy($scope.projectList);
- $scope.selectVersion = response.filters.version[0];
- $scope.selectLoop = response.filters.loops[0];
- $scope.selectTime = response.filters.time[0];
-
- getScenarioData();
-
- } else {
- }
- });
- }
-
- function toSelectList(arr){
- var tempList = [];
- angular.forEach(arr, function(ele){
- tempList.push({'title': ele});
- });
- return tempList;
- }
-
- function copy(arr){
- var tempList = [];
- angular.forEach(arr, function(ele){
- tempList.push(ele);
- });
- return tempList;
- }
-
- function getScenarioData() {
-
- var data = {
- 'status': $scope.selectStatus,
- 'projects': $scope.selectProjects,
- 'installers': $scope.selectInstallers,
- 'version': $scope.selectVersion,
- 'loops': $scope.selectLoop,
- 'time': $scope.selectTime
- };
-
- TableFactory.getScenario(data).then(function(response) {
- if (response.status == 200) {
- $scope.scenarios = response.data.scenarios;
- getScenario();
- }
-
- }, function(error) {
- });
-
- }
-
- function getScenario(){
-
- $scope.project_row = [];
- angular.forEach($scope.selectInstallers, function(installer){
- angular.forEach($scope.selectProjects, function(project){
- var temp = {
- 'installer': installer,
- 'project': project
- }
- $scope.project_row.push(temp);
-
- });
- });
-
-
- $scope.scenario_rows = [];
- angular.forEach($scope.scenarios, function(scenario, name){
- var scenario_row = {
- 'name': null,
- 'status': null,
- 'statusDisplay': null,
- 'datadisplay': [],
- };
- scenario_row.name = name;
- scenario_row.status = scenario.status;
-
- var scenarioStatusDisplay;
- if (scenario.status == "success") {
- scenarioStatusDisplay = "navy";
- } else if (scenario.status == "danger") {
- scenarioStatusDisplay = "danger";
- } else if (scenario.status == "warning") {
- scenarioStatusDisplay = "warning";
- }
- scenario_row.statusDisplay = scenarioStatusDisplay;
-
- angular.forEach($scope.selectInstallers, function(installer){
- angular.forEach($scope.selectProjects, function(project){
- var datadisplay = {
- 'installer': null,
- 'project': null,
- 'value': null,
- 'label': null,
- 'label_value': null
- };
- datadisplay.installer = installer;
- datadisplay.project = project;
- datadisplay.value = scenario.installers[installer][project].score;
-
- var single_status = scenario.installers[installer][project].status;
- if (single_status == "platinium") {
- datadisplay.label = 'primary';
- datadisplay.label_value = 'P';
- } else if (single_status == "gold") {
- datadisplay.label = 'danger';
- datadisplay.label_value = 'G';
- } else if (single_status == "silver") {
- datadisplay.label = 'warning';
- datadisplay.label_value = 'S';
- } else if (single_status == null) {
- }
- scenario_row.datadisplay.push(datadisplay);
-
- });
- });
- $scope.scenario_rows.push(scenario_row);
- });
- }
-
-
- function clickBase(eleList, ele){
- var idx = eleList.indexOf(ele);
- if(idx > -1){
- eleList.splice(idx, 1);
- }else{
- eleList.push(ele);
- }
- }
-
- $scope.clickStatus = function(status){
- if($scope.selectStatus.length == $scope.statusList.length && $scope.statusClicked == false){
- $scope.selectStatus = [];
- $scope.statusClicked = true;
- }
-
- clickBase($scope.selectStatus, status);
-
- if($scope.selectStatus.length == 0 && $scope.statusClicked == true){
- $scope.selectStatus = copy($scope.statusList);
- $scope.statusClicked = false;
- }
-
- getScenarioData();
- }
-
- $scope.clickInstaller = function(installer){
- if($scope.selectInstallers.length == $scope.installerList.length && $scope.installerClicked == false){
- $scope.selectInstallers = [];
- $scope.installerClicked = true;
- }
-
- clickBase($scope.selectInstallers, installer);
-
- if($scope.selectInstallers.length == 0 && $scope.installerClicked == true){
- $scope.selectInstallers = copy($scope.installerList);
- $scope.installerClicked = false;
- }
-
- getScenarioData();
- }
-
- $scope.clickProject = function(project){
- if($scope.selectProjects.length == $scope.projectList.length && $scope.projectClicked == false){
- $scope.selectProjects = [];
- $scope.projectClicked = true;
- }
-
- clickBase($scope.selectProjects, project);
-
- if($scope.selectProjects.length == 0 && $scope.projectClicked == true){
- $scope.selectProjects = copy($scope.projectList);
- $scope.projectClicked = false;
- }
-
- getScenarioData();
- }
-
- }
- ]);
diff --git a/utils/test/reporting/pages/app/scripts/controllers/testvisual.controller.js b/utils/test/reporting/pages/app/scripts/controllers/testvisual.controller.js
deleted file mode 100644
index 894e10f77..000000000
--- a/utils/test/reporting/pages/app/scripts/controllers/testvisual.controller.js
+++ /dev/null
@@ -1,125 +0,0 @@
-'use strict';
-
-/**
- * @ngdoc function
- * @name opnfvdashBoardAngularApp.controller:testVisualController
- * @description
- * # TableController
- * Controller of the opnfvdashBoardAngularApp
- */
-angular.module('opnfvApp')
- .controller('testVisualController', ['$scope', '$state', '$stateParams', 'TableFactory', 'ngDialog', '$http', '$loading',
- function($scope, $state, $stateParams, TableFactory, ngDialog, $http, $loading) {
- $scope.dovet = "50,168,177,443";
- $scope.functest = "194,173,356,442";
- $scope.yardstick = "377,183,521,412";
- $scope.vsperf = "542,185,640,414";
- $scope.stor = "658,187,750,410";
- $scope.qtip = "769,190,852,416";
- $scope.bottlenecks = "870,192,983,419";
- $scope.noPopArea1 = "26,8,1190,180";
- $scope.noPopArea2 = "1018,193,1190,590";
- $scope.noPopArea3 = "37,455,1003,584";
-
- init();
- $scope.showSelectValue = 0;
- $scope.scenarioList = ["os_nosdn_kvm_noha", "os_nosdn_kvm_no", "os_nosdn_kvm_"];
-
- function init() {
- $scope.myTrigger = myTrigger;
- $scope.openTestDetail = openTestDetail;
- $scope.pop = pop;
- $scope.getDetail = getDetail;
- getUrl();
-
-
-
- }
-
- function myTrigger(name) {
- $loading.start('Key');
- $scope.tableData = null;
- $scope.modalName = name;
-
- TableFactory.getProjectTestCases(name).then(function(response) {
- if (response.status == 200) {
- $scope.tableData = response.data;
-
- $scope.tableData = constructObjectArray($scope.tableData);
- console.log($scope.tableData);
- $loading.finish('Key');
- }
- }, function(error) {
-
- })
-
- }
-
- //construct key value for tableData
- function constructObjectArray(array) {
- var templateArray = [];
- for (var i = 0; i < array.length; i++) {
- var key = Object.keys(array[i])[0];
- var value = array[i][key];
- var temp = {
- 'key': key,
- 'value': value
- };
- templateArray.push(temp);
-
- }
-
- return templateArray;
- }
-
- function getDetail(casename) {
- TableFactory.getProjectTestCaseDetail().get({
- 'project': $scope.modalName,
- 'testcase': casename
- }).$promise.then(function(response) {
- if (response != null) {
- $scope.name_modal = response.name;
- $scope.description_modal = response.description;
- openTestDetail();
- }
- })
-
- }
-
-
- function openTestDetail() {
- ngDialog.open({
- template: 'views/modal/testcasedetail.html',
- className: 'ngdialog-theme-default',
- scope: $scope,
- showClose: false
- })
- }
-
- function getUrl() {
- TableFactory.getProjectUrl().get({
-
- }).$promise.then(function(response) {
- if (response != null) {
- $scope.functesturl = response.functest;
- $scope.yardstickurl = response.yardstick;
- $scope.vsperfurl = response.vsperf;
- $scope.storperfurl = response.storperf;
- $scope.qtipurl = response.qtip;
- $scope.bottlenecksurl = response.bottlenecks;
- $scope.doveturl = null;
- }
- })
- }
-
-
-
-
-
-
-
-
-
-
- }
- ]);