3 angular.module('yardStickGui2App')
4 .controller('ContentController', ['$scope', '$state', '$stateParams', 'mainFactory', 'Upload', 'toaster', '$location', '$localStorage',
5 function($scope, $state, $stateParams, mainFactory, Upload, toaster, $location, $localStorage) {
11 $scope.showEnvironment = false;
12 $scope.counldGoDetail = false;
13 $scope.activeStatus = 0;
15 $scope.$watch(function() {
17 }, function(newvalue, oldvalue) {
18 if (location.hash.indexOf('project') > -1) {
19 $scope.projectShow = true;
20 $scope.taskShow = false;
21 $scope.reportShow = false;
22 } else if (location.hash.indexOf('task') > -1) {
23 $scope.taskShow = true;
24 $scope.projectShow = true;
25 } else if (location.hash.indexOf('report') > -1) {
26 $scope.reportShow = true;
27 $scope.taskShow = true;
28 $scope.projectShow = true;
37 $scope.showEnvironments = showEnvironments;
38 $scope.showSteps = $location.path().indexOf('project');
40 $scope.gotoUploadPage = gotoUploadPage;
41 $scope.gotoOpenrcPage = gotoOpenrcPage;
42 $scope.gotoPodPage = gotoPodPage;
43 $scope.gotoContainerPage = gotoContainerPage;
44 $scope.gotoTestcase = gotoTestcase;
45 $scope.gotoEnviron = gotoEnviron;
46 $scope.gotoSuite = gotoSuite;
47 $scope.gotoProject = gotoProject;
48 $scope.gotoTask = gotoTask;
49 $scope.gotoReport = gotoReport;
50 $scope.stepsStatus = $localStorage.stepsStatus;
51 $scope.goBack = goBack;
58 function showEnvironments() {
59 $scope.showEnvironment = true;
66 function gotoOpenrcPage() {
67 $scope.path = $location.path();
68 $scope.uuid = $scope.path.split('/').pop();
69 $state.go('app.environmentDetail', { uuid: $scope.uuid })
72 function gotoUploadPage() {
73 $scope.path = $location.path();
74 $scope.uuid = $scope.path.split('/').pop();
75 $state.go('app.uploadImage', { uuid: $scope.uuid });
78 function gotoPodPage() {
79 $scope.path = $location.path();
80 $scope.uuid = $scope.path.split('/').pop();
81 $state.go('app.podUpload', { uuid: $scope.uuid });
84 function gotoContainerPage() {
85 $scope.path = $location.path();
86 $scope.uuid = $scope.path.split('/').pop();
87 $state.go('app.container', { uuid: $scope.uuid });
90 function gotoTestcase() {
91 $state.go('app2.testcase');
94 function gotoEnviron() {
95 if ($location.path().indexOf('env') > -1 || $location.path().indexOf('environment') > -1) {
96 $scope.counldGoDetail = true;
98 $state.go('app2.environment');
101 function gotoSuite() {
102 $state.go('app2.testsuite');
105 function gotoProject() {
106 $state.go('app2.projectList');
109 function gotoTask() {
110 $state.go('app2.tasklist');
113 function gotoReport() {
114 $state.go('app2.report');
118 if ($location.path().indexOf('main/environment')) {
120 } else if ($location.path().indexOf('main/envDetail/') || $location.path().indexOf('main/imageDetail/') ||
121 $location.path().indexOf('main/podupload/') || $location.path().indexOf('main/container/')) {
122 $state.go('app2.environment');
125 window.history.back();