diff options
Diffstat (limited to 'testapi/opnfv_testapi/ui')
4 files changed, 10 insertions, 35 deletions
diff --git a/testapi/opnfv_testapi/ui/app.js b/testapi/opnfv_testapi/ui/app.js index ada7577..b4e8d08 100644 --- a/testapi/opnfv_testapi/ui/app.js +++ b/testapi/opnfv_testapi/ui/app.js @@ -19,7 +19,7 @@ angular .module('testapiApp', [ 'ui.router','ui.bootstrap', 'cgBusy', - 'ngResource', 'angular-confirm' + 'ngResource', 'angular-confirm', 'angular-json-tree' ]); angular diff --git a/testapi/opnfv_testapi/ui/components/results/result/result.html b/testapi/opnfv_testapi/ui/components/results/result/result.html index 52d794e..e6b30a9 100644 --- a/testapi/opnfv_testapi/ui/components/results/result/result.html +++ b/testapi/opnfv_testapi/ui/components/results/result/result.html @@ -50,31 +50,7 @@ <tr style="padding:9px"> <td class="podsTableTd">Details :</td> <td width="90%" class="podsTableLeftTd"> - <a ng-click="ctrl.showDetails()"> - <p ng-if="ctrl.details">Hide</p> - <p ng-if="!ctrl.details">Show</p> - </a> - <table class="table" ng-class="{'hidden' : !ctrl.details}" style="margin:10px"> - <tbody> - <tr style="padding:9px"></tr> - <tr style="padding:9px"> - <td class="podsTableTd">Failures :</td> - <td width="90%" class="podsTableLeftTd">{{ctrl.data.details.failures}}</td> - </tr> - <tr style="padding:9px"> - <td class="podsTableTd">Details :</td> - <td width="90%" class="podsTableLeftTd">{{ctrl.data.details.errors}}</td> - </tr> - <tr style="padding:9px"> - <td class="podsTableTd">Stream :</td> - <td width="90%" class="podsTableLeftTd"><p>{{ctrl.data.details.stream}}</p></td> - </tr> - <tr style="padding:9px"> - <td class="podsTableTd">TestsRun :</td> - <td width="90%" class="podsTableLeftTd"><p>{{ctrl.data.details.testsRun}}</p></td> - </tr> - </tbody> - </table> + <json-tree object="ctrl.json.object" root-name="object" start-expanded="true"></json-tree> </td> </tr> </tbody> diff --git a/testapi/opnfv_testapi/ui/components/results/result/resultController.js b/testapi/opnfv_testapi/ui/components/results/result/resultController.js index cb5dd28..d297b43 100644 --- a/testapi/opnfv_testapi/ui/components/results/result/resultController.js +++ b/testapi/opnfv_testapi/ui/components/results/result/resultController.js @@ -35,8 +35,10 @@ ctrl.url = testapiApiUrl + '/results'; ctrl._id = $state.params['_id']; ctrl.loadDetails = loadDetails - ctrl.showTrustIndicator = showTrustIndicator - ctrl.showDetails = showDetails + + ctrl.json = {}; + ctrl.json.string = '{"id": ""}'; + ctrl.json.object = JSON.parse(ctrl.json.string); /** *Contact the testapi and retrevie the result details @@ -47,6 +49,8 @@ ctrl.podsRequest = $http.get(resultUrl).success(function (data) { ctrl.data = data; + ctrl.object=JSON.stringify(ctrl.data.details) + ctrl.json.object = JSON.parse(ctrl.object) }).catch(function (error) { ctrl.data = null; ctrl.showError = true; @@ -54,13 +58,6 @@ }); } - function showDetails(){ - if(ctrl.details){ - ctrl.details = false - }else{ - ctrl.details = true - } - } ctrl.loadDetails(); } })();
\ No newline at end of file diff --git a/testapi/opnfv_testapi/ui/index.html b/testapi/opnfv_testapi/ui/index.html index 68c6cc5..f345197 100644 --- a/testapi/opnfv_testapi/ui/index.html +++ b/testapi/opnfv_testapi/ui/index.html @@ -28,6 +28,7 @@ <link rel="stylesheet" href="testapi-ui/assets/lib/angular-busy/dist/angular-busy.min.css"> <link rel="stylesheet" href="testapi-ui/assets/css/style.css"> <link rel="stylesheet" href="testapi-ui/assets/lib/font-awesome-4.7.0/css/font-awesome.min.css"> + <link rel="stylesheet" href="testapi-ui/assets/lib/angular-json-tree/angular-json-tree.css" /> <script src="testapi-ui/assets/lib/jquery/jquery-3.2.1.min.js"></script> <script src="testapi-ui/assets/lib/bootstrap/dist/js/bootstrap.min.js"></script> @@ -36,6 +37,7 @@ <script src="testapi-ui/assets/lib/angular-resource/angular-resource.min.js"></script> <script src="testapi-ui/assets/lib/angular-bootstrap/ui-bootstrap-tpls.min.js"></script> <script src="testapi-ui/assets/lib/angular-busy/dist/angular-busy.min.js"></script> + <script src="testapi-ui/assets/lib/angular-json-tree/angular-json-tree.min.js"></script> <script src="testapi-ui/assets/lib/angular-confirm-modal/angular-confirm.js"></script> <script src="testapi-ui/app.js"></script> |