diff options
author | Serena Feng <feng.xiaowei@zte.com.cn> | 2018-01-18 07:00:33 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@opnfv.org> | 2018-01-18 07:00:33 +0000 |
commit | 98fde9b5bd0eaf5bf5acb76dc530925a3cc19881 (patch) | |
tree | a0ad3b0ebea119f7732426951a737a80d8c33233 /testapi/opnfv_testapi/ui/components/pods/podsController.js | |
parent | f82dd79721fec6d4d6e5ac8b7b27cfec689b92ea (diff) | |
parent | 86db2b6832d51f8cd4d428bc431aca9daa99c4e0 (diff) |
Merge "Design the scenario create method"
Diffstat (limited to 'testapi/opnfv_testapi/ui/components/pods/podsController.js')
-rw-r--r-- | testapi/opnfv_testapi/ui/components/pods/podsController.js | 41 |
1 files changed, 9 insertions, 32 deletions
diff --git a/testapi/opnfv_testapi/ui/components/pods/podsController.js b/testapi/opnfv_testapi/ui/components/pods/podsController.js index c66873a..95e3571 100644 --- a/testapi/opnfv_testapi/ui/components/pods/podsController.js +++ b/testapi/opnfv_testapi/ui/components/pods/podsController.js @@ -40,13 +40,13 @@ ctrl.listPods = listPods; ctrl.open = open; ctrl.filter = 'name' - ctrl.clearFilters = clearFilters; ctrl.openDeleteModal = openDeleteModal ctrl.openBatchDeleteModal = openBatchDeleteModal ctrl.openCreateModal = openCreateModal ctrl.podDelete = podDelete ctrl.batchDelete = batchDelete; ctrl.viewPod = viewPod + ctrl.filterText = '' /** * This is called when the date filter calendar is opened. It @@ -61,13 +61,6 @@ ctrl[openVar] = true; } - /** - * This function will clear all filters and update the results - * listing. - */ - function clearFilters() { - ctrl.listPods(); - } /** * This will contact the TestAPI to create a new pod. @@ -91,7 +84,7 @@ ctrl.listPods(); }).catch(function (data) { ctrl.showError = true; - ctrl.error = "Error creating the new pod from server: " + data.statusText; + ctrl.error = data.statusText; }); } else{ @@ -105,21 +98,21 @@ */ function listPods() { ctrl.showError = false; + var reqURL = ctrl.url; + if(ctrl.filterText!=''){ + reqURL = ctrl.url + "?name=" + ctrl.filterText + } ctrl.podsRequest = - $http.get(ctrl.url).success(function (data) { + $http.get(reqURL).success(function (data) { ctrl.data = data; - // mapNametoRandom - }).error(function (error) { + }).catch(function (data) { ctrl.data = null; ctrl.showError = true; - ctrl.error = - 'Error retrieving pods from server: ' + - angular.toJson(error); + ctrl.error = data.statusText; }); } function viewPod(name){ - console.log('hello'); $state.go('pod', {'name':name}, {reload: true}); } /** @@ -192,22 +185,6 @@ }); } - // function openUpdateModal(podName){ - // $uibModal.open({ - // templateUrl: 'testapi-ui/components/pods/modals/createModal.html', - // controller: 'PodModalCtrl as PodModalCtrl', - // size: 'md', - // resolve: { - // data: function () { - // return { - // text: "Update", - // successHandler: ctrl.update, - // // pod: ctrl. - // }; - // } - // } - // }); - // } ctrl.listPods(); } |