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;
14 $scope.ifshowEnvChild = false;
16 $scope.$watch(function () {
18 }, function (newvalue, oldvalue) {
19 if (location.hash.indexOf('project') > -1) {
20 $scope.projectShow = true;
21 $scope.taskShow = false;
22 $scope.reportShow = false;
23 } else if (location.hash.indexOf('task') > -1) {
24 $scope.taskShow = true;
25 $scope.projectShow = true;
26 } else if (location.hash.indexOf('report') > -1) {
27 $scope.reportShow = true;
28 $scope.taskShow = true;
29 $scope.projectShow = true;
30 } else if (location.hash.indexOf('envDetail') > -1 || location.hash.indexOf('envimageDetail') > -1 ||
31 location.hash.indexOf('envpodupload') > -1 || location.hash.indexOf('envcontainer') > -1) {
32 $scope.ifshowEnvChild = true;
33 $scope.activeStatus=0;
35 $scope.ifshowEnvChild=false;
36 $scope.activeStatus=-1;
45 $scope.showEnvironments = showEnvironments;
46 $scope.showSteps = $location.path().indexOf('project');
48 $scope.gotoUploadPage = gotoUploadPage;
49 $scope.gotoOpenrcPage = gotoOpenrcPage;
50 $scope.gotoPodPage = gotoPodPage;
51 $scope.gotoContainerPage = gotoContainerPage;
52 $scope.gotoTestcase = gotoTestcase;
53 $scope.gotoEnviron = gotoEnviron;
54 $scope.gotoSuite = gotoSuite;
55 $scope.gotoProject = gotoProject;
56 $scope.gotoTask = gotoTask;
57 $scope.gotoReport = gotoReport;
58 $scope.stepsStatus = $localStorage.stepsStatus;
59 $scope.goBack = goBack;
66 function showEnvironments() {
67 $scope.showEnvironment = true;
74 function gotoOpenrcPage() {
75 $scope.path = $location.path();
76 $scope.uuid = $scope.path.split('/').pop();
77 $state.go('app.environmentDetail', { uuid: $scope.uuid })
80 function gotoUploadPage() {
81 $scope.path = $location.path();
82 $scope.uuid = $scope.path.split('/').pop();
83 $state.go('app.uploadImage', { uuid: $scope.uuid });
86 function gotoPodPage() {
87 $scope.path = $location.path();
88 $scope.uuid = $scope.path.split('/').pop();
89 $state.go('app.podUpload', { uuid: $scope.uuid });
92 function gotoContainerPage() {
93 $scope.path = $location.path();
94 $scope.uuid = $scope.path.split('/').pop();
95 $state.go('app.container', { uuid: $scope.uuid });
98 function gotoTestcase() {
99 $state.go('app.testcase');
102 function gotoEnviron() {
103 if ($location.path().indexOf('env') > -1 || $location.path().indexOf('environment') > -1) {
104 $scope.counldGoDetail = true;
106 $state.go('app.environment');
109 function gotoSuite() {
110 $state.go('app.testsuite');
113 function gotoProject() {
114 $state.go('app.projectList');
117 function gotoTask() {
118 $state.go('app.tasklist');
121 function gotoReport() {
122 $state.go('app.report');
126 if ($location.path().indexOf('main/environment')) {
128 } else if ($location.path().indexOf('main/envDetail/') || $location.path().indexOf('main/imageDetail/') ||
129 $location.path().indexOf('main/podupload/') || $location.path().indexOf('main/container/')) {
130 $state.go('app.environment');
133 window.history.back();