summaryrefslogtreecommitdiffstats
path: root/gui/app/scripts/controllers/sut.controller.js
diff options
context:
space:
mode:
authorJack Chan <chenjiankun1@huawei.com>2018-03-16 09:00:21 +0000
committerGerrit Code Review <gerrit@opnfv.org>2018-03-16 09:00:21 +0000
commit320ddb571c774a2cf17863225bb415bf6b2c65aa (patch)
treee69c25ea066668c95ce4de4c4b2a3c2a1274cda3 /gui/app/scripts/controllers/sut.controller.js
parent32e60fb2c37573265111994d33c1a43ea64bf6f8 (diff)
parent4b8f53542a6871c863fbaba16dd5e0e35cf05ce5 (diff)
Merge "Add SUT page in GUI"
Diffstat (limited to 'gui/app/scripts/controllers/sut.controller.js')
-rw-r--r--gui/app/scripts/controllers/sut.controller.js58
1 files changed, 58 insertions, 0 deletions
diff --git a/gui/app/scripts/controllers/sut.controller.js b/gui/app/scripts/controllers/sut.controller.js
new file mode 100644
index 000000000..092aabc41
--- /dev/null
+++ b/gui/app/scripts/controllers/sut.controller.js
@@ -0,0 +1,58 @@
+'use strict';
+
+angular.module('yardStickGui2App')
+ .controller('SUTController', ['$scope', '$state', '$stateParams', 'mainFactory', 'Upload', 'toaster', '$location', 'ngDialog',
+ function($scope, $state, $stateParams, mainFactory, Upload, toaster, $location, ngDialog) {
+
+
+ init();
+ $scope.showloading = false;
+ $scope.loadingOPENrc = false;
+
+ function init() {
+
+
+ $scope.uuid = $stateParams.uuid;
+ $scope.sutInfo = {};
+ getItemIdDetail();
+ getSUTDetail();
+
+ }
+
+ function getItemIdDetail() {
+ mainFactory.ItemDetail().get({
+ 'envId': $scope.uuid
+ }).$promise.then(function(response) {
+ if (response.status == 1) {
+ $scope.envName = response.result.environment.name;
+ }else{
+ mainFactory.errorHandler1(response);
+ }
+ }, function(error) {
+ mainFactory.errorHandler2(error);
+ })
+ }
+
+ function getSUTDetail(){
+ mainFactory.SUTDetail().get({
+ 'envId': $scope.uuid
+ }).$promise.then(function(resp){
+ $scope.sutInfo = resp.result.sut;
+ console.log($scope.sutInfo);
+ }, function(error){
+ })
+ }
+
+ $scope.goBack = function goBack() {
+ $state.go('app.projectList');
+ }
+
+
+ $scope.goNext = function goNext() {
+ $scope.path = $location.path();
+ $scope.uuid = $scope.path.split('/').pop();
+ $state.go('app.container', { uuid: $scope.uuid });
+ }
+
+ }
+ ]);