diff options
Diffstat (limited to 'utils/test/reporting/pages/app/scripts')
9 files changed, 0 insertions, 728 deletions
diff --git a/utils/test/reporting/pages/app/scripts/app.js b/utils/test/reporting/pages/app/scripts/app.js deleted file mode 100644 index 043e3ca91..000000000 --- a/utils/test/reporting/pages/app/scripts/app.js +++ /dev/null @@ -1,24 +0,0 @@ -'use strict'; - -/** - * @ngdoc overview - * @name opnfvApp - * @description - * # opnfvApp - * - * Main module of the application. - */ -angular - .module('opnfvApp', [ - 'ngAnimate', - 'ui.router', - 'oc.lazyLoad', - 'ui.bootstrap', - 'ngResource', - 'selectize', - '720kb.tooltips', - 'ngDialog', - 'angularUtils.directives.dirPagination', - 'darthwade.dwLoading' - - ]);
\ No newline at end of file diff --git a/utils/test/reporting/pages/app/scripts/config.js b/utils/test/reporting/pages/app/scripts/config.js deleted file mode 100644 index 1010169d3..000000000 --- a/utils/test/reporting/pages/app/scripts/config.js +++ /dev/null @@ -1,19 +0,0 @@ -/** - * @ngdoc overview - * @name opnfvApp - * @description - * # opnfvApp - * - * Main config file of the application. - */ -angular - .module('opnfvApp').config(['$httpProvider', '$qProvider', function($httpProvider, $qProvider) { - - $httpProvider.defaults.useXDomain = true; - delete $httpProvider.defaults.headers.common['X-Requested-With']; - - $qProvider.errorOnUnhandledRejections(false); - - } - - ]);
\ No newline at end of file diff --git a/utils/test/reporting/pages/app/scripts/config.router.js b/utils/test/reporting/pages/app/scripts/config.router.js deleted file mode 100644 index d3724b765..000000000 --- a/utils/test/reporting/pages/app/scripts/config.router.js +++ /dev/null @@ -1,84 +0,0 @@ -'use strict' -/** - * @ngdoc function - * @name opnfvdashBoardAngularApp.config:config.router.js - * @description config of the ui router and lazy load setting - * config of the opnfvdashBoardAngularApp - */ -angular.module('opnfvApp') - .run([ - '$rootScope', '$state', '$stateParams', - function($rootScope, $state, $stateParams) { - - $rootScope.$state = $state; - $rootScope.$stateParams = $stateParams; - - } - ]).config(['$stateProvider', '$urlRouterProvider', - function($stateProvider, $urlRouterProvider) { - - $urlRouterProvider.otherwise('/landingpage/table'); - - $stateProvider - .state('landingpage', { - url: "/landingpage", - controller: 'MainController', - templateUrl: "views/main.html", - data: { pageTitle: '首页', specialClass: 'landing-page' }, - resolve: { - controller: ['$ocLazyLoad', function($ocLazyLoad) { - return $ocLazyLoad.load([ - - ]) - }] - } - }) - .state('landingpage.table', { - url: "/table", - controller: 'TableController', - templateUrl: "views/commons/table.html", - resolve: { - controller: ['$ocLazyLoad', function($ocLazyLoad) { - return $ocLazyLoad.load([ - // 'scripts/controllers/table.controller.js' - - - ]) - }] - } - }) - .state('select', { - url: '/select', - templateUrl: "views/testcase.html", - data: { specialClass: 'top-navigation' }, - - }) - .state('select.selectTestCase', { - url: "/selectCase", - controller: 'CaseController', - templateUrl: "views/commons/selectTestcase.html", - - }) - .state('select.testlist', { - url: "/caselist", - templateUrl: "views/commons/testCaseList.html" - }) - .state('select.admin', { - url: "/admin", - controller: 'AdminController', - templateUrl: "views/commons/admin.html" - }) - .state('select.testVisual', { - url: "/visual", - controller: "testVisualController", - templateUrl: "views/commons/testCaseVisual.html" - }) - // .state('admin', { - // url: '/admin', - // data: { specialClass: ' fixed-sidebar pace-done' }, - // templateUrl: "views/commons/admin.html" - // }) - - } - ]) - .run(); 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; - } - }) - } - - - - - - - - - - - } - ]); diff --git a/utils/test/reporting/pages/app/scripts/factory/table.factory.js b/utils/test/reporting/pages/app/scripts/factory/table.factory.js deleted file mode 100644 index e715c5c28..000000000 --- a/utils/test/reporting/pages/app/scripts/factory/table.factory.js +++ /dev/null @@ -1,70 +0,0 @@ -'use strict'; - -/** - * get data factory - */ -angular.module('opnfvApp') - .factory('TableFactory', function($resource, $rootScope, $http) { - - var BASE_URL = 'http://testresults.opnfv.org/reporting2'; - $.ajax({ - url: 'config.json', - async: false, - dataType: 'json', - success: function (response) { - BASE_URL = response.url; - }, - error: function (response){ - alert('fail to get api url, using default: http://testresults.opnfv.org/reporting2') - } - }); - - return { - getFilter: function() { - return $resource(BASE_URL + '/landing-page/filters', {}, { - 'get': { - method: 'GET', - - } - }); - }, - getScenario: function(data) { - - var config = { - headers: { - 'Content-Type': 'application/x-www-form-urlencoded;charset=utf-8;' - } - } - - return $http.post(BASE_URL + '/landing-page/scenarios', data, config); - }, - - - getProjectUrl: function() { - return $resource(BASE_URL + '/projects-page/projects', {}, { - 'get': { - method: 'GET' - } - }) - }, - getProjectTestCases: function(name) { - var config = { - headers: { - 'Content-Type': 'application/x-www-form-urlencoded;charset=utf-8;' - } - }; - return $http.get(BASE_URL + '/projects/' + name + '/cases', {}, config) - - - }, - getProjectTestCaseDetail: function() { - return $resource(BASE_URL + '/projects/:project/cases/:testcase', { project: '@project', testcase: '@testcase' }, { - 'get': { - - method: 'GET' - } - }) - } - - }; - }); |