summaryrefslogtreecommitdiffstats
path: root/testapi/opnfv_testapi/ui/components/pods
diff options
context:
space:
mode:
authorthuva4 <tharma.thuva@gmail.com>2018-01-16 00:09:51 +0530
committerthuva4 <tharma.thuva@gmail.com>2018-01-16 09:13:07 +0530
commit86db2b6832d51f8cd4d428bc431aca9daa99c4e0 (patch)
treea834b06487cef796afa67f484005b09a8a81c3bd /testapi/opnfv_testapi/ui/components/pods
parent62fb9a03e047d70bb15c67d2748ffe377273d0b6 (diff)
Design the scenario create method
design scenario create method in modal way. design scenario page. Add,delete for installers,versions, projects and customs are implemented. tests are added. 1. Pods page 2. project page 3. Scenarios 4. Scenario Change-Id: Ice26af77ec3d5fe874cf5c2062f208072dea289f Signed-off-by: thuva4 <tharma.thuva@gmail.com>
Diffstat (limited to 'testapi/opnfv_testapi/ui/components/pods')
-rw-r--r--testapi/opnfv_testapi/ui/components/pods/pods.html13
-rw-r--r--testapi/opnfv_testapi/ui/components/pods/podsController.js41
2 files changed, 11 insertions, 43 deletions
diff --git a/testapi/opnfv_testapi/ui/components/pods/pods.html b/testapi/opnfv_testapi/ui/components/pods/pods.html
index e092699..4fa8fb1 100644
--- a/testapi/opnfv_testapi/ui/components/pods/pods.html
+++ b/testapi/opnfv_testapi/ui/components/pods/pods.html
@@ -22,14 +22,7 @@
</div>
<div class="col-sm-3 pull-right">
<span style="margin-top:6px">Search:&nbsp;&nbsp;</span>
- <input type="text" class="form-control search" ngModel="filter" placeholder="Search String">
- </div>
- <div class="col-md-3 row pull-right">
- <span style="margin-top:6px">Filter:&nbsp;&nbsp;</span>
- <select ng-model="ctrl.filter" class="form-control">
- <option value="name">Name</option>
- <option value="owner">Owner</option>
- </select>
+ <input type="text" class="form-control search" ng-Model="ctrl.filterText" placeholder="Search String">
</div>
</div>
<div class="col-md-12">
@@ -67,9 +60,7 @@
<td>{{pod.mode}}</td>
<td ng-class="{ 'hidden': !auth.isAuthenticated }">
<span class="podsTable-col">
- <a class="text-warning" title="Edit">
- <i class="fa fa-pencil-square-o"></i></a>
- <a class="text-danger" ng-click="ctrl.openDeleteModal(pod.name)" title="Delete">
+ <a class="text-danger" ng-click="ctrl.openDeleteModal(pod.name)" title="Delete" ng-class="{ 'hidden': !auth.isAuthenticated }">
<i class="fa fa-trash-o"></i></a>
</span>
</td>
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();
}